Annotation of MiNT/src/mem.h, revision 1.1

1.1     ! root        1: /*
        !             2: 
        !             3: Copyright 1990,1991,1992 Eric R. Smith. All rights reserved.
        !             4: 
        !             5: */
        !             6: 
        !             7: 
        !             8: 
        !             9: #ifndef _mem_h
        !            10: 
        !            11: #define _mem_h
        !            12: 
        !            13: 
        !            14: 
        !            15: typedef struct memregion {
        !            16: 
        !            17:        long    loc;            /* base of memory region */
        !            18: 
        !            19:        ulong   len;            /* length of memory region */
        !            20: 
        !            21:        ushort  links;          /* number of users of region */
        !            22: 
        !            23:        ushort  mflags;         /* e.g. which map this came from */
        !            24: 
        !            25:        struct memregion *next; /* next region in memory map */
        !            26: 
        !            27: } MEMREGION;
        !            28: 
        !            29: 
        !            30: 
        !            31: /* dummy type for virtual addresses */
        !            32: 
        !            33: typedef struct vaddr {
        !            34: 
        !            35:        char dummy;
        !            36: 
        !            37: } *virtaddr;
        !            38: 
        !            39: 
        !            40: 
        !            41: /* flags for memory regions */
        !            42: 
        !            43: #define M_CORE         0x01            /* region came from core map */
        !            44: 
        !            45: #define M_ALT          0x02            /* region came from alt map */
        !            46: 
        !            47: #define M_SWAP         0x04            /* region came from swap map */
        !            48: 
        !            49: #define M_KER          0x08            /* region came from kernel map */
        !            50: 
        !            51: #define M_MAP          0x0f            /* and with this to pick out map */
        !            52: 
        !            53: 
        !            54: 
        !            55: #define M_KEEP         0x0100          /* don't free on process termination */
        !            56: 
        !            57: 
        !            58: 
        !            59: /* flags for curproc->memflags */
        !            60: 
        !            61: #define F_FASTLOAD     0x01            /* don't zero heap */
        !            62: 
        !            63: #define F_ALTLOAD      0x02            /* OK to load in alternate ram */
        !            64: 
        !            65: #define F_ALTALLOC     0x04            /* OK to malloc from alt. ram */
        !            66: 
        !            67: 
        !            68: 
        !            69: /* flags for Malloc/Mxalloc */
        !            70: 
        !            71: #define F_KEEP         0x4000          /* don't free memory on termination */
        !            72: 
        !            73: 
        !            74: 
        !            75: typedef MEMREGION **MMAP;
        !            76: 
        !            77: extern MMAP core, alt, ker, swap;
        !            78: 
        !            79: 
        !            80: 
        !            81: /* compilers differ on what "sizeof" returns */
        !            82: 
        !            83: #define SIZEOF         (long)sizeof
        !            84: 
        !            85: 
        !            86: 
        !            87: /* MiNT leaves this much memory for TOS to use
        !            88: 
        !            89:  */
        !            90: 
        !            91: #define TOS_MEM                (8*1024L)
        !            92: 
        !            93: 
        !            94: 
        !            95: /* MiNT tries to keep this much memory available for the kernel and other
        !            96: 
        !            97:  * programs when a program is launched
        !            98: 
        !            99:  */
        !           100: 
        !           101: #define KEEP_MEM       (8*1024L)
        !           102: 
        !           103: 
        !           104: 
        !           105: /*
        !           106: 
        !           107:  * how much memory should be allocated to the kernel?
        !           108: 
        !           109:  */
        !           110: 
        !           111: #define KERNEL_MEM     (24*1024L)
        !           112: 
        !           113: 
        !           114: 
        !           115: /* macro for rounding off region sizes */
        !           116: 
        !           117: #define MASKBITS       0xf
        !           118: 
        !           119: #define ROUND(size) ((size + MASKBITS) & ~MASKBITS)
        !           120: 
        !           121: 
        !           122: 
        !           123: #endif /* _mem_h */
        !           124: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.