25#define TRAMPOLINE_BASE_ADDR 0x8000
33#define TRAMPOLINE_DATA_OFFSET 0x0F00
38#define TRAMPOLINE_PML4_OFFSET (TRAMPOLINE_DATA_OFFSET + 0x00)
43#define TRAMPOLINE_ENTRY_OFFSET (TRAMPOLINE_DATA_OFFSET + 0x08)
48#define TRAMPOLINE_CPU_ID_OFFSET (TRAMPOLINE_DATA_OFFSET + 0x10)
53#define TRAMPOLINE_CPU_OFFSET (TRAMPOLINE_DATA_OFFSET + 0x18)
58#define TRAMPOLINE_STACK_OFFSET (TRAMPOLINE_DATA_OFFSET + 0x20)
63#define TRAMPOLINE_ADDR(offset) ((void*)(TRAMPOLINE_BASE_ADDR + (offset)))
78#define TRAMPOLINE_SIZE ((uintptr_t)trampoline_end - (uintptr_t)trampoline_start)
void trampoline_send_startup_ipi(cpu_t *cpu, cpuid_t cpuId, lapic_id_t lapicId)
Sends the startup IPI to a CPU to start it up.
void trampoline_start(void)
The start of the trampoline code, defined in trampoline.s.
void trampoline_end(void)
The end of the trampoline code, defined in trampoline.s.
void trampoline_deinit(void)
Deinitializes the trampoline by restoring the original contents of the trampoline memory location.
uint64_t trampoline_wait_ready(clock_t timeout)
Waits for the currently starting CPU to signal that it is ready.
void trampoline_init(void)
Initializes the trampoline by copying the trampoline code to its designated memory location.
_NORETURN void trampoline_c_entry(cpu_t *self, cpuid_t cpuId)
After the trampoline is done with basic initialization, it calls this C entry point to continue CPU i...
uint16_t cpuid_t
Type used to identify a CPU.
uint8_t lapic_id_t
Local APIC ID type.
__UINT64_TYPE__ clock_t
A nanosecond time.