CVS: sml-dist/src/runtime/mach-dep signal-sysdep.h,1.12,1.13

John Reppy <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/runtime/mach-dep
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv620/src/runtime/mach-dep

Modified Files:
	signal-sysdep.h 
Log Message:
  NetBSD patches for version 3.x (provided by Cary Gray)


Index: signal-sysdep.h
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/runtime/mach-dep/signal-sysdep.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** signal-sysdep.h	6 Feb 2006 22:04:00 -0000	1.12
--- signal-sysdep.h	10 Feb 2006 22:14:58 -0000	1.13
***************
*** 463,485 ****
       typedef void SigReturn_t;
  
! #  elif defined(OPSYS_NETBSD)
!     /** x86, NetBSD **/
! /* NetBSD (including versions 1.0 and 1.1) generates SIGBUS rather
!    than SIGFPE for overflows.  The real fix is a trivial change to
!    kernel sources, which has already been reported (NetBSD internal
!    problem identification "port-i386/1833"). 
! 
!    If you want to fix this on your NetBSD system.  Edit machdep.c in
!    directory /sys/arch/i386/i386, and find the line
! 
!         setgate(&idt[  4], &IDTVEC(ofl),     0, SDT_SYS386TGT, SEL_KPL);
! 
!    Change SEL_KPL to SEL_UPL.  With SEL_KPL, the int overflow trap is
!    not accessible at user level, and a protection fault occurs instead
!    (thus the seg fault).  SEL_UPL will allow user processes to generate
!    this trap.
! 
!    For the change to take effect, recompile your kernel, install it
!    and reboot. */
  #    define SIG_FAULT1		SIGFPE
  #    define SIG_FAULT2		SIGBUS
--- 463,468 ----
       typedef void SigReturn_t;
  
! #  elif defined(OPSYS_NETBSD2)
!     /** x86, NetBSD (version 2.x) **/
  #    define SIG_FAULT1		SIGFPE
  #    define SIG_FAULT2		SIGBUS
***************
*** 494,497 ****
--- 477,492 ----
       typedef void SigReturn_t;
  
+ #  elif defined(OPSYS_NETBSD)
+     /** x86, NetBSD (version 3.x) **/
+ #    define SIG_FAULT1		SIGFPE
+ #    define SIG_FAULT2		SIGBUS
+ #    define INT_DIVZERO(s, c)	0
+ #    define INT_OVFLW(s, c)	(((s) == SIGFPE) || ((s) == SIGBUS))
+ 
+ #    define SIG_GetCode(info, scp)	(info)
+ #    define SIG_GetPC(scp)		(_UC_MACHINE_PC(scp))
+ #    define SIG_SetPC(scp, addr)	{ _UC_MACHINE_SET_PC(scp, ((long) (addr))); }
+ #    define SIG_ZeroLimitPtr(scp)	{ ML_X86Frame[LIMITPTR_X86OFFSET] = 0; }
+ 
  #  elif defined(OPSYS_SOLARIS)
       /** x86, Solaris */



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.