home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / gcl-1.000 / gcl-1 / gcl-1.0 / h / rios.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-07  |  5.3 KB  |  217 lines

  1. #define ATT
  2. #define RIOS
  3. #define AIX
  4. #define AIX3  
  5. #include "att.h"
  6.  
  7. #define USE_ULONG_
  8.   
  9. #define ADDITIONAL_FEATURES \
  10.                ADD_FEATURE("AIX");\
  11.                ADD_FEATURE("AIX3");\
  12.                  ADD_FEATURE("RIOS");\
  13.                ADD_FEATURE("BUGGY-CC"); 
  14.  
  15. /*  These are supplied in rios_ics.s
  16. #define USE_C_EXTENDED_DIV
  17. #define USE_C_EXTENDED_MUL
  18. */
  19.  
  20. #define    IBMRT
  21. #define    IEEEFLOAT
  22.  
  23. #undef SET_REAL_MAXPAGE
  24. #define SET_REAL_MAXPAGE \
  25.     real_maxpage= ulimit(3)/PAGESIZE; \
  26.     if (real_maxpage > MAXPAGE) \
  27.         real_maxpage = MAXPAGE;
  28.  
  29. #define N_DATADDR(header) 
  30. #define DATA_BEGIN (char *)header.a_dbase
  31.  
  32. #define PAGEWIDTH 12
  33.   
  34. /* I don't know why all the bsd versions are subtracting this off
  35.    I thought the header.a_text was the actual size of the text
  36.    not including the header */
  37.  
  38. #define LD_COMMAND(command,main,start,input,ldarg,output) \
  39.   sprintf(command, "ld -d -x -A %s -T %x %s %s -o %s", \
  40.             main,start,input,ldarg,output)
  41. /* smallest address data can occur */
  42. #define DBEGIN  0x20000000
  43. #define FIX_ADDRESS(jj) \
  44.   do {int del = (int) data_load_addr - DBEGIN; \
  45.    if (del && (0x20000000 & jj)) jj += del; \
  46.    {unsigned short x ;  fread(&x,sizeof(short),1,symin); \
  47.       SYM_TC_OFF(c_table,i) = x;} \
  48.    } while(0)
  49.  
  50. /*
  51. #define SYM_EXTERNAL_P(sym) (((sym)->n_sclass & (~N_SECT)) == C_EXT)
  52. #define SYM_UNDEF_P(sym) (((sym)->n_sclass & N_SECT) ==  N_UNDF)
  53. */
  54.  
  55.  
  56. #define N_SECTION(sym) (((struct syment *)sym)->n_scnum)
  57.             
  58.  
  59. #define N_TYPE N_SECT  
  60.  
  61. /* the header is regared as part of the text */
  62.  
  63. #define N_RELOFF(header) A_TRELPOS(header)
  64. #define SYMNMLEN 8
  65.  
  66.   /* in aix we must use the pointer to the constant pool for the init_code,
  67.      not the actual pointer to the code.  */
  68.  
  69. #define CALL_INIT \
  70. { FUNC at=(FUNC)(init_address + memory->cfd.cfd_start ); \
  71.   if (at==0 || *(char **)at!= memory->cfd.cfd_start) \
  72.     FEerror("init code constant pool bad"); \
  73.   (*at)(memory->cfd.cfd_start, memory->cfd.cfd_size, data);} 
  74.  
  75.   /* find the first symbol in the data section:
  76.      It should begin with with "_init_" and correspond to the
  77.      beginning of the pcp pool for the init function..*/
  78. #define DATA_NSCN  4
  79.     /* the section number of the data section : text,pad,data,...*/
  80.  
  81. #define FIND_INIT \
  82.  { if (*ptr==0 && (N_SECTION(sym) == DATA_NSCN ) && \
  83.        ((sym)->n_sclass  == C_EXT) &&\
  84.        sym->n_value ) \
  85.   { char tem [9]; \
  86.     char *str=SYM_NAME(sym); \
  87.      dprintf(find init: %s ,str); \
  88.   if (str[0]=='i'    && str[1]=='n'  && str[2]=='i' && str[3]== 't' \
  89.       && str[4]=='_' &&  str[strlen(str)-1] !='X')  \
  90.     *ptr=  sym->n_value ; \
  91.    else {/* printf("The first data symbol was not the init"); */}    \
  92.  }} 
  93.  
  94.   
  95. #define RELOC_FILE "rel_rios.c"
  96.  
  97. #define GETCWD
  98.   /* the system defines a different getwd */
  99. #define getwd ourgetwd
  100.   
  101. /* these two symbols are too long for the rt pl8cc compiler */
  102.   
  103. #define check_type_or_pathname_string_symbol_stream  check_type_or_path_or_strm
  104. #define check_type_or_Pathname_string_symbol check_type_or_path_sym
  105. #define TSor_pathname_string_symbol_stream  TSor_path_string_sym_strm  
  106. #define check_type_or_symbol_string_package check_type_or_sym_str_pack  
  107.  
  108.  
  109. #ifdef IN_UNIXFSYS
  110. #define BSD
  111. #undef NEED_GETWD
  112. #undef ATT
  113. #endif
  114.  
  115. #define NOFREE_ERR
  116. #define UNIXSAVE "saveaix3.c"
  117.  
  118.  
  119. #define ISCOFF(x) (x==479)
  120. /* Should really use this */
  121. /*
  122. #define TEXT_NSCN (fileheader.f_opthdr > 28 ? header.o_sntext : 1)
  123. #define DATA_NSCN (fileheader.f_opthdr > 28 ? header.o_sndata : 2)
  124. #define BSS_NSCN (fileheader.f_opthdr > 28 ? header.o_snbss : 3)
  125. */
  126. #define TEXT_NSCN 2
  127. #define DATA_NSCN 4
  128. #define BSS_NSCN 5
  129.  
  130. #define SYM_EXTERNAL_P(sym) ((sym)->n_sclass  == C_EXT)
  131.  
  132. #define EXT_and_TEXT_BSS_DAT(p) \
  133.  ( SYM_EXTERNAL_P(p) && \
  134.   ((p)->n_scnum ==  TEXT_NSCN || (p)->n_scnum ==  BSS_NSCN  || \
  135.   (p)->n_scnum ==  DATA_NSCN ))
  136.  
  137. #define CLEAR_CACHE do{extern system(),myics(); myics();\
  138.              system("true"); \
  139.                if (*next_toc_addresses_to_relocate) \
  140.                  printf("did not relocate all toc addresses"); \
  141.              }while(0);
  142.  
  143.  
  144.  
  145. /* Begin for cmpinclude */
  146. /* yes we have alloca */
  147. /* #define HAVE_ALLOCA */
  148.  
  149. /* make signals stay installed, not lapse every time the
  150.    signal is sent */
  151. #define signal sigset
  152.  
  153.  
  154.  
  155. /* NOTE: If you don't have the system call mprotect DON'T
  156.    define this.
  157.    I have added it to my own kernel.
  158.    */
  159.  
  160.  
  161. /* If you define this you must make available mprotect system call
  162. for the kernel.   See aix3_mprotect directory.
  163. */
  164. /* #define SGC
  165. #define GET_FAULT_ADDR(x,y,c,d) getfault()
  166. */
  167.  
  168. #define QUICK_DIV(x,y,h,hi)\
  169.  if ((int)y > 0 && y > h << 1) \
  170.    {return divsl3(x,y,hi);}
  171.  
  172.  
  173. /* _setjmp and _longjmp exist on bsd and are more efficient
  174.    and handle the C stack which is all we need. [I think!]
  175.    
  176.  */
  177. /*
  178. #define setjmp _setjmp
  179. #define longjmp _longjmp
  180. */
  181.  
  182. /* setjmp only lets you jump in one direction
  183.    upwards in address
  184. */   
  185. #define SETJMP_ONE_DIRECTION
  186.  
  187.  
  188. /* End for cmpinclude */
  189.  
  190.  
  191.   /* if there is no input there return false */
  192. #define LISTEN_FOR_INPUT(fp) \
  193.   if((fp)->_cnt <=0 && (c=0,ioctl((fp)->_file, FIONREAD, &c),c<=0)) \
  194.      return 0
  195.  
  196.  /* have sys/ioctl.h */
  197. #define HAVE_IOCTL
  198. #define HAVE_SIGACTION
  199.   
  200. #define HAVE_XDR
  201.   
  202. #define SHARP_EQ_CONTEXT_SIZE 1024
  203. #undef VSSIZE
  204. #define VSSIZE 81520
  205. #undef MAXPAGE
  206. #define MAXPAGE (1<<15)
  207.  
  208. #define INSTALL_SEGMENTATION_CATCHER \
  209.         sigstack(&estack,0); \
  210.         (void) gcl_signal(SIGSEGV,segmentation_catcher);
  211.  
  212.   
  213.  
  214.   
  215.  
  216.  
  217.