Changeset 8804


Ignore:
Timestamp:
Mar 17, 2008, 7:06:08 AM (12 years ago)
Author:
gb
Message:

Fix typo in ensure_gc_structures_writeable(). Set HEAP_START/HEAP_END
globals just before calling it.
Provide some win64 definitions (terminate_lisp(), etc.)
Set _fmode (default text/binary mode for open()), so we don't have to
remember to say O_BINARY, make stderr unbuffered on Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/lisp-kernel/pmcl-kernel.c

    r8787 r8804  
    631631
    632632  if (new_reloctab_limit > reloctab_limit) {
    633     CommitMemory(global_mark_ref_bits, markbits_size);
     633    CommitMemory(global_reloctab, reloctab_size);
    634634    UnProtectMemory(global_reloctab, reloctab_size);
    635635    reloctab_limit = new_reloctab_limit;
     
    665665  a->softprot = NULL;
    666666  a->hardprot = NULL;
     667  lisp_global(HEAP_START) = ptr_to_lispobj(a->low);
     668  lisp_global(HEAP_END) = ptr_to_lispobj(a->high);
    667669  ensure_gc_structures_writable();
    668670  return a;
     
    738740register_sigint_handler()
    739741{
     742#ifdef WINDOWS
     743  extern BOOL ControlEventHandler(DWORD);
     744
     745  SetConsoleCtrlHandler(ControlEventHandler,TRUE);
     746#else
    740747  install_signal_handler(SIGINT, (void *)sigint_handler);
     748#endif
    741749}
    742750
     
    779787
    780788#if defined(DARWIN) || defined(WINDOWS)
     789#ifdef WINDOWS
     790/* Chop the trailing ".exe" from the kernel image name */
     791char *
     792chop_exe_suffix(char *path)
     793{
     794  int len = strlen(path);
     795  char *copy = malloc(len+1), *tail;
     796
     797  strcpy(copy,path);
     798  tail = strrchr(copy, '.');
     799  if (tail) {
     800    *tail = 0;
     801  }
     802  return copy;
     803}
     804#endif
     805
    781806/*
    782807   The underlying file system may be case-insensitive (e.g., HFS),
     
    787812default_image_name(char *orig)
    788813{
    789   int len = strlen(orig) + strlen(".image") + 1;
     814#ifdef WINDOWS
     815  char *path = chop_exe_suffix(orig);
     816#else
     817  char *path = orig;
     818#endif
     819  int len = strlen(path) + strlen(".image") + 1;
    790820  char *copy = (char *) malloc(len);
    791821
    792822  if (copy) {
    793     strcpy(copy, orig);
     823    strcpy(copy, path);
    794824    strcat(copy, ".image");
    795825  }
     
    11071137terminate_lisp()
    11081138{
     1139  ExitProcess(EXIT_FAILURE);
    11091140}
    11101141#else
     
    13441375  TCR *tcr;
    13451376  int i;
     1377
     1378#ifdef WINDOWS
     1379  _fmode = O_BINARY;
     1380  setvbuf(stderr, NULL, _IONBF, 0);
     1381#endif
    13461382
    13471383  check_os_version(argv[0]);
     
    17481784
    17491785
    1750 #ifndef O_BINARY
    1751 #define O_BINARY 0
    1752 #endif
    17531786
    17541787Boolean
    17551788check_for_embedded_image (char *path)
    17561789{
    1757   int fd = open(path, O_RDONLY|O_BINARY);
     1790  int fd = open(path, O_RDONLY);
    17581791  Boolean image_is_embedded = false;
    17591792
     
    17721805load_image(char *path)
    17731806{
    1774   int fd = open(path, O_RDONLY|O_BINARY, 0666);
     1807  int fd = open(path, O_RDONLY, 0666);
    17751808  LispObj image_nil = 0;
    17761809  if (fd > 0) {
Note: See TracChangeset for help on using the changeset viewer.