Port the SB128 code to AROS.
[AROS.git] / rom / exec / mungwall.h
blobad147e476323a312f8d0d7deee3016d541bf3bef
1 #undef MDEBUG
2 #define MDEBUG 1
4 #include <aros/debug.h>
5 #include <exec/memory.h>
7 #define MUNGWALL_HEADER_ID 0x1ADEBCA1
9 struct MungwallHeader
11 struct MinNode mwh_node;
12 ULONG mwh_magicid; /* ID for validation */
13 BOOL mwh_fault; /* Fault state indicator */
14 IPTR mwh_allocsize; /* Allocation size (requested by the caller) */
15 APTR mwh_pool; /* Pool to which the allocation belongs */
16 const char *mwh_AllocFunc; /* Name of API allocator function */
17 struct Task *mwh_Owner; /* Allocator task */
18 APTR mwh_Caller; /* Caller address */
22 * Total size of mungwall header needs to be a multiple of MEMCHUNK_TOTAL
23 * for keeping proper alignment.
25 #define MUNGWALLHEADER_SIZE (AROS_ROUNDUP2(sizeof(struct MungwallHeader), MEMCHUNK_TOTAL))
26 #define MUNGWALL_BLOCK_SHIFT (MUNGWALLHEADER_SIZE + MUNGWALL_SIZE)
27 #define MUNGWALL_TOTAL_SIZE (MUNGWALLHEADER_SIZE + MUNGWALL_SIZE * 2)
29 APTR MungWall_Build(APTR res, APTR pool, IPTR origSize, ULONG requirements, const char *function, APTR caller, struct ExecBase *SysBase);
30 APTR MungWall_Check(APTR memoryBlock, IPTR byteSize, const char *function, APTR caller, APTR stack, struct ExecBase *SysBase);
31 void MungWall_Scan(APTR pool, const char *function, APTR caller, APTR stack, struct ExecBase *SysBase);