Ignore:
Timestamp:
Sep 20, 2011, 2:19:03 AM (9 years ago)
Author:
rme
Message:

New functions in x86-utils.[ch], moved, more-or-less,
from xlbt.c.

Use them in x86-exceptions.c, in particular in
create_exception_callback_frame().

Move the definitions of the RECOVER_FN_xxx constants
from x86-exceptions.h to the appropriate x86-constants{32,64}.h
files.

File:
1 edited

Legend:

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

    r14968 r14991  
    1818#include "lisp-exceptions.h"
    1919#include "lisp_globals.h"
     20#include "x86-utils.h"
    2021#include "threads.h"
    2122#include <ctype.h>
     
    409410  f = xpGPR(xp,Ifn);
    410411  tra = *(LispObj*)(xpGPR(xp,Isp));
    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 
     412  tra_f = tra_function(tra);
    439413  abs_pc = (LispObj)xpPC(xp);
    440414
    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     }
     415  if (functionp(f))
     416    nominal_function = f;
     417  else if (tra_f)
     418    nominal_function = tra_f;
    454419 
    455420  f = xpGPR(xp,Ifn);
     
    474439  } else {
    475440    containing_uvector = lisp_nil;
     441    /*
     442     * An absolute PC will not necessarily fit into a fixnum,
     443     * so encode it as two fixnums and let lisp reassemble it.
     444     */
    476445#if WORD_SIZE == 64
    477446    relative_pc = ((abs_pc >> 32) & 0xffffffff) << fixnumshift;
Note: See TracChangeset for help on using the changeset viewer.