From ff8ad24867fd8d279e782d803b520f2c3ba28e62 Mon Sep 17 00:00:00 2001 From: Vincent Barrilliot Date: Sun, 3 Dec 2023 22:25:40 +0100 Subject: [PATCH] Use stdint --- src/memory.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/memory.c b/src/memory.c index 40e6553..cb3df39 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1,10 +1,10 @@ /** * @file memory.h * - * Memory mangament system: memory in Foenix/MCP is handled very simply. + * Memory managament system: memory in Foenix/MCP is handled very simply. * The system will keep track of the top of available system RAM. - * User programs can do whatever they want with system RAM from $400 to - * the top of system RAM. Memory above top of system RAM is reserved for + * User programs can do whatever they want with system RAM from $400 (end of 68K vectors area) + * to the top of system RAM. Memory above top of system RAM is reserved for * the kernel and any terminate-stay-resident code the user cares to install. * * NOTE: this code does not manage video RAM or DRAM (on the A2560K)... only @@ -12,16 +12,17 @@ * */ +#include #include "memory.h" -unsigned long mem_top_of_ram = 0; +uint32_t mem_top_of_ram = 0; /* * Initialize the memory management system * * @param top_of_ram initial value for the top of system RAM */ -void mem_init(unsigned long top_of_ram) { +void mem_init(uint32_t top_of_ram) { mem_top_of_ram = top_of_ram; } @@ -31,7 +32,7 @@ void mem_init(unsigned long top_of_ram) { * * @return the address of the first byte of reserved system RAM (one above the last byte the user program can use) */ -unsigned long mem_get_ramtop() { +uint32_t mem_get_ramtop() { return mem_top_of_ram; } @@ -41,7 +42,7 @@ unsigned long mem_get_ramtop() { * @param bytes the number of bytes to reserve * @return address of the first byte of the reserved block */ -unsigned long mem_reserve(unsigned long bytes) { +uint32_t mem_reserve(uint32_t bytes) { mem_top_of_ram -= bytes; return mem_top_of_ram; }