diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-14 22:08:10 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-14 22:42:25 +0200 |
commit | befadb5a31a013a95802478d45707f49043a773c (patch) | |
tree | aedfbce156c155c329e13defca2069d10653d29d /kern | |
parent | 160f9286fd8b6e358244e2642c3068c9484d82d0 (diff) | |
download | gnumach-befadb5a31a013a95802478d45707f49043a773c.tar.gz gnumach-befadb5a31a013a95802478d45707f49043a773c.tar.bz2 gnumach-befadb5a31a013a95802478d45707f49043a773c.zip |
pmap+slab: Add more smoketests
Checking the range of addresses for operations on the kernel_pmap is
quite cheap, and allows to catch oddities quite early enough.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/slab.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kern/slab.c b/kern/slab.c index 7cb4ee27..ee51f9e9 100644 --- a/kern/slab.c +++ b/kern/slab.c @@ -416,6 +416,9 @@ kmem_pagealloc_virtual(vm_size_t size, vm_size_t align) static void kmem_pagefree_virtual(vm_offset_t addr, vm_size_t size) { + if (addr < kernel_virtual_start || addr + size > kernel_virtual_end) + panic("kmem_pagefree_virtual(%lx-%lx) falls in physical memory area!\n", + (unsigned long) addr, (unsigned long) addr + size); assert(size > PAGE_SIZE); size = vm_page_round(size); kmem_free(kernel_map, addr, size); |