36 LOG_ERR(
"failed to init exception stack for cpu %u\n", cpu->
id);
45 LOG_ERR(
"failed to init double fault stack for cpu %u\n", cpu->
id);
54 LOG_ERR(
"failed to init interrupt stack for cpu %u\n", cpu->
id);
73 panic(
NULL,
"CPU%u exception stack overflow detected", cpu->
id);
77 panic(
NULL,
"CPU%u double fault stack overflow detected", cpu->
id);
81 panic(
NULL,
"CPU%u interrupt stack overflow detected", cpu->
id);
void gdt_cpu_tss_load(tss_t *tss)
Load a TSS into the GDT and load it using the ltr instruction on the current CPU.
void gdt_cpu_load(void)
Load the GDT on the current CPU.
void idt_cpu_load(void)
Load the IDT on the current CPU.
void interrupt_ctx_init(interrupt_ctx_t *ctx)
Initializes the CLI context.
void stack_pointer_deinit_buffer(stack_pointer_t *stack)
Deinitializes a stack pointer structure that was initialized using stack_pointer_init_buffer().
uint64_t stack_pointer_init_buffer(stack_pointer_t *stack, void *buffer, uint64_t pages)
Initializes a stack pointer structure using a provided buffer, does not allocate or map any memory.
void syscalls_cpu_init(void)
Initalize syscalls on the current CPU.
void tss_ist_load(tss_t *tss, tss_ist_t ist, stack_pointer_t *stack)
Load a stack into an IST entry.
void tss_init(tss_t *tss)
Initialize a TSS structure.
#define TSS_IST_INTERRUPT
The IST index to use for other interrupts.
#define TSS_IST_EXCEPTION
The IST index to use for exceptions.
#define TSS_IST_DOUBLE_FAULT
The IST index to use for double faults.
void cpu_stacks_overflow_check(cpu_t *cpu)
Checks for CPU stack overflows.
uint64_t cpu_init(cpu_t *cpu, cpuid_t id)
Initializes a CPU structure as part of the boot process.
#define CPU_STACK_CANARY
CPU stack canary value.
uint16_t cpuid_t
Type used to identify a CPU.
void lapic_cpu_init(void)
Initialize the local apic for the current cpu.
lapic_id_t lapic_self_id(void)
Get the lapic id of the current cpu.
void statistics_cpu_ctx_init(statistics_cpu_ctx_t *ctx)
Initializes a per-CPU statistics context.
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
#define LOG_ERR(format,...)
void vmm_cpu_ctx_init(vmm_cpu_ctx_t *ctx)
Initializes a per-CPU VMM context and performs per-CPU VMM initialization.
void wait_cpu_ctx_init(wait_cpu_ctx_t *wait, cpu_t *self)
Initialize per-CPU wait context.
void sched_cpu_ctx_init(sched_cpu_ctx_t *ctx, cpu_t *self)
Initializes a CPU's scheduling context.
void timer_ctx_init(timer_ctx_t *ctx)
Initialize per-CPU timer context.
#define CONFIG_INTERRUPT_STACK_PAGES
Interrupt stack configuration.
#define NULL
Pointer error value.
#define ERR
Integer error value.
static void msr_write(uint32_t msr, uint64_t value)
interrupt_ctx_t interrupt
stack_pointer_t exceptionStack
statistics_cpu_ctx_t stat
stack_pointer_t interruptStack
stack_pointer_t doubleFaultStack
uintptr_t bottom
The bottom of the stack, this address is inclusive.