home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright 1990,1991,1992 Eric R. Smith. All rights reserved.
- */
-
- #ifndef _mem_h
- #define _mem_h
-
- typedef struct memregion {
- long loc; /* base of memory region */
- ulong len; /* length of memory region */
- ushort links; /* number of users of region */
- ushort mflags; /* e.g. which map this came from */
- struct memregion *next; /* next region in memory map */
- } MEMREGION;
-
- /* dummy type for virtual addresses */
- typedef struct vaddr {
- char dummy;
- } *virtaddr;
-
- /* flags for memory regions */
- #define M_CORE 0x01 /* region came from core map */
- #define M_ALT 0x02 /* region came from alt map */
- #define M_SWAP 0x04 /* region came from swap map */
- #define M_KER 0x08 /* region came from kernel map */
- #define M_MAP 0x0f /* and with this to pick out map */
-
- #define M_KEEP 0x0100 /* don't free on process termination */
-
- /* flags for curproc->memflags */
- #define F_FASTLOAD 0x01 /* don't zero heap */
- #define F_ALTLOAD 0x02 /* OK to load in alternate ram */
- #define F_ALTALLOC 0x04 /* OK to malloc from alt. ram */
-
- /* flags for Malloc/Mxalloc */
- #define F_KEEP 0x4000 /* don't free memory on termination */
-
- typedef MEMREGION **MMAP;
- extern MMAP core, alt, ker, swap;
-
- /* compilers differ on what "sizeof" returns */
- #define SIZEOF (long)sizeof
-
- /* MiNT leaves this much memory for TOS to use
- */
- #define TOS_MEM (8*1024L)
-
- /* MiNT tries to keep this much memory available for the kernel and other
- * programs when a program is launched
- */
- #define KEEP_MEM (8*1024L)
-
- /*
- * how much memory should be allocated to the kernel?
- */
- #define KERNEL_MEM (24*1024L)
-
- /* macro for rounding off region sizes */
- #define MASKBITS 0xf
- #define ROUND(size) ((size + MASKBITS) & ~MASKBITS)
-
- #endif /* _mem_h */
-