2013-02-07 22:49:20 -05:00
|
|
|
#ifndef __mpw_mm_h__
|
|
|
|
#define __mpw_mm_h__
|
2013-02-07 22:12:30 -05:00
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace MM
|
|
|
|
{
|
2013-02-17 13:03:03 -05:00
|
|
|
// native functions.
|
|
|
|
namespace Native
|
|
|
|
{
|
2013-02-17 21:54:45 -05:00
|
|
|
|
2013-07-05 13:56:06 -04:00
|
|
|
void MemoryInfo(uint32_t address);
|
2013-02-17 21:54:45 -05:00
|
|
|
void PrintMemoryStats();
|
|
|
|
|
2013-02-20 23:28:35 -05:00
|
|
|
uint16_t NewHandle(uint32_t size, bool clear, uint32_t &handle);
|
|
|
|
uint16_t NewHandle(uint32_t size, bool clear, uint32_t &handle, uint32_t &ptr);
|
|
|
|
|
2013-02-17 15:07:32 -05:00
|
|
|
uint16_t NewPtr(uint32_t size, bool clear, uint32_t &pointer);
|
|
|
|
|
2013-02-17 13:03:03 -05:00
|
|
|
uint16_t DisposeHandle(uint32_t handle);
|
|
|
|
uint16_t DisposePtr(uint32_t pointer);
|
2013-06-26 22:50:30 -04:00
|
|
|
|
|
|
|
uint16_t GetHandleSize(uint32_t handle, uint32_t &handleSize);
|
2013-08-03 19:17:15 -04:00
|
|
|
uint16_t HSetRBit(uint32_t handle);
|
|
|
|
uint16_t HClrRBit(uint32_t handle);
|
|
|
|
|
2013-02-17 13:03:03 -05:00
|
|
|
}
|
|
|
|
|
2013-02-17 21:54:45 -05:00
|
|
|
bool Init(uint8_t *memory, uint32_t memorySize, uint32_t reserved);
|
|
|
|
|
2013-02-17 13:03:03 -05:00
|
|
|
|
2013-02-07 23:44:58 -05:00
|
|
|
uint16_t BlockMove(uint16_t trap);
|
2013-02-15 00:08:22 -05:00
|
|
|
uint32_t CompactMem(uint16_t trap);
|
2013-03-30 18:45:20 -04:00
|
|
|
uint32_t MaxMem(uint16_t trap);
|
2013-05-17 19:05:03 -04:00
|
|
|
uint32_t MaxBlock(uint16_t trap);
|
2013-03-30 18:45:20 -04:00
|
|
|
uint32_t FreeMem(uint16_t trap);
|
2013-03-31 23:49:59 -04:00
|
|
|
uint16_t ReserveMem(uint16_t trap);
|
2013-03-30 18:45:20 -04:00
|
|
|
|
2013-03-31 23:49:59 -04:00
|
|
|
|
2013-02-14 23:08:56 -05:00
|
|
|
uint16_t DisposeHandle(uint16_t trap);
|
2013-02-16 15:37:55 -05:00
|
|
|
uint16_t DisposePtr(uint16_t trap);
|
|
|
|
|
2013-03-03 21:54:53 -05:00
|
|
|
uint16_t EmptyHandle(uint16_t trap);
|
|
|
|
uint16_t ReallocHandle(uint16_t trap);
|
|
|
|
|
2013-02-16 15:37:55 -05:00
|
|
|
uint32_t GetHandleSize(uint16_t);
|
|
|
|
uint32_t GetPtrSize(uint16_t);
|
2013-02-14 23:08:56 -05:00
|
|
|
|
|
|
|
uint16_t NewHandle(uint16_t trap);
|
2013-02-16 15:37:55 -05:00
|
|
|
uint16_t NewPtr(uint16_t trap);
|
2013-02-15 20:33:00 -05:00
|
|
|
|
|
|
|
uint16_t SetHandleSize(uint16_t);
|
2013-02-16 15:37:55 -05:00
|
|
|
uint16_t SetPtrSize(uint16_t);
|
|
|
|
|
2013-08-03 19:17:50 -04:00
|
|
|
uint16_t HGetState(uint16_t trap);
|
|
|
|
|
2013-02-16 15:37:55 -05:00
|
|
|
uint16_t HLock(uint16_t trap);
|
|
|
|
uint16_t HUnlock(uint16_t trap);
|
2013-02-19 18:28:29 -05:00
|
|
|
|
2013-02-24 23:20:38 -05:00
|
|
|
uint16_t HPurge(uint16_t trap);
|
|
|
|
|
2013-02-19 18:28:29 -05:00
|
|
|
uint16_t MoveHHi(uint16_t trap);
|
|
|
|
|
2013-02-25 17:33:26 -05:00
|
|
|
uint32_t StripAddress(uint16_t trap);
|
|
|
|
|
2013-02-26 18:32:39 -05:00
|
|
|
// operating system utility routines
|
|
|
|
uint16_t HandAndHand(uint16_t trap);
|
|
|
|
uint16_t HandToHand(uint16_t trap);
|
|
|
|
uint16_t PtrAndHand(uint16_t trap);
|
|
|
|
uint16_t PtrToHand(uint16_t trap);
|
|
|
|
uint16_t PtrToXHand(uint16_t trap);
|
|
|
|
|
2013-06-26 22:50:53 -04:00
|
|
|
uint32_t StackSpace(uint16_t trap);
|
|
|
|
|
|
|
|
uint16_t HandleZone(uint16_t trap);
|
2013-06-26 23:50:08 -04:00
|
|
|
uint16_t GetZone(uint16_t trap);
|
|
|
|
uint16_t SetZone(uint16_t trap);
|
2013-02-07 22:12:30 -05:00
|
|
|
}
|
|
|
|
|
2013-02-15 00:08:22 -05:00
|
|
|
|
|
|
|
|
2013-02-07 22:12:30 -05:00
|
|
|
#endif
|