From 7f51b0755ba73ccdecf517ae020eae21d9d1b1d6 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 29 Dec 2022 19:21:59 +0000 Subject: [PATCH] Added a status field to memory regions to differentiate allocated and reserved regions --- sandbox/memblock/main.c | 2 +- sandbox/memblock/memblock.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sandbox/memblock/main.c b/sandbox/memblock/main.c index 866e910..1a3526d 100644 --- a/sandbox/memblock/main.c +++ b/sandbox/memblock/main.c @@ -18,7 +18,7 @@ int main(int argc, const char **argv) if (system_memory == MAP_FAILED) { perror("mmap"); - fprintf(stderr, "cannot allocate simulated system RAM buffer"); + fprintf(stderr, "cannot allocate simulated system RAM buffer\n"); return -1; } diff --git a/sandbox/memblock/memblock.h b/sandbox/memblock/memblock.h index f6fbec2..d4c721b 100644 --- a/sandbox/memblock/memblock.h +++ b/sandbox/memblock/memblock.h @@ -36,6 +36,8 @@ typedef enum memblock_region_status { } memblock_region_status_t; typedef struct memblock_region { + /* the status of the memory region (free, reserved, allocated, etc) */ + memblock_region_status_t status; /* the address of the first byte that makes up the region */ phys_addr_t base; /* the address of the last byte that makes up the region */