- Move a bit of the shared logic of secondary bootstrapping into a new
function, lk_secondary_cpu_entry_early() which sets the current cpu
pointer before calling the first half of the secondary LK_INIT
routines.
- Create the per cpu idle threads on the main cpu instead of the
secondary as they come up.
- Tweak all of the SMP capable architectures to use this new path.
- Move the top level mp routines into a separate file top/mp.c
- A bit more correctly ifdef out more SMP code.
No real functional change except how the smaller ARCH_DEFAULT_PAGE_SIZE
is now computed and set in defines.h instead of rules.mk for arch/arm to
be consistent with the other arch that has a large/small build (riscv).
Clang will omit the initial comparison in this while loop on the
assumption that two different variables will not have the same address,
which will lead to a crash if the kernel has no constructors.
It will, however, retain the comparison for incomplete arrays
because they may have zero size (and therefore may alias with another
variable). Therefore, change the declarations of the start/end symbols
for the constructor list to incomplete arrays.
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.
See scripts/codestyle
Ran everything through scripts/codestyle.space, which uses astyle
to generally follow K&R style.
Biggest non whitespace change is pulling brackets down on function
declarations, which I'm pretty ambivalent about, but astyle insists
on taking a stance
Hopefully to nothing...
- remove current/pinned cpu tracking in thread struct
- macroize access to current/pinned cpu tracking
- empty-inline/remove vestigial mp_* bits in UP builds
-move the per-cpu initialization of the gic and cortex-a9 timer into an init hook.
This removes the hard coded call in arm/arch.c
-make sure the timer initialization happens in the pre-threading callback, in case
a secondary init hook needs the timer.
Change api to pass in a range of levels to call, instead of just the
last level.
Allows secondary init hooks to run in parallel on multiple cpus.
Change-Id: I7447547818a35d475631b3e7fa8315ff7f80ba4f
Call lk_init_secondary_cpus on the main cpu to create bootstrap
threads for secondary cpus. Call lk_secondary_cpu_entry on secondary
cpus to boot them. It is not safe to call into the heap on secondary
cpus before getting to the bootstrap thread.
Change-Id: Id9ee72a96cdc894dc8089527bde8468f36a25eac
The existing runqueues are scanned on resched until a thread that is
not pinned to another cpu is found.
Per-pu runqueues can be added later to avoid this scan.
Change-Id: Idd7dbddb4b79ef38a0ccd0c42b53f8867020e6cd
Conflicts:
kernel/thread.c
Allows code anywhere in the system to define an init hook which is
called at the run level specified.
Hooks are guaranteed to be called in order of init level. Within an init
level the order of the hooks is not guaranteed.
The kernel shouldn't really own most of the bringup of all
the modules. Generally speaking the kernel can and should be treated
like any other module in the system.