memory.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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$ */
  6. #define ALLOEMIT 0 /* Section contents. */
  7. #define ALLORELO (ALLOEMIT + MAXSECT) /* Relocation table. */
  8. #define ALLOLOCL (ALLORELO + 1) /* Saved local names. */
  9. #define ALLOGLOB (ALLOLOCL + 1) /* Saved global names. */
  10. #define ALLOLCHR (ALLOGLOB + 1) /* Strings of local names. */
  11. #define ALLOGCHR (ALLOLCHR + 1) /* Strings of global names. */
  12. #ifdef SYMDEBUG
  13. #define ALLODBUG (ALLOGCHR + 1) /* Symbolic debugging info. */
  14. #else /* SYMDEBUG */
  15. #define ALLODBUG ALLOGCHR
  16. #endif /* SYMDEBUG */
  17. #define ALLOSYMB (ALLODBUG + 1) /* Symbol table. */
  18. #define ALLOARCH (ALLOSYMB + 1) /* Archive positions. */
  19. #define ALLOMODL (ALLOARCH + 1) /* Modules. */
  20. #define ALLORANL (ALLOMODL + 1) /* Ranlib information. */
  21. #define NMEMS (ALLORANL + 1)
  22. #define BADOFF ((ind_t)-1)
  23. typedef long ind_t;
  24. struct memory {
  25. char *mem_base;
  26. ind_t mem_full;
  27. ind_t mem_left;
  28. };
  29. extern struct memory mems[];
  30. #define address(piece,offset) (mems[(piece)].mem_base+(offset))
  31. #define modulptr(offset) (mems[ALLOMODL].mem_base+core_position+(offset))
  32. #define int_align(sz) (((sz)+(sizeof(int)-1))&~(int)(sizeof(int)-1))
  33. extern ind_t core_position;
  34. extern ind_t hard_alloc();
  35. extern ind_t alloc();