39 LOG_INFO(
"other cpus already started\n");
47 LOG_INFO(
"bootstrap cpu already started\n");
108MODULE_INFO(
"SMP Bootstrap",
"Kai Norberg",
"Symmetric Multiprocessing support via APIC", OS_VERSION,
"MIT",
#define assert(expression)
#define PROCESSOR_LOCAL_APIC_ENABLED
#define INTERRUPT_CONTROLLER_PROCESSOR_LOCAL_APIC
sdt_header_t * acpi_tables_lookup(const char *signature, uint64_t minSize, uint64_t n)
Lookup the n'th table matching the signature.
#define MADT_FOR_EACH(madt, ic)
Iterate over all MADT interrupt controllers.
#define MADT_SIGNATURE
MADT table signature.
static void cli_pop(void)
Decrements the CLI depth, re-enabling interrupts if depth reaches zero and interrupts were enabled pr...
static void cli_push(void)
Increments the CLI depth, disabling interrupts if depth was zero.
#define SELF
Macro to access data in the current cpu.
static uint16_t cpu_amount(void)
Gets the number of identified CPUs.
#define CPU_ID_BOOTSTRAP
ID of the bootstrap CPU.
lapic_t PERCPU _pcpu_lapic
The per-CPU local APIC structure.
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
#define LOG_INFO(format,...)
#define LOG_DEBUG(format,...)
void * vmm_alloc(space_t *space, void *virtAddr, size_t length, size_t alignment, pml_flags_t pmlFlags, vmm_alloc_flags_t allocFlags)
Allocates and maps virtual memory in a given address space.
@ VMM_ALLOC_OVERWRITE
If any page is already mapped, overwrite the mapping.
#define MODULE_INFO(_name, _author, _description, _version, _licence, _deviceTypes)
Macro to define module information.
void trampoline_send_startup_ipi(cpu_t *cpu, lapic_id_t lapicId)
Sends the startup IPI to a CPU to start it up.
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.
static void smp_start_others(void)
Starts the other CPUs in the system.
#define NULL
Pointer error value.
#define ERR
Integer error value.
#define PAGE_SIZE
The size of a memory page in bytes.
uint64_t _module_procedure(const module_event_t *event)
_PUBLIC void * memset(void *s, int c, size_t n)
Multiple APIC Description Table.
interrupt_controller_header_t header