Use stdint
This commit is contained in:
parent
5ae3b996c6
commit
ff8ad24867
15
src/memory.c
15
src/memory.c
|
@ -1,10 +1,10 @@
|
||||||
/**
|
/**
|
||||||
* @file memory.h
|
* @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.
|
* 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
|
* User programs can do whatever they want with system RAM from $400 (end of 68K vectors area)
|
||||||
* the top of system RAM. Memory above top of system RAM is reserved for
|
* 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.
|
* 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
|
* NOTE: this code does not manage video RAM or DRAM (on the A2560K)... only
|
||||||
|
@ -12,16 +12,17 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
unsigned long mem_top_of_ram = 0;
|
uint32_t mem_top_of_ram = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the memory management system
|
* Initialize the memory management system
|
||||||
*
|
*
|
||||||
* @param top_of_ram initial value for the top of system RAM
|
* @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;
|
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)
|
* @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;
|
return mem_top_of_ram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ unsigned long mem_get_ramtop() {
|
||||||
* @param bytes the number of bytes to reserve
|
* @param bytes the number of bytes to reserve
|
||||||
* @return address of the first byte of the reserved block
|
* @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;
|
mem_top_of_ram -= bytes;
|
||||||
return mem_top_of_ram;
|
return mem_top_of_ram;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue