From 41c405fdb18b139bbde475063230e14a59304ef6 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 21 Dec 2021 12:23:00 +0200 Subject: Modified vmem internals to use pages --- include/apos/tcb.h | 1 + include/apos/vmem.h | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/apos/tcb.h b/include/apos/tcb.h index 9cef386..f987b43 100644 --- a/include/apos/tcb.h +++ b/include/apos/tcb.h @@ -23,6 +23,7 @@ struct tcb { id_t tid; vm_t stack; + vm_t heap; vm_t bin; struct vm_branch_t *b_r; diff --git a/include/apos/vmem.h b/include/apos/vmem.h index 2f6b10c..6918ba4 100644 --- a/include/apos/vmem.h +++ b/include/apos/vmem.h @@ -28,15 +28,12 @@ struct sp_mem { #define __va(x) (((char *)(x)) + VM_DMAP - RAM_BASE) #define __pa(x) (((char *)(x)) + RAM_BASE - VM_DMAP) +#define __page(x) ((x) / BASE_PAGE_SIZE) +#define __addr(x) ((x) * BASE_PAGE_SIZE) /* general overview of the different functions: - * (un)map_vmem: map one known page of physical memory to one known page of - * virtual memory - * - * (un)map_vregion: map known physical region to unknown virtual region within - * start and end - * - * (un)map_vsize: map unknown physical region to unknown virtual region + * internally they all work with pages, but they are called and return usable + * addresses, though within page bounds of course. */ /* defined by arch */ -- cgit v1.3