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 / 386-bsd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-07  |  3.3 KB  |  122 lines

  1. /*
  2.   386-bsd.h 
  3.  
  4.   Hacked September/93 by Paul F. Werkowsksi for 386BSD.
  5.   Tested on i486 EISA 16MB hardware/386BSD 0.1 + PatchKit 0.2.4
  6.   * gcc-2.3.3
  7.   * SGC enabled (big performance win but needs a small kernel hack)
  8.   * Files in September-16-92-Systems.tar (PCL clcs loop clx) compile & run.
  9.    CLUE also compiles and runs. 16 MB insufficient memory to compile CLIO.
  10.  
  11.   Hacked November/93 by Werkowski for FreeBSD. Essentially no changes
  12.   except to use 'unexlin.c' instead of 'unixsave.c'. FreeBSD 1.0.2 has
  13.   (at this time 17-Nov-93) a bug in stdio that needs repair before this will
  14.   work - otherwise use libc.a from 386bsd pk2.4.
  15.   The 'bug' is that vfprintf prints out a 0l0 as '           0e+00' while
  16.   gcl edit_double in print.d expects something like ' 0.00000000000e+00'.
  17. */
  18.  
  19. #include "bsd.h"
  20. /*#include "386.h" /* NOT if you want this to work on 386bsd!!!*/
  21.  
  22. #define ADDITIONAL_FEATURES \
  23.              ADD_FEATURE("386BSD");\
  24.                      ADD_FEATURE("CLX-LITTLE-ENDIAN");
  25.  
  26. #define    I386            /* ?? this is apparently not used anywhere */
  27. #define    IEEEFLOAT
  28.  
  29. #undef HAVE_XDR
  30.  
  31. #define USE_ATT_TIME
  32.  
  33. /* begin listen for input */
  34. #undef LISTEN_FOR_INPUT        /* default in bsd.h is loser in 386bsd */
  35. #if 1                /* Required for CLX to work correctly  */
  36. #if defined IN_FILE
  37. #include <unistd.h>
  38. #include <sys/types.h>
  39. #include <sys/time.h>
  40. #include <stdio.h>
  41. #endif
  42. #define LISTEN_FOR_INPUT(fp) \
  43. {\
  44.   int fd = (fp)->_file;\
  45.   static struct timeval tv = {0,0};\
  46.   static fd_set rmask; FD_ZERO(&rmask); FD_SET(fd,&rmask);\
  47.   select(fd+1,&rmask,NULL,NULL,&tv);\
  48.   return (FD_ISSET(fd,&rmask));\
  49. }
  50. #endif
  51. /* end listen for input */
  52.  
  53. /* we dont need to worry about zeroing fp->_base , to prevent  */
  54. #define FCLOSE_SETBUF_OK 
  55.  
  56. #define DATA_BEGIN (char *)N_DATADDR(header);
  57. #define UNIXSAVE "unexlin.c"
  58.  
  59. #define RELOC_FILE "rel_sun3.c"    /* for SFASL - enabled in bsd.h */
  60.  
  61. #define LITTLE_ENDIAN        /* also in <machine/endian.h> */
  62. #if 0                /* are these relics? */
  63. #define USE_DIRENT
  64. #define GETPATHNAME
  65. #define PATHNAME_CACHE    10    /* ??? */
  66. #endif
  67.  
  68. #define HZ        60
  69.  
  70. /* this for GC */
  71.  
  72. /* #define PAGEWIDTH 12        /* i386 sees 4096 byte pages */
  73. /* try out the gnu malloc */
  74. #if 1                /* (conflict with PAGEWIDTH != 11) */
  75. #define GNU_MALLOC        /* works if PAGEWIDTH==11 */
  76. #define GNUMALLOC
  77. #endif
  78.  
  79. #if 0                /* wont work, but need to patch
  80.                  realloc to return something if ptr is null */
  81. #define DONT_NEED_MALLOC
  82. #endif
  83.  
  84. #define INSTALL_SEGMENTATION_CATCHER \
  85.        (void) signal(SIGSEGV,segmentation_catcher); \
  86.        (void) signal(SIGBUS,segmentation_catcher)
  87.  
  88. /* Begin for cmpinclude */
  89. /* yes we have alloca */
  90. #define HAVE_ALLOCA
  91.  
  92. #define WANT_SGC
  93.  
  94. #ifdef WANT_SGC            /* begin defines for SGC */
  95. /*
  96.   SGC is a performance winner for large applications as it doesn't
  97.   run the entire image through the pager during collection. SGC requires
  98.   the 'mprotect' function.
  99.  
  100.   Need Jeffrey Hsu's kernel patch for signal handlers.  Should be in
  101. FreeBSD versions later than 1.0.2.
  102.  
  103.   Also need to add
  104. #include <sys/types.h> before
  105. #include <sys/mman.h> in c/sgc.c
  106.  
  107.   Also - the above handler conflicts with use of '(un)catch-bad-signals'
  108.   You may want to modify unixint.c to account for SGC use.
  109.  
  110. */
  111. #define SGC
  112. #define SIGPROTV SIGBUS
  113. #endif                /* end of SGC mods */
  114.  
  115. /* _setjmp and _longjmp exist on bsd and are more efficient
  116.    and handle the C stack which is all we need. [I think!]
  117. */
  118. #define setjmp _setjmp
  119. #define longjmp _longjmp
  120.  
  121.  
  122.