furix
cute os
include/arch/x86_64/ap_boot.h
716 bytes raw
1#ifndef FURIX_ARCH_X86_64_AP_BOOT_H
2#define FURIX_ARCH_X86_64_AP_BOOT_H
3
4#include <acpi.h>
5#include <efi.h>
6#include <types.h>
7
8/*
9 * reserve a free page below 1 MiB for the trampoline and copy the image into
10 * it. must run BEFORE the kernel installs its own GDT/IDT, because afterwards
11 * we must not call into UEFI boot services again. false if no page was found.
12 */
13bool ap_boot_reserve(const EFI_SYSTEM_TABLE *st, uint64_t *out_base);
14
15/* start every MADT AP via INIT-SIPI-SIPI, waiting with a bounded spin */
16uint32_t ap_boot_start(const struct acpi_madt_info *madt);
17
18/* set by each AP once running with its per-CPU area */
19extern volatile uint32_t ap_online_count;
20
21#endif /* FURIX_ARCH_X86_64_AP_BOOT_H */