Changeset 10401
- Timestamp:
- Aug 8, 2008, 11:42:01 AM (11 years ago)
- Location:
- release/1.2/source/lisp-kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
release/1.2/source/lisp-kernel/lisp-exceptions.h
r8547 r10401 140 140 exception_fn_name( ExceptionInformation *, int, char *, size_t ); 141 141 142 /* Need to define this here */143 #ifdef DARWIN144 #define USE_MACH_EXCEPTION_LOCK 0145 #endif146 142 147 143 -
release/1.2/source/lisp-kernel/ppc-exceptions.c
r9067 r10401 2279 2279 2280 2280 2281 #if USE_MACH_EXCEPTION_LOCK2282 pthread_mutex_t _mach_exception_lock, *mach_exception_lock;2283 #endif2284 2281 2285 2282 #define LISP_EXCEPTIONS_HANDLED_MASK \ … … 2705 2702 kern_return_t kret; 2706 2703 2707 #ifdef DEBUG_MACH_EXCEPTIONS 2708 fprintf(stderr, "obtaining Mach exception lock in exception thread\n"); 2709 #endif 2710 2711 if ( 2712 #if USE_MACH_EXCEPTION_LOCK 2713 pthread_mutex_trylock(mach_exception_lock) == 0 2714 #else 2715 1 2716 #endif 2717 ) { 2718 if (tcr->flags & (1<<TCR_FLAG_BIT_PENDING_EXCEPTION)) { 2719 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION); 2720 } 2721 if ((exception == EXC_BAD_INSTRUCTION) && 2722 (code_vector[0] == EXC_PPC_UNIPL_INST) && 2723 (((code1 = code_vector[1]) == (int)pseudo_sigreturn) || 2724 (code1 == (int)enable_fp_exceptions) || 2725 (code1 == (int)disable_fp_exceptions))) { 2726 if (code1 == (int)pseudo_sigreturn) { 2727 kret = do_pseudo_sigreturn(thread, tcr); 2704 2705 if (tcr->flags & (1<<TCR_FLAG_BIT_PENDING_EXCEPTION)) { 2706 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION); 2707 } 2708 if ((exception == EXC_BAD_INSTRUCTION) && 2709 (code_vector[0] == EXC_PPC_UNIPL_INST) && 2710 (((code1 = code_vector[1]) == (int)pseudo_sigreturn) || 2711 (code1 == (int)enable_fp_exceptions) || 2712 (code1 == (int)disable_fp_exceptions))) { 2713 if (code1 == (int)pseudo_sigreturn) { 2714 kret = do_pseudo_sigreturn(thread, tcr); 2728 2715 #if 0 2729 2716 fprintf(stderr, "Exception return in 0x%x\n",tcr); 2730 2717 #endif 2731 2718 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2719 } else if (code1 == (int)enable_fp_exceptions) { 2720 kret = thread_set_fp_exceptions_enabled(thread, true); 2721 } else kret = thread_set_fp_exceptions_enabled(thread, false); 2722 } else if (tcr->flags & (1<<TCR_FLAG_BIT_PROPAGATE_EXCEPTION)) { 2723 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION); 2724 kret = 17; 2725 } else { 2726 switch (exception) { 2727 case EXC_BAD_ACCESS: 2728 signum = SIGSEGV; 2729 break; 2743 2730 2744 2745 2746 2731 case EXC_BAD_INSTRUCTION: 2732 signum = SIGILL; 2733 break; 2747 2734 2748 2749 2750 2751 2752 2735 case EXC_SOFTWARE: 2736 if (code == EXC_PPC_TRAP) { 2737 signum = SIGTRAP; 2738 } 2739 break; 2753 2740 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2741 case EXC_ARITHMETIC: 2742 signum = SIGFPE; 2743 break; 2744 2745 default: 2746 break; 2747 } 2748 if (signum) { 2749 kret = setup_signal_frame(thread, 2750 (void *)pseudo_signal_handler, 2751 signum, 2752 code, 2753 tcr); 2767 2754 #if 0 2768 2755 fprintf(stderr, "Setup pseudosignal handling in 0x%x\n",tcr); 2769 2756 #endif 2770 2757 2771 } else { 2772 kret = 17; 2773 } 2774 } 2775 #if USE_MACH_EXCEPTION_LOCK 2776 #ifdef DEBUG_MACH_EXCEPTIONS 2777 fprintf(stderr, "releasing Mach exception lock in exception thread\n"); 2778 #endif 2779 pthread_mutex_unlock(mach_exception_lock); 2780 #endif 2781 } else { 2782 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION); 2783 #if 0 2784 fprintf(stderr, "deferring pending exception in 0x%x\n", tcr); 2785 #endif 2786 kret = 0; 2787 if (tcr == gc_tcr) { 2788 int i; 2789 write(1, "exception in GC thread. Sleeping for 60 seconds\n",sizeof("exception in GC thread. Sleeping for 60 seconds\n")); 2790 for (i = 0; i < 60; i++) { 2791 sleep(1); 2792 } 2793 _exit(EX_SOFTWARE); 2758 } else { 2759 kret = 17; 2794 2760 } 2795 2761 } … … 2870 2836 kern_return_t kret; 2871 2837 if (__exception_port_set == MACH_PORT_NULL) { 2872 #if USE_MACH_EXCEPTION_LOCK2873 mach_exception_lock = &_mach_exception_lock;2874 pthread_mutex_init(mach_exception_lock, NULL);2875 #endif2876 2838 kret = mach_port_allocate(mach_task_self(), 2877 2839 MACH_PORT_RIGHT_PORT_SET, … … 3148 3110 3149 3111 LOCK(lisp_global(TCR_AREA_LOCK), current); 3150 #if USE_MACH_EXCEPTION_LOCK3151 pthread_mutex_lock(mach_exception_lock);3152 #endif3153 3154 3112 if (suspend_mach_thread(mach_thread)) { 3155 3113 if (thread_info(mach_thread, … … 3178 3136 3179 3137 } 3180 #if USE_MACH_EXCEPTION_LOCK3181 pthread_mutex_unlock(mach_exception_lock);3182 #endif3183 3138 UNLOCK(lisp_global(TCR_AREA_LOCK), current); 3184 3139 return 0; -
release/1.2/source/lisp-kernel/ppc-exceptions.h
r9067 r10401 388 388 #include <mach/machine/thread_status.h> 389 389 390 #if USE_MACH_EXCEPTION_LOCK391 pthread_mutex_t *mach_exception_lock;392 #endif393 390 #endif 394 391 -
release/1.2/source/lisp-kernel/thread_manager.c
r10178 r10401 18 18 #include "Threads.h" 19 19 20 /*21 If we suspend via signals - and if the "suspend" signal is maked22 in the handler for that signal - then it's not possible to suspend23 a thread that's still waiting to be resumed (which is what24 WAIT_FOR_RESUME_ACK is all about.)25 */26 #define WAIT_FOR_RESUME_ACK 027 #define RESUME_VIA_RESUME_SEMAPHORE 128 #define SUSPEND_RESUME_VERBOSE 029 20 30 21 typedef struct { … … 156 147 157 148 static void inline 158 lock_futex( natural *p)149 lock_futex(signed_natural *p) 159 150 { 160 151 … … 173 164 174 165 static void inline 175 unlock_futex( natural *p)166 unlock_futex(signed_natural *p) 176 167 { 177 168 if (atomic_decf(p) != FUTEX_AVAIL) { … … 427 418 } 428 419 429 420 void 430 421 suspend_resume_handler(int signo, siginfo_t *info, ExceptionInformation *context) 431 422 { … … 438 429 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_SUSPEND); 439 430 } else { 440 if (signo == thread_suspend_signal) { 441 #if 0 442 sigset_t wait_for; 443 #endif 444 445 tcr->suspend_context = context; 446 #if 0 447 sigfillset(&wait_for); 448 #endif 449 SEM_RAISE(tcr->suspend); 450 #if 0 451 sigdelset(&wait_for, thread_resume_signal); 452 #endif 453 #if 1 454 #if RESUME_VIA_RESUME_SEMAPHORE 455 SEM_WAIT_FOREVER(tcr->resume); 456 #if SUSPEND_RESUME_VERBOSE 457 fprintf(stderr, "got resume in 0x%x\n",tcr); 458 #endif 459 tcr->suspend_context = NULL; 460 #else 461 sigsuspend(&wait_for); 462 #endif 463 #else 464 do { 465 sigsuspend(&wait_for); 466 } while (tcr->suspend_context); 467 #endif 468 } else { 469 tcr->suspend_context = NULL; 470 #if SUSEPEND_RESUME_VERBOSE 471 fprintf(stderr,"got resume in in 0x%x\n",tcr); 472 #endif 473 } 474 #if WAIT_FOR_RESUME_ACK 431 tcr->suspend_context = context; 475 432 SEM_RAISE(tcr->suspend); 476 #endif 433 SEM_WAIT_FOREVER(tcr->resume); 434 tcr->suspend_context = NULL; 477 435 } 478 436 #ifdef DARWIN_GS_HACK … … 530 488 *size = temp_size; 531 489 #endif 532 490 #ifdef SOLARIS 491 stack_t st; 492 493 thr_stksegment(&st); 494 *size = st.ss_size; 495 *base = st.ss_sp; 496 497 #endif 533 498 } 534 499 #endif … … 718 683 /* darwin_set_x8664_fs_reg(tcr); */ 719 684 #endif 720 } 721 722 #endif 723 724 685 #ifdef SOLARIS 686 /* Chris Curtis found this and suggested the use of syscall here */ 687 syscall(SYS_lwp_private,_LWP_SETPRIVATE, _LWP_GSBASE, tcr); 688 #endif 689 } 690 691 #endif 692 693 #ifdef X8632 694 #ifdef DARWIN 695 #include <architecture/i386/table.h> 696 #include <architecture/i386/sel.h> 697 #include <i386/user_ldt.h> 698 699 void setup_tcr_extra_segment(TCR *tcr) 700 { 701 uintptr_t addr = (uintptr_t)tcr; 702 unsigned int size = sizeof(*tcr); 703 ldt_entry_t desc; 704 sel_t sel; 705 int i; 706 707 desc.data.limit00 = (size - 1) & 0xffff; 708 desc.data.limit16 = ((size - 1) >> 16) & 0xf; 709 desc.data.base00 = addr & 0xffff; 710 desc.data.base16 = (addr >> 16) & 0xff; 711 desc.data.base24 = (addr >> 24) & 0xff; 712 desc.data.type = DESC_DATA_WRITE; 713 desc.data.dpl = USER_PRIV; 714 desc.data.present = 1; 715 desc.data.stksz = DESC_CODE_32B; 716 desc.data.granular = DESC_GRAN_BYTE; 717 718 i = i386_set_ldt(LDT_AUTO_ALLOC, &desc, 1); 719 720 if (i < 0) { 721 perror("i386_set_ldt"); 722 } else { 723 sel.index = i; 724 sel.rpl = USER_PRIV; 725 sel.ti = SEL_LDT; 726 tcr->ldt_selector = sel; 727 } 728 } 729 730 void free_tcr_extra_segment(TCR *tcr) 731 { 732 /* load %fs with null segement selector */ 733 __asm__ volatile ("mov %0,%%fs" : : "r"(0)); 734 if (i386_set_ldt(tcr->ldt_selector.index, NULL, 1) < 0) 735 perror("i386_set_ldt"); 736 tcr->ldt_selector = NULL_SEL; 737 } 738 #endif 739 #endif 725 740 726 741 /* … … 747 762 #ifdef HAVE_TLS 748 763 TCR *tcr = ¤t_tcr; 749 #else 764 #else /* no TLS */ 750 765 TCR *tcr = allocate_tcr(); 751 #endif 752 753 #ifdef X8664 766 #ifdef X8632 767 setup_tcr_extra_segment(tcr); 768 #endif 769 #endif 770 771 #ifdef X86 754 772 setup_tcr_extra_segment(tcr); 755 773 tcr->linear = tcr; 774 #ifdef X8632 775 tcr->node_regs_mask = X8632_DEFAULT_NODE_REGS_MASK; 776 #endif 756 777 #endif 757 778 … … 853 874 dequeue_tcr(tcr); 854 875 #endif 876 #ifdef DARWIN 877 #ifdef X8632 878 free_tcr_extra_segment(tcr); 879 #endif 880 #endif 855 881 UNLOCK(lisp_global(TCR_AREA_LOCK),tcr); 856 882 if (termination_semaphore) { … … 1254 1280 #define NSAVEREGS 4 1255 1281 #endif 1282 #ifdef X8632 1283 #define NSAVEREGS 0 1284 #endif 1256 1285 for (i = 0; i < NSAVEREGS; i++) { 1257 1286 *(--current->save_vsp) = 0; … … 1283 1312 pthread_t thread; 1284 1313 if (suspend_count == 1) { 1285 #if SUSPEND_RESUME_VERBOSE1286 fprintf(stderr,"Suspending 0x%x\n", tcr);1287 #endif1288 #ifdef DARWIN_nope1289 if (mach_suspend_tcr(tcr)) {1290 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_ALT_SUSPEND);1291 return true;1292 }1293 #endif1294 1314 thread = (pthread_t)(tcr->osid); 1295 1315 if ((thread != (pthread_t) 0) && … … 1318 1338 SEM_WAIT_FOREVER(tcr->suspend); 1319 1339 tcr->flags &= ~(1<<TCR_FLAG_BIT_SUSPEND_ACK_PENDING); 1320 #if SUSPEND_RESUME_VERBOSE1321 fprintf(stderr,"Suspend ack from 0x%x\n", tcr);1322 #endif1323 1324 1340 } 1325 1341 return true; … … 1336 1352 1337 1353 LOCK(lisp_global(TCR_AREA_LOCK),current); 1338 #ifdef DARWIN1339 #if USE_MACH_EXCEPTION_LOCK1340 if (use_mach_exception_handling) {1341 pthread_mutex_lock(mach_exception_lock);1342 }1343 #endif1344 #endif1345 1354 suspended = suspend_tcr(tcr); 1346 1355 if (suspended) { 1347 1356 while (!tcr_suspend_ack(tcr)); 1348 1357 } 1349 #ifdef DARWIN1350 #if USE_MACH_EXCEPTION_LOCK1351 if (use_mach_exception_handling) {1352 pthread_mutex_unlock(mach_exception_lock);1353 }1354 #endif1355 #endif1356 1358 UNLOCK(lisp_global(TCR_AREA_LOCK),current); 1357 1359 return suspended; … … 1364 1366 int suspend_count = atomic_decf(&(tcr->suspend_count)); 1365 1367 if (suspend_count == 0) { 1366 #ifdef DARWIN 1367 if (tcr->flags & (1<<TCR_FLAG_BIT_ALT_SUSPEND)) { 1368 #if SUSPEND_RESUME_VERBOSE 1369 fprintf(stderr,"Mach resume to 0x%x\n", tcr); 1370 #endif 1371 mach_resume_tcr(tcr); 1368 void *s = (tcr->resume); 1369 if (s != NULL) { 1370 SEM_RAISE(s); 1372 1371 return true; 1373 1372 } 1374 #endif1375 #if RESUME_VIA_RESUME_SEMAPHORE1376 SEM_RAISE(tcr->resume);1377 #else1378 if ((err = (pthread_kill((pthread_t)(tcr->osid), thread_resume_signal))) != 0) {1379 Bug(NULL, "pthread_kill returned %d on thread #x%x", err, tcr->osid);1380 }1381 #endif1382 #if SUSPEND_RESUME_VERBOSE1383 fprintf(stderr, "Sent resume to 0x%x\n", tcr);1384 #endif1385 return true;1386 1373 } 1387 1374 return false; 1388 1375 } 1389 1376 1390 void1391 wait_for_resumption(TCR *tcr)1392 {1393 if (tcr->suspend_count == 0) {1394 #ifdef DARWIN1395 if (tcr->flags & (1<<TCR_FLAG_BIT_ALT_SUSPEND)) {1396 tcr->flags &= ~(1<<TCR_FLAG_BIT_ALT_SUSPEND);1397 return;1398 }1399 #endif1400 #if WAIT_FOR_RESUME_ACK1401 #if SUSPEND_RESUME_VERBOSE1402 fprintf(stderr, "waiting for resume in 0x%x\n",tcr);1403 #endif1404 SEM_WAIT_FOREVER(tcr->suspend);1405 #endif1406 }1407 }1408 1377 1409 1378 … … 1417 1386 LOCK(lisp_global(TCR_AREA_LOCK),current); 1418 1387 resumed = resume_tcr(tcr); 1419 wait_for_resumption(tcr);1420 1388 UNLOCK(lisp_global(TCR_AREA_LOCK), current); 1421 1389 return resumed; … … 1483 1451 1484 1452 LOCK(lisp_global(TCR_AREA_LOCK), current); 1485 #ifdef DARWIN1486 #if USE_MACH_EXCEPTION_LOCK1487 if (for_gc && use_mach_exception_handling) {1488 #if SUSPEND_RESUME_VERBOSE1489 fprintf(stderr, "obtaining Mach exception lock in GC thread 0x%x\n", current);1490 #endif1491 pthread_mutex_lock(mach_exception_lock);1492 }1493 #endif1494 #endif1495 1453 for (other = current->next; other != current; other = other->next) { 1496 1454 if ((other->osid != 0)) { … … 1533 1491 lisp_suspend_other_threads() 1534 1492 { 1535 TCR *current = get_tcr(true);1536 LOCK(lisp_global(TCR_AREA_LOCK),current);1537 1493 suspend_other_threads(false); 1538 1494 } … … 1547 1503 } 1548 1504 } 1549 for (other = current->next; other != current; other = other->next) {1550 if ((other->osid != 0)) {1551 wait_for_resumption(other);1552 }1553 }1554 1505 free_freed_tcrs(); 1555 #ifdef DARWIN1556 #if USE_MACH_EXCEPTION_LOCK1557 if (for_gc && use_mach_exception_handling) {1558 #if SUSPEND_RESUME_VERBOSE1559 fprintf(stderr, "releasing Mach exception lock in GC thread 0x%x\n", current);1560 #endif1561 pthread_mutex_unlock(mach_exception_lock);1562 }1563 #endif1564 #endif1565 1566 1506 UNLOCK(lisp_global(TCR_AREA_LOCK), current); 1567 1507 } … … 1570 1510 lisp_resume_other_threads() 1571 1511 { 1572 TCR *current = get_tcr(true);1573 1512 resume_other_threads(false); 1574 UNLOCK(lisp_global(TCR_AREA_LOCK),current);1575 1513 } 1576 1514 -
release/1.2/source/lisp-kernel/x86-exceptions.c
r9055 r10401 2137 2137 #define TCR_TO_EXCEPTION_PORT(tcr) ((mach_port_t)((natural)(tcr))) 2138 2138 2139 #if USE_MACH_EXCEPTION_LOCK2140 pthread_mutex_t _mach_exception_lock, *mach_exception_lock;2141 #endif2142 2139 extern void pseudo_sigreturn(void); 2143 2140 … … 2541 2538 2542 2539 2543 if (2544 #if USE_MACH_EXCEPTION_LOCK2545 pthread_mutex_trylock(mach_exception_lock) == 02546 #else2547 12548 #endif2549 ) {2550 2540 #ifdef X8664 2551 2552 2553 2554 2555 2556 2557 2541 do { 2542 thread_state_count = x86_THREAD_STATE64_COUNT; 2543 call_kret = thread_get_state(thread, 2544 x86_THREAD_STATE64, 2545 (thread_state_t)&ts, 2546 &thread_state_count); 2547 } while (call_kret == KERN_ABORTED); 2558 2548 MACH_CHECK_ERROR("getting thread state",call_kret); 2559 2549 #else 2560 thread_state_count = x86_THREAD_STATE_COUNT; 2561 thread_get_state(thread, 2562 x86_THREAD_STATE, 2563 (thread_state_t)&ts, 2564 &thread_state_count); 2565 #endif 2566 if (tcr->flags & (1<<TCR_FLAG_BIT_PENDING_EXCEPTION)) { 2567 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION); 2568 } 2569 if ((code == EXC_I386_GPFLT) && 2570 ((natural)(ts_pc(ts)) == (natural)pseudo_sigreturn)) { 2571 kret = do_pseudo_sigreturn(thread, tcr); 2572 #if 0 2573 fprintf(stderr, "Exception return in 0x%x\n",tcr); 2574 #endif 2575 } else if (tcr->flags & (1<<TCR_FLAG_BIT_PROPAGATE_EXCEPTION)) { 2576 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION); 2550 thread_state_count = x86_THREAD_STATE_COUNT; 2551 thread_get_state(thread, 2552 x86_THREAD_STATE, 2553 (thread_state_t)&ts, 2554 &thread_state_count); 2555 #endif 2556 if (tcr->flags & (1<<TCR_FLAG_BIT_PENDING_EXCEPTION)) { 2557 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION); 2558 } 2559 if ((code == EXC_I386_GPFLT) && 2560 ((natural)(ts_pc(ts)) == (natural)pseudo_sigreturn)) { 2561 kret = do_pseudo_sigreturn(thread, tcr); 2562 } else if (tcr->flags & (1<<TCR_FLAG_BIT_PROPAGATE_EXCEPTION)) { 2563 CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION); 2564 kret = 17; 2565 } else { 2566 switch (exception) { 2567 case EXC_BAD_ACCESS: 2568 if (code == EXC_I386_GPFLT) { 2569 signum = SIGSEGV; 2570 } else { 2571 signum = SIGBUS; 2572 } 2573 break; 2574 2575 case EXC_BAD_INSTRUCTION: 2576 if (code == EXC_I386_GPFLT) { 2577 signum = SIGSEGV; 2578 } else { 2579 signum = SIGILL; 2580 } 2581 break; 2582 2583 case EXC_SOFTWARE: 2584 signum = SIGILL; 2585 break; 2586 2587 case EXC_ARITHMETIC: 2588 signum = SIGFPE; 2589 break; 2590 2591 default: 2592 break; 2593 } 2594 if (signum) { 2595 kret = setup_signal_frame(thread, 2596 (void *)DARWIN_EXCEPTION_HANDLER, 2597 signum, 2598 code, 2599 tcr, 2600 &ts); 2601 2602 } else { 2577 2603 kret = 17; 2578 } else { 2579 switch (exception) { 2580 case EXC_BAD_ACCESS: 2581 if (code == EXC_I386_GPFLT) { 2582 signum = SIGSEGV; 2583 } else { 2584 signum = SIGBUS; 2585 } 2586 break; 2587 2588 case EXC_BAD_INSTRUCTION: 2589 if (code == EXC_I386_GPFLT) { 2590 signum = SIGSEGV; 2591 } else { 2592 signum = SIGILL; 2593 } 2594 break; 2595 2596 case EXC_SOFTWARE: 2597 signum = SIGILL; 2598 break; 2599 2600 case EXC_ARITHMETIC: 2601 signum = SIGFPE; 2602 break; 2603 2604 default: 2605 break; 2606 } 2607 if (signum) { 2608 kret = setup_signal_frame(thread, 2609 (void *)DARWIN_EXCEPTION_HANDLER, 2610 signum, 2611 code, 2612 tcr, 2613 &ts); 2614 #if 0 2615 fprintf(stderr, "Setup pseudosignal handling in 0x%x\n",tcr); 2616 #endif 2617 2618 } else { 2619 kret = 17; 2620 } 2621 } 2622 #if USE_MACH_EXCEPTION_LOCK 2623 #ifdef DEBUG_MACH_EXCEPTIONS 2624 fprintf(stderr, "releasing Mach exception lock in exception thread\n"); 2625 #endif 2626 pthread_mutex_unlock(mach_exception_lock); 2627 #endif 2628 } else { 2629 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION); 2630 2631 #if 0 2632 fprintf(stderr, "deferring pending exception in 0x%x\n", tcr); 2633 #endif 2634 kret = KERN_SUCCESS; 2635 if (tcr == gc_tcr) { 2636 int i; 2637 write(1, "exception in GC thread. Sleeping for 60 seconds\n",sizeof("exception in GC thread. Sleeping for 60 seconds\n")); 2638 for (i = 0; i < 60; i++) { 2639 sleep(1); 2640 } 2641 _exit(EX_SOFTWARE); 2642 } 2643 } 2604 } 2605 } 2606 2644 2607 return kret; 2645 2608 }
Note: See TracChangeset
for help on using the changeset viewer.