Ignore:
Timestamp:
Jul 18, 2008, 7:29:15 PM (11 years ago)
Author:
rme
Message:

Conditionalize for x8632.

File:
1 edited

Legend:

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

    r9901 r10094  
    152152handle_gc_trap(ExceptionInformation *xp, TCR *tcr)
    153153{
    154   LispObj
    155     selector = xpGPR(xp,Iimm0),
    156     arg = xpGPR(xp,Iimm1);
     154  LispObj selector = xpGPR(xp,Iimm0);
     155#ifdef X8664
     156  LispObj arg = xpGPR(xp,Iimm1);
     157#else
     158  LispObj arg = xpMMXreg(xp,Imm0);
     159#endif
    157160  area *a = active_dynamic_area;
    158161  Boolean egc_was_enabled = (a->older != NULL);
     
    167170
    168171  case GC_TRAP_FUNCTION_CONFIGURE_EGC:
     172#ifdef X8664
    169173    a->threshold = unbox_fixnum(xpGPR(xp, Iarg_x));
     174#else
     175    a->threshold = unbox_fixnum(xpGPR(xp, Itemp0));
     176#endif
    170177    g1_area->threshold = unbox_fixnum(xpGPR(xp, Iarg_y));
    171178    g2_area->threshold = unbox_fixnum(xpGPR(xp, Iarg_z));
     
    283290finish_function_entry(ExceptionInformation *xp)
    284291{
     292#ifdef X8664
    285293  natural nargs = (xpGPR(xp,Inargs)&0xffff)>> fixnumshift;
    286   signed_natural disp = nargs-3;
     294#else
     295  natural nargs = xpGPR(xp,Inargs)>>fixnumshift;
     296#endif
     297  signed_natural disp;
    287298  LispObj *vsp =  (LispObj *) xpGPR(xp,Isp), ra = *vsp++;
    288299   
    289300  xpGPR(xp,Isp) = (LispObj) vsp;
    290301
     302#ifdef X8664
     303  disp = nargs - 3;
     304#endif
     305#ifdef X8632
     306  disp = nargs - 2;
     307#endif
     308
     309#ifdef X8664
    291310  if (disp > 0) {               /* implies that nargs > 3 */
    292311    vsp[disp] = xpGPR(xp,Irbp);
     
    310329    }
    311330  }
     331#endif
     332#ifdef X8632
     333  if (disp > 0) {               /* implies that nargs > 2 */
     334    vsp[disp] = xpGPR(xp,Iebp);
     335    vsp[disp+1] = ra;
     336    xpGPR(xp,Iebp) = (LispObj)(vsp+disp);
     337    xpGPR(xp,Isp) = (LispObj)vsp;
     338    push_on_lisp_stack(xp,xpGPR(xp,Iarg_y));
     339    push_on_lisp_stack(xp,xpGPR(xp,Iarg_z));
     340  } else {
     341    push_on_lisp_stack(xp,ra);
     342    push_on_lisp_stack(xp,xpGPR(xp,Iebp));
     343    xpGPR(xp,Iebp) = xpGPR(xp,Isp);
     344    if (nargs == 2) {
     345      push_on_lisp_stack(xp,xpGPR(xp,Iarg_y));
     346    }
     347    if (nargs >= 1) {
     348      push_on_lisp_stack(xp,xpGPR(xp,Iarg_z));
     349    }
     350  }
     351#endif
    312352}
    313353
     
    335375  f = xpGPR(xp,Ifn);
    336376  tra = *(LispObj*)(xpGPR(xp,Isp));
     377
     378#ifdef X8664
    337379  if (tag_of(tra) == tag_tra) {
    338380    if ((*((unsigned short *)tra) == RECOVER_FN_FROM_RIP_WORD0) &&
     
    347389    tra = 0;
    348390  }
     391#endif
     392#ifdef X8632
     393  if (fulltag_of(tra) == fulltag_tra) {
     394    if (*(unsigned char *)tra == RECOVER_FN_OPCODE) {
     395      tra_f = (LispObj)*(LispObj *)(tra + 1);
     396    }
     397    if (tra_f && header_subtag(header_of(tra_f)) != subtag_function) {
     398      tra_f = 0;
     399    }
     400  } else {
     401    tra = 0;
     402  }
     403#endif
    349404
    350405  abs_pc = (LispObj)xpPC(xp);
    351406
     407#ifdef X8664
    352408  if (fulltag_of(f) == fulltag_function) {
     409#else
     410  if (fulltag_of(f) == fulltag_misc &&
     411      header_subtag(header_of(f)) == subtag_function) {
     412#endif
    353413    nominal_function = f;
    354414  } else {
     
    389449  push_on_lisp_stack(xp,nominal_function);
    390450  push_on_lisp_stack(xp,0);
     451#ifdef X8664
    391452  push_on_lisp_stack(xp,xpGPR(xp,Irbp));
    392453  xpGPR(xp,Irbp) = xpGPR(xp,Isp);
     454#else
     455  push_on_lisp_stack(xp,xpGPR(xp,Iebp));
     456  xpGPR(xp,Iebp) = xpGPR(xp,Isp);
     457#endif
    393458  return xpGPR(xp,Isp);
    394459}
     
    408473  allocptr_tag = fulltag_of(cur_allocptr);
    409474  if (allocptr_tag == fulltag_misc) {
     475#ifdef X8664
    410476    disp = xpGPR(xp,Iimm1);
     477#else
     478    disp = xpGPR(xp,Iimm0);
     479#endif
    411480  } else {
    412481    disp = dnode_size-fulltag_cons;
     
    442511  int delta;
    443512  unsigned old_mxcsr = get_mxcsr();
     513#ifdef X8632
     514  natural saved_node_regs_mask = tcr->node_regs_mask;
     515  LispObj *vsp = (LispObj *)xpGPR(xp, Isp);
     516#endif
    444517
    445518  set_mxcsr(0x1f80);
    446519
    447520  /* Put the active stack pointers where .SPcallback expects them */
     521#ifdef X8664
    448522  tcr->save_vsp = (LispObj *) xpGPR(xp, Isp);
    449523  tcr->save_rbp = (LispObj *) xpGPR(xp, Irbp);
    450 
     524#else
     525  tcr->node_regs_mask = X8632_DEFAULT_NODE_REGS_MASK;
     526
     527  *--vsp = tcr->save0;
     528  *--vsp = tcr->save1;
     529  *--vsp = tcr->save2;
     530  *--vsp = tcr->save3;
     531  *--vsp = tcr->next_method_context;
     532  xpGPR(xp, Isp) = (LispObj)vsp;
     533
     534  tcr->save_vsp = (LispObj *)xpGPR(xp, Isp);
     535  tcr->save_ebp = (LispObj *)xpGPR(xp, Iebp);
     536#endif
    451537
    452538  /* Call back.  The caller of this function may have modified stack/frame
     
    457543  delta = ((int (*)())callback_ptr) (xp, arg1, arg2, arg3, arg4, arg5);
    458544  LOCK(lisp_global(EXCEPTION_LOCK), tcr);
     545
     546#ifdef X8632
     547  tcr->next_method_context = *vsp++;
     548  tcr->save3 = *vsp++;
     549  tcr->save2 = *vsp++;
     550  tcr->save1 = *vsp++;
     551  tcr->save0 = *vsp++;
     552  xpGPR(xp, Isp) = (LispObj)vsp;
     553
     554  tcr->node_regs_mask = saved_node_regs_mask;
     555#endif
    459556  set_mxcsr(old_mxcsr);
    460557  return delta;
     
    464561callback_for_interrupt(TCR *tcr, ExceptionInformation *xp)
    465562{
    466   LispObj save_rbp = xpGPR(xp,Irbp),
    467     *save_vsp = (LispObj *)xpGPR(xp,Isp),
     563  LispObj *save_vsp = (LispObj *)xpGPR(xp,Isp),
    468564    word_beyond_vsp = save_vsp[-1],
    469565    xcf = create_exception_callback_frame(xp, tcr);
    470566  int save_errno = errno;
    471  
     567#ifdef X8664
     568  LispObj save_rbp = xpGPR(xp,Irbp);
     569#else
     570  LispObj save_ebp = xpGPR(xp,Iebp);
     571#endif
     572
    472573  callback_to_lisp(tcr, nrs_CMAIN.vcell,xp, xcf, 0, 0, 0, 0);
     574#ifdef X8664
    473575  xpGPR(xp,Irbp) = save_rbp;
     576#else
     577  xpGPR(xp,Iebp) = save_ebp;
     578#endif
    474579  xpGPR(xp,Isp) = (LispObj)save_vsp;
    475580  save_vsp[-1] = word_beyond_vsp;
     
    483588  unsigned char op0 = program_counter[0], op1 = program_counter[1];
    484589  LispObj rpc, errdisp = nrs_ERRDISP.vcell,
    485     save_rbp = xpGPR(xp,Irbp), save_vsp = xpGPR(xp,Isp), xcf0;
     590    save_vsp = xpGPR(xp,Isp), xcf0;
     591#ifdef X8664
     592  LispObj save_rbp = xpGPR(xp,Irbp);
     593#else
     594  LispObj save_ebp = xpGPR(xp,Iebp);
     595#endif
    486596  int skip;
    487597
     
    507617      skip = 0;
    508618    }
     619#ifdef X8664
    509620    xpGPR(xp,Irbp) = save_rbp;
     621#else
     622    xpGPR(xp,Iebp) = save_ebp;
     623#endif
    510624    xpGPR(xp,Isp) = save_vsp;
    511625    if ((op0 == 0xcd) && (op1 == 0xc7)) {
     
    521635      */
    522636      LispObj *vsp =(LispObj *)save_vsp, ra = *vsp;
     637#ifdef X8664
    523638      int nargs = (xpGPR(xp, Inargs) & 0xffff)>>fixnumshift;
    524      
     639#else
     640      int nargs = xpGPR(xp, Inargs)>>fixnumshift;
     641#endif
     642
     643#ifdef X8664
    525644      if (nargs > 3) {
    526645        xpGPR(xp,Isp)=(LispObj) (vsp + (1 + 2 + (nargs - 3)));
    527646        push_on_lisp_stack(xp,ra);
    528647      }
     648#else
     649      if (nargs > 2) {
     650        xpGPR(xp,Isp)=(LispObj) (vsp + (1 + 2 + (nargs - 2)));
     651        push_on_lisp_stack(xp,ra);
     652      }
     653#endif
    529654      xpPC(xp) = xpGPR(xp,Ifn);
    530655      xpGPR(xp,Inargs) = 1<<fixnumshift;
     
    582707  lisp_protection_kind which = prot_area->why;
    583708  Boolean on_TSP = (which == kTSPsoftguard);
    584   LispObj save_rbp = xpGPR(xp,Irbp),
    585     save_vsp = xpGPR(xp,Isp),
     709#ifdef X8664
     710  LispObj save_rbp = xpGPR(xp,Irbp);
     711#else
     712  LispObj save_ebp = xpGPR(xp,Iebp);
     713#endif
     714  LispObj save_vsp = xpGPR(xp,Isp),
    586715    xcf,
    587716    cmain = nrs_CMAIN.vcell;
     
    602731    xcf = create_exception_callback_frame(xp, tcr);
    603732    skip = callback_to_lisp(tcr, nrs_CMAIN.vcell, xp, xcf, SIGSEGV, on_TSP, 0, 0);
     733#ifdef X8664
    604734    xpGPR(xp,Irbp) = save_rbp;
     735#else
     736    xpGPR(xp,Iebp) = save_ebp;
     737#endif
    605738    xpGPR(xp,Isp) = save_vsp;
    606739    xpPC(xp) += skip;
     
    614747{
    615748#ifdef DARWIN
     749#ifdef X8664
    616750  return (UC_MCONTEXT(xp)->__es.__err & 0x2) != 0;
     751#else
     752  return (xp->uc_mcontext->__es.__err & 0x2) != 0;
     753#endif
    617754#endif
    618755#ifdef LINUX
     
    681818  int code = info->si_code, skip;
    682819  LispObj  xcf, cmain = nrs_CMAIN.vcell,
    683 
    684     save_rbp = xpGPR(xp,Irbp), save_vsp = xpGPR(xp,Isp);
     820    save_vsp = xpGPR(xp,Isp);
     821#ifdef X8664
     822  LispObj save_rbp = xpGPR(xp,Irbp);
     823#else
     824  LispObj save_ebp = xpGPR(xp,Iebp);
     825#endif
    685826
    686827  if ((fulltag_of(cmain) == fulltag_misc) &&
     
    689830    skip = callback_to_lisp(tcr, cmain, xp, xcf, SIGFPE, code, 0, 0);
    690831    xpPC(xp) += skip;
     832#ifdef X8664
    691833    xpGPR(xp,Irbp) = save_rbp;
     834#else
     835    xpGPR(xp,Iebp) = save_ebp;
     836#endif
    692837    xpGPR(xp,Isp) = save_vsp;
    693838    return true;
     
    9861131#endif
    9871132  xf->curr = context;
     1133#ifdef X8632
     1134  xf->node_regs_mask = tcr->node_regs_mask;
     1135#endif
    9881136  xf->prev = tcr->xframe;
    9891137  tcr->xframe =  xf;
     
    9961144{
    9971145  tcr->pending_exception_context = tcr->xframe->curr;
     1146#ifdef X8632
     1147  tcr->node_regs_mask = tcr->xframe->node_regs_mask;
     1148#endif
    9981149  tcr->xframe = tcr->xframe->prev;
    9991150  tcr->valence = TCR_STATE_EXCEPTION_RETURN;
     
    13221473        (tcr->unwinding != 0) ||
    13231474        ! stack_pointer_on_vstack_p(xpGPR(context,Isp), tcr) ||
     1475#ifdef X8664
    13241476        ! stack_pointer_on_vstack_p(xpGPR(context,Irbp), tcr)) {
     1477#else
     1478        ! stack_pointer_on_vstack_p(xpGPR(context,Iebp), tcr)) {
     1479#endif
    13251480      tcr->interrupt_pending = (1L << (nbits_in_word - 1L));
    13261481    } else {
     
    17701925*/
    17711926
     1927#ifdef X8664
    17721928opcode load_allocptr_reg_from_tcr_save_allocptr_instruction[] =
    17731929  {0x65,0x48,0x8b,0x1c,0x25,0xd8,0x00,0x00,0x00};
     
    17831939  {0x48,0x89,0x43,0xf3};
    17841940
    1785 
    17861941alloc_instruction_id
    17871942recognize_alloc_instruction(pc program_counter)
     
    18031958  return ID_unrecognized_alloc_instruction;
    18041959}
    1805      
     1960#endif
     1961#ifdef X8632
     1962opcode load_allocptr_reg_from_tcr_save_allocptr_instruction[] =
     1963  {0x64,0x8b,0x0d,0x84,0x00,0x00,0x00};
     1964opcode compare_allocptr_reg_to_tcr_save_allocbase_instruction[] =
     1965  {0x64,0x3b,0x0d,0x88,0x00,0x00,0x00};
     1966opcode branch_around_alloc_trap_instruction[] =
     1967  {0x7f,0x02};
     1968opcode alloc_trap_instruction[] =
     1969  {0xcd,0xc5};
     1970opcode clear_tcr_save_allocptr_tag_instruction[] =
     1971  {0x64,0x80,0x25,0x84,0x00,0x00,0x00,0xf8};
     1972opcode set_allocptr_header_instruction[] =
     1973  {0x0f,0x7e,0x41,0xfa};
     1974
     1975alloc_instruction_id
     1976recognize_alloc_instruction(pc program_counter)
     1977{
     1978  switch(program_counter[0]) {
     1979  case 0xcd: return ID_alloc_trap_instruction;
     1980  case 0x7f: return ID_branch_around_alloc_trap_instruction;
     1981  case 0x0f: return ID_set_allocptr_header_instruction;
     1982  case 0x64:
     1983    switch(program_counter[1]) {
     1984    case 0x80: return ID_clear_tcr_save_allocptr_tag_instruction;
     1985    case 0x3b: return ID_compare_allocptr_reg_to_tcr_save_allocbase_instruction;
     1986    case 0x8b: return ID_load_allocptr_reg_from_tcr_save_allocptr_instruction;
     1987    }
     1988  }
     1989  return ID_unrecognized_alloc_instruction;
     1990}
     1991#endif     
    18061992#ifdef WINDOWS 
    18071993void
     
    18182004  if (allocptr_tag != 0) {
    18192005    alloc_instruction_id state = recognize_alloc_instruction(program_counter);
     2006#ifdef X8664
    18202007    signed_natural
    18212008      disp = (allocptr_tag == fulltag_cons) ?
    18222009      sizeof(cons) - fulltag_cons :
    18232010      xpGPR(xp,Iimm1);
     2011#else
     2012      signed_natural disp = (allocptr_tag == fulltag_cons) ?
     2013      sizeof(cons) - fulltag_cons :
     2014      xpMMXreg(xp,Imm0);
     2015#endif
    18242016    LispObj new_vector;
    18252017
     
    18312023    switch(state) {
    18322024    case ID_set_allocptr_header_instruction:
    1833       /* We were consing a vector and we won.  Set the header of the new vector
    1834          (in the allocptr register) to the header in %rax and skip over this
    1835          instruction, then fall into the next case. */
     2025      /* We were consing a vector and we won.  Set the header of the
     2026         new vector (in the allocptr register) to the header in
     2027         %eax/%rax and skip over this instruction, then fall into the
     2028         next case. */
    18362029      new_vector = xpGPR(xp,Iallocptr);
    18372030      deref(new_vector,0) = xpGPR(xp,Iimm0);
     
    18632056      break;
    18642057    case ID_branch_around_alloc_trap_instruction:
    1865       /* If we'd take the branch - which is a 'jg" - around the alloc trap,
     2058      /* If we'd take the branch - which is a "jg" - around the alloc trap,
    18662059         we might as well finish the allocation.  Otherwise, back out of the
    18672060         attempt. */
     
    19282121      /* The conditional store succeeded.  Set the refbit, return to ra0 */
    19292122      val = xpGPR(xp,Iarg_z);
     2123#ifdef X8664
    19302124      ea = (LispObj*)(xpGPR(xp,Iarg_x) + (unbox_fixnum((signed_natural)
    19312125                                                       xpGPR(xp,Itemp0))));
     2126#else
     2127      ea = (LispObj *)(misc_data_offset + xpGPR(xp,Itemp1) + xpGPR(xp,Itemp0));
     2128#endif
    19322129      xpGPR(xp,Iarg_z) = t_value;
    19332130      need_store = false;
    19342131    } else if (program_counter >= &egc_set_hash_key) {
     2132#ifdef X8664
    19352133      root = xpGPR(xp,Iarg_x);
     2134#else
     2135      root = xpGPR(xp,Itemp0);
     2136#endif
    19362137      ea = (LispObj *) (root+xpGPR(xp,Iarg_y)+misc_data_offset);
    19372138      val = xpGPR(xp,Iarg_z);
    19382139      need_memoize_root = true;
    19392140    } else if (program_counter >= &egc_gvset) {
     2141#ifdef X8664
    19402142      ea = (LispObj *) (xpGPR(xp,Iarg_x)+xpGPR(xp,Iarg_y)+misc_data_offset);
     2143#else
     2144      ea = (LispObj *) (xpGPR(xp,Itemp0)+xpGPR(xp,Iarg_y)+misc_data_offset);
     2145#endif
    19412146      val = xpGPR(xp,Iarg_z);
    19422147    } else if (program_counter >= &egc_rplacd) {
     
    19652170         to pop the return address off the stack and set
    19662171         the PC there. */
    1967       LispObj *rsp = (LispObj *)xpGPR(xp,Isp), ra = *rsp++;
     2172      LispObj *sp = (LispObj *)xpGPR(xp,Isp), ra = *sp++;
    19682173      xpPC(xp) = ra;
    1969       xpGPR(xp,Isp)=(LispObj)rsp;
     2174      xpGPR(xp,Isp)=(LispObj)sp;
    19702175    }
    19712176    return;
     
    22422447  MCONTEXT_T mc = UC_MCONTEXT(pseudosigcontext);
    22432448#else
    2244   struct mcontext * mc = UC_MCONTEXT(pseudosigcontext);
     2449  mcontext_t mc = UC_MCONTEXT(pseudosigcontext);
    22452450#endif
    22462451
    22472452  /* Set the thread's FP state from the pseudosigcontext */
     2453#if WORD_SIZE == 64
    22482454  kret = thread_set_state(thread,
    22492455                          x86_FLOAT_STATE64,
    22502456                          (thread_state_t)&(mc->__fs),
    22512457                          x86_FLOAT_STATE64_COUNT);
    2252 
     2458#else
     2459  kret = thread_set_state(thread,
     2460                          x86_FLOAT_STATE32,
     2461                          (thread_state_t)&(mc->__fs),
     2462                          x86_FLOAT_STATE32_COUNT);
     2463#endif
    22532464  MACH_CHECK_ERROR("setting thread FP state", kret);
    22542465
     
    23092520                            x86_thread_state64_t *ts
    23102521#else
    2311                             x86_thread_state_t *ts
     2522                            x86_thread_state32_t *ts
    23122523#endif
    23132524                            )
     
    23182529  MCONTEXT_T mc;
    23192530#else
    2320   struct mcontext *mc;
     2531  mcontext_t mc;
    23212532#endif
    23222533  natural stackp;
    23232534
    2324  
     2535#ifdef X8664 
    23252536  stackp = (LispObj) find_foreign_rsp(ts->__rsp,tcr->cs_area,tcr);
    23262537  stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN);
     2538#else
     2539  stackp = (LispObj) find_foreign_rsp(ts->__esp, tcr->cs_area, tcr);
     2540#endif
    23272541  stackp = TRUNC_DOWN(stackp, sizeof(siginfo_t), C_STK_ALIGN);
    23282542  if (info_ptr) {
     
    23332547
    23342548  stackp = TRUNC_DOWN(stackp, sizeof(*mc), C_STK_ALIGN);
    2335 #ifdef X8664
    23362549  mc = (MCONTEXT_T) ptr_from_lispobj(stackp);
    2337 #else
    2338   mc = (struct mcontext *) ptr_from_lispobj(stackp);
    2339 #endif
    23402550 
    23412551  memmove(&(mc->__ss),ts,sizeof(*ts));
    23422552
     2553#ifdef X8664
    23432554  thread_state_count = x86_FLOAT_STATE64_COUNT;
    23442555  thread_get_state(thread,
     
    23472558                   &thread_state_count);
    23482559
    2349 
    2350 #ifdef X8664
    23512560  thread_state_count = x86_EXCEPTION_STATE64_COUNT;
    2352 #else
    2353   thread_state_count = x86_EXCEPTION_STATE_COUNT;
    2354 #endif
    23552561  thread_get_state(thread,
    2356 #ifdef X8664
    23572562                   x86_EXCEPTION_STATE64,
    2358 #else
    2359                    x86_EXCEPTION_STATE,
    2360 #endif
    23612563                   (thread_state_t)&(mc->__es),
    23622564                   &thread_state_count);
     2565#else
     2566  thread_state_count = x86_FLOAT_STATE32_COUNT;
     2567  thread_get_state(thread,
     2568                   x86_FLOAT_STATE32,
     2569                   (thread_state_t)&(mc->__fs),
     2570                   &thread_state_count);
     2571
     2572  thread_state_count = x86_EXCEPTION_STATE32_COUNT;
     2573  thread_get_state(thread,
     2574                   x86_EXCEPTION_STATE32,
     2575                   (thread_state_t)&(mc->__es),
     2576                   &thread_state_count);
     2577#endif
    23632578
    23642579
     
    23962611                   x86_thread_state64_t *ts
    23972612#else
    2398                    x86_thread_state_t *ts
     2613                   x86_thread_state32_t *ts
    23992614#endif
    24002615                   )
     
    24032618  x86_thread_state64_t new_ts;
    24042619#else
    2405   x86_thread_state_t new_ts;
     2620  x86_thread_state32_t new_ts;
    24062621#endif
    24072622  ExceptionInformation *pseudosigcontext;
     
    24352650  */
    24362651
     2652#ifdef X8664
    24372653  new_ts.__rip = (natural) handler_address;
    24382654  stackpp = (natural *)stackp;
     
    24462662  new_ts.__rsp = stackp;
    24472663  new_ts.__rflags = ts->__rflags;
    2448 
     2664#else
     2665#define USER_CS 0x17
     2666#define USER_DS 0x1f
     2667  bzero(&new_ts, sizeof(new_ts));
     2668  new_ts.__cs = ts->__cs;
     2669  new_ts.__ss = ts->__ss;
     2670  new_ts.__ds = ts->__ds;
     2671  new_ts.__es = ts->__es;
     2672  new_ts.__fs = ts->__fs;
     2673  new_ts.__gs = ts->__gs;
     2674
     2675  new_ts.__eip = (natural)handler_address;
     2676  stackpp = (natural *)stackp;
     2677  *--stackpp = 0;               /* alignment */
     2678  *--stackpp = 0;
     2679  *--stackpp = 0;
     2680  *--stackpp = (natural)old_valence;
     2681  *--stackpp = (natural)tcr;
     2682  *--stackpp = (natural)pseudosigcontext;
     2683  *--stackpp = (natural)info;
     2684  *--stackpp = (natural)signum;
     2685  *--stackpp = (natural)pseudo_sigreturn;
     2686  stackp = (natural)stackpp;
     2687  new_ts.__esp = stackp;
     2688  new_ts.__eflags = ts->__eflags;
     2689#endif
    24492690
    24502691#ifdef X8664
     
    24552696#else
    24562697  thread_set_state(thread,
    2457                    x86_THREAD_STATE,
     2698                   x86_THREAD_STATE32,
    24582699                   (thread_state_t)&new_ts,
    2459                    x86_THREAD_STATE_COUNT);
     2700                   x86_THREAD_STATE32_COUNT);
    24602701#endif
    24612702#ifdef DEBUG_MACH_EXCEPTIONS
     
    24982739#define ts_pc(t) t.__rip
    24992740#else
    2500 #define ts_pc(t) t.eip
     2741#define ts_pc(t) t.__eip
    25012742#endif
    25022743
     
    25222763  x86_thread_state64_t ts;
    25232764#else
    2524   x86_thread_state_t ts;
     2765  x86_thread_state32_t ts;
    25252766#endif
    25262767  mach_msg_type_number_t thread_state_count;
     
    25502791  MACH_CHECK_ERROR("getting thread state",call_kret);
    25512792#else
    2552     thread_state_count = x86_THREAD_STATE_COUNT;
    2553     thread_get_state(thread,
    2554                      x86_THREAD_STATE,
    2555                      (thread_state_t)&ts,
    2556                      &thread_state_count);
     2793    thread_state_count = x86_THREAD_STATE32_COUNT;
     2794    call_kret = thread_get_state(thread,
     2795                                 x86_THREAD_STATE32,
     2796                                 (thread_state_t)&ts,
     2797                                 &thread_state_count);
     2798    MACH_CHECK_ERROR("getting thread state",call_kret);
    25572799#endif
    25582800    if (tcr->flags & (1<<TCR_FLAG_BIT_PENDING_EXCEPTION)) {
     
    29083150                     &thread_state_count);
    29093151#else
    2910     x86_thread_state_t ts;
     3152    x86_thread_state32_t ts;
    29113153    thread_state_count = x86_THREAD_STATE_COUNT;
    29123154    thread_get_state(mach_thread,
Note: See TracChangeset for help on using the changeset viewer.