? m3-sys/m3middle/1.txt ? m3-sys/m3middle/ALPHA_OPENBSD ? m3-sys/m3middle/PPC64_DARWIN ? m3-sys/m3middle/SPARC32_SOLARIS ? m3-sys/m3middle/src/1.txt ? m3-libs/m3core/1 ? m3-libs/m3core/1.txt ? m3-libs/m3core/2.txt ? m3-libs/m3core/3.txt ? m3-libs/m3core/SPARC32_SOLARIS ? m3-libs/m3core/src/C/1.txt ? m3-libs/m3core/src/runtime/1.txt ? m3-libs/m3core/src/runtime/NT386/RTMachine.i3 Index: m3-sys/m3middle/src/Target.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/Target.m3,v retrieving revision 1.115 diff -u -r1.115 Target.m3 --- m3-sys/m3middle/src/Target.m3 19 Dec 2010 14:59:10 -0000 1.115 +++ m3-sys/m3middle/src/Target.m3 4 Jan 2011 12:47:33 -0000 @@ -19,7 +19,7 @@ Word := Word64; Address := Word64; Address.cg_type := CGType.Addr; - Jumpbuf_align := Address.align; + (* Jumpbuf_align := 2 * Address.align; *) END Init64; PROCEDURE IsX86(): BOOLEAN = @@ -155,13 +155,26 @@ (* this is overly optimistic... *) Allow_packed_byte_aligned := FALSE; - Jumpbuf_align := Address.align; All_floats_legal := TRUE; PCC_bitfield_type_matters := TRUE; Structure_size_boundary := 8; Little_endian := TRUE; Setjmp := "_setjmp"; + (* Jumpbuf_align should be 128 on PPC_LINUX, PA64_HPUX, SPARC64_LINUX, + but we don't have a way to express that in Csetjmp.i3. + On PPC_LINUX the setjmp.h comments say 32 is all that is needed, + but that 128 is ideal. PA64_HPUX, SPARC64_LINUX might be plain wrong. + On many platforms 32 is sufficient, and this might waste a word in the + stack frame, but it is useful to have the same value across many + platforms, and this is an efficient area anyway. Hopefully we'll + get stack walkers for many platforms before long. + If possible, it would be nice to set this to 2 * Address.size. + i.e. if the compiler would inject Csetjmp.jmp_buf instead of + it being delclared in Csetjmp.i3. + *) + Jumpbuf_align := 2 * Address.align; + (* There is no portable stack walker, and therefore few systems have one. Having a stack walker theoretically speeds up everything nicely. If you are familiar with NT exception handling, all but x86 have a stack @@ -286,19 +299,16 @@ | Systems.ARMEL_LINUX => Jumpbuf_size := 32 * Int64.size; - Jumpbuf_align := 64; | Systems.PA32_HPUX => Structure_size_boundary := 16; (* 200 bytes with 8 byte alignment *) Jumpbuf_size := 50 * Address.size; - Jumpbuf_align := 64; | Systems.PA64_HPUX => Structure_size_boundary := 16; (* 640 bytes with 16 byte alignment *) Jumpbuf_size := 80 * Address.size; - Jumpbuf_align := 128; | Systems.MIPS64_OPENBSD, Systems.MIPS64EL_OPENBSD => @@ -328,7 +338,6 @@ | Systems.SPARC32_SOLARIS, Systems.SOLgnu, Systems.SOLsun => (* 48 bytes with 4 byte alignment *) Jumpbuf_size := 12 * Address.size; - Jumpbuf_align := Address.size; | Systems.SPARC32_LINUX => Jumpbuf_size := 16_90 * Char.size; @@ -338,22 +347,18 @@ | Systems.SPARC64_LINUX => Jumpbuf_size := 16_280 * Char.size; - Jumpbuf_align := 16 * Char.size; | Systems.SPARC64_SOLARIS => (* 96 bytes with 8 byte alignment *) Jumpbuf_size := 12 * Address.size; - Jumpbuf_align := Address.size; | Systems.I386_SOLARIS => (* 40 bytes with 4 byte alignment *) Jumpbuf_size := 10 * Address.size; - Jumpbuf_align := Address.size; | Systems.AMD64_SOLARIS => (* 64 bytes with 8 byte alignment *) Jumpbuf_size := 8 * Address.size; - Jumpbuf_align := Address.size; | Systems.I386_LINUX, Systems.LINUXLIBC6 => Jumpbuf_size := 39 * Address.size; @@ -372,21 +377,17 @@ | Systems.PPC_DARWIN => Jumpbuf_size := 768 * Word8.size; - Jumpbuf_align := Word32.size; (* Allow_packed_byte_aligned := TRUE; use <*LAZYALIGN*>*) | Systems.PPC64_DARWIN => Jumpbuf_size := 872 * Word8.size; - Jumpbuf_align := Word32.size; | Systems.PPC_LINUX => Jumpbuf_size := 74 * Int64.size; (* ideal alignment is 16 bytes, but 4 is ok *) - Jumpbuf_align := 128; | Systems.PPC32_OPENBSD => Jumpbuf_size := 100 * Address.size; - Jumpbuf_align := Word64.align; | Systems.I386_NETBSD => Jumpbuf_size := 14 * Address.size; (* 13? *) @@ -394,7 +395,6 @@ | Systems.ALPHA32_VMS, Systems.ALPHA64_VMS => Jumpbuf_size := 68 * Word64.size; - Jumpbuf_align := Word64.align; Setjmp := "decc$setjmp"; (* | Systems.I386_MSDOS => @@ -479,6 +479,7 @@ PROCEDURE FixI (VAR i: Int_type; max_align: INTEGER) = VAR success := TRUE; BEGIN + <* ASSERT i.align = MIN (i.align, max_align) *> i.align := MIN (i.align, max_align); i.bytes := i.size DIV Byte; i.pack := (i.size + i.align - 1) DIV i.align * i.align; Index: m3-libs/m3core/src/C/m3makefile =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/m3makefile,v retrieving revision 1.8 diff -u -r1.8 m3makefile --- m3-libs/m3core/src/C/m3makefile 21 May 2010 13:02:12 -0000 1.8 +++ m3-libs/m3core/src/C/m3makefile 4 Jan 2011 12:47:33 -0000 @@ -8,7 +8,15 @@ % modified on Wed May 5 11:53:58 PDT 1993 by mjordan include_dir ("Common") -include_dir (TARGET) + +proc FileExists(a) is + return not stale (a, a) +end + +if FileExists(path() & "/" & TARGET & "/m3makefile") + include_dir (TARGET) +end + if equal(OS_TYPE, "WIN32") include_dir("32BITS") % long is 32bits even on 64bit Windows else Index: m3-libs/m3core/src/C/Common/m3makefile =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/Common/m3makefile,v retrieving revision 1.26 diff -u -r1.26 m3makefile --- m3-libs/m3core/src/C/Common/m3makefile 26 Nov 2009 04:28:17 -0000 1.26 +++ m3-libs/m3core/src/C/Common/m3makefile 4 Jan 2011 12:47:33 -0000 @@ -2,10 +2,6 @@ % All rights reserved. % See the file COPYRIGHT for a full description. -% Last modified on Wed Jun 9 17:25:14 PDT 1993 by harrison -% modified on Fri May 7 21:06:11 PDT 1993 by mjordan -% modified on Thu May 6 12:10:31 PDT 1993 by muller - Interface ("Cerrno") Interface ("Cstddef") Interface ("Cstdint") @@ -22,3 +18,8 @@ Interface ("Csignal") % not used by all ports c_source("CsignalC") + +if not FileExists(path() & "/../" & TARGET & "/Csetjmp.i3") + or not FileExists(path() & "/../" & TARGET & "/m3makefile") + interface ("Csetjmp") +end Index: m3-libs/m3core/src/C/I386_CYGWIN/Csetjmp.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/I386_CYGWIN/Csetjmp.i3,v retrieving revision 1.1 diff -u -r1.1 Csetjmp.i3 --- m3-libs/m3core/src/C/I386_CYGWIN/Csetjmp.i3 17 Apr 2010 11:03:52 -0000 1.1 +++ m3-libs/m3core/src/C/I386_CYGWIN/Csetjmp.i3 4 Jan 2011 12:47:33 -0000 @@ -4,10 +4,10 @@ INTERFACE Csetjmp; -FROM Ctypes IMPORT int; - -TYPE jmp_buf = ARRAY [0..15] OF INTEGER; +(* See Common/Csetjmp.i3 for comments. *) +FROM Ctypes IMPORT int; +TYPE jmp_buf = ARRAY [0..16_FFFFFF] OF LONGREAL; <*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (VAR env: jmp_buf; val: int); END Csetjmp. Index: m3-libs/m3core/src/C/I386_MINGW/Csetjmp.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/I386_MINGW/Csetjmp.i3,v retrieving revision 1.1 diff -u -r1.1 Csetjmp.i3 --- m3-libs/m3core/src/C/I386_MINGW/Csetjmp.i3 17 Apr 2010 11:03:55 -0000 1.1 +++ m3-libs/m3core/src/C/I386_MINGW/Csetjmp.i3 4 Jan 2011 12:47:33 -0000 @@ -4,10 +4,10 @@ INTERFACE Csetjmp; -FROM Ctypes IMPORT int; - -TYPE jmp_buf = ARRAY [0..15] OF INTEGER; +(* See Common/Csetjmp.i3 for comments. *) +FROM Ctypes IMPORT int; +TYPE jmp_buf = ARRAY [0..16_FFFFFF] OF LONGREAL; <*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (VAR env: jmp_buf; val: int); END Csetjmp. Index: m3-libs/m3core/src/C/I386_NT/Csetjmp.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/I386_NT/Csetjmp.i3,v retrieving revision 1.1 diff -u -r1.1 Csetjmp.i3 --- m3-libs/m3core/src/C/I386_NT/Csetjmp.i3 17 Apr 2010 11:03:55 -0000 1.1 +++ m3-libs/m3core/src/C/I386_NT/Csetjmp.i3 4 Jan 2011 12:47:33 -0000 @@ -4,10 +4,10 @@ INTERFACE Csetjmp; -FROM Ctypes IMPORT int; - -TYPE jmp_buf = ARRAY [0..15] OF INTEGER; +(* See Common/Csetjmp.i3 for comments. *) +FROM Ctypes IMPORT int; +TYPE jmp_buf = ARRAY [0..16_FFFFFF] OF LONGREAL; <*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (VAR env: jmp_buf; val: int); END Csetjmp. Index: m3-libs/m3core/src/C/NT386/Csetjmp.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/NT386/Csetjmp.i3,v retrieving revision 1.9 diff -u -r1.9 Csetjmp.i3 --- m3-libs/m3core/src/C/NT386/Csetjmp.i3 5 Jan 2010 12:19:39 -0000 1.9 +++ m3-libs/m3core/src/C/NT386/Csetjmp.i3 4 Jan 2011 12:47:33 -0000 @@ -4,10 +4,9 @@ INTERFACE Csetjmp; +(* See Common/Csetjmp.i3 for comments. *) FROM Ctypes IMPORT int; - -TYPE jmp_buf = ARRAY [0..15] OF INTEGER; - +TYPE jmp_buf = ARRAY [0..16_FFFFFF] OF LONGREAL; <*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (VAR env: jmp_buf; val: int); END Csetjmp.