x86_64: Split cpu_startup() into pic_finish() and cpu_finish()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 1 Jun 2011 09:17:15 +0000 (17:17 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 1 Jun 2011 09:31:02 +0000 (17:31 +0800)
sys/platform/pc64/x86_64/machdep.c

index 763beee..b171ecc 100644 (file)
@@ -138,6 +138,9 @@ extern void finishidentcpu(void);
 extern void panicifcpuunsupported(void);
 
 static void cpu_startup(void *);
+static void pic_finish(void *);
+static void cpu_finish(void *);
+
 #ifndef CPU_DISABLE_SSE
 static void set_fpregs_xmm(struct save87 *, struct savexmm *);
 static void fill_fpregs_xmm(struct savexmm *, struct save87 *);
@@ -148,6 +151,8 @@ extern void ffs_rawread_setup(void);
 static void init_locks(void);
 
 SYSINIT(cpu, SI_BOOT2_START_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
+SYSINIT(pic_finish, SI_BOOT2_FINISH_PIC, SI_ORDER_FIRST, pic_finish, NULL)
+SYSINIT(cpu_finish, SI_BOOT2_FINISH_CPU, SI_ORDER_FIRST, cpu_finish, NULL)
 
 #ifdef DDB
 extern vm_offset_t ksym_start, ksym_end;
@@ -385,9 +390,6 @@ again:
        bufinit();
        vm_pager_bufferinit();
 
-       /* Log ELCR information */
-       elcr_dump();
-
 #ifdef SMP
        /*
         * OK, enough kmem_alloc/malloc state should be up, lets get on with it!
@@ -395,11 +397,22 @@ again:
        mp_start();                     /* fire up the APs and APICs */
        mp_announce();
 #endif  /* SMP */
+}
+
+static void
+cpu_finish(void *dummy __unused)
+{
+       cpu_setregs();
+}
+
+static void
+pic_finish(void *dummy __unused)
+{
+       /* Log ELCR information */
+       elcr_dump();
 
        /* Finalize PCI */
        MachIntrABI.finalize();
-
-       cpu_setregs();
 }
 
 /*