Changeset 15099


Ignore:
Timestamp:
Dec 1, 2011, 8:19:18 PM (8 years ago)
Author:
rme
Message:

Revert r15026.

Location:
release/1.7/source
Files:
2 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • release/1.7/source

  • release/1.7/source/compiler/X86/X8632/x8632-arch.lisp

    r15026 r15099  
    539539  foreign-sp                            ;value of tcr.foreign_sp
    540540  prev-xframe                           ;tcr.xframe before exception
    541                                         ;(last 2 needed by apply-in-frame)
    542   pc-low                                ;fixnum low half of absolute pc
    543   pc-high                               ;and the high half
    544   )
     541  )                                     ;(last 2 needed by apply-in-frame)
    545542
    546543;;; The kernel uses these (rather generically named) structures
  • release/1.7/source/compiler/X86/X8664/x8664-arch.lisp

    r15026 r15099  
    635635  prev-xframe                           ; tcr.xframe before exception
    636636                                        ; (last 2 needed by apply-in-frame)
    637   pc-low                                ;fixnum low half of absolute pc
    638   pc-high                               ;and the high half
    639637  )
    640638
  • release/1.7/source/level-0/l0-cfm-support.lisp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • release/1.7/source/level-1/x86-trap-support.lisp

    r15026 r15099  
    342342                        (type (simple-array (unsigned-byte 8) (*)) containing-object))
    343343        (aref containing-object (the fixnum (+ byte-offset delta))))
    344       (let* ((high-half (%get-object xcf-ptr target::xcf.pc-high))
    345              (low-half (%get-object xcf-ptr target::xcf.pc-low))
    346              (pc #+64-bit-target (dpb high-half (byte 32 32) low-half)
    347                  #+32-bit-target (dpb high-half (byte 16 16) low-half)))
     344      ;; xcf.relative-pc is a fixnum, but it might be negative.
     345      (let* ((encoded-pc (%get-ptr xcf-ptr target::xcf.relative-pc))
     346             (pc (ash (%ptr-to-int encoded-pc) (- target::fixnumshift))))
    348347        (%get-unsigned-byte (%int-to-ptr pc) delta)))))
    349348
  • release/1.7/source/lisp-kernel/darwinx8632/Makefile

    r15026 r15099  
    5252COBJ  = pmcl-kernel.o gc-common.o bits.o  \
    5353        thread_manager.o lisp-debug.o image.o memory.o x86-gc.o \
    54         x86-utils.o \
    5554        x86-exceptions.o unix-calls.o mach-o-image.o
    5655
     
    6362        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    6463        threads.h lisptypes.h x86-constants32.h x86-exceptions.h \
    65         x86-utils.h \
    6664        $(PLATFORM_H) constants.h os-darwin.h
    6765
  • release/1.7/source/lisp-kernel/darwinx8664/Makefile

    r15026 r15099  
    7272
    7373COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    74         x86-utils.o \
    7574        thread_manager.o lisp-debug.o image.o memory.o unix-calls.o \
    7675        mach-o-image.o
     
    8584        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    8685        threads.h lisptypes.h x86-constants64.h x86-exceptions.h \
    87         x86-utils.h \
    8886        $(PLATFORM_H) constants.h os-darwin.h
    8987
  • release/1.7/source/lisp-kernel/freebsdx8632/Makefile

    r15026 r15099  
    3636
    3737COBJ  = pmcl-kernel.o gc-common.o  x86-gc.o bits.o  x86-exceptions.o \
    38         x86-utils.o \
    3938        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
    4039
     
    5049CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
    5150        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    52         x86-utils.h \
    5351        threads.h x86-constants32.h x86-exceptions.h $(PLATFORM_H)
    5452
  • release/1.7/source/lisp-kernel/freebsdx8664/Makefile

    r15026 r15099  
    3737
    3838COBJ  = pmcl-kernel.o gc-common.o  x86-gc.o bits.o  x86-exceptions.o \
    39         x86-utils.o \
    4039        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
    4140
     
    4847CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
    4948        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    50         x86-utils.h \
    5149        threads.h x86-constants64.h x86-exceptions.h $(PLATFORM_H)
    5250
  • release/1.7/source/lisp-kernel/linuxx8632/Makefile

    r15026 r15099  
    5050
    5151COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    52         x86-utils.o \
    5352        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
    5453
     
    6261        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    6362        threads.h x86-constants32.h x86-exceptions.h lisptypes.h \
    64         x86-utils.h \
    6563        $(PLATFORM_H) constants.h os-linux.h
    6664
  • release/1.7/source/lisp-kernel/linuxx8664/Makefile

    r15026 r15099  
    5050
    5151COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    52         x86-utils.o \
    5352        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
    5453
     
    6261        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    6362        threads.h x86-constants64.h x86-exceptions.h lisptypes.h \
    64         x86-utils.h \
    6563        $(PLATFORM_H) constants.h os-linux.h
    6664
  • release/1.7/source/lisp-kernel/solarisx64/Makefile

    r15026 r15099  
    4646
    4747COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    48         x86-utils.o \
    4948        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
    5049
     
    5857        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    5958        threads.h x86-constants64.h x86-exceptions.h lisptypes.h \
    60         x86-utils.h \
    6159        $(PLATFORM_H) constants.h os-solaris.h
    6260
  • release/1.7/source/lisp-kernel/solarisx86/Makefile

    r15026 r15099  
    4545
    4646COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    47         x86-utils.o \
    4847        image.o thread_manager.o lisp-debug.o memory.o unix-calls.o
    4948
     
    5756        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    5857        threads.h x86-constants32.h x86-exceptions.h lisptypes.h \
    59         x86-utils.h \
    6058        $(PLATFORM_H) constants.h os-solaris.h
    6159
  • release/1.7/source/lisp-kernel/win32/Makefile

    r15026 r15099  
    6565
    6666COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    67         x86-utils.o \
    6867        image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
    6968
     
    7776        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    7877        threads.h x86-constants32.h x86-exceptions.h lisptypes.h \
    79         x86-utils.h \
    8078        $(PLATFORM_H) constants.h os-windows.h
    8179
  • release/1.7/source/lisp-kernel/win64/Makefile

    r15026 r15099  
    6464
    6565COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
    66         x86-utils.o \
    6766        image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
    6867
     
    7675        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
    7776        threads.h x86-constants64.h x86-exceptions.h lisptypes.h \
    78         x86-utils.h \
    7977        $(PLATFORM_H) constants.h os-windows.h
    8078
  • release/1.7/source/lisp-kernel/x86-constants32.h

    r15026 r15099  
    216216#define function_boundary_marker subtag_function_boundary_marker
    217217
    218 /* The 32-bit immediate value in the instruction
    219  * "(mov ($ 0x12345678) (% fn))" at a tagged return address
    220  * refers to the associated function.
    221  */
    222 #define RECOVER_FN_OPCODE 0xbf
    223 #define RECOVER_FN_LENGTH 5
    224218
    225219
     
    247241    LispObj tra;                /* ALWAYS 0 FOR AN XCF */
    248242    LispObj nominal_function;   /* the current function at the time of the exception */
    249     LispObj relative_pc;        /* Boxed byte offset within actual function */
     243    LispObj relative_pc;        /* Boxed byte offset within actual function or absolute address */
    250244    LispObj containing_uvector; /* the uvector that contains the relative PC or NIL */
    251245    LispObj xp;                 /* exception context */
     
    253247    LispObj foreign_sp;         /* foreign sp at the time that exception occurred */
    254248    LispObj prev_xframe;        /* so %apply-in-frame can unwind it */
    255     LispObj pc_low;             /* fixnum low half of absolute pc */
    256     LispObj pc_high;            /* and the high half */
    257249} xcf;
    258250
  • release/1.7/source/lisp-kernel/x86-constants64.h

    r15026 r15099  
    254254#define function_boundary_marker SUBTAG(fulltag_imm_1,15)       
    255255
    256 /*
    257  * To determine the function associated with a tagged return
    258  * address, we attempt to recognize an the instruction
    259  * (lea (@ disp (% rip)) (% fn)) at the tra.
    260  */
    261 #define RECOVER_FN_FROM_RIP_LENGTH 7 /* the instruction is 7 bytes long */
    262 #define RECOVER_FN_FROM_RIP_DISP_OFFSET 3 /* displacement word is 3 bytes in */
    263 #define RECOVER_FN_FROM_RIP_WORD0 0x8d4c /* 0x4c 0x8d, little-endian */
    264 #define RECOVER_FN_FROM_RIP_BYTE2 0x2d  /* third byte of opcode */
    265 
    266 
    267256/* The objects themselves look something like this: */
    268257
     
    289278  LispObj tra;                  /* ALWAYS 0 FOR AN XCF */
    290279  LispObj nominal_function;     /* the current function at the time of the exception */
    291   LispObj relative_pc;          /* Boxed byte offset within actual function */
     280  LispObj relative_pc;          /* Boxed byte offset within actual
     281                                   function or absolute address */
    292282  LispObj containing_uvector;   /* the uvector that contains the relative PC or NIL */
    293283  LispObj xp;                   /* exception context */
     
    295285  LispObj foreign_sp;           /* foreign sp at the time that exception occurred */
    296286  LispObj prev_xframe;          /* so %apply-in-frame can unwind it */
    297   LispObj pc_low;               /* fixnum low half of absolute pc */
    298   LispObj pc_high;              /* and the high half */
    299287} xcf;
    300288
  • release/1.7/source/lisp-kernel/x86-exceptions.c

    r15056 r15099  
    1818#include "lisp-exceptions.h"
    1919#include "lisp_globals.h"
    20 #include "x86-utils.h"
    2120#include "threads.h"
    2221#include <ctype.h>
     
    404403{
    405404  LispObj containing_uvector = 0,
    406     relative_pc = lisp_nil,
     405    relative_pc,
    407406    nominal_function = lisp_nil,
    408407    f, tra, tra_f = 0, abs_pc;
    409   LispObj pc_low, pc_high;
    410408
    411409  f = xpGPR(xp,Ifn);
    412410  tra = *(LispObj*)(xpGPR(xp,Isp));
    413   tra_f = tra_function(tra);
     411
     412#ifdef X8664
     413  if (tag_of(tra) == tag_tra) {
     414    if ((*((unsigned short *)tra) == RECOVER_FN_FROM_RIP_WORD0) &&
     415        (*((unsigned char *)(tra+2)) == RECOVER_FN_FROM_RIP_BYTE2)) {
     416      int sdisp = (*(int *) (tra+3));
     417      tra_f = RECOVER_FN_FROM_RIP_LENGTH+tra+sdisp;
     418    }
     419    if (fulltag_of(tra_f) != fulltag_function) {
     420      tra_f = 0;
     421    }
     422  } else {
     423    tra = 0;
     424  }
     425#endif
     426#ifdef X8632
     427  if (fulltag_of(tra) == fulltag_tra) {
     428    if (*(unsigned char *)tra == RECOVER_FN_OPCODE) {
     429      tra_f = (LispObj)*(LispObj *)(tra + 1);
     430    }
     431    if (tra_f && header_subtag(header_of(tra_f)) != subtag_function) {
     432      tra_f = 0;
     433    }
     434  } else {
     435    tra = 0;
     436  }
     437#endif
     438
    414439  abs_pc = (LispObj)xpPC(xp);
    415 #if WORD_SIZE == 64
    416   pc_high = ((abs_pc >> 32) & 0xffffffff) << fixnumshift;
    417   pc_low = (abs_pc & 0xffffffff) << fixnumshift;
    418 #else
    419   pc_high = ((abs_pc >> 16) & 0xffff) << fixnumshift;
    420   pc_low = (abs_pc & 0xffff) << fixnumshift;
    421 #endif
    422 
    423 
    424   if (functionp(f))
    425     nominal_function = f;
    426   else if (tra_f)
    427     nominal_function = tra_f;
     440
     441#ifdef X8664
     442  if (fulltag_of(f) == fulltag_function)
     443#else
     444    if (fulltag_of(f) == fulltag_misc &&
     445        header_subtag(header_of(f)) == subtag_function)
     446#endif
     447      {
     448        nominal_function = f;
     449      } else {
     450      if (tra_f) {
     451        nominal_function = tra_f;
     452      }
     453    }
    428454 
    429455  f = xpGPR(xp,Ifn);
     
    448474  } else {
    449475    containing_uvector = lisp_nil;
    450   }
    451   push_on_lisp_stack(xp, pc_high);
    452   push_on_lisp_stack(xp, pc_low);
     476    relative_pc = abs_pc << fixnumshift;
     477  }
    453478  push_on_lisp_stack(xp,(LispObj)(tcr->xframe->prev));
    454479  push_on_lisp_stack(xp,(LispObj)(tcr->foreign_sp));
  • release/1.7/source/lisp-kernel/x86-exceptions.h

    r15026 r15099  
    9191#endif
    9292
     93/* recognizing the function associated with a tagged return address */
     94/* now involves recognizinig an "(lea (@ disp (% rip)) (% rn))" */
     95/* instruction at the tra */
     96
     97#define RECOVER_FN_FROM_RIP_LENGTH 7 /* the instruction is 7 bytes long */
     98#define RECOVER_FN_FROM_RIP_DISP_OFFSET 3 /* displacement word is 3 bytes in */
     99#define RECOVER_FN_FROM_RIP_WORD0 0x8d4c /* 0x4c 0x8d, little-endian */
     100#define RECOVER_FN_FROM_RIP_BYTE2 0x2d  /* third byte of opcode */
     101
    93102extern natural get_mxcsr();
    94103extern void set_mxcsr(natural);
    95104void enable_fp_exceptions(void);
     105
     106#ifdef X8632
     107/* The 32-bit immediate value in the instruction
     108 * "(mov ($ 0x12345678) (% fn))" at a tagged return address
     109 * refers to the associated function.
     110 */
     111#define RECOVER_FN_OPCODE 0xbf
     112#define RECOVER_FN_LENGTH 5
     113#endif
    96114
    97115void callback_for_gc_notification(ExceptionInformation *xp, TCR *tcr);
  • release/1.7/source/lisp-kernel/xlbt.c

    r15026 r15099  
    1616
    1717#include "lispdcmd.h"
    18 #include "x86-utils.h"
    1918#include <stdio.h>
    2019#include <signal.h>
    2120
    22 natural
    23 pc_from_xcf(xcf *xcf)
    24 {
    25   if (functionp(xcf->nominal_function)) {
    26     LispObj fv = function_to_function_vector(xcf->nominal_function);
    27     if (fv == xcf->containing_uvector) {
    28       unsigned tag;
    2921
    30 #ifdef X8664
    31       tag = tag_function;
    32 #else
    33       tag = fulltag_misc;
    34 #endif
    35       return unbox_fixnum(xcf->relative_pc) - tag;
    36     } else {
    37       LispObj tra = xcf->ra0;
    38       LispObj f = tra_function(tra);
    39 
    40       if (f && f == xcf->nominal_function)
    41         return tra_offset(tra);
    42     }
    43   }
    44   return 0;
    45 }
    4622
    4723void
     
    6743  }
    6844  if (pc == 0) {
    69     natural rpc = pc_from_xcf((xcf *)frame);
    70 
    7145    fun = ((xcf *)frame)->nominal_function;
    72     fprintf(dbgout, "(#x%08X) #x%08X : %s + ", frame, pc,
    73             print_lisp_object(fun));
    74     if (rpc)
    75       fprintf(dbgout, "%d\n", rpc);
    76     else
    77       fprintf(dbgout, "??\n", rpc);
     46    Dprintf("(#x%08X) #x%08X : %s + ??", frame, pc, print_lisp_object(fun));
    7847    return;
    7948  }
     
    9261  }
    9362  if (pc == 0) {
    94     natural rpc = pc_from_xcf((xcf *)frame);
    95 
    9663    fun = ((xcf *)frame)->nominal_function;
    97     fprintf(dbgout, "(#x%016lX) #x%016lX : %s + ", frame, pc,
    98             print_lisp_object(fun));
    99     if (rpc)
    100       fprintf(dbgout, "%d\n", rpc);
    101     else
    102       fprintf(dbgout, "??\n");
     64    Dprintf("(#x%016lX) #x%016lX : %s + ??", frame, pc, print_lisp_object(fun));
    10365    return;
    10466  }
Note: See TracChangeset for help on using the changeset viewer.