Changeset 10951


Ignore:
Timestamp:
Oct 3, 2008, 5:06:47 PM (11 years ago)
Author:
gb
Message:

In the Windows version of terminate_lisp(), use #exit (not ExitProcess?,
which seems to want to run things registers via #_atexit. Windows' little
joke.)

Don't claim to run on Panther on Darwin. (We probably haven't in quite
a while, but try to catch that earlier.)

Use SPJUMP_TARGET_ADDRESS in all of the various versions of remap_spjump;
in the Windows version, consider the possibility that the jump table's
already where it needs to be.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r10928 r10951  
    11451145terminate_lisp()
    11461146{
    1147   ExitProcess(EXIT_FAILURE);
     1147  _exit(EXIT_FAILURE);
    11481148}
    11491149#else
     
    11591159
    11601160#ifdef DARWIN
    1161 #ifdef PPC64
    11621161#define min_os_version "8.0"    /* aka Tiger */
    1163 #else
    1164 #define min_os_version "7.0"    /* aka Panther */
    1165 #endif
    11661162#endif
    11671163#ifdef LINUX
     
    12011197  int disp;
    12021198 
    1203   if (old != (pc)0x5000) {
    1204     new = mmap((pc) 0x5000,
     1199  if (old != (pc)SPJUMP_TARGET_ADDRESS) {
     1200    new = mmap((pc) SPJUMP_TARGET_ADDRESS,
    12051201               0x1000,
    12061202               PROT_READ | PROT_WRITE | PROT_EXEC,
     
    12081204               -1,
    12091205               0);
    1210     if (new != (pc) 0x5000) {
     1206    if (new != (pc) SPJUMP_TARGET_ADDRESS) {
     1207      perror("remap spjump");
    12111208      _exit(1);
    12121209    }
     
    12391236  DWORD old_protect;
    12401237
    1241   if (!VirtualProtect((pc) 0x15000,
    1242                       0x1000,
    1243                       PAGE_EXECUTE_READWRITE,
    1244                       &old_protect)) {
    1245     wperror("VirtualProtect spjump");
    1246     _exit(1);
    1247   }
    1248   memmove((pc) 0x15000, &spjump_start, 0x1000);
     1238  if ((void *)(&spjump_start) != (void *) SPJUMP_TARGET_ADDRESS) {
     1239    if (!VirtualProtect((pc) SPJUMP_TARGET_ADDRESS,
     1240                        0x1000,
     1241                        PAGE_EXECUTE_READWRITE,
     1242                        &old_protect)) {
     1243      wperror("VirtualProtect spjump");
     1244      _exit(1);
     1245    }
     1246    memmove((pc) SPJUMP_TARGET_ADDRESS, &spjump_start, 0x1000);
     1247  }
    12491248}
    12501249#else
     
    12531252{
    12541253  extern opcode spjump_start;
    1255   pc new = mmap((pc) 0x15000,
     1254  pc new = mmap((pc) SPJUMP_TARGET_ADDRESS,
    12561255                0x1000,
    12571256                PROT_READ | PROT_WRITE | PROT_EXEC,
Note: See TracChangeset for help on using the changeset viewer.