Changeset 5281
- Timestamp:
- Oct 2, 2006, 1:33:40 AM (18 years ago)
- Location:
- trunk/ccl/lisp-kernel
- Files:
-
- 4 edited
-
lisptypes.h (modified) (2 diffs)
-
pmcl-kernel.c (modified) (1 diff)
-
x86-exceptions.c (modified) (14 diffs)
-
x86-exceptions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lisp-kernel/lisptypes.h
r5239 r5281 64 64 65 65 66 #if defined(DARWIN) 66 #ifdef DARWIN 67 #include <sys/ucontext.h> 68 69 #ifdef PPC 67 70 #if WORD_SIZE == 64 68 71 #ifdef _STRUCT_UCONTEXT64 69 typ def _STRUCT_UCONTEXT64 ExceptionInformation;70 #else 72 typedef _STRUCT_UCONTEXT64 ExceptionInformation; 73 #else /* _STRUCT_UCONTEXT64 */ 71 74 typedef struct ucontext64 ExceptionInformation; 72 #endif 75 #endif /* _STRUCT_UCONTEXT64 */ 73 76 #define UC_MCONTEXT(UC) UC->uc_mcontext64 77 #else /* WORD_SIZE */ 78 typedef struct ucontext ExceptionInformation; 79 #define UC_MCONTEXT(UC) UC->uc_mcontext 80 #endif /* WORD_SIZE */ 81 #endif /* PPC */ 82 74 83 #ifdef X8664 75 84 /* Broken <i386/ucontext.h> in xcode 2.4 */ 76 #include <sys/ucontext.h>77 85 #ifndef _STRUCT_MCONTEXT64 /* A guess at what'll be defined when this is fixed */ 78 86 struct mcontext64 { … … 81 89 x86_float_state64_t fs; 82 90 }; 83 #endif 84 #endif 85 #else 86 typedef struct ucontext ExceptionInformation; 91 #endif /* _STRUCT_MCONTEXT64 */ 92 typedef ucontext_t ExceptionInformation; 87 93 #define UC_MCONTEXT(UC) UC->uc_mcontext 88 #endif 89 #else /* #ifdef DARWIN */ 94 #endif /* X86_64 */ 95 #endif /* #ifdef DARWIN */ 96 90 97 #ifdef LINUX 91 98 typedef struct ucontext ExceptionInformation; 92 99 #endif 100 93 101 #ifdef FREEBSD 94 102 typedef struct __ucontext ExceptionInformation; 95 103 #endif 104 96 105 #ifdef SOLARIS 97 106 typedef struct ucontext ExceptionInformation; 98 107 #endif 99 #define UC_MCONTEXT(UC) UC->uc_mcontext100 #endif /* #ifdef DARWIN */101 108 102 109 typedef u32_t lisp_char_code; -
trunk/ccl/lisp-kernel/pmcl-kernel.c
r5241 r5281 556 556 mach_msg_type_number_t vm_info_size = VM_REGION_BASIC_INFO_COUNT; 557 557 #endif 558 port_t vm_object_name = (port_t) 0;558 mach_port_t vm_object_name = (mach_port_t) 0; 559 559 kern_return_t kret; 560 560 -
trunk/ccl/lisp-kernel/x86-exceptions.c
r5274 r5281 619 619 { 620 620 if (info->si_code == EXC_I386_SSEEXTERR) { 621 #ifdef _STRUCT_MCONTEXT64 622 uint32_t mxcsr = UC_MCONTEXT(xp)->__fs.__fpu_mxcsr; 623 #else 621 624 uint32_t mxcsr = UC_MCONTEXT(xp)->fs.fpu_mxcsr; 625 #endif 626 622 627 623 628 decode_vector_fp_exception(info, mxcsr); … … 890 895 #ifdef DARWIN 891 896 LispObj * 892 copy_darwin_mcontext( struct mcontext64 *context,897 copy_darwin_mcontext(mcontext_t context, 893 898 LispObj *current, 894 struct mcontext64 **out)895 { 896 struct mcontext64 *dest = ((struct mcontext64 *)current)-1;897 dest = ( struct mcontext64 *) (((LispObj)dest) & ~15);899 mcontext_t *out) 900 { 901 mcontext_t dest = ((mcontext_t)current)-1; 902 dest = (mcontext_t) (((LispObj)dest) & ~15); 898 903 899 904 *dest = *context; … … 1063 1068 #endif 1064 1069 #ifdef DARWIN 1065 struct mcontext64 *mcontextp = NULL;1070 mcontext_t mcontextp = NULL; 1066 1071 #endif 1067 1072 siginfo_t *info_copy = NULL; … … 1155 1160 #endif 1156 1161 #ifdef DARWIN 1157 struct mcontext64 *mcontextp = NULL;1162 mcontext_t mcontextp = NULL; 1158 1163 #endif 1159 1164 … … 1715 1720 kern_return_t kret; 1716 1721 #if WORD_SIZE == 64 1717 struct mcontext64 *mc = UC_MCONTEXT(pseudosigcontext);1722 mcontext_t mc = UC_MCONTEXT(pseudosigcontext); 1718 1723 #else 1719 1724 struct mcontext * mc = UC_MCONTEXT(pseudosigcontext); … … 1723 1728 kret = thread_set_state(thread, 1724 1729 x86_FLOAT_STATE64, 1725 (thread_state_t)&(mc-> fs),1730 (thread_state_t)&(mc->__fs), 1726 1731 x86_FLOAT_STATE64_COUNT); 1727 1732 … … 1732 1737 kret = thread_set_state(thread, 1733 1738 x86_THREAD_STATE64, 1734 (thread_state_t)&(mc-> ss),1739 (thread_state_t)&(mc->__ss), 1735 1740 x86_THREAD_STATE64_COUNT); 1736 1741 #else 1737 1742 kret = thread_set_state(thread, 1738 1743 x86_THREAD_STATE32, 1739 (thread_state_t)&(mc-> ss),1744 (thread_state_t)&(mc->__ss), 1740 1745 x86_THREAD_STATE32_COUNT); 1741 1746 #endif … … 1793 1798 ExceptionInformation *pseudosigcontext; 1794 1799 #ifdef X8664 1795 struct mcontext64 *mc;1800 mcontext_t mc; 1796 1801 #else 1797 1802 struct mcontext *mc; … … 1800 1805 1801 1806 1802 stackp = (LispObj) find_foreign_rsp(ts-> rsp,tcr->cs_area,tcr);1807 stackp = (LispObj) find_foreign_rsp(ts->__rsp,tcr->cs_area,tcr); 1803 1808 stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN); 1804 1809 stackp = TRUNC_DOWN(stackp, sizeof(siginfo_t), C_STK_ALIGN); … … 1811 1816 stackp = TRUNC_DOWN(stackp, sizeof(*mc), C_STK_ALIGN); 1812 1817 #ifdef X8664 1813 mc = ( struct mcontext64 *) ptr_from_lispobj(stackp);1818 mc = (mcontext_t) ptr_from_lispobj(stackp); 1814 1819 #else 1815 1820 mc = (struct mcontext *) ptr_from_lispobj(stackp); 1816 1821 #endif 1817 1822 1818 bcopy(ts,&(mc-> ss),sizeof(*ts));1823 bcopy(ts,&(mc->__ss),sizeof(*ts)); 1819 1824 1820 1825 thread_state_count = x86_FLOAT_STATE64_COUNT; 1821 1826 thread_get_state(thread, 1822 1827 x86_FLOAT_STATE64, 1823 (thread_state_t)&(mc-> fs),1828 (thread_state_t)&(mc->__fs), 1824 1829 &thread_state_count); 1825 1830 … … 1836 1841 x86_EXCEPTION_STATE, 1837 1842 #endif 1838 (thread_state_t)&(mc-> es),1843 (thread_state_t)&(mc->__es), 1839 1844 &thread_state_count); 1840 1845 … … 1894 1899 bzero(info, sizeof(*info)); 1895 1900 info->si_code = code; 1896 info->si_addr = (void *)(UC_MCONTEXT(pseudosigcontext)-> es.faultvaddr);1901 info->si_addr = (void *)(UC_MCONTEXT(pseudosigcontext)->__es.__faultvaddr); 1897 1902 info->si_signo = signum; 1898 1903 pseudosigcontext->uc_onstack = 0; … … 1908 1913 */ 1909 1914 1910 new_ts. rip = (natural) handler_address;1915 new_ts.__rip = (natural) handler_address; 1911 1916 stackpp = (natural *)stackp; 1912 1917 *--stackpp = (natural)pseudo_sigreturn; 1913 1918 stackp = (natural)stackpp; 1914 new_ts. rdi = signum;1915 new_ts. rsi = (natural)info;1916 new_ts. rdx = (natural)pseudosigcontext;1917 new_ts. rcx = (natural)tcr;1918 new_ts. rsp = stackp;1919 new_ts.__rdi = signum; 1920 new_ts.__rsi = (natural)info; 1921 new_ts.__rdx = (natural)pseudosigcontext; 1922 new_ts.__rcx = (natural)tcr; 1923 new_ts.__rsp = stackp; 1919 1924 1920 1925 … … 1967 1972 1968 1973 #ifdef X8664 1969 #define ts_pc(t) t. rip1974 #define ts_pc(t) t.__rip 1970 1975 #else 1971 1976 #define ts_pc(t) t.eip -
trunk/ccl/lisp-kernel/x86-exceptions.h
r5274 r5281 31 31 #define DarwinSigReturn(context) syscall(SYS_sigreturn,context) 32 32 #ifdef X8664 33 #ifdef _STRUCT_MCONTEXT64 34 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__ss.__rax))) 35 #else 33 36 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->ss.rax))) 37 #endif 34 38 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 35 39 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 36 40 #define xpPC(x) (xpGPR(x,Iip)) 41 #ifdef _STRUCT_MCONTEXT64 42 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__fs.__fpu_stmm0))) 43 #else 37 44 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->fs.fp_stmm0))) 45 #endif 38 46 #define xpMMXreg(x,n) (xpFPRvector(x)[gprno]) 39 47 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
