drivers: power: report battery voltage in AOSP compatible format
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / init / main.c
index 9484f4ba88d05aa589bb737d96836a1a01db55ce..2dbb884e2caa5133da5d4c45a3435b2b0fee3c9c 100644 (file)
 #include <linux/ptrace.h>
 #include <linux/blkdev.h>
 #include <linux/elevator.h>
+#include <linux/sched_clock.h>
+#include <linux/random.h>
+#include <linux/time_log.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
 #include <asm/setup.h>
 #include <asm/sections.h>
 #include <asm/cacheflush.h>
+#include <linux/bootprof.h>
 
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/smp.h>
@@ -127,6 +131,7 @@ extern void softirq_init(void);
 char __initdata boot_command_line[COMMAND_LINE_SIZE];
 /* Untouched saved command line (eg. for /proc) */
 char *saved_command_line;
+EXPORT_SYMBOL_GPL(saved_command_line);
 /* Command line for parameter parsing */
 static char *static_command_line;
 
@@ -555,6 +560,7 @@ asmlinkage void __init start_kernel(void)
        softirq_init();
        timekeeping_init();
        time_init();
+       sched_clock_postinit();
        profile_init();
        call_function_init();
        WARN(!irqs_disabled(), "Interrupts were enabled early\n");
@@ -604,6 +610,10 @@ asmlinkage void __init start_kernel(void)
 #ifdef CONFIG_X86
        if (efi_enabled(EFI_RUNTIME_SERVICES))
                efi_enter_virtual_mode();
+#endif
+#ifdef CONFIG_X86_ESPFIX64
+       /* Should be run before the first non-init thread is created */
+       init_espfix_bsp();
 #endif
        thread_info_cache_init();
        cred_init();
@@ -679,7 +689,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
 {
        int count = preempt_count();
        int ret;
-
+       TIME_LOG_START();
        if (initcall_debug)
                ret = do_one_initcall_debug(fn);
        else
@@ -697,6 +707,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
        }
        WARN(msgbuf[0], "initcall %pF returned with %s\n", fn, msgbuf);
 
+       TIME_LOG_END("[init] f(%p)\n", fn);
        return ret;
 }
 
@@ -777,6 +788,7 @@ static void __init do_basic_setup(void)
        do_ctors();
        usermodehelper_enable();
        do_initcalls();
+       random_int_secret_init();
 }
 
 static void __init do_pre_smp_initcalls(void)
@@ -820,6 +832,8 @@ static int __ref kernel_init(void *unused)
 
        flush_delayed_fput();
 
+       log_boot("Kernel_init_done");
+       
        if (ramdisk_execute_command) {
                if (!run_init_process(ramdisk_execute_command))
                        return 0;
@@ -848,6 +862,11 @@ static int __ref kernel_init(void *unused)
              "See Linux Documentation/init.txt for guidance.");
 }
 
+
+#ifdef CONFIG_MTK_HIBERNATION
+// IPO-H, move here for console ok after hibernaton
+extern int software_resume(void);
+#endif
 static noinline void __init kernel_init_freeable(void)
 {
        /*
@@ -885,6 +904,11 @@ static noinline void __init kernel_init_freeable(void)
 
        (void) sys_dup(0);
        (void) sys_dup(0);
+
+#ifdef CONFIG_MTK_HIBERNATION
+// IPO-H, move here for console ok after hibernaton resume
+    software_resume();
+#endif
        /*
         * check if there is an early userspace init.  If yes, let it do all
         * the work