Changeset 12988
- Timestamp:
- Oct 10, 2009, 7:09:34 AM (15 years ago)
- Location:
- branches/working-0711/ccl/lisp-kernel
- Files:
-
- 4 edited
-
x86-constants32.h (modified) (2 diffs)
-
x86-constants64.h (modified) (2 diffs)
-
x86-exceptions.c (modified) (15 diffs)
-
xlbt.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/lisp-kernel/x86-constants32.h
r12198 r12988 74 74 #define Inargs Itemp1 75 75 #define Ixfn Itemp1 76 #define Ifp Iebp 76 77 77 78 /* MMX register offsets from where mm0 is found in uc_mcontext.fs */ … … 424 425 LispObj save2; 425 426 LispObj save3; 426 LispObj *save_ ebp; /* EBP when in foreign code */427 LispObj *save_fp; /* EBP when in foreign code */ 427 428 u32_t lisp_mxcsr; 428 429 u32_t foreign_mxcsr; -
branches/working-0711/ccl/lisp-kernel/x86-constants64.h
r12198 r12988 109 109 #define Inargs Iimm2 110 110 #define Ixfn Itemp1 111 #define Ifp Irbp 111 112 112 113 … … 484 485 } single_float_convert; 485 486 struct tcr* linear; 486 LispObj *save_ rbp; /* RBP when in foreign code */487 LispObj *save_fp; /* RBP when in foreign code */ 487 488 u32_t lisp_mxcsr; 488 489 u32_t foreign_mxcsr; -
branches/working-0711/ccl/lisp-kernel/x86-exceptions.c
r12198 r12988 480 480 push_on_lisp_stack(xp,nominal_function); 481 481 push_on_lisp_stack(xp,0); 482 #ifdef X8664 483 push_on_lisp_stack(xp,xpGPR(xp,Irbp)); 484 xpGPR(xp,Irbp) = xpGPR(xp,Isp); 485 #else 486 push_on_lisp_stack(xp,xpGPR(xp,Iebp)); 487 xpGPR(xp,Iebp) = xpGPR(xp,Isp); 488 #endif 482 push_on_lisp_stack(xp,xpGPR(xp,Ifp)); 483 xpGPR(xp,Ifp) = xpGPR(xp,Isp); 489 484 return xpGPR(xp,Isp); 490 485 } … … 597 592 598 593 /* Put the active stack pointers where .SPcallback expects them */ 599 #ifdef X8664 600 tcr->save_vsp = (LispObj *) xpGPR(xp, Isp); 601 tcr->save_rbp = (LispObj *) xpGPR(xp, Irbp); 602 #else 594 #ifdef X8632 603 595 tcr->node_regs_mask = X8632_DEFAULT_NODE_REGS_MASK; 604 596 … … 609 601 *--vsp = tcr->next_method_context; 610 602 xpGPR(xp, Isp) = (LispObj)vsp; 611 603 #endif 612 604 tcr->save_vsp = (LispObj *)xpGPR(xp, Isp); 613 tcr->save_ebp = (LispObj *)xpGPR(xp, Iebp); 614 #endif 605 tcr->save_fp = (LispObj *)xpGPR(xp, Ifp); 615 606 616 607 /* Call back. The caller of this function may have modified stack/frame … … 643 634 LispObj *save_vsp = (LispObj *)xpGPR(xp,Isp), 644 635 word_beyond_vsp = save_vsp[-1], 645 #ifdef X8664 646 save_rbp = xpGPR(xp,Irbp), 647 #else 648 save_ebp = xpGPR(xp,Iebp), 649 #endif 636 save_fp = xpGPR(xp,Ifp), 650 637 xcf = create_exception_callback_frame(xp, tcr); 651 638 int save_errno = errno; 652 639 653 640 callback_to_lisp(tcr, nrs_CMAIN.vcell,xp, xcf, 0, 0, 0, 0); 654 #ifdef X8664 655 xpGPR(xp,Irbp) = save_rbp; 656 #else 657 xpGPR(xp,Iebp) = save_ebp; 658 #endif 641 xpGPR(xp,Ifp) = save_fp; 659 642 xpGPR(xp,Isp) = (LispObj)save_vsp; 660 643 save_vsp[-1] = word_beyond_vsp; … … 668 651 unsigned char op0 = program_counter[0], op1 = program_counter[1]; 669 652 LispObj rpc, errdisp = nrs_ERRDISP.vcell, 670 save_vsp = xpGPR(xp,Isp), xcf0; 671 #ifdef X8664 672 LispObj save_rbp = xpGPR(xp,Irbp); 673 #else 674 LispObj save_ebp = xpGPR(xp,Iebp); 675 #endif 653 save_vsp = xpGPR(xp,Isp), xcf0, 654 save_fp = xpGPR(xp,Ifp); 676 655 int skip; 677 656 … … 703 682 skip = 0; 704 683 } 705 #ifdef X8664 706 xpGPR(xp,Irbp) = save_rbp; 707 #else 708 xpGPR(xp,Iebp) = save_ebp; 709 #endif 684 xpGPR(xp,Ifp) = save_fp; 710 685 xpGPR(xp,Isp) = save_vsp; 711 686 if ((op0 == 0xcd) && (op1 == 0xc7)) { … … 721 696 */ 722 697 LispObj *vsp =(LispObj *)save_vsp, ra = *vsp; 723 #ifdef X8664724 int nargs = (xpGPR(xp, Inargs) & 0xffff)>>fixnumshift;725 #else726 698 int nargs = xpGPR(xp, Inargs)>>fixnumshift; 727 #endif728 699 729 700 #ifdef X8664 … … 793 764 lisp_protection_kind which = prot_area->why; 794 765 Boolean on_TSP = (which == kTSPsoftguard); 795 #ifdef X8664 796 LispObj save_rbp = xpGPR(xp,Irbp); 797 #else 798 LispObj save_ebp = xpGPR(xp,Iebp); 799 #endif 766 LispObj save_fp = xpGPR(xp,Ifp); 800 767 LispObj save_vsp = xpGPR(xp,Isp), 801 768 xcf, … … 816 783 unprotect_area(soft); 817 784 xcf = create_exception_callback_frame(xp, tcr); 818 skip = callback_to_lisp(tcr, nrs_CMAIN.vcell, xp, xcf, SIGSEGV, on_TSP, 0, 0); 819 #ifdef X8664 820 xpGPR(xp,Irbp) = save_rbp; 821 #else 822 xpGPR(xp,Iebp) = save_ebp; 823 #endif 785 skip = callback_to_lisp(tcr, cmain, xp, xcf, SIGSEGV, on_TSP, 0, 0); 786 xpGPR(xp,Ifp) = save_fp; 824 787 xpGPR(xp,Isp) = save_vsp; 825 788 xpPC(xp) += skip; … … 833 796 { 834 797 #ifdef DARWIN 835 #ifdef X8664836 798 return (UC_MCONTEXT(xp)->__es.__err & 0x2) != 0; 837 #else838 return (xp->uc_mcontext->__es.__err & 0x2) != 0;839 #endif840 799 #endif 841 800 #if defined(LINUX) || defined(SOLARIS) … … 907 866 int code,skip; 908 867 LispObj xcf, cmain = nrs_CMAIN.vcell, 909 save_vsp = xpGPR(xp,Isp); 910 #ifdef X8664 911 LispObj save_rbp = xpGPR(xp,Irbp); 912 #else 913 LispObj save_ebp = xpGPR(xp,Iebp); 914 #endif 868 save_vsp = xpGPR(xp,Isp), 869 save_fp = xpGPR(xp,Ifp); 915 870 #ifdef WINDOWS 916 871 code = info->ExceptionCode; … … 924 879 skip = callback_to_lisp(tcr, cmain, xp, xcf, SIGFPE, code, 0, 0); 925 880 xpPC(xp) += skip; 926 #ifdef X8664 927 xpGPR(xp,Irbp) = save_rbp; 928 #else 929 xpGPR(xp,Iebp) = save_ebp; 930 #endif 881 xpGPR(xp,Ifp) = save_fp; 931 882 xpGPR(xp,Isp) = save_vsp; 932 883 return true; … … 1441 1392 { 1442 1393 ExceptionInformation *xp; 1443 LispObj * bp;1394 LispObj *fp; 1444 1395 1445 1396 if (tcr->pending_exception_context) … … 1451 1402 } 1452 1403 if (xp) { 1453 #ifdef X8664 1454 bp = (LispObj *) xpGPR(xp, Irbp); 1455 #else 1456 bp = (LispObj *) xpGPR(xp, Iebp); 1457 #endif 1404 fp = (LispObj *)xpGPR(xp, Ifp); 1458 1405 } else { 1459 #ifdef X8664 1460 bp = tcr->save_rbp; 1461 #else 1462 bp = tcr->save_ebp; 1463 #endif 1464 } 1465 return bp; 1406 fp = tcr->save_fp; 1407 } 1408 return fp; 1466 1409 } 1467 1410 … … 1662 1605 (tcr->unwinding != 0) || 1663 1606 ! stack_pointer_on_vstack_p(xpGPR(context,Isp), tcr) || 1664 #ifdef X8664 1665 ! stack_pointer_on_vstack_p(xpGPR(context,Irbp), tcr)) { 1666 #else 1667 ! stack_pointer_on_vstack_p(xpGPR(context,Iebp), tcr)) { 1668 #endif 1607 ! stack_pointer_on_vstack_p(xpGPR(context,Ifp), tcr)) { 1669 1608 tcr->interrupt_pending = (((natural) 1)<< (nbits_in_word - ((natural)1))); 1670 1609 } else { -
branches/working-0711/ccl/lisp-kernel/xlbt.c
r12198 r12988 138 138 139 139 void 140 plbt_sp(LispObj current RBP)140 plbt_sp(LispObj current_fp) 141 141 { 142 142 area *vs_area, *cs_area; 143 144 { 145 TCR *tcr = (TCR *)get_tcr(true); 146 char *ilevel = interrupt_level_description(tcr); 147 vs_area = tcr->vs_area; 148 cs_area = tcr->cs_area; 149 if ((((LispObj) ptr_to_lispobj(vs_area->low)) > currentRBP) || 150 (((LispObj) ptr_to_lispobj(vs_area->high)) < currentRBP)) { 151 #ifdef X8664 152 currentRBP = (LispObj) (tcr->save_rbp); 153 #else 154 currentRBP = (LispObj) (tcr->save_ebp); 155 #endif 156 } 157 if ((((LispObj) ptr_to_lispobj(vs_area->low)) > currentRBP) || 158 (((LispObj) ptr_to_lispobj(vs_area->high)) < currentRBP)) { 159 Dprintf("\nFramepointer [#x%lX] in unknown area.", currentRBP); 160 } else { 161 fprintf(dbgout, "current thread: tcr = 0x%lx, native thread ID = 0x%lx, interrupts %s\n", tcr, tcr->native_thread_id, ilevel); 162 walk_stack_frames((lisp_frame *) ptr_from_lispobj(currentRBP), (lisp_frame *) (vs_area->high)); 163 /* walk_other_areas();*/ 164 } 165 } 143 TCR *tcr = (TCR *)get_tcr(true); 144 char *ilevel = interrupt_level_description(tcr); 145 146 vs_area = tcr->vs_area; 147 cs_area = tcr->cs_area; 148 if ((((LispObj) ptr_to_lispobj(vs_area->low)) > current_fp) || 149 (((LispObj) ptr_to_lispobj(vs_area->high)) < current_fp)) { 150 current_fp = (LispObj) (tcr->save_fp); 151 } 152 if ((((LispObj) ptr_to_lispobj(vs_area->low)) > current_fp) || 153 (((LispObj) ptr_to_lispobj(vs_area->high)) < current_fp)) { 154 Dprintf("\nFrame pointer [#x" LISP "] in unknown area.", current_fp); 155 } else { 156 fprintf(dbgout, "current thread: tcr = 0x" LISP ", native thread ID = 0x" LISP ", interrupts %s\n", tcr, tcr->native_thread_id, ilevel); 157 walk_stack_frames((lisp_frame *) ptr_from_lispobj(current_fp), (lisp_frame *) (vs_area->high)); 158 /* walk_other_areas();*/ 159 } 166 160 } 167 161
Note:
See TracChangeset
for help on using the changeset viewer.
