vmm: fix getting free range at edge of spaces

This commit is contained in:
Matheus
2023-05-07 15:08:33 -03:00
parent 46bbf60ce8
commit 9ce8bd25f5
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
#define KERNELSPACE_START (void *)0xffff800000000000
#define KERNELSPACE_END (void *)0xffffffffffffffff
#define USERSPACE_START (void *)0x0000000000001000
#define USERSPACE_END (void *)0x00007fffffffffff
#define USERSPACE_END (void *)0x0000800000000000
#define PAGE_SIZE 4096
#define ARCH_MMU_FLAGS_READ (uint64_t)1
+2 -2
View File
@@ -83,9 +83,9 @@ static vmmspace_t kernelspace = {
// returns a pointer to the space of vaddr
static vmmspace_t *getspace(void *vaddr) {
if (USERSPACE_START <= vaddr && vaddr <= USERSPACE_END)
if (USERSPACE_START <= vaddr && vaddr < USERSPACE_END)
return &_cpu()->vmmctx->space;
else if (KERNELSPACE_START <= vaddr && vaddr <= KERNELSPACE_END)
else if (KERNELSPACE_START <= vaddr && vaddr < KERNELSPACE_END)
return &kernelspace;
else
return NULL;