Changeset 8210
- Timestamp:
- Jan 17, 2008, 9:56:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ia32/lisp-kernel/x86-exceptions.c
r8070 r8210 2198 2198 2199 2199 /* Set the thread's FP state from the pseudosigcontext */ 2200 #if WORD_SIZE == 64 2200 2201 kret = thread_set_state(thread, 2201 2202 x86_FLOAT_STATE64, 2202 2203 (thread_state_t)&(mc->__fs), 2203 2204 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 2205 2211 MACH_CHECK_ERROR("setting thread FP state", kret); 2206 2212 … … 2278 2284 #ifdef X8664 2279 2285 stackp = (LispObj) find_foreign_rsp(ts->__rsp,tcr->cs_area,tcr); 2286 stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN); 2280 2287 #else 2281 2288 stackp = (LispObj) ts->__esp; 2282 2289 #endif 2283 2284 stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN);2285 2290 stackp = TRUNC_DOWN(stackp, sizeof(siginfo_t), C_STK_ALIGN); 2286 2291 if (info_ptr) { … … 2291 2296 2292 2297 stackp = TRUNC_DOWN(stackp, sizeof(*mc), C_STK_ALIGN); 2293 #ifdef X86642294 2298 mc = (MCONTEXT_T) ptr_from_lispobj(stackp); 2295 #else2296 mc = (mcontext_t) ptr_from_lispobj(stackp);2297 #endif2298 2299 2299 2300 bcopy(ts,&(mc->__ss),sizeof(*ts)); 2300 2301 2302 #ifdef X8664 2301 2303 thread_state_count = x86_FLOAT_STATE64_COUNT; 2302 2304 thread_get_state(thread, … … 2305 2307 &thread_state_count); 2306 2308 2307 2308 #ifdef X86642309 2309 thread_state_count = x86_EXCEPTION_STATE64_COUNT; 2310 #else2311 thread_state_count = x86_EXCEPTION_STATE_COUNT;2312 #endif2313 2310 thread_get_state(thread, 2314 #ifdef X86642315 2311 x86_EXCEPTION_STATE64, 2316 #else2317 x86_EXCEPTION_STATE,2318 #endif2319 2312 (thread_state_t)&(mc->__es), 2320 2313 &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 2321 2327 2322 2328 … … 2407 2413 new_ts.__rflags = ts->__rflags; 2408 2414 #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 2409 2426 new_ts.__eip = (natural)handler_address; 2410 2427 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; 2411 2435 *--stackpp = (natural)pseudo_sigreturn; 2412 2436 stackp = (natural)stackpp; 2413 /* xxx and other stuff */2414 2437 new_ts.__esp = stackp; 2415 2438 new_ts.__eflags = ts->__eflags; … … 2423 2446 #else 2424 2447 thread_set_state(thread, 2425 x86_THREAD_STATE ,2448 x86_THREAD_STATE32, 2426 2449 (thread_state_t)&new_ts, 2427 x86_THREAD_STATE _COUNT);2450 x86_THREAD_STATE32_COUNT); 2428 2451 #endif 2429 2452 #ifdef DEBUG_MACH_EXCEPTIONS
Note: See TracChangeset
for help on using the changeset viewer.