Changeset 13638
- Timestamp:
- Apr 18, 2010, 10:58:15 AM (10 years ago)
- Location:
- trunk/source/lisp-kernel
- Files:
-
- 5 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/Threads.h
r13431 r13638 235 235 236 236 237 #if defined(SIGRTMIN) && !defined(SOLARIS)238 #define SIG_SUSPEND_THREAD (SIGRTMIN+6)239 #else240 #define SIG_SUSPEND_THREAD SIGUSR2241 #endif242 243 244 #ifdef DARWIN245 #define SIG_KILL_THREAD SIGEMT246 #endif247 248 #if defined(LINUX) && defined(SIGRTMIN)249 #define SIG_KILL_THREAD (SIGRTMIN+7)250 #endif251 252 #ifdef SOLARIS253 #define SIG_KILL_THREAD SIGRTMIN254 #endif255 256 #ifdef FREEBSD257 #define SIG_KILL_THREAD (SIGTHR+5)258 #endif259 260 237 261 238 extern int thread_suspend_signal, thread_kill_signal; -
trunk/source/lisp-kernel/darwinppc/Makefile
r13607 r13638 51 51 CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \ 52 52 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 53 Threads.h lisptypes.h ppc-constants32.h ppc-exceptions.h $(PLATFORM_H) 53 Threads.h lisptypes.h ppc-constants32.h ppc-exceptions.h \ 54 $(PLATFORM_H) constants.h os-darwin.h 54 55 55 56 # Subprims linked into the kernel ? -
trunk/source/lisp-kernel/darwinppc64/Makefile
r13607 r13638 59 59 CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \ 60 60 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 61 Threads.h lisptypes.h ppc-constants64.h ppc-exceptions.h $(PLATFORM_H) 61 Threads.h lisptypes.h ppc-constants64.h ppc-exceptions.h \ 62 $(PLATFORM_H) constants.h os-darwin.h 62 63 63 64 # Subprims linked into the kernel ? -
trunk/source/lisp-kernel/darwinx8632/Makefile
r13628 r13638 53 53 CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ 54 54 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 55 Threads.h lisptypes.h x86-constants32.h x86-exceptions.h $(PLATFORM_H)\56 constants.h55 Threads.h lisptypes.h x86-constants32.h x86-exceptions.h \ 56 $(PLATFORM_H) constants.h os-darwin.h 57 57 58 58 # Subprims linked into the kernel ? -
trunk/source/lisp-kernel/darwinx8664/Makefile
r13628 r13638 76 76 CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ 77 77 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 78 Threads.h lisptypes.h x86-constants64.h x86-exceptions.h $(PLATFORM_H)\79 constants.h78 Threads.h lisptypes.h x86-constants64.h x86-exceptions.h \ 79 $(PLATFORM_H) constants.h os-darwin.h 80 80 81 81 # Subprims linked into the kernel ? -
trunk/source/lisp-kernel/linuxppc/Makefile
r13602 r13638 72 72 CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \ 73 73 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 74 Threads.h ppc-constants32.h ppc-exceptions.h $(PLATFORM_H) 74 Threads.h ppc-constants32.h ppc-exceptions.h $(PLATFORM_H) \ 75 constants.h os-linux.h 75 76 76 77 # Subprims linked into the kernel ? -
trunk/source/lisp-kernel/linuxppc64/Makefile
r13602 r13638 60 60 CHEADERS = area.h bits.h ppc-constants.h lisp-errors.h gc.h lisp.h \ 61 61 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 62 Threads.h ppc-constants64.h ppc-exceptions.h $(PLATFORM_H) 62 Threads.h ppc-constants64.h ppc-exceptions.h $(PLATFORM_H) \ 63 constants.h os-linux.h 63 64 64 65 # Subprims linked into the kernel ? -
trunk/source/lisp-kernel/linuxx8632/Makefile
r13625 r13638 59 59 CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ 60 60 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 61 Threads.h x86-constants32.h x86-exceptions.h lisptypes.h $(PLATFORM_H) 61 Threads.h x86-constants32.h x86-exceptions.h lisptypes.h \ 62 $(PLATFORM_H) constants.h os-linux.h 62 63 63 64 -
trunk/source/lisp-kernel/linuxx8664/Makefile
r13625 r13638 59 59 CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ 60 60 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 61 Threads.h x86-constants64.h x86-exceptions.h lisptypes.h $(PLATFORM_H) 61 Threads.h x86-constants64.h x86-exceptions.h lisptypes.h \ 62 $(PLATFORM_H) constants.h os-linux.h 62 63 63 64 -
trunk/source/lisp-kernel/platform-darwinppc.h
r13637 r13638 68 68 #define SIGRETURN(context) 69 69 70 #include "os-darwin.h" -
trunk/source/lisp-kernel/platform-darwinppc64.h
r13637 r13638 68 68 */ 69 69 #define SIGRETURN(context) 70 71 #include "os-darwin.h" -
trunk/source/lisp-kernel/platform-darwinx8632.h
r13627 r13638 36 36 #include "lisptypes.h" 37 37 #include "x86-constants32.h" 38 39 40 /* xp accessors, sigreturn stuff */ 41 #define DARWIN_USE_PSEUDO_SIGRETURN 1 42 #define DarwinSigReturn(context) do {\ 43 darwin_sigreturn(context);\ 44 Bug(context,"sigreturn returned");\ 45 } while (0) 46 47 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__ss))) 48 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 49 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 50 #define xpPC(x) (xpGPR(x,Iip)) 51 #define eflags_register(xp) xpGPR(xp,Iflags) 52 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__fs.__fpu_xmm0))) 53 #define xpMMXvector(x) (&(UC_MCONTEXT(x)->__fs.__fpu_stmm0)) 54 /* Note that this yields only the lower half of the MMX reg on x8632 */ 55 #define xpMMXreg(x,n) *(natural *)&(xpMMXvector(x)[n]) 56 57 #define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Not really, but our Mach handler fakes that */ 58 #define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->__es.__trapno == 0xd) && (((UC_MCONTEXT(xp)->__es.__err)&7)==2)) 59 #define IS_PAGE_FAULT(info,xp) (UC_MCONTEXT(xp)->__es.__trapno == 0xe) 60 /* The x86 version of sigreturn just needs the context argument; the 61 hidden, magic "flavor" argument that sigtramp uses is ignored. */ 62 #define SIGRETURN(context) DarwinSigReturn(context) 63 64 #include <mach/mach.h> 65 #include <mach/mach_error.h> 66 #include <mach/machine/thread_state.h> 67 #include <mach/machine/thread_status.h> 68 69 pthread_mutex_t *mach_exception_lock; 70 71 #include "os-darwin.h" -
trunk/source/lisp-kernel/platform-darwinx8664.h
r13627 r13638 37 37 #include "lisptypes.h" 38 38 #include "x86-constants64.h" 39 40 /* xp accessors, sigreturn stuff */ 41 #define DARWIN_USE_PSEUDO_SIGRETURN 1 42 #define DarwinSigReturn(context) do {\ 43 darwin_sigreturn(context);\ 44 Bug(context,"sigreturn returned");\ 45 } while (0) 46 47 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__ss))) 48 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 49 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 50 #define xpPC(x) (xpGPR(x,Iip)) 51 #define eflags_register(xp) xpGPR(xp,Iflags) 52 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__fs.__fpu_xmm0))) 53 #define xpMMXvector(x) (&(UC_MCONTEXT(x)->__fs.__fpu_stmm0)) 54 /* Note that this yields only the lower half of the MMX reg on x8632 */ 55 #define xpMMXreg(x,n) *(natural *)&(xpMMXvector(x)[n]) 56 #define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Not really, but our Mach handler fakes that */ 57 #define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->__es.__trapno == 0xd) && (((UC_MCONTEXT(xp)->__es.__err)&7)==2)) 58 #define IS_PAGE_FAULT(info,xp) (UC_MCONTEXT(xp)->__es.__trapno == 0xe) 59 /* The x86 version of sigreturn just needs the context argument; the 60 hidden, magic "flavor" argument that sigtramp uses is ignored. */ 61 #define SIGRETURN(context) DarwinSigReturn(context) 62 63 #include <mach/mach.h> 64 #include <mach/mach_error.h> 65 #include <mach/machine/thread_state.h> 66 #include <mach/machine/thread_status.h> 67 68 pthread_mutex_t *mach_exception_lock; 69 70 #include "os-darwin.h" -
trunk/source/lisp-kernel/platform-freebsdx8632.h
r13627 r13638 31 31 #include "lisptypes.h" 32 32 #include "x86-constants32.h" 33 34 #include <machine/fpu.h> 35 #define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext))) 36 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 37 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 38 #define eflags_register(xp) xpGPR(xp,Iflags) 39 #define xpPC(x) xpGPR(x,Iip) 40 #define xpMMXreg(x,n) *((natural *)(&(((struct ccl_savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n]))) 41 #define xpXMMregs(x)(&(((struct ccl_savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0])) 42 extern void freebsd_sigreturn(ExceptionInformation *); 43 #define SIGNUM_FOR_INTN_TRAP SIGBUS 44 #define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2)) 45 #define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno == T_PAGEFLT) 46 #define SIGRETURN(context) freebsd_sigreturn(context) 47 48 #include "os-freebsd.h" -
trunk/source/lisp-kernel/platform-freebsdx8664.h
r13627 r13638 30 30 #include "lisptypes.h" 31 31 #include "x86-constants64.h" 32 33 #include <machine/fpu.h> 34 #define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext))) 35 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 36 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 37 #define eflags_register(xp) xpGPR(xp,Iflags) 38 #define xpPC(x) xpGPR(x,Iip) 39 #define xpMMXreg(x,n) *((natural *)(&(((struct savefpu *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n]))) 40 #define xpXMMregs(x)(&(((struct savefpu *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0])) 41 extern void freebsd_sigreturn(ExceptionInformation *); 42 #define SIGNUM_FOR_INTN_TRAP SIGBUS 43 #define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2)) 44 #define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno == T_PAGEFLT) 45 #define SIGRETURN(context) freebsd_sigreturn(context) 46 47 #include "os-freebsd.h" -
trunk/source/lisp-kernel/platform-linuxppc.h
r13637 r13638 59 59 #define DarwinSigReturn(context) 60 60 #define SIGRETURN(context) 61 62 #include "os-linux.h" -
trunk/source/lisp-kernel/platform-linuxppc64.h
r13637 r13638 58 58 #define DarwinSigReturn(context) 59 59 #define SIGRETURN(context) 60 61 #include "os-linux.h" -
trunk/source/lisp-kernel/platform-linuxx8632.h
r13627 r13638 31 31 #include "lisptypes.h" 32 32 #include "x86-constants32.h" 33 34 /* xp accessors */ 35 #define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext.gregs))) 36 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 37 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 38 #define xpPC(x) (xpGPR(x,Iip)) 39 #define xpMMXreg(x,n) *((natural *)(&((x)->uc_mcontext.fpregs->_st[n]))) 40 #define eflags_register(xp) xpGPR(xp,Iflags) 41 #define SIGNUM_FOR_INTN_TRAP SIGSEGV 42 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2)) 43 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe) 44 #define SIGRETURN(context) 45 46 #include "os-linux.h" -
trunk/source/lisp-kernel/platform-linuxx8664.h
r13627 r13638 30 30 #include "lisptypes.h" 31 31 #include "x86-constants64.h" 32 33 /* xp accessors */ 34 #define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext.gregs))) 35 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 36 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 37 #define xpPC(x) (xpGPR(x,Iip)) 38 #define xpMMXreg(x,n) *((natural *)(&((x)->uc_mcontext.fpregs->_st[n]))) 39 #define eflags_register(xp) xpGPR(xp,Iflags) 40 #define SIGNUM_FOR_INTN_TRAP SIGSEGV 41 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2)) 42 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe) 43 #define SIGRETURN(context) 44 45 #include "os-linux.h" -
trunk/source/lisp-kernel/platform-solarisx64.h
r13627 r13638 30 30 #include "lisptypes.h" 31 31 #include "x86-constants64.h" 32 33 #define xpGPRvector(x) ((x)->uc_mcontext.gregs) 34 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 35 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 36 #define xpPC(x) xpGPR(x,Iip) 37 #define eflags_register(xp) xpGPR(xp,Iflags) 38 #define xpXMMregs(x)(&((x)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[0])) 39 #define SIGNUM_FOR_INTN_TRAP SIGSEGV 40 #ifdef X8664 41 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2)) 42 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe) 43 #else 44 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,TRAPNO)==0xd)&&((xpGPR(xp,ERR)&7)==2)) 45 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,TRAPNO)==0xe) 46 #endif 47 #define SIGRETURN(context) setcontext(context) 48 49 #include "os-solaris.h" -
trunk/source/lisp-kernel/platform-solarisx86.h
r13627 r13638 30 30 #include "lisptypes.h" 31 31 #include "x86-constants32.h" 32 33 #define xpGPRvector(x) ((x)->uc_mcontext.gregs) 34 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 35 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new) 36 #define xpPC(x) xpGPR(x,Iip) 37 #define eflags_register(xp) xpGPR(xp,Iflags) 38 #define xpXMMregs(x)(&((x)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[0])) 39 #define xpMMXreg(x,n)*(natural *)(&(((struct fnsave_state *)(&(((x)->uc_mcontext.fpregs))))->f_st[n])) 40 #define SIGNUM_FOR_INTN_TRAP SIGSEGV 41 #ifdef X8664 42 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2)) 43 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe) 44 #else 45 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,TRAPNO)==0xd)&&((xpGPR(xp,ERR)&7)==2)) 46 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,TRAPNO)==0xe) 47 #endif 48 #define SIGRETURN(context) setcontext(context) 49 50 #include "os-solaris.h" -
trunk/source/lisp-kernel/platform-win32.h
r13627 r13638 32 32 #include "lisptypes.h" 33 33 #include "x86-constants32.h" 34 35 #define xpGPRvector(x) ((DWORD *)(&(x)->Edi)) 36 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 37 #define xpPC(x) xpGPR(x,Iip) 38 #define eflags_register(xp) xp->EFlags 39 #define xpFPRvector(x) ((natural *)(&(x->ExtendedRegisters[10*16]))) 40 #define xpMMXreg(x,n) (*((u64_t *)(&(x->FloatSave.RegisterArea[10*(n)])))) 41 #define xpMXCSRptr(x) (DWORD *)(&(x->ExtendedRegisters[24])) 42 43 #ifdef SOLARIS 44 #define SIGNUM_FOR_INTN_TRAP SIGSEGV 45 #ifdef X8664 46 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2)) 47 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe) 48 #else 49 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,TRAPNO)==0xd)&&((xpGPR(xp,ERR)&7)==2)) 50 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,TRAPNO)==0xe) 51 #endif 52 #define SIGRETURN(context) setcontext(context) 53 #endif 54 55 #include "os-windows.h" -
trunk/source/lisp-kernel/platform-win64.h
r13627 r13638 33 33 #include "lisptypes.h" 34 34 #include "x86-constants64.h" 35 36 #define xpGPRvector(x) ((DWORD64 *)(&(x)->Rax)) 37 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno]) 38 #define xpPC(x) xpGPR(x,Iip) 39 #define eflags_register(xp) xp->EFlags 40 #define xpMXCSRptr(x) (DWORD *)(&(x->MxCsr)) 41 42 #ifdef SOLARIS 43 #define SIGNUM_FOR_INTN_TRAP SIGSEGV 44 #ifdef X8664 45 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2)) 46 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe) 47 #else 48 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,TRAPNO)==0xd)&&((xpGPR(xp,ERR)&7)==2)) 49 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,TRAPNO)==0xe) 50 #endif 51 #define SIGRETURN(context) setcontext(context) 52 #endif 53 54 #include "os-windows.h" -
trunk/source/lisp-kernel/solarisx64/Makefile
r13605 r13638 60 60 CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ 61 61 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 62 Threads.h x86-constants64.h x86-exceptions.h lisptypes.h $(PLATFORM_H) 62 Threads.h x86-constants64.h x86-exceptions.h lisptypes.h \ 63 $(PLATFORM_H) constants.h os-solaris.h 63 64 64 65 -
trunk/source/lisp-kernel/solarisx86/Makefile
r13605 r13638 59 59 CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \ 60 60 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 61 Threads.h x86-constants32.h x86-exceptions.h lisptypes.h $(PLATFORM_H) 61 Threads.h x86-constants32.h x86-exceptions.h lisptypes.h \ 62 $(PLATFORM_H) constants.h os-solaris.h 62 63 63 64 -
trunk/source/lisp-kernel/win32/Makefile
r13609 r13638 75 75 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 76 76 Threads.h x86-constants32.h x86-exceptions.h lisptypes.h \ 77 $(PLATFORM_H) 77 $(PLATFORM_H) constsnts.h os-windows.h 78 78 79 79 -
trunk/source/lisp-kernel/win64/Makefile
r13612 r13638 74 74 lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \ 75 75 Threads.h x86-constants64.h x86-exceptions.h lisptypes.h \ 76 $(PLATFORM_H) 76 $(PLATFORM_H) constants.h os-windows.h 77 77 78 78 -
trunk/source/lisp-kernel/x86-exceptions.h
r13206 r13638 19 19 20 20 typedef u8_t opcode, *pc; 21 22 #ifdef LINUX23 #define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext.gregs)))24 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno])25 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)26 #define xpPC(x) (xpGPR(x,Iip))27 #define xpMMXreg(x,n) *((natural *)(&((x)->uc_mcontext.fpregs->_st[n])))28 #define eflags_register(xp) xpGPR(xp,Iflags)29 #endif30 31 #ifdef DARWIN32 #define DARWIN_USE_PSEUDO_SIGRETURN 133 #include <sys/syscall.h>34 #define DarwinSigReturn(context) do {\35 darwin_sigreturn(context);\36 Bug(context,"sigreturn returned");\37 } while (0)38 39 #define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__ss)))40 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno])41 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)42 #define xpPC(x) (xpGPR(x,Iip))43 #define eflags_register(xp) xpGPR(xp,Iflags)44 #define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__fs.__fpu_xmm0)))45 #define xpMMXvector(x) (&(UC_MCONTEXT(x)->__fs.__fpu_stmm0))46 /* Note that this yields only the lower half of the MMX reg on x8632 */47 #define xpMMXreg(x,n) *(natural *)&(xpMMXvector(x)[n])48 49 #include <mach/mach.h>50 #include <mach/mach_error.h>51 #include <mach/machine/thread_state.h>52 #include <mach/machine/thread_status.h>53 54 pthread_mutex_t *mach_exception_lock;55 56 #endif57 58 #ifdef FREEBSD59 #ifdef X866460 #include <machine/fpu.h>61 #else62 #include "freebsdx8632/fpu.h"63 #endif64 #define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext)))65 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno])66 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)67 #define eflags_register(xp) xpGPR(xp,Iflags)68 #define xpPC(x) xpGPR(x,Iip)69 #ifdef X866470 #define xpMMXreg(x,n) *((natural *)(&(((struct savefpu *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n])))71 #define xpXMMregs(x)(&(((struct savefpu *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0]))72 #else73 #define xpMMXreg(x,n) *((natural *)(&(((struct ccl_savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n])))74 #define xpXMMregs(x)(&(((struct ccl_savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0]))75 #endif76 #endif77 78 #ifdef SOLARIS79 #define xpGPRvector(x) ((x)->uc_mcontext.gregs)80 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno])81 #define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)82 #define xpPC(x) xpGPR(x,Iip)83 #define eflags_register(xp) xpGPR(xp,Iflags)84 #define xpXMMregs(x)(&((x)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[0]))85 #ifdef X863286 #define xpMMXreg(x,n)*(natural *)(&(((struct fnsave_state *)(&(((x)->uc_mcontext.fpregs))))->f_st[n]))87 #endif88 #endif89 90 #ifdef WINDOWS91 #ifdef X866492 #define xpGPRvector(x) ((DWORD64 *)(&(x)->Rax))93 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno])94 #define xpPC(x) xpGPR(x,Iip)95 #define eflags_register(xp) xp->EFlags96 #define xpMXCSRptr(x) (DWORD *)(&(x->MxCsr))97 #else98 #define xpGPRvector(x) ((DWORD *)(&(x)->Edi))99 #define xpGPR(x,gprno) (xpGPRvector(x)[gprno])100 #define xpPC(x) xpGPR(x,Iip)101 #define eflags_register(xp) xp->EFlags102 #define xpFPRvector(x) ((natural *)(&(x->ExtendedRegisters[10*16])))103 #define xpMMXreg(x,n) (*((u64_t *)(&(x->FloatSave.RegisterArea[10*(n)]))))104 #define xpMXCSRptr(x) (DWORD *)(&(x->ExtendedRegisters[24]))105 #endif106 #endif107 108 #ifdef DARWIN109 #define SIGNAL_FOR_PROCESS_INTERRUPT SIGUSR1110 #endif111 #ifdef LINUX112 #define SIGNAL_FOR_PROCESS_INTERRUPT SIGPWR113 #endif114 #ifdef FREEBSD115 #define SIGNAL_FOR_PROCESS_INTERRUPT SIGEMT116 #endif117 #ifdef SOLARIS118 #define SIGNAL_FOR_PROCESS_INTERRUPT SIGUSR1119 #endif120 #ifdef WINDOWS121 #define SIGNAL_FOR_PROCESS_INTERRUPT SIGINT122 #ifndef SIGBUS123 #define SIGBUS 10124 #endif125 #ifndef CONTEXT_ALL126 #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS)127 #endif128 #endif129 130 131 21 132 22 void switch_to_foreign_stack(void*, ...); … … 170 60 } alloc_instruction_id; 171 61 172 #ifdef LINUX173 #define SIGNUM_FOR_INTN_TRAP SIGSEGV174 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2))175 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe)176 #define SIGRETURN(context)177 #endif178 62 179 #ifdef FREEBSD180 extern void freebsd_sigreturn(ExceptionInformation *);181 #define SIGNUM_FOR_INTN_TRAP SIGBUS182 #define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2))183 #define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno == T_PAGEFLT)184 #define SIGRETURN(context) freebsd_sigreturn(context)185 #endif186 63 187 #ifdef DARWIN188 #define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Not really, but our Mach handler fakes that */189 #define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->__es.__trapno == 0xd) && (((UC_MCONTEXT(xp)->__es.__err)&7)==2))190 #define IS_PAGE_FAULT(info,xp) (UC_MCONTEXT(xp)->__es.__trapno == 0xe)191 /* The x86 version of sigreturn just needs the context argument; the192 hidden, magic "flavor" argument that sigtramp uses is ignored. */193 #define SIGRETURN(context) DarwinSigReturn(context)194 #endif195 64 196 #ifdef SOLARIS197 #define SIGNUM_FOR_INTN_TRAP SIGSEGV198 #ifdef X8664199 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2))200 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)==0xe)201 #else202 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,TRAPNO)==0xd)&&((xpGPR(xp,ERR)&7)==2))203 #define IS_PAGE_FAULT(info,xp) (xpGPR(xp,TRAPNO)==0xe)204 #endif205 #define SIGRETURN(context) setcontext(context)206 #endif207 208 #ifdef WINDOWS209 #define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Also fake */210 #define IS_MAYBE_INT_TRAP(info,xp) \211 ((info->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) && \212 (info->ExceptionInformation[0]==0) && \213 (info->ExceptionInformation[1]==(ULONG_PTR)(-1L)))214 #define IS_PAGE_FAULT(info,xp) (1)215 #define SIGRETURN(context) /* for now */216 #endif217 65 218 66 /* Please go away. */ … … 250 98 extern void set_mxcsr(natural); 251 99 252 #ifdef WINDOWS253 typedef struct {254 HANDLE h;255 OVERLAPPED *o;256 } pending_io;257 #endif258 259 100 #ifdef X8632 260 101 /* The 32-bit immediate value in the instruction
Note: See TracChangeset
for help on using the changeset viewer.