Changeset 11501
- Timestamp:
- Dec 11, 2008, 1:31:44 PM (12 years ago)
- Location:
- trunk/source/lisp-kernel
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/Threads.h
r11500 r11501 241 241 242 242 243 #define SIG_KILL_THREAD SIGQUIT /* unless we can find something better */ 244 245 extern int thread_suspend_signal, thread_quit_signal; 243 #ifdef DARWIN 244 #define SIG_KILL_THREAD SIGEMT 245 #endif 246 247 #if defined(LINUX) && defined(SIGRTMIN) 248 #define SIG_KILL_THREAD (SIGRTMIN+7) 249 #endif 250 251 #ifdef SOLARIS 252 #define SIG_KILL_THREAD SIGRTMIN 253 #endif 254 255 #ifdef FREEBSD 256 #define SIG_KILL_THREAD (SIG_THR+5) 257 #endif 258 259 260 extern int thread_suspend_signal, thread_kill_signal; 246 261 247 262 void * -
trunk/source/lisp-kernel/image.c
r11468 r11501 455 455 prepare_to_write_dynamic_space(active_dynamic_area); 456 456 457 { 458 area *g0_area = g1_area->younger; 459 460 /* Save GC config */ 461 lisp_global(LISP_HEAP_THRESHOLD) = lisp_heap_gc_threshold; 462 lisp_global(G0_THRESHOLD) = g0_area->threshold; 463 lisp_global(G1_THRESHOLD) = g1_area->threshold; 464 lisp_global(G1_THRESHOLD) = g2_area->threshold; 465 lisp_global(EGC_ENABLED) = (LispObj)(active_dynamic_area->older != NULL); 466 } 457 467 /* 458 468 lisp_global(GC_NUM) and lisp_global(FWDNUM) are persistent, … … 466 476 case STATIC_CONSES: 467 477 case WEAK_GC_METHOD: 478 case LISP_HEAP_THRESHOLD: 479 case EGC_ENABLED: 480 case G0_THRESHOLD: 481 case G1_THRESHOLD: 482 case G2_THRESHOLD: 468 483 break; 469 484 default: -
trunk/source/lisp-kernel/lisp-debug.c
r11244 r11501 929 929 #endif 930 930 {debug_kill_process, 931 "Kill OpenMCL process",931 "Kill Clozure CL process", 932 932 0, 933 933 NULL, … … 1057 1057 while (state == debug_continue) { 1058 1058 #ifdef WINDOWS 1059 fprintf(stderr, "[%d] OpenMCL kernel debugger: ", (int)GetCurrentProcessId());1059 fprintf(stderr, "[%d] Clozure CL kernel debugger: ", (int)GetCurrentProcessId()); 1060 1060 #else 1061 fprintf(stderr, "[%d] OpenMCL kernel debugger: ", main_thread_pid);1061 fprintf(stderr, "[%d] Clozure CL kernel debugger: ", main_thread_pid); 1062 1062 #endif 1063 1063 state = apply_debug_command(xp, readc(), info, why); … … 1110 1110 lisp_bug(char *string) 1111 1111 { 1112 Bug(NULL, "Bug in OpenMCL system code:\n%s", string);1113 } 1114 1112 Bug(NULL, "Bug in Clozure CL system code:\n%s", string); 1113 } 1114 -
trunk/source/lisp-kernel/lisp_globals.h
r10969 r11501 72 72 #define MIN_KERNEL_GLOBAL INITIAL_TCR 73 73 74 /* These are only non-zero when an image is being saved or loaded */ 75 76 #if (WOED_SIZE==64) 77 #define LISP_HEAP_THRESHOLD (-511) 78 #define EGC_ENABLED (-510) 79 #define G0_THRESHOLD (-509) 80 #define G1_THRESHOLD (-508) 81 #define G2_THRESHOLD (-507) 82 #else 83 #define LISP_HEAP_THRESHOLD (-1023) 84 #define EGC_ENABLED (-1022) 85 #define G0_THRESHOLD (-1021) 86 #define G1_THRESHOLD (-1020) 87 #define G2_THRESHOLD (-1019) 88 #endif 89 74 90 #ifdef PPC 75 91 #ifdef PPC64 -
trunk/source/lisp-kernel/pmcl-kernel.c
r11450 r11501 1469 1469 { 1470 1470 extern int page_size; 1471 natural default_g0_threshold = G0_AREA_THRESHOLD, 1472 default_g1_threshold = G1_AREA_THRESHOLD, 1473 default_g2_threshold = G2_AREA_THRESHOLD, 1474 lisp_heap_threshold_from_image = 0; 1475 Boolean egc_enabled = 1476 #ifdef DISABLE_EGC 1477 false 1478 #else 1479 true 1480 #endif 1481 ; 1482 Boolean lisp_heap_threshold_set_from_command_line = false; 1471 1483 1472 1484 #ifdef PPC … … 1585 1597 process_options(argc,argv); 1586 1598 } 1599 if (lisp_heap_gc_threshold != DEFAULT_LISP_HEAP_GC_THRESHOLD) { 1600 lisp_heap_threshold_set_from_command_line = true; 1601 } 1602 1587 1603 initial_stack_size = ensure_stack_limit(initial_stack_size); 1588 1604 if (image_name == NULL) { … … 1601 1617 1602 1618 set_nil(load_image(image_name)); 1619 lisp_heap_threshold_from_image = lisp_global(LISP_HEAP_THRESHOLD); 1620 if (lisp_heap_threshold_from_image) { 1621 if ((!lisp_heap_threshold_set_from_command_line) && 1622 (lisp_heap_threshold_from_image != lisp_heap_gc_threshold)) { 1623 lisp_heap_gc_threshold = lisp_heap_threshold_from_image; 1624 resize_dynamic_heap(active_dynamic_area->active,lisp_heap_gc_threshold); 1625 } 1626 /* If lisp_heap_threshold_from_image was set, other image params are 1627 valid. */ 1628 default_g0_threshold = lisp_global(G0_THRESHOLD); 1629 default_g1_threshold = lisp_global(G1_THRESHOLD); 1630 default_g2_threshold = lisp_global(G2_THRESHOLD); 1631 egc_enabled = lisp_global(EGC_ENABLED); 1632 } 1633 1603 1634 lisp_global(TCR_AREA_LOCK) = ptr_to_lispobj(tcr_area_lock); 1604 1635 … … 1664 1695 lisp_global(TENURED_AREA) = ptr_to_lispobj(tenured_area); 1665 1696 lisp_global(REFBITS) = ptr_to_lispobj(tenured_area->refbits); 1666 g2_area->threshold = G2_AREA_THRESHOLD;1667 g1_area->threshold = G1_AREA_THRESHOLD;1668 a->threshold = G0_AREA_THRESHOLD;1697 g2_area->threshold = default_g2_threshold; 1698 g1_area->threshold = default_g1_threshold; 1699 a->threshold = default_g0_threshold; 1669 1700 } 1670 1701 … … 1694 1725 (nrs_GC_EVENT_STATUS_BITS.vcell |= gc_integrity_check_bit); 1695 1726 #endif 1696 #ifndef DISABLE_EGC 1697 egc_control(true, NULL);1698 #endif 1727 if (egc_enabled) { 1728 egc_control(true, NULL); 1729 } 1699 1730 atexit(lazarus); 1700 1731 start_lisp(TCR_TO_TSD(tcr), 0); -
trunk/source/lisp-kernel/ppc-exceptions.c
r11500 r11501 2174 2174 2175 2175 void 2176 quit_handler(int signum, siginfo_t info, ExceptionInformation *xp)2176 thread_kill_handler(int signum, siginfo_t info, ExceptionInformation *xp) 2177 2177 { 2178 2178 TCR *tcr = get_tcr(false); … … 2206 2206 { 2207 2207 thread_suspend_signal = SIG_SUSPEND_THREAD; 2208 thread_ quit_signal = SIG_KILL_THREAD;2208 thread_kill_signal = SIG_KILL_THREAD; 2209 2209 2210 2210 install_signal_handler(thread_suspend_signal, (void *) suspend_resume_handler); 2211 install_signal_handler( SIGQUIT, (void *)quit_handler);2211 install_signal_handler(thread_kill_signal, (void *)thread_kill_handler); 2212 2212 } 2213 2213 -
trunk/source/lisp-kernel/thread_manager.c
r11500 r11501 547 547 548 548 549 int thread_suspend_signal = 0, thread_ quit_signal = 0;549 int thread_suspend_signal = 0, thread_kill_signal = 0; 550 550 551 551 … … 2021 2021 } 2022 2022 #else 2023 if (pthread_kill((pthread_t)osid,thread_ quit_signal)) {2023 if (pthread_kill((pthread_t)osid,thread_kill_signal)) { 2024 2024 result = false; 2025 2025 } -
trunk/source/lisp-kernel/x86-exceptions.c
r11500 r11501 2011 2011 #ifdef WINDOWS 2012 2012 void 2013 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)2014 { 2015 } 2016 #else 2017 void 2018 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)2013 thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *xp) 2014 { 2015 } 2016 #else 2017 void 2018 thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *xp) 2019 2019 { 2020 2020 #ifdef DARWIN_GS_HACK … … 2036 2036 #ifndef USE_SIGALTSTACK 2037 2037 void 2038 arbstack_ quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)2038 arbstack_thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *context) 2039 2039 { 2040 2040 #ifdef DARWIN_GS_HACK … … 2048 2048 (current_sp < vs->high)) { 2049 2049 handle_signal_on_foreign_stack(tcr, 2050 quit_handler,2050 thread_kill_handler, 2051 2051 signum, 2052 2052 info, … … 2065 2065 } 2066 2066 #endif 2067 quit_handler(signum, info, context);2068 } 2069 } 2070 2071 2072 #else 2073 void 2074 altstack_ quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)2067 thread_kill_handler(signum, info, context); 2068 } 2069 } 2070 2071 2072 #else 2073 void 2074 altstack_thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *context) 2075 2075 { 2076 2076 #ifdef DARWIN_GS_HACK … … 2079 2079 TCR* tcr = get_tcr(true); 2080 2080 handle_signal_on_foreign_stack(tcr, 2081 quit_handler,2081 thread_kill_handler, 2082 2082 signum, 2083 2083 info, … … 2094 2094 #ifdef USE_SIGALTSTACK 2095 2095 #define SUSPEND_RESUME_HANDLER altstack_suspend_resume_handler 2096 #define QUIT_HANDLER altstack_quit_handler2096 #define THREAD_KILL_HANDLER altstack_thread_kill_handler 2097 2097 #else 2098 2098 #define SUSPEND_RESUME_HANDLER arbstack_suspend_resume_handler 2099 #define QUIT_HANDLER arbstack_quit_handler2099 #define THREAD_KILL_HANDLER arbstack_thread_kill_handler 2100 2100 #endif 2101 2101 … … 2110 2110 { 2111 2111 thread_suspend_signal = SIG_SUSPEND_THREAD; 2112 thread_ quit_signal = SIG_KILL_THREAD;2112 thread_kill_signal = SIG_KILL_THREAD; 2113 2113 2114 2114 install_signal_handler(thread_suspend_signal, (void *)SUSPEND_RESUME_HANDLER); 2115 install_signal_handler(thread_ quit_signal, (void *)QUIT_HANDLER);2115 install_signal_handler(thread_kill_signal, (void *)THREAD_KILL_HANDLER); 2116 2116 } 2117 2117 #endif -
trunk/source/lisp-kernel/x86-gc.c
r11168 r11501 375 375 } 376 376 377 dnode = gc_area_dnode(n); 378 if (dnode >= GCndnodes_in_area) { 379 return; 380 } 381 377 382 #ifdef X8632 378 383 if (tag_n == fulltag_tra) { … … 380 385 n = *(LispObj *)(n + 1); 381 386 tag_n = fulltag_misc; 387 dnode = gc_area_dnode(n); 382 388 } else 383 389 return; … … 391 397 n = RECOVER_FN_FROM_RIP_LENGTH+n+sdisp; 392 398 tag_n = fulltag_function; 399 dnode = gc_area_dnode(n); 393 400 } 394 401 else { … … 398 405 #endif 399 406 400 401 dnode = gc_area_dnode(n);402 if (dnode >= GCndnodes_in_area) {403 return;404 }405 407 set_bits_vars(GCmarkbits,dnode,bitsp,bits,mask); 406 408 if (bits & mask) { … … 594 596 } 595 597 598 dnode = gc_area_dnode(n); 599 if (dnode >= GCndnodes_in_area) { 600 return; 601 } 602 596 603 #ifdef X8632 597 604 if (tag_n == fulltag_tra) { … … 599 606 n = *(LispObj *)(n + 1); 600 607 tag_n = fulltag_misc; 608 dnode = gc_area_dnode(n); 601 609 } else { 602 610 return; … … 611 619 n = RECOVER_FN_FROM_RIP_LENGTH+n+sdisp; 612 620 tag_n = fulltag_function; 621 dnode = gc_area_dnode(n); 613 622 } else { 614 623 return; … … 617 626 #endif 618 627 619 dnode = gc_area_dnode(n);620 if (dnode >= GCndnodes_in_area) {621 return;622 }623 628 set_bits_vars(markbits,dnode,bitsp,bits,mask); 624 629 if (bits & mask) {
Note: See TracChangeset
for help on using the changeset viewer.