vm: print log messages during initialisation

This commit is contained in:
2023-02-07 15:43:14 +00:00
parent bf0b4d412c
commit e9d4b60181
4 changed files with 10 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
#include <limits.h>
#include <socks/vm.h>
#include <socks/memblock.h>
#include <socks/printk.h>
#include <stddef.h>
#include <limits.h>
#include <stdint.h>
@@ -15,6 +16,7 @@ kern_status_t vm_bootstrap(const vm_zone_descriptor_t *zones, size_t nr_zones)
/* we're only worrying about UMA systems for now */
node_data = memblock_alloc(sizeof(vm_pg_data_t) * numa_count, 8);
printk("vm: initialising %u node%s", numa_count, numa_count > 1 ? "s" : "");
vm_page_init_array();

View File

@@ -2,6 +2,7 @@
#include <socks/memblock.h>
#include <socks/vm.h>
#include <socks/util.h>
#include <socks/printk.h>
#include <socks/libc/string.h>
#define SIZE_N_CACHE(s) \
@@ -38,6 +39,7 @@ void kmalloc_init(void)
}
kmalloc_initialised = 1;
printk("vm: kmalloc size-N caches online");
}
void *kmalloc(size_t count, vm_flags_t flags)

View File

@@ -1,5 +1,6 @@
#include <socks/types.h>
#include <socks/memblock.h>
#include <socks/printk.h>
#include <socks/vm.h>
#include <socks/libc/string.h>
@@ -87,6 +88,7 @@ void vm_page_init_array()
}
size_t nr_reserved = 0;
for_each_reserved_mem_range(&it, 0x0, UINTPTR_MAX) {
for (uintptr_t i = it.it_base; i < it.it_limit; i += VM_PAGE_SIZE) {
size_t pfn = i / VM_PAGE_SIZE;
@@ -95,6 +97,8 @@ void vm_page_init_array()
nr_reserved++;
}
}
printk("vm: page array has %zu pages, %zu reserved", nr_pages, nr_reserved);
}
vm_page_t *vm_page_get(phys_addr_t addr)

View File

@@ -2,6 +2,7 @@
#include <socks/queue.h>
#include <socks/types.h>
#include <socks/vm.h>
#include <socks/printk.h>
#include <socks/libc/string.h>
static vm_page_t *group_pages_into_block(vm_zone_t *z, phys_addr_t base, phys_addr_t limit, int order)
@@ -114,6 +115,7 @@ void vm_zone_init(vm_zone_t *z, const vm_zone_descriptor_t *zone_info)
}
spin_unlock_irqrestore(&z->z_lock, flags);
printk("vm: zone %s on node %u online.", z->z_info.zd_name, z->z_info.zd_node);
}
static int replenish_free_page_list(vm_zone_t *z, vm_page_order_t order)