Added a status field to memory regions to differentiate allocated and reserved regions
This commit is contained in:
@@ -18,7 +18,7 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
if (system_memory == MAP_FAILED) {
|
if (system_memory == MAP_FAILED) {
|
||||||
perror("mmap");
|
perror("mmap");
|
||||||
fprintf(stderr, "cannot allocate simulated system RAM buffer");
|
fprintf(stderr, "cannot allocate simulated system RAM buffer\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ typedef enum memblock_region_status {
|
|||||||
} memblock_region_status_t;
|
} memblock_region_status_t;
|
||||||
|
|
||||||
typedef struct memblock_region {
|
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 */
|
/* the address of the first byte that makes up the region */
|
||||||
phys_addr_t base;
|
phys_addr_t base;
|
||||||
/* the address of the last byte that makes up the region */
|
/* the address of the last byte that makes up the region */
|
||||||
|
|||||||
Reference in New Issue
Block a user