limine/common/sys/smp.h

55 lines
1.6 KiB
C
Raw Normal View History

2020-09-21 13:15:55 +03:00
#ifndef __SYS__SMP_H__
#define __SYS__SMP_H__
2020-09-18 15:39:29 +03:00
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
2020-09-21 13:15:55 +03:00
#include <mm/vmm.h>
2020-09-18 15:39:29 +03:00
#if defined (__x86_64__) || defined (__i386__)
2020-09-18 15:39:29 +03:00
struct smp_information {
uint32_t acpi_processor_uid;
2020-09-18 15:39:29 +03:00
uint32_t lapic_id;
2020-09-18 20:02:47 +03:00
uint64_t stack_addr;
2020-09-18 15:39:29 +03:00
uint64_t goto_address;
uint64_t extra_argument;
2020-09-18 15:39:29 +03:00
} __attribute__((packed));
2020-10-25 14:41:13 +03:00
struct smp_information *init_smp(size_t header_hack_size,
void **header_ptr,
size_t *cpu_count,
uint32_t *_bsp_lapic_id,
2020-09-18 15:39:29 +03:00
bool longmode,
bool lv5,
2020-09-18 15:39:29 +03:00
pagemap_t pagemap,
2021-07-15 17:20:29 +03:00
bool x2apic,
2022-03-18 03:47:04 +03:00
bool nx,
uint64_t hhdm,
bool wp);
2020-09-18 15:39:29 +03:00
#elif defined (__aarch64__)
struct smp_information {
uint32_t acpi_processor_uid;
uint32_t gic_iface_no;
uint64_t mpidr;
uint64_t stack_addr;
uint64_t goto_address;
uint64_t extra_argument;
} __attribute__((packed));
struct smp_information *init_smp(size_t header_hack_size,
void **header_ptr,
size_t *cpu_count,
uint64_t *bsp_mpidr,
pagemap_t pagemap,
uint64_t mair,
uint64_t tcr,
uint64_t sctlr);
#else
#error Unknown architecture
#endif
2020-09-18 15:39:29 +03:00
#endif