diff options
author | Richard Braun <rbraun@sceen.net> | 2012-12-12 23:04:26 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2012-12-12 23:04:26 +0100 |
commit | 45acb625b17ca642fa968a7ca41e0a03e8e9ccfb (patch) | |
tree | 944e86a982b2576b10dcacffb1e9439823c09bb6 /kern | |
parent | 51bff7b18de9329d7bd77324cc597e72173fae74 (diff) |
Simplify requirements on interrupts during initialization
Don't involve the pmap module directly, as there could be others. Make
the cpu module completely responsible for synchronizing all processors
on kernel entry so that interrupts can be explicitely enabled there.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/kernel.c | 7 | ||||
-rw-r--r-- | kern/kernel.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/kern/kernel.c b/kern/kernel.c index 760f68e8..07a0f660 100644 --- a/kern/kernel.c +++ b/kern/kernel.c @@ -30,7 +30,7 @@ kernel_main(void) task_setup(); thread_setup(); - /* Interrupts are enabled by this call */ + cpu_intr_enable(); cpu_mp_setup(); thread_run(); @@ -41,7 +41,10 @@ kernel_main(void) void __init kernel_ap_main(void) { - assert(cpu_intr_enabled()); + assert(!cpu_intr_enabled()); + + cpu_intr_enable(); + cpu_ap_sync(); thread_run(); diff --git a/kern/kernel.h b/kern/kernel.h index 22d5714b..f5821ca6 100644 --- a/kern/kernel.h +++ b/kern/kernel.h @@ -26,13 +26,15 @@ /* * Machine-independent entry point. + * + * Interrupts must be disabled when calling this function. */ void kernel_main(void); /* * Entry point for APs. * - * Interrupts must be enabled when calling this function. + * Interrupts must be disabled when calling this function. */ void kernel_ap_main(void); |