2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
11 # include <aros/debug.h>
12 #include <exec/lists.h>
13 #include <exec/semaphores.h>
14 #include <exec/memory.h>
17 #define RTPOTx4(a) ((a)>2?4:(a)>1?2:1)
19 #define RTPOTx10(a) ((a)>=4?RTPOTx4(((a)+3)/4)*4:RTPOTx4(a))
21 #define RTPOTx100(a) \
22 ((a)>=0x10?RTPOTx10(((a)+0xf)/0x10)*0x10:RTPOTx10(a))
24 #define RTPOTx10000(a) \
25 ((a)>=0x100?RTPOTx100(((a)+0xff)/0x100)*0x100:RTPOTx100(a))
27 #define RTPOTx100000000(a) \
28 ((a)>=0x10000?RTPOTx10000(((a)+0xffff)/0x10000)*0x10000:RTPOTx10000(a))
30 #define ROUNDUP_TO_POWER_OF_TWO(a) RTPOTx100(a)
32 /* Some defines for the memory handling functions. */
34 /* This is for the alignment of memchunk structures. */
35 #define MEMCHUNK_TOTAL \
36 ROUNDUP_TO_POWER_OF_TWO(AROS_WORSTALIGN>sizeof(struct MemChunk)? \
37 AROS_WORSTALIGN:sizeof(struct MemChunk))
39 /* This allows to take the end of the MemHeader as the first MemChunk. */
40 #define MEMHEADER_TOTAL \
41 ((sizeof(struct MemHeader)+MEMCHUNK_TOTAL-1)&~(MEMCHUNK_TOTAL-1))
43 /* Private Pool structure */
46 struct MinList PuddleList
;
47 struct MinList BlockList
;
56 struct SignalSemaphore sem
;
65 #if AROS_MUNGWALL_DEBUG
67 #define MUNGWALL_HEADER_ID 0x1ADEBCA1
69 /* This struct must not be bigger than MUNGWALLHEADER_SIZE!! */
83 UBYTE blub
[MUNGWALLHEADER_SIZE
];
88 #define mwh_node u.s.node
89 #define mwh_magicid u.s.magicid
90 #define mwh_allocsize u.s.allocsize
96 ((sizeof(struct Block)+AROS_WORSTALIGN-1)&~(AROS_WORSTALIGN-1))