You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.5 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2019. All rights reserved.
* Description: boottime.c
* Author: Hisilicon
* Create: 2020-1-2
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/kmod.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
#include <linux/sysctl.h>
#include <mntn/util.h>
#include <linux/uaccess.h>
#include <mntn/mntn_bootup_keypoint.h>
#include <mntn/rdr_pub.h>
#define MNTN_LOG_TAG MNTN_BOOTTIME_TAG
#include <mntn/mntn_log.h>
#include "mntn_inner.h"
/* record kernle boot is completed */
#define COMPLETED_MASK 0xABCDEF00
static unsigned int g_bootanim_complete;
/*
* check kernel boot is completed
* Return: 1, kernel boot is completed
* 0, no completed
*/
int is_bootanim_completed(void)
{
return (g_bootanim_complete == COMPLETED_MASK);
}
static ssize_t boot_time_proc_write(struct file *file, const char __user *buf,
size_t nr, loff_t *off)
{
if (is_bootanim_completed())
return nr;
/* only need the print time */
mntn_print_pn("bootanim has been complete, turn to Lancher!\n");
g_bootanim_complete = COMPLETED_MASK;
mntn_dump_bootkmsg();
return nr;
}
static const mntn_proc_ops g_boot_time_proc_fops = {
.MNTN_PROC_WRITE = boot_time_proc_write,
};
static int __init boot_time_proc_init(void)
{
mntn_create_stats_proc_entry("boot_time", (S_IWUSR),
&g_boot_time_proc_fops, NULL);
return 0;
}
module_init(boot_time_proc_init);