Changeset 5639


Ignore:
Timestamp:
Dec 29, 2006, 12:32:35 AM (18 years ago)
Author:
Gary Byers
Message:

Don't remap ppc64 spjump table if it's already where it should be.

File:
1 edited

Legend:

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

    r5634 r5639  
    12211221{
    12221222  extern opcode spjump_start, spjump_end;
    1223   pc new = mmap((pc) 0x5000,
    1224                 0x1000,
    1225                 PROT_READ | PROT_WRITE | PROT_EXEC,
    1226                 MAP_PRIVATE | MAP_ANON | MAP_FIXED,
    1227                 -1,
    1228                 0),
     1223  pc new,
    12291224    old = &spjump_start,
    12301225    limit = &spjump_end,
     
    12341229  int disp;
    12351230 
    1236   if (new != (pc) 0x5000) {
    1237     _exit(1);
    1238   }
    1239  
    1240   for (work = new; old < limit; work++, old++) {
    1241     instr = *old;
    1242     disp = instr & ((1<<26)-1);
    1243     target = (void*)old+disp;
    1244     disp = target-(void *)work;
    1245     *work = ((instr >> 26) << 26) | disp;
    1246   }
    1247   xMakeDataExecutable(new, (void*)work-(void*)new);
    1248   mprotect(new, 0x1000, PROT_READ | PROT_EXEC);
     1231  if (old != (pc)0x5000) {
     1232    new = mmap((pc) 0x5000,
     1233               0x1000,
     1234               PROT_READ | PROT_WRITE | PROT_EXEC,
     1235               MAP_PRIVATE | MAP_ANON | MAP_FIXED,
     1236               -1,
     1237               0);
     1238    if (new != (pc) 0x5000) {
     1239      _exit(1);
     1240    }
     1241   
     1242    for (work = new; old < limit; work++, old++) {
     1243      instr = *old;
     1244      disp = instr & ((1<<26)-1);
     1245      target = (void*)old+disp;
     1246      disp = target-(void *)work;
     1247      *work = ((instr >> 26) << 26) | disp;
     1248    }
     1249    xMakeDataExecutable(new, (void*)work-(void*)new);
     1250    mprotect(new, 0x1000, PROT_READ | PROT_EXEC);
     1251  }
    12491252}
    12501253#endif
     
    16921695    error = dlerror();
    16931696    *resultType = 0;
    1694     return error;
     1697    return (void *)error;
    16951698  }
    16961699  *resultType = 1;
Note: See TracChangeset for help on using the changeset viewer.