PatchworkOS  3984a1d
A non-POSIX operating system.
Loading...
Searching...
No Matches
trampoline.c File Reference
#include "trampoline.h"
#include <kernel/cpu/cpu.h>
#include <kernel/cpu/gdt.h>
#include <kernel/log/log.h>
#include <kernel/log/panic.h>
#include <kernel/mem/pmm.h>
#include <kernel/mem/vmm.h>
#include <kernel/sched/clock.h>
#include <kernel/sched/sched.h>
#include <kernel/sched/thread.h>
#include <kernel/sched/timer.h>
#include <kernel/utils/utils.h>
#include <kernel/mem/paging_types.h>
#include <string.h>
Include dependency graph for trampoline.c:

Go to the source code of this file.

Functions

void trampoline_init (void)
 Initializes the trampoline by copying the trampoline code to its designated memory location.
 
void trampoline_deinit (void)
 Deinitializes the trampoline by restoring the original contents of the trampoline memory location.
 
void trampoline_send_startup_ipi (cpu_t *cpu, lapic_id_t lapicId)
 Sends the startup IPI to a CPU to start it up.
 
uint64_t trampoline_wait_ready (clock_t timeout)
 Waits for the currently starting CPU to signal that it is ready.
 
static void trampoline_after_jump (void)
 
void trampoline_c_entry (cpu_t *cpu)
 After the trampoline is done with basic initialization, it calls this C entry point to continue CPU initialization.
 

Variables

static voidbackupBuffer
 
static voidtrampolineStack
 
static atomic_bool cpuReadyFlag = ATOMIC_VAR_INIT(false)
 

Function Documentation

◆ trampoline_after_jump()

static void trampoline_after_jump ( void  )
static

Definition at line 104 of file trampoline.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ backupBuffer

void* backupBuffer
static

Definition at line 18 of file trampoline.c.

◆ trampolineStack

void* trampolineStack
static

Definition at line 19 of file trampoline.c.

◆ cpuReadyFlag

atomic_bool cpuReadyFlag = ATOMIC_VAR_INIT(false)
static

Definition at line 21 of file trampoline.c.