/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2019. All rights reserved. * Description: boottime.c * Author: Hisilicon * Create: 2020-1-2 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MNTN_LOG_TAG MNTN_BOOTTIME_TAG #include #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);