Index: m3-libs/m3core/src/C/Common/Csetjmp.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/C/Common/Csetjmp.i3,v retrieving revision 1.3 diff -u -r1.3 Csetjmp.i3 --- m3-libs/m3core/src/C/Common/Csetjmp.i3 4 Jan 2011 12:48:26 -0000 1.3 +++ m3-libs/m3core/src/C/Common/Csetjmp.i3 5 Jan 2011 14:32:05 -0000 @@ -2,24 +2,14 @@ (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) -INTERFACE Csetjmp; +UNSAFE INTERFACE Csetjmp; FROM Ctypes IMPORT int; -(* jmp_buf is number of bytes with 8 byte alignment. - Ideally it is target-dependent and 4, 8, or 16, however 16 cannot be - expressed and 8 is preferred over 4 to remove target-dependence, even - if it is a slight waste on some platforms. - See Jumpbuf_align in m3-sys/m3middle/Target.m3. - This should never be instantiated. To help catch that, we make it large. - 2 * BYTESIZE(INTEGER) would be nice, if we could express that. - Specifically, as far as we know, correctness requires 16 on PA64_HPUX - and SPARC64_LINUX. 4 is adequate for correctness on PPC_LINUX, but - 16 is ideal there (according to comments in setjmp.h). - +(* jmp_buf is allocated with alloca(Csetjmp__Jumpbuf_size) "u" in "ulongjmp" is probably for "underscore". This variant of longjmp never restores the signal mask. *) -TYPE jmp_buf = ARRAY [0..16_FFFFFF] OF LONGREAL; -<*EXTERNAL "_longjmp" *> PROCEDURE ulongjmp (VAR env: jmp_buf; val: int); +<*EXTERNAL "Csetjmp__Jumpbuf_size" *> VAR Jumpbuf_size: INTEGER; +<*EXTERNAL "_longjmp" *> PROCEDURE ulongjmp (env: ADDRESS; val: int); END Csetjmp. 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.2 diff -u -r1.2 Csetjmp.i3 --- m3-libs/m3core/src/C/I386_CYGWIN/Csetjmp.i3 4 Jan 2011 12:48:27 -0000 1.2 +++ m3-libs/m3core/src/C/I386_CYGWIN/Csetjmp.i3 5 Jan 2011 14:32:05 -0000 @@ -2,12 +2,11 @@ (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) -INTERFACE Csetjmp; +UNSAFE INTERFACE Csetjmp; (* 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); +<*EXTERNAL "Csetjmp__Jumpbuf_size" *> VAR Jumpbuf_size: INTEGER; +<*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (env: ADDRESS; 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.2 diff -u -r1.2 Csetjmp.i3 --- m3-libs/m3core/src/C/I386_MINGW/Csetjmp.i3 4 Jan 2011 12:48:28 -0000 1.2 +++ m3-libs/m3core/src/C/I386_MINGW/Csetjmp.i3 5 Jan 2011 14:32:05 -0000 @@ -2,12 +2,11 @@ (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) -INTERFACE Csetjmp; +UNSAFE INTERFACE Csetjmp; (* 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); +<*EXTERNAL "Csetjmp__Jumpbuf_size" *> VAR Jumpbuf_size: INTEGER; +<*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (env: ADDRESS; 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.2 diff -u -r1.2 Csetjmp.i3 --- m3-libs/m3core/src/C/I386_NT/Csetjmp.i3 4 Jan 2011 12:48:29 -0000 1.2 +++ m3-libs/m3core/src/C/I386_NT/Csetjmp.i3 5 Jan 2011 14:32:05 -0000 @@ -2,12 +2,11 @@ (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) -INTERFACE Csetjmp; +UNSAFE INTERFACE Csetjmp; (* 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); +<*EXTERNAL "Csetjmp__Jumpbuf_size" *> VAR Jumpbuf_size: INTEGER; +<*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (env: ADDRESS; 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.10 diff -u -r1.10 Csetjmp.i3 --- m3-libs/m3core/src/C/NT386/Csetjmp.i3 4 Jan 2011 12:48:30 -0000 1.10 +++ m3-libs/m3core/src/C/NT386/Csetjmp.i3 5 Jan 2011 14:32:05 -0000 @@ -2,11 +2,11 @@ (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) -INTERFACE Csetjmp; +UNSAFE INTERFACE Csetjmp; (* 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); +<*EXTERNAL "Csetjmp__Jumpbuf_size" *> VAR Jumpbuf_size: INTEGER; +<*EXTERNAL "longjmp" *> PROCEDURE ulongjmp (env: ADDRESS; val: int); END Csetjmp. Index: m3-libs/m3core/src/runtime/ex_frame/RTExFrame.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/runtime/ex_frame/RTExFrame.m3,v retrieving revision 1.9 diff -u -r1.9 RTExFrame.m3 --- m3-libs/m3core/src/runtime/ex_frame/RTExFrame.m3 31 Dec 2010 15:04:01 -0000 1.9 +++ m3-libs/m3core/src/runtime/ex_frame/RTExFrame.m3 5 Jan 2011 14:32:05 -0000 @@ -35,7 +35,7 @@ class : INTEGER; (* ORD(ScopeKind) *) handles : ExceptionList; (* NIL-terminated list of exceptions handled *) info : RT0.RaiseActivation; (* current exception being dispatched *) - jmpbuf : Csetjmp.jmp_buf; + jmpbuf : ADDRESS; END; TYPE (* FinallyProc *) Index: m3-libs/m3core/src/unix/Common/Uconstants.c =================================================================== RCS file: /usr/cvs/cm3/m3-libs/m3core/src/unix/Common/Uconstants.c,v retrieving revision 1.50 diff -u -r1.50 Uconstants.c --- m3-libs/m3core/src/unix/Common/Uconstants.c 5 Jan 2011 14:21:50 -0000 1.50 +++ m3-libs/m3core/src/unix/Common/Uconstants.c 5 Jan 2011 14:32:05 -0000 @@ -45,6 +45,8 @@ #define X(x) EXTERN_CONST int Uerror__##x = x; #include "UerrorX.h" +EXTERN_CONST INTEGER Csetjmp__Jumpbuf_size = sizeof(jmp_buf); + #ifndef _WIN32 #undef X Index: m3-sys/m3cc/gcc/gcc/m3cg/parse.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc/gcc/m3cg/parse.c,v retrieving revision 1.476 diff -u -r1.476 parse.c --- m3-sys/m3cc/gcc/gcc/m3cg/parse.c 2 Dec 2010 09:19:26 -0000 1.476 +++ m3-sys/m3cc/gcc/gcc/m3cg/parse.c 5 Jan 2011 14:32:07 -0000 @@ -2973,11 +2973,37 @@ EXPR_POP (); } +static tree +m3_convert_function_to_builtin (tree p) +{ + tree *slot = (tree *)htab_find_slot (builtins, p, NO_INSERT); + + if (slot) + { + p = *slot; + } + else + { + const char *name = IDENTIFIER_POINTER (DECL_NAME (p)); + if (name[0] == 'a' || name[0] == '_') + { + if (strcmp(name, "alloca") == 0 + || strcmp(name, "_alloca") == 0 + || strcmp(name, "__builtin_alloca") == 0) + { + p = built_in_decls[BUILT_IN_ALLOCA]; + } + } + } + return p; +} + #if GCC42 static void m3_call_direct (tree p, tree return_type) { + p = m3_convert_function_to_builtin (p); tree call = m3_build3 (CALL_EXPR, return_type, proc_addr (p), CALL_TOP_ARG (), CALL_TOP_STATIC_CHAIN ()); if (return_type == t_void) @@ -3087,10 +3113,7 @@ static void m3_call_direct (tree p, tree return_type) { - tree *slot = (tree *)htab_find_slot (builtins, p, NO_INSERT); - - if (slot) - p = *slot; + p = m3_convert_function_to_builtin (p); if (TREE_USED (p) == false) { TREE_USED (p) = true; Index: m3-sys/m3front/src/misc/Marker.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3front/src/misc/Marker.m3,v retrieving revision 1.6 diff -u -r1.6 Marker.m3 --- m3-sys/m3front/src/misc/Marker.m3 5 Jan 2011 14:25:37 -0000 1.6 +++ m3-sys/m3front/src/misc/Marker.m3 5 Jan 2011 14:32:10 -0000 @@ -54,6 +54,8 @@ n_frames : INTEGER := 0; save_depth : INTEGER := 0; setjmp : CG.Proc := NIL; + alloca : CG.Proc := NIL; + Jumpbuf_size : CG.Var := NIL; tos : INTEGER := 0; stack : ARRAY [0..50] OF Frame; @@ -232,19 +234,47 @@ PROCEDURE CaptureState (frame: CG.Var; handler: CG.Label) = VAR new: BOOLEAN; BEGIN + (* int setjmp(void* ); *) IF (setjmp = NIL) THEN setjmp := CG.Import_procedure (M3ID.Add (Target.Setjmp), 1, Target.Integer.cg_type, Target.DefaultCall, new); IF (new) THEN - EVAL CG.Declare_param (M3ID.Add ("jmpbuf"), Target.Jumpbuf_size, - Target.Address.align, CG.Type.Struct, 0, - in_memory := TRUE,up_level := FALSE, + EVAL CG.Declare_param (M3ID.Add ("jmpbuf"), Target.Address.size, + Target.Address.align, CG.Type.Addr, 0, + in_memory := FALSE, up_level := FALSE, f := CG.Never); END; END; + (* void* _alloca(size_t); *) + IF (alloca = NIL) THEN + alloca := CG.Import_procedure (M3ID.Add ("_alloca"), 1, CG.Type.Addr, + Target.DefaultCall, new); + IF (new) THEN + EVAL CG.Declare_param (M3ID.NoID, Target.Word.size, Target.Word.align, + Target.Word.cg_type, 0, in_memory := FALSE, + up_level := FALSE, f := CG.Never); + END; + END; + (* extern /*const*/ size_t Csetjmp__Jumpbuf_size/* = sizeof(jmp_buf)*/; *) + IF (Jumpbuf_size = NIL) THEN + Jumpbuf_size := CG.Import_global (M3ID.Add ("Csetjmp__Jumpbuf_size"), + Target.Word.size, Target.Word.align, + Target.Word.cg_type, 0); + END; + + (* frame.jmpbuf = alloca(Csetjmp__Jumpbuf_size); *) + CG.Start_call_direct (alloca, 0, Target.Address.cg_type); + CG.Load_int (Target.Word.cg_type, Jumpbuf_size); + CG.Pop_param (Target.Word.cg_type); + CG.Call_direct (alloca, Target.Address.cg_type); + CG.Store (frame, M3RT.EF1_jmpbuf, Target.Address.size, Target.Address.align, + Target.Address.cg_type); + + (* setmp(frame.jmpbuf) *) CG.Start_call_direct (setjmp, 0, Target.Integer.cg_type); - CG.Load_addr_of (frame, M3RT.EF1_jmpbuf, Target.Jumpbuf_align); + CG.Load (frame, M3RT.EF1_jmpbuf, Target.Address.size, Target.Address.align, + Target.Address.cg_type); CG.Pop_param (CG.Type.Addr); CG.Call_direct (setjmp, Target.Integer.cg_type); CG.If_true (handler, CG.Never); @@ -773,6 +803,8 @@ n_frames := 0; save_depth := 0; setjmp := NIL; + alloca := NIL; + Jumpbuf_size := NIL; tos := 0; END Reset; Index: m3-sys/m3front/src/stmts/TryFinStmt.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3front/src/stmts/TryFinStmt.m3,v retrieving revision 1.5 diff -u -r1.5 TryFinStmt.m3 --- m3-sys/m3front/src/stmts/TryFinStmt.m3 4 May 2008 11:03:48 -0000 1.5 +++ m3-sys/m3front/src/stmts/TryFinStmt.m3 5 Jan 2011 14:32:10 -0000 @@ -293,7 +293,7 @@ <* ASSERT NOT p.viaProc *> (* declare and initialize the info record *) - frame := CG.Declare_local (M3ID.NoID, M3RT.EF1_SIZE, M3RT.EF1_ALIGN, + frame := CG.Declare_local (M3ID.NoID, M3RT.EF1_SIZE, Target.Address.align, CG.Type.Struct, 0, in_memory := TRUE, up_level := FALSE, f := CG.Never); CG.Load_nil (); Index: m3-sys/m3front/src/stmts/TryStmt.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3front/src/stmts/TryStmt.m3,v retrieving revision 1.2 diff -u -r1.2 TryStmt.m3 --- m3-sys/m3front/src/stmts/TryStmt.m3 4 May 2008 11:03:48 -0000 1.2 +++ m3-sys/m3front/src/stmts/TryStmt.m3 5 Jan 2011 14:32:10 -0000 @@ -401,7 +401,7 @@ CG.Set_label (l, barrier := TRUE); (* declare and initialize the info record *) - frame := CG.Declare_local (M3ID.NoID, M3RT.EF1_SIZE, M3RT.EF1_ALIGN, + frame := CG.Declare_local (M3ID.NoID, M3RT.EF1_SIZE, Target.Address.align, CG.Type.Struct, 0, in_memory := TRUE, up_level := FALSE, f := CG.Never); Index: m3-sys/m3middle/src/M3RT.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3RT.i3,v retrieving revision 1.4 diff -u -r1.4 M3RT.i3 --- m3-sys/m3middle/src/M3RT.i3 8 Apr 2009 04:11:45 -0000 1.4 +++ m3-sys/m3middle/src/M3RT.i3 5 Jan 2011 14:32:10 -0000 @@ -79,7 +79,6 @@ EF1_info : CARDINAL; (* : RTException.Activation *) EF1_jmpbuf : CARDINAL; (* : jmp_buf *) EF1_SIZE : CARDINAL; - EF1_ALIGN : CARDINAL; (* because of the jmp_buf alignment... *) VAR (* FinallyProc frames *) EF2_handler : CARDINAL; (* : ADDRESS (PROC) *) Index: m3-sys/m3middle/src/M3RT.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3RT.m3,v retrieving revision 1.2 diff -u -r1.2 M3RT.m3 --- m3-sys/m3middle/src/M3RT.m3 8 May 2005 23:44:29 -0000 1.2 +++ m3-sys/m3middle/src/M3RT.m3 5 Jan 2011 14:32:10 -0000 @@ -1,8 +1,6 @@ (* Copyright (C) 1993, Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) -(* *) -(* Last modified on Mon Jul 25 09:11:22 PDT 1994 by kalsow *) MODULE M3RT; @@ -57,10 +55,8 @@ (* Except, ExceptElse, and Finally frames *) EF1_handles := EF_SIZE; (* : ADDRESS *) EF1_info := EF1_handles + AP; (* : RTException.Activation *) - EF1_jmpbuf := RoundUp (EF1_info + EA_SIZE, Target.Jumpbuf_align); - (* : jmp_buf *) - EF1_SIZE := EF1_jmpbuf + Target.Jumpbuf_size; - EF1_ALIGN := MAX (Target.Address.align, Target.Jumpbuf_align); + EF1_jmpbuf := EF1_info + EA_SIZE; (* : jmp_buf *) + EF1_SIZE := EF1_jmpbuf + AP; (* FinallyProc frames *) EF2_handler := EF_SIZE; (* : ADDRESS (PROC) *) @@ -94,6 +90,7 @@ TC_next := TC_name + AP; (* : ADDRESS *) TC_SIZE := TC_next + AP; TC_ALIGN := MAX (Target.Address.align, Target.Integer.align); + <* ASSERT Target.Address.align = Target.Integer.align *> OTC_parentID := TC_SIZE; (* : INTEGER *) OTC_linkProc := OTC_parentID + IP; (* : PROC() *) Index: m3-sys/m3middle/src/Target.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/Target.i3,v retrieving revision 1.66 diff -u -r1.66 Target.i3 --- m3-sys/m3middle/src/Target.i3 19 Dec 2010 14:59:09 -0000 1.66 +++ m3-sys/m3middle/src/Target.i3 5 Jan 2011 14:32:11 -0000 @@ -364,10 +364,6 @@ will cause an address faults. Hence, no explicit NIL checks are needed for dereferencing with offsets in this range. *) - (* Thread stacks *) - Jumpbuf_size : CARDINAL; (* size of a "jmp_buf" *) - Jumpbuf_align : CARDINAL; (* alignment of a "jmp_buf" *) - (* floating point values *) All_floats_legal : BOOLEAN; (* If all bit patterns are "legal" floating point values (i.e. they can Index: m3-sys/m3middle/src/Target.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/Target.m3,v retrieving revision 1.117 diff -u -r1.117 Target.m3 --- m3-sys/m3middle/src/Target.m3 4 Jan 2011 13:04:53 -0000 1.117 +++ m3-sys/m3middle/src/Target.m3 5 Jan 2011 14:32:11 -0000 @@ -19,7 +19,6 @@ Word := Word64; Address := Word64; Address.cg_type := CGType.Addr; - (* Jumpbuf_align := 2 * Address.align; *) END Init64; PROCEDURE IsX86(): BOOLEAN = @@ -52,9 +51,8 @@ PROCEDURE Init (system: TEXT; in_OS_name: TEXT; backend_mode: M3BackendMode_t): BOOLEAN = CONST FF = 16_FF; VAR sys := 0; max_align := 64; - calling_conventions := FALSE; BEGIN - (* lookup the system *) + (* lookup the system -- linear search *) IF (system = NIL) THEN RETURN FALSE END; WHILE NOT Text.Equal (system, SystemNames[sys]) DO INC (sys); IF (sys >= NUMBER (SystemNames)) THEN RETURN FALSE END; @@ -161,20 +159,6 @@ 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 inefficient 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 @@ -283,130 +267,22 @@ Aligned_procedures := TRUE; (* Assume aligned => unaligned is ok. *) END; - CASE System OF - - | Systems.ALPHA_LINUX => Jumpbuf_size := 34 * Address.size; - | Systems.ALPHA_OPENBSD => Jumpbuf_size := 81 * Address.size; - | Systems.ALPHA_OSF => Jumpbuf_size := 84 * Address.size; - - | Systems.I386_FREEBSD, Systems.FreeBSD4 => - Jumpbuf_size := 11 * Address.size; - - | Systems.AMD64_NETBSD, - Systems.AMD64_OPENBSD, - Systems.AMD64_FREEBSD => - Jumpbuf_size := 12 * Address.size; - - | Systems.ARMEL_LINUX => - Jumpbuf_size := 32 * Int64.size; - - | Systems.PA32_HPUX => - Structure_size_boundary := 16; - (* 200 bytes with 8 byte alignment *) - Jumpbuf_size := 50 * Address.size; - - | Systems.PA64_HPUX => - Structure_size_boundary := 16; - (* 640 bytes with 16 byte alignment *) - Jumpbuf_size := 80 * Address.size; - - | Systems.MIPS64_OPENBSD, - Systems.MIPS64EL_OPENBSD => - Jumpbuf_size := 16_53 * Address.size; - - | Systems.I386_INTERIX => - - (* Visual C++'s 16 plus 2 ints: is sigmask saved, its value. *) - - Jumpbuf_size := 18 * Address.size; - calling_conventions := TRUE; - - | Systems.NT386, Systems.I386_NT, Systems.I386_CYGWIN, Systems.I386_MINGW => - - (* Cygwin: 13, Visual C++: 16, Interix: 18. - Use 18 for interop. - Cygwin's setjmp.h is wrong by a factor of 4. - Cygwin provides setjmp and _setjmp that resolve the same. - Visual C++ provides only _setjmp. - Visual C++ also has _setjmp3 that the compiler generates - a call to. In fact _setjmp appears to only use 8 ints - and _setjmp3 appears to use more. Consider using _setjmp3. - *) - Jumpbuf_size := (18 * Address.size); - calling_conventions := TRUE; - - | Systems.SPARC32_SOLARIS, Systems.SOLgnu, Systems.SOLsun => - (* 48 bytes with 4 byte alignment *) - Jumpbuf_size := 12 * Address.size; - - | Systems.SPARC32_LINUX => - Jumpbuf_size := 16_90 * Char.size; - - | Systems.SPARC64_OPENBSD => - Jumpbuf_size := 14 * Address.size; - - | Systems.SPARC64_LINUX => - Jumpbuf_size := 16_280 * Char.size; - - | Systems.SPARC64_SOLARIS => - (* 96 bytes with 8 byte alignment *) - Jumpbuf_size := 12 * Address.size; - - | Systems.I386_SOLARIS => - (* 40 bytes with 4 byte alignment *) - Jumpbuf_size := 10 * Address.size; - - | Systems.AMD64_SOLARIS => - (* 64 bytes with 8 byte alignment *) - Jumpbuf_size := 8 * Address.size; - - | Systems.I386_LINUX, Systems.LINUXLIBC6 => - Jumpbuf_size := 39 * Address.size; - - | Systems.AMD64_LINUX => - Jumpbuf_size := 25 * Address.size; - - | Systems.I386_DARWIN => - Jumpbuf_size := 18 * Address.size; - - | Systems.AMD64_DARWIN => - Jumpbuf_size := ((9 * 2) + 3 + 16) * Int32.size; - - | Systems.ARM_DARWIN => - Jumpbuf_size := 28 * Address.size; - - | Systems.PPC_DARWIN => - Jumpbuf_size := 768 * Word8.size; - (* Allow_packed_byte_aligned := TRUE; use <*LAZYALIGN*>*) - - | Systems.PPC64_DARWIN => - Jumpbuf_size := 872 * Word8.size; - - | Systems.PPC_LINUX => - Jumpbuf_size := 74 * Int64.size; - (* ideal alignment is 16 bytes, but 4 is ok *) - - | Systems.PPC32_OPENBSD => - Jumpbuf_size := 100 * Address.size; - - | Systems.I386_NETBSD => - Jumpbuf_size := 14 * Address.size; (* 13? *) - - | Systems.ALPHA32_VMS, - Systems.ALPHA64_VMS => - Jumpbuf_size := 68 * Word64.size; - Setjmp := "decc$setjmp"; - -(* | Systems.I386_MSDOS => - Jumpbuf_size := 172 * Char.size; TBD *) - - | Systems.I386_OPENBSD => - Jumpbuf_size := 10 * Address.size; - - ELSE RETURN FALSE; + IF System IN SET OF Systems{Systems.ALPHA32_VMS, + Systems.ALPHA64_VMS} THEN + Setjmp := "decc$setjmp"; END; - InitCallingConventions (backend_mode, calling_conventions); + IF System IN SET OF Systems{Systems.PA32_HPUX, + Systems.PA64_HPUX} THEN + Structure_size_boundary := 16; + END; + + InitCallingConventions (backend_mode, + System IN SET OF Systems{Systems.I386_INTERIX, + Systems.NT386, + Systems.I386_NT, + Systems.I386_CYGWIN, + Systems.I386_MINGW}); (* fill in the "bytes" and "pack" fields *) FixI (Address, max_align);