sandbox: moved all sources to main kernel tree
This commit is contained in:
36
vm/bootstrap.c
Normal file
36
vm/bootstrap.c
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <socks/status.h>
|
||||
#include <limits.h>
|
||||
#include <socks/vm.h>
|
||||
#include <socks/memblock.h>
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* One vm_pg_data_t per NUMA node. */
|
||||
static vm_pg_data_t *node_data = NULL;
|
||||
|
||||
kern_status_t vm_bootstrap(const vm_zone_descriptor_t *zones, size_t nr_zones)
|
||||
{
|
||||
int numa_count = 1;
|
||||
|
||||
/* we're only worrying about UMA systems for now */
|
||||
node_data = memblock_alloc(sizeof(vm_pg_data_t) * numa_count);
|
||||
|
||||
vm_page_init_array();
|
||||
|
||||
for (size_t i = 0; i < nr_zones; i++) {
|
||||
vm_zone_init(&node_data->pg_zones[zones[i].zd_id], &zones[i]);
|
||||
}
|
||||
|
||||
return KERN_OK;
|
||||
}
|
||||
|
||||
vm_pg_data_t *vm_pg_data_get(vm_node_id_t node)
|
||||
{
|
||||
if (node == 0) {
|
||||
return node_data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user