Changeset 5282
- Timestamp:
- Oct 2, 2006, 1:46:22 AM (18 years ago)
- Location:
- trunk/ccl/lisp-kernel
- Files:
-
- 3 edited
-
lisptypes.h (modified) (1 diff)
-
x86-exceptions.c (modified) (7 diffs)
-
x86-exceptions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lisp-kernel/lisptypes.h
r5281 r5282 85 85 #ifndef _STRUCT_MCONTEXT64 /* A guess at what'll be defined when this is fixed */ 86 86 struct mcontext64 { 87 x86_exception_state64_t es;88 x86_thread_state64_t ss;89 x86_float_state64_t fs;87 x86_exception_state64_t __es; 88 x86_thread_state64_t __ss; 89 x86_float_state64_t __fs; 90 90 }; 91 #endif /* _STRUCT_MCONTEXT64 */ 91 92 typedef struct mcontext64 *MCONTEXT_T; 93 typedef ucontext64_t ExceptionInformation; 94 #define UC_MCONTEXT(UC) UC->uc_mcontext64 95 #define __rax rax 96 #define __fpu_mxcsr fpu_mxcsr 97 #define __rsp rsp 98 #define __faultvaddr faultvaddr 99 #define __rip rip 100 #define __rsi rsi 101 #define __rdi rdi 102 #define __rdx rdx 103 #define __rcx rcx 104 #else 105 typedef mcontext_t MCONTEXT_T; 92 106 typedef ucontext_t ExceptionInformation; 93 107 #define UC_MCONTEXT(UC) UC->uc_mcontext 108 #endif /* _STRUCT_MCONTEXT64 */ 94 109 #endif /* X86_64 */ 95 110 #endif /* #ifdef DARWIN */ -
trunk/ccl/lisp-kernel/x86-exceptions.c
r5281 r5282 619 619 { 620 620 if (info->si_code == EXC_I386_SSEEXTERR) { 621 #ifdef _STRUCT_MCONTEXT64622 621 uint32_t mxcsr = UC_MCONTEXT(xp)->__fs.__fpu_mxcsr; 623 #else624 uint32_t mxcsr = UC_MCONTEXT(xp)->fs.fpu_mxcsr;625 #endif626 627 622 628 623 decode_vector_fp_exception(info, mxcsr); … … 895 890 #ifdef DARWIN 896 891 LispObj * 897 copy_darwin_mcontext( mcontext_tcontext,892 copy_darwin_mcontext(MCONTEXT_T context, 898 893 LispObj *current, 899 mcontext_t*out)900 { 901 mcontext_t dest = ((mcontext_t)current)-1;902 dest = ( mcontext_t) (((LispObj)dest) & ~15);894 MCONTEXT_T *out) 895 { 896 MCONTEXT_T dest = ((MCONTEXT_T)current)-1; 897 dest = (MCONTEXT_T) (((LispObj)dest) & ~15); 903 898 904 899 *dest = *context; … … 1068 1063 #endif 1069 1064 #ifdef DARWIN 1070 mcontext_tmcontextp = NULL;1065 MCONTEXT_T mcontextp = NULL; 1071 1066 #endif 1072 1067 siginfo_t *info_copy = NULL; … … 1160 1155 #endif 1161 1156 #ifdef DARWIN 1162 mcontext_tmcontextp = NULL;1157 MCONTEXT_T mcontextp = NULL; 1163 1158 #endif 1164 1159 … … 1720 1715 kern_return_t kret; 1721 1716 #if WORD_SIZE == 64 1722 mcontext_tmc = UC_MCONTEXT(pseudosigcontext);1717 MCONTEXT_T mc = UC_MCONTEXT(pseudosigcontext); 1723 1718 #else 1724 1719 struct mcontext * mc = UC_MCONTEXT(pseudosigcontext); … … 1798 1793 ExceptionInformation *pseudosigcontext; 1799 1794 #ifdef X8664 1800 mcontext_tmc;1795 MCONTEXT_T mc; 1801 1796 #else 1802 1797 struct mcontext *mc; … … 1816 1811 stackp = TRUNC_DOWN(stackp, sizeof(*mc), C_STK_ALIGN); 1817 1812 #ifdef X8664 1818 mc = ( mcontext_t) ptr_from_lispobj(stackp);1813 mc = (MCONTEXT_T) ptr_from_lispobj(stackp); 1819 1814 #else 1820 1815 mc = (struct mcontext *) ptr_from_lispobj(stackp); -
trunk/ccl/lisp-kernel/x86-exceptions.h
r5281 r5282 31 31 #define DarwinSigReturn(context) syscall(SYS_sigreturn,context) 32 32 #ifdef X8664 33 #ifdef _STRUCT_MCONTEXT6434 33 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__ss.__rax))) 35 #else36 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->ss.rax)))37 #endif38 34 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 39 35 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 40 36 #define xpPC(x) (xpGPR(x,Iip)) 41 #ifdef _STRUCT_MCONTEXT6442 37 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__fs.__fpu_stmm0))) 43 #else44 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->fs.fp_stmm0)))45 #endif46 38 #define xpMMXreg(x,n) (xpFPRvector(x)[gprno]) 47 39 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
