Pristine Ack-5.5
[Ack-5.5.git] / util / led / memory.h
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 /* $Id: memory.h,v 3.8 1994/06/24 10:34:56 ceriel Exp $ */
6
7 #define ALLOEMIT        0                       /* Section contents. */
8 #define ALLORELO        (ALLOEMIT + MAXSECT)    /* Relocation table. */
9 #define ALLOLOCL        (ALLORELO + 1)          /* Saved local names. */
10 #define ALLOGLOB        (ALLOLOCL + 1)          /* Saved global names. */
11 #define ALLOLCHR        (ALLOGLOB + 1)          /* Strings of local names. */
12 #define ALLOGCHR        (ALLOLCHR + 1)          /* Strings of global names. */
13 #ifdef SYMDEBUG
14 #define ALLODBUG        (ALLOGCHR + 1)          /* Symbolic debugging info. */
15 #else /* SYMDEBUG */
16 #define ALLODBUG        ALLOGCHR
17 #endif /* SYMDEBUG */
18 #define ALLOSYMB        (ALLODBUG + 1)          /* Symbol table. */
19 #define ALLOARCH        (ALLOSYMB + 1)          /* Archive positions. */
20 #define ALLOMODL        (ALLOARCH + 1)          /* Modules. */
21 #define ALLORANL        (ALLOMODL + 1)          /* Ranlib information. */
22 #define NMEMS           (ALLORANL + 1)
23
24 #define BADOFF          ((ind_t)-1)
25
26 typedef long            ind_t;
27
28 struct memory {
29         char    *mem_base;
30         ind_t   mem_full;
31         ind_t   mem_left;
32 };
33 extern struct memory    mems[];
34
35 #define address(piece,offset)   (mems[(piece)].mem_base+(offset))
36 #define modulptr(offset)        (mems[ALLOMODL].mem_base+core_position+(offset))
37
38 #define int_align(sz)           (((sz)+(sizeof(int)-1))&~(int)(sizeof(int)-1))
39
40 extern ind_t            core_position;
41 extern ind_t            hard_alloc();
42 extern ind_t            alloc();