added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / exec / memory.h
blob3f7baea35a20af3f16a5dc4afcb12c18cb7d87bf
1 #ifndef EXEC_MEMORY_H
2 #define EXEC_MEMORY_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Memory handling
9 Lang: english
12 #ifndef EXEC_NODES_H
13 # include <exec/nodes.h>
14 #endif
16 struct MemHeader
18 struct Node mh_Node;
19 UWORD mh_Attributes;
20 struct MemChunk * mh_First;
21 APTR mh_Lower;
22 APTR mh_Upper;
23 ULONG mh_Free;
26 struct MemChunk
28 struct MemChunk * mc_Next;
29 ULONG mc_Bytes;
32 struct MemEntry
34 union
36 ULONG meu_Reqs;
37 APTR meu_Addr;
38 } me_Un;
39 ULONG me_Length;
41 #define me_Reqs me_Un.meu_Reqs
42 #define me_Addr me_Un.meu_Addr
44 struct MemList
46 struct Node ml_Node;
47 UWORD ml_NumEntries;
48 struct MemEntry ml_ME[1];
51 #define MEM_BLOCKSIZE 8L
52 #define MEM_BLOCKMASK (MEM_BLOCKSIZE - 1)
54 /* AllocMem() Flags */
55 #define MEMF_ANY 0L
56 #define MEMF_PUBLIC (1L<<0)
57 #define MEMF_CHIP (1L<<1)
58 #define MEMF_FAST (1L<<2)
59 #define MEMF_LOCAL (1L<<8)
60 #define MEMF_24BITDMA (1L<<9)
61 #define MEMF_KICK (1L<<10)
62 #define MEMF_CLEAR (1L<<16)
63 #define MEMF_LARGEST (1L<<17)
64 #define MEMF_REVERSE (1L<<18)
65 #define MEMF_TOTAL (1L<<19)
66 #define MEMF_NO_EXPUNGE (1L<<31)
68 /* New in AROS/MorphOS. Flag for CreatePool to get automatic
69 semaphore protection */
70 #define MEMF_SEM_PROTECTED (1L << 20)
72 struct MemHandlerData
74 ULONG memh_RequestSize;
75 ULONG memh_RequestFlags;
76 ULONG memh_Flags;
79 #define MEMHF_RECYCLE (1L<<0)
81 #define MEM_ALL_DONE (-1)
82 #define MEM_DID_NOTHING 0
83 #define MEM_TRY_AGAIN 1
85 #endif /* EXEC_MEMORY_H */