1 #ifndef EXEC_MEMORY_H 2 #define EXEC_MEMORY_H 3 4 /* 5 exec memory definitions (V50) 6 7 Copyright © 2002 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_NODES_H 11 # include <exec/nodes.h> 12 #endif 13 14 #pragma pack(2) 15 16 17 struct MemChunk 18 { 19 struct MemChunk *mc_Next; 20 ULONG mc_Bytes; 21 }; 22 23 struct MemHeader 24 { 25 struct Node mh_Node; 26 UWORD mh_Attributes; 27 struct MemChunk *mh_First; 28 APTR mh_Lower; 29 APTR mh_Upper; 30 ULONG mh_Free; 31 }; 32 33 struct MemEntry 34 { 35 union 36 { 37 ULONG meu_Reqs; 38 APTR meu_Addr; 39 } me_Un; 40 ULONG me_Length; 41 }; 42 43 #define me_un me_Un 44 #define me_Reqs me_Un.meu_Reqs 45 #define me_Addr me_Un.meu_Addr 46 47 struct MemList 48 { 49 struct Node ml_Node; 50 UWORD ml_NumEntries; 51 struct MemEntry ml_ME[1]; 52 }; 53 54 #define ml_me ml_ME 55 56 #define MEMF_ANY (0) 57 #define MEMF_PUBLIC (1<<0) 58 #define MEMF_CHIP (1<<1) 59 #define MEMF_FAST (1<<2) 60 #define MEMF_LOCAL (1<<8) 61 #define MEMF_24BITDMA (1<<9) 62 #define MEMF_KICK (1<<10) 63 #define MEMF_SWAP (1<<11) /* Memory that can be swapped out to disk */ 64 #define MEMF_31BIT (1<<12) /* Memory that is in <2GiB area (V51) */ 65 66 #define MEMF_CLEAR (1<<16) 67 #define MEMF_LARGEST (1<<17) 68 #define MEMF_REVERSE (1<<18) 69 #define MEMF_TOTAL (1<<19) 70 #define MEMF_SEM_PROTECTED (1<<20) /* Pools: semaphore protection */ 71 #define MEMF_NO_EXPUNGE (1<<31) 72 73 #define MEM_BLOCKSIZE (8UL) 74 #define MEM_BLOCKMASK (MEM_BLOCKSIZE - 1) 75 76 struct MemHandlerData 77 { 78 ULONG memh_RequestSize; 79 ULONG memh_RequestFlags; 80 ULONG memh_Flags; 81 }; 82 83 #define MEMHF_RECYCLE (1<<0) 84 85 #define MEM_DID_NOTHING (0) 86 #define MEM_ALL_DONE (-1) 87 #define MEM_TRY_AGAIN (1) 88 89 struct FreeBlocksData 90 { 91 ULONG fbd_NumBlocks; 92 struct MemEntry fbd_Blocks[1]; /* fbd_NumBlocks entries */ 93 }; 94 95 96 #pragma pack() 97 98 #endif