The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
cpu.c File Reference

the data of each core (per-CPU data). More...

#include "kernel/cpu/cpu.h"
#include "common/stddef.h"

Functions

void cpu_init_boot (void)
 set up the cpu_t of the boot core and point the per-CPU segment at it.

Variables

cpu_t cpus [CPU_MAX]
 the data of all cores; index 0 is the boot core
bool cpu_ready
 true once cpu_init_boot() has run, so cpu_current() is valid
uint32_t cpu_count = 1
 the number of cores that run: cpus[0] to cpus[cpu_count - 1]

Detailed Description

the data of each core (per-CPU data).

Function Documentation

◆ cpu_init_boot()

void cpu_init_boot ( void )

set up the cpu_t of the boot core and point the per-CPU segment at it.

call it once, right after the GDT is loaded, before anything uses cpu_current().

Variable Documentation

◆ cpus

cpu_t cpus[CPU_MAX]

the data of all cores; index 0 is the boot core

◆ cpu_ready

bool cpu_ready

true once cpu_init_boot() has run, so cpu_current() is valid

◆ cpu_count

uint32_t cpu_count = 1

the number of cores that run: cpus[0] to cpus[cpu_count - 1]