vm: use vm_memory_mode() to determine which model to initialise

This commit is contained in:
2023-02-08 21:28:47 +00:00
parent b0b557d919
commit 9792aa512d

View File

@@ -22,7 +22,17 @@ kern_status_t vm_bootstrap(const vm_zone_descriptor_t *zones, size_t nr_zones)
/* TODO select which memory model to use automatically, and add
a kernel boot parameter to override the choice */
vm_set_memory_model(VM_MODEL_SPARSE);
switch (vm_memory_model()) {
case VM_MODEL_SPARSE:
vm_sparse_init();
break;
case VM_MODEL_FLAT:
vm_flat_init();
break;
default:
break;
}
for (size_t i = 0; i < nr_zones; i++) {
vm_zone_init(&node_data->pg_zones[zones[i].zd_id], &zones[i]);