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

@@ -3,6 +3,8 @@
#include <socks/object.h>
#include <arch/e820.h>
#include <socks/init.h>
#include <socks/percpu.h>
#include <socks/cpu.h>
#include <socks/memblock.h>
#include <socks/vm.h>
#include <socks/printk.h>
@@ -53,7 +55,13 @@ int ml_init(uintptr_t arg)
pmap_bootstrap();
acpi_init();
acpi_scan_cpu_topology();
init_per_cpu_areas();
cpu_data_t *this_cpu = get_this_cpu();
this_cpu->c_flags = CPU_ONLINE;
this_cpu->c_id = this_cpu();
put_cpu(this_cpu);
vm_zone_descriptor_t vm_zones[] = {
{ .zd_id = VM_ZONE_DMA, .zd_node = 0, .zd_name = "dma", .zd_base = 0x00, .zd_limit = 0xffffff },