kernel: implement cpu IDs and per-cpu variables

This commit is contained in:
2023-03-18 19:35:00 +00:00
parent 56bc47f570
commit 57eaf4e01c
14 changed files with 232 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ struct acpi_rsdp {
struct acpi_rsdp_20 rsdp_20;
};
} __packed;
struct acpi_sdt {
char s_sig[4];
uint32_t s_length;
@@ -66,7 +66,7 @@ struct acpi_madt {
} __packed;
extern kern_status_t acpi_init(void);
extern kern_status_t acpi_smp_init(void);
extern kern_status_t acpi_scan_cpu_topology(void);
extern struct acpi_sdt *acpi_find_sdt(uint32_t sig);

View File

@@ -0,0 +1,12 @@
#ifndef ARCH_MSR_H_
#define ARCH_MSR_H_
#include <stdint.h>
#define MSR_GS_BASE 0xC0000101
/* defined in cpu_ctrl.S */
extern uint64_t rdmsr(uint32_t id);
extern void wrmsr(uint32_t id, uint64_t val);
#endif