[−][src]Function sunrise_kernel::cpu_locals::init_cpu_locals
pub fn init_cpu_locals(cpu_count: usize)
Initializes cpu locals during early boot stage.
- Maps the kernel's ELF to get our
PT_TLSprogram header information, including the TLS initialization image. - Allocates an array of
cpu_countcpu local regions and stores them in CPU_LOCAL_REGIONS. - Makes this core's
KTlssegment point toCPU_LOCAL_REGIONS[0]'sThreadControlBlock.
Panics
- Failed to map kernel's ELF.
- Failed to get kernel ELF's TLS initialization image.