|
miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
|
#include <smp.h>

Public Attributes | |
| struct cpu_t * | self |
| uint32_t | cpu_id |
| uint32_t | lapic_id |
| struct thread * | idle_thread |
| uint8_t * | kstack_base |
| struct thread * | run_queue_head |
| struct thread * | run_queue_tail |
| uint32_t | queue_depth |
| struct thread * | current_thread |
| uint64_t | kstack_top |
| uint64_t | user_rsp_scratch |
cpu_t - Per-CPU state block; GS.base on each CPU points to this struct.
The first field MUST be a self-pointer at offset 0 (gs:0) so cpu_local() works with a single mov %gs:0, %0 instruction regardless of cpu count. Fields at fixed GS offsets are used by assembly: current_thread at gs:56, kstack_top at gs:64, user_rsp_scratch at gs:72.
| uint32_t cpu_t::cpu_id |
| struct thread* cpu_t::current_thread |
| struct thread* cpu_t::idle_thread |
| uint8_t* cpu_t::kstack_base |
| uint64_t cpu_t::kstack_top |
| uint32_t cpu_t::lapic_id |
| uint32_t cpu_t::queue_depth |
| struct thread* cpu_t::run_queue_head |
| struct thread* cpu_t::run_queue_tail |
| struct cpu_t* cpu_t::self |
| uint64_t cpu_t::user_rsp_scratch |