Changeset 8210


Ignore:
Timestamp:
Jan 17, 2008, 9:56:35 PM (12 years ago)
Author:
rme
Message:

More IA-32 changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/lisp-kernel/x86-exceptions.c

    r8070 r8210  
    21982198
    21992199  /* Set the thread's FP state from the pseudosigcontext */
     2200#if WORD_SIZE == 64
    22002201  kret = thread_set_state(thread,
    22012202                          x86_FLOAT_STATE64,
    22022203                          (thread_state_t)&(mc->__fs),
    22032204                          x86_FLOAT_STATE64_COUNT);
    2204 
     2205#else
     2206  kret = thread_set_state(thread,
     2207                          x86_FLOAT_STATE32,
     2208                          (thread_state_t)&(mc->__fs),
     2209                          x86_FLOAT_STATE32_COUNT);
     2210#endif
    22052211  MACH_CHECK_ERROR("setting thread FP state", kret);
    22062212
     
    22782284#ifdef X8664 
    22792285  stackp = (LispObj) find_foreign_rsp(ts->__rsp,tcr->cs_area,tcr);
     2286  stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN);
    22802287#else
    22812288  stackp = (LispObj) ts->__esp;
    22822289#endif
    2283 
    2284   stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN);
    22852290  stackp = TRUNC_DOWN(stackp, sizeof(siginfo_t), C_STK_ALIGN);
    22862291  if (info_ptr) {
     
    22912296
    22922297  stackp = TRUNC_DOWN(stackp, sizeof(*mc), C_STK_ALIGN);
    2293 #ifdef X8664
    22942298  mc = (MCONTEXT_T) ptr_from_lispobj(stackp);
    2295 #else
    2296   mc = (mcontext_t) ptr_from_lispobj(stackp);
    2297 #endif
    22982299 
    22992300  bcopy(ts,&(mc->__ss),sizeof(*ts));
    23002301
     2302#ifdef X8664
    23012303  thread_state_count = x86_FLOAT_STATE64_COUNT;
    23022304  thread_get_state(thread,
     
    23052307                   &thread_state_count);
    23062308
    2307 
    2308 #ifdef X8664
    23092309  thread_state_count = x86_EXCEPTION_STATE64_COUNT;
    2310 #else
    2311   thread_state_count = x86_EXCEPTION_STATE_COUNT;
    2312 #endif
    23132310  thread_get_state(thread,
    2314 #ifdef X8664
    23152311                   x86_EXCEPTION_STATE64,
    2316 #else
    2317                    x86_EXCEPTION_STATE,
    2318 #endif
    23192312                   (thread_state_t)&(mc->__es),
    23202313                   &thread_state_count);
     2314#else
     2315  thread_state_count = x86_FLOAT_STATE32_COUNT;
     2316  thread_get_state(thread,
     2317                   x86_FLOAT_STATE32,
     2318                   (thread_state_t)&(mc->__fs),
     2319                   &thread_state_count);
     2320
     2321  thread_state_count = x86_EXCEPTION_STATE32_COUNT;
     2322  thread_get_state(thread,
     2323                   x86_EXCEPTION_STATE32,
     2324                   (thread_state_t)&(mc->__es),
     2325                   &thread_state_count);
     2326#endif
    23212327
    23222328
     
    24072413  new_ts.__rflags = ts->__rflags;
    24082414#else
     2415#define USER_CS 0x17
     2416#define USER_DS 0x1f
     2417  bzero(&new_ts, sizeof(new_ts));
     2418#if 0
     2419  new_ts.__cs = ts->__cs;
     2420  new_ts.__ss = ts->__ss;
     2421  new_ts.__ds = ts->__ds;
     2422  new_ts.__es = ts->__es;
     2423  new_ts.__fs = ts->__fs;
     2424  new_ts.__gs = ts->__gs;
     2425#endif
    24092426  new_ts.__eip = (natural)handler_address;
    24102427  stackpp = (natural *)stackp;
     2428  *--stackpp = 0;               /* alignment */
     2429  *--stackpp = 0;
     2430  *--stackpp = (natural)old_valence;
     2431  *--stackpp = (natural)tcr;
     2432  *--stackpp = (natural)pseudosigcontext;
     2433  *--stackpp = (natural)info;
     2434  *--stackpp = (natural)signum;
    24112435  *--stackpp = (natural)pseudo_sigreturn;
    24122436  stackp = (natural)stackpp;
    2413   /* xxx and other stuff */
    24142437  new_ts.__esp = stackp;
    24152438  new_ts.__eflags = ts->__eflags;
     
    24232446#else
    24242447  thread_set_state(thread,
    2425                    x86_THREAD_STATE,
     2448                   x86_THREAD_STATE32,
    24262449                   (thread_state_t)&new_ts,
    2427                    x86_THREAD_STATE_COUNT);
     2450                   x86_THREAD_STATE32_COUNT);
    24282451#endif
    24292452#ifdef DEBUG_MACH_EXCEPTIONS
Note: See TracChangeset for help on using the changeset viewer.