2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
11 #include <exec/lists.h>
12 #include <exec/semaphores.h>
13 #include <exec/memory.h>
16 #define RTPOTx4(a) ((a)>2?4:(a)>1?2:1)
18 #define RTPOTx10(a) ((a)>=4?RTPOTx4(((a)+3)/4)*4:RTPOTx4(a))
20 #define RTPOTx100(a) \
21 ((a)>=0x10?RTPOTx10(((a)+0xf)/0x10)*0x10:RTPOTx10(a))
23 #define RTPOTx10000(a) \
24 ((a)>=0x100?RTPOTx100(((a)+0xff)/0x100)*0x100:RTPOTx100(a))
26 #define RTPOTx100000000(a) \
27 ((a)>=0x10000?RTPOTx10000(((a)+0xffff)/0x10000)*0x10000:RTPOTx10000(a))
29 #define ROUNDUP_TO_POWER_OF_TWO(a) RTPOTx100(a)
31 /* Some defines for the memory handling functions. */
33 /* This is for the alignment of memchunk structures. */
34 #define MEMCHUNK_TOTAL \
35 ROUNDUP_TO_POWER_OF_TWO(AROS_WORSTALIGN>sizeof(struct MemChunk)? \
36 AROS_WORSTALIGN:sizeof(struct MemChunk))
38 /* This allows to take the end of the MemHeader as the first MemChunk. */
39 #define MEMHEADER_TOTAL \
40 ((sizeof(struct MemHeader)+MEMCHUNK_TOTAL-1)&~(MEMCHUNK_TOTAL-1))
42 /* Private Pool structure */
45 struct MinList PuddleList
;
46 struct MinList BlockList
;
55 struct SignalSemaphore sem
;
64 #if AROS_MUNGWALL_DEBUG
65 #include <aros/debug.h> /* for MUNGWALLHEADER_SIZE */
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))