Use stdint

This commit is contained in:
Vincent Barrilliot 2023-12-03 22:25:40 +01:00
parent 5ae3b996c6
commit ff8ad24867

View file

@ -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 <stdint.h>
#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;
}