diff options
author | Richard Braun <rbraun@sceen.net> | 2013-03-14 22:26:24 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-03-14 22:26:24 +0100 |
commit | ed09fa58fb5778d943b2636b13c873fa68d4daac (patch) | |
tree | 48f641ccf52688c23b4d8883bc13af17be7836ac /arch/x86/machine/cpu.h | |
parent | fd051e1e8b2cae9a302c08ff6df76b98ea6fe58e (diff) |
kern/{kernel,thread}: rework initialization
Make cpu_count() available on kernel entry so that modules (and in particular
the thread module) can allocate per-CPU resources from the BSP. This makes
the initial state stable and simplifies code (no need to check for a transient
early initialization state).
Diffstat (limited to 'arch/x86/machine/cpu.h')
-rw-r--r-- | arch/x86/machine/cpu.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h index 9e846e34..24d4ef48 100644 --- a/arch/x86/machine/cpu.h +++ b/arch/x86/machine/cpu.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012 Richard Braun. + * Copyright (c) 2010, 2011, 2012, 2013 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -576,22 +576,23 @@ void cpu_mp_register_lapic(unsigned int apic_id, int is_bsp); /* * Probe application processors and start them. + * + * On return, cpu_count() gives the actual number of managed processors. */ void cpu_mp_setup(void); /* + * Synchronize with APs on kernel entry. + */ +void cpu_mp_sync(void); + +/* * CPU initialization on APs. */ void cpu_ap_setup(void); /* - * Synchronize processors on kernel entry. - * - * Wait for all processors to reach a proper state when entering the kernel, - * so that memory allocations can proceed and thread scheduling started. - * - * Once this function returns, cpu_count can be used reliably to know if there - * are more than one processors, and how many. + * Synchronize with BSP on kernel entry. */ void cpu_ap_sync(void); |