68000: Add the syscalls and libraries
authorAlan Cox <alan@linux.intel.com>
Tue, 11 Oct 2016 11:56:36 +0000 (12:56 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 11 Oct 2016 11:56:36 +0000 (12:56 +0100)
This is sufficient to build the C and supporting libraries plus the syscalls
for 68000. We can't load and run a 68K binary yet but this gets us closer as
we can now begin to build some test binaries.

121 files changed:
Library/Makefile
Library/include/68000/README [new file with mode: 0644]
Library/include/68000/float.h [new file with mode: 0644]
Library/include/68000/iso646.h [new file with mode: 0644]
Library/include/68000/limits.h [new file with mode: 0644]
Library/include/68000/math-68881.h [new file with mode: 0644]
Library/include/68000/stdalign.h [new file with mode: 0644]
Library/include/68000/stdarg.h [new file with mode: 0644]
Library/include/68000/stdatomic.h [new file with mode: 0644]
Library/include/68000/stdbool.h [new file with mode: 0644]
Library/include/68000/stddef.h [new file with mode: 0644]
Library/include/68000/stdfix.h [new file with mode: 0644]
Library/include/68000/stdint-gcc.h [new file with mode: 0644]
Library/include/68000/stdint.h [new file with mode: 0644]
Library/include/68000/stdnoreturn.h [new file with mode: 0644]
Library/include/68000/syslimits.h [new file with mode: 0644]
Library/include/68000/unwind.h [new file with mode: 0644]
Library/include/68000/varargs.h [new file with mode: 0644]
Library/libs/Makefile.68000 [new file with mode: 0644]
Library/libs/fuzix68000/Makefile [new file with mode: 0644]
Library/libs/fuzix68000/syscall__accept.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__exit.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__exit.s [new file with mode: 0644]
Library/libs/fuzix68000/syscall__fork.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__fstat.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__getdirent.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__getfsys.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__getsockaddrs.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__lseek.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys66.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys67.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys68.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys69.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys70.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys71.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys80.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys81.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys82.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys83.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys84.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys85.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys86.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys87.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys88.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__nosys89.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__pause.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__profil.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__recvfrom.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__select.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__sendto.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__shutdown.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__sigdisp.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__stat.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__stime.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__time.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall__uname.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_access.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_acct.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_alarm.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_bind.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_brk.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_chdir.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_chmod.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_chown.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_chroot.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_close.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_connect.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_dup.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_dup2.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_execve.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_fchdir.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_fchmod.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_fchown.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_fcntl.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_flock.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getegid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_geteuid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getgid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getgroups.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getpgrp.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getpid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getppid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getrlimit.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getsid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_getuid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_ioctl.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_kill.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_link.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_listen.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_memalloc.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_memfree.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_mkdir.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_mknod.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_mount.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_nice.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_open.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_pipe.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_read.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_rename.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_rmdir.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_sbrk.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setgid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setgroups.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setpgid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setpgrp.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setrlimit.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setsid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_setuid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_signal.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_socket.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_sync.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_times.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_uadmin.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_umask.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_umount.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_unlink.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_utime.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_waitpid.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_write.S [new file with mode: 0644]
Library/libs/fuzix68000/syscall_yield.S [new file with mode: 0644]
Library/tools/syscall_68000.c [new file with mode: 0644]

index 7f722cd..23cff4e 100644 (file)
@@ -3,6 +3,7 @@
 CFLAGS += -I../Kernel/include
 
 all: tools/syscall tools/binman tools/fcc tools/syscall_6502 \
+     tools/syscall_68000 \
      tools/syscall_6809 tools/syscall-scc6809 tools/binman \
      tools/fcc tools/liberror
 
@@ -19,6 +20,9 @@ tools/syscall-z88dk: tools/syscall-z88dk.c ../Kernel/include/syscall_name.h
 tools/syscall_6502: tools/syscall_6502.c ../Kernel/include/syscall_name.h
        $(CC) $(CFLAGS) -o $@ $<
 
+tools/syscall_68000: tools/syscall_68000.c ../Kernel/include/syscall_name.h
+       $(CC) $(CFLAGS) -o $@ $<
+
 tools/syscall_6809: tools/syscall_6809.c ../Kernel/include/syscall_name.h
        $(CC) $(CFLAGS) -o $@ $<
 
diff --git a/Library/include/68000/README b/Library/include/68000/README
new file mode 100644 (file)
index 0000000..7086a77
--- /dev/null
@@ -0,0 +1,14 @@
+This README file is copied into the directory for GCC-only header files
+when fixincludes is run by the makefile for GCC.
+
+Many of the files in this directory were automatically edited from the
+standard system header files by the fixincludes process.  They are
+system-specific, and will not work on any other kind of system.  They
+are also not part of GCC.  The reason we have to do this is because
+GCC requires ANSI C headers and many vendors supply ANSI-incompatible
+headers.
+
+Because this is an automated process, sometimes headers get "fixed"
+that do not, strictly speaking, need a fix.  As long as nothing is broken
+by the process, it is just an unfortunate collateral inconvenience.
+We would like to rectify it, if it is not "too inconvenient".
diff --git a/Library/include/68000/float.h b/Library/include/68000/float.h
new file mode 100644 (file)
index 0000000..805b84d
--- /dev/null
@@ -0,0 +1,265 @@
+/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  5.2.4.2.2  Characteristics of floating types <float.h>
+ */
+
+#ifndef _FLOAT_H___
+#define _FLOAT_H___
+
+/* Radix of exponent representation, b. */
+#undef FLT_RADIX
+#define FLT_RADIX      __FLT_RADIX__
+
+/* Number of base-FLT_RADIX digits in the significand, p.  */
+#undef FLT_MANT_DIG
+#undef DBL_MANT_DIG
+#undef LDBL_MANT_DIG
+#define FLT_MANT_DIG   __FLT_MANT_DIG__
+#define DBL_MANT_DIG   __DBL_MANT_DIG__
+#define LDBL_MANT_DIG  __LDBL_MANT_DIG__
+
+/* Number of decimal digits, q, such that any floating-point number with q
+   decimal digits can be rounded into a floating-point number with p radix b
+   digits and back again without change to the q decimal digits,
+
+       p * log10(b)                    if b is a power of 10
+       floor((p - 1) * log10(b))       otherwise
+*/
+#undef FLT_DIG
+#undef DBL_DIG
+#undef LDBL_DIG
+#define FLT_DIG                __FLT_DIG__
+#define DBL_DIG                __DBL_DIG__
+#define LDBL_DIG       __LDBL_DIG__
+
+/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
+#undef FLT_MIN_EXP
+#undef DBL_MIN_EXP
+#undef LDBL_MIN_EXP
+#define FLT_MIN_EXP    __FLT_MIN_EXP__
+#define DBL_MIN_EXP    __DBL_MIN_EXP__
+#define LDBL_MIN_EXP   __LDBL_MIN_EXP__
+
+/* Minimum negative integer such that 10 raised to that power is in the
+   range of normalized floating-point numbers,
+
+       ceil(log10(b) * (emin - 1))
+*/
+#undef FLT_MIN_10_EXP
+#undef DBL_MIN_10_EXP
+#undef LDBL_MIN_10_EXP
+#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
+#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
+#define LDBL_MIN_10_EXP        __LDBL_MIN_10_EXP__
+
+/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax.  */
+#undef FLT_MAX_EXP
+#undef DBL_MAX_EXP
+#undef LDBL_MAX_EXP
+#define FLT_MAX_EXP    __FLT_MAX_EXP__
+#define DBL_MAX_EXP    __DBL_MAX_EXP__
+#define LDBL_MAX_EXP   __LDBL_MAX_EXP__
+
+/* Maximum integer such that 10 raised to that power is in the range of
+   representable finite floating-point numbers,
+
+       floor(log10((1 - b**-p) * b**emax))
+*/
+#undef FLT_MAX_10_EXP
+#undef DBL_MAX_10_EXP
+#undef LDBL_MAX_10_EXP
+#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
+#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
+#define LDBL_MAX_10_EXP        __LDBL_MAX_10_EXP__
+
+/* Maximum representable finite floating-point number,
+
+       (1 - b**-p) * b**emax
+*/
+#undef FLT_MAX
+#undef DBL_MAX
+#undef LDBL_MAX
+#define FLT_MAX                __FLT_MAX__
+#define DBL_MAX                __DBL_MAX__
+#define LDBL_MAX       __LDBL_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+   representable in the given floating point type, b**1-p.  */
+#undef FLT_EPSILON
+#undef DBL_EPSILON
+#undef LDBL_EPSILON
+#define FLT_EPSILON    __FLT_EPSILON__
+#define DBL_EPSILON    __DBL_EPSILON__
+#define LDBL_EPSILON   __LDBL_EPSILON__
+
+/* Minimum normalized positive floating-point number, b**(emin - 1).  */
+#undef FLT_MIN
+#undef DBL_MIN
+#undef LDBL_MIN
+#define FLT_MIN                __FLT_MIN__
+#define DBL_MIN                __DBL_MIN__
+#define LDBL_MIN       __LDBL_MIN__
+
+/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown.  */
+/* ??? This is supposed to change with calls to fesetround in <fenv.h>.  */
+#undef FLT_ROUNDS
+#define FLT_ROUNDS 1
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* The floating-point expression evaluation method.
+        -1  indeterminate
+         0  evaluate all operations and constants just to the range and
+            precision of the type
+         1  evaluate operations and constants of type float and double
+            to the range and precision of the double type, evaluate
+            long double operations and constants to the range and
+            precision of the long double type
+         2  evaluate all operations and constants to the range and
+            precision of the long double type
+
+   ??? This ought to change with the setting of the fp control word;
+   the value provided by the compiler assumes the widest setting.  */
+#undef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD        __FLT_EVAL_METHOD__
+
+/* Number of decimal digits, n, such that any floating-point number in the
+   widest supported floating type with pmax radix b digits can be rounded
+   to a floating-point number with n decimal digits and back again without
+   change to the value,
+
+       pmax * log10(b)                 if b is a power of 10
+       ceil(1 + pmax * log10(b))       otherwise
+*/
+#undef DECIMAL_DIG
+#define DECIMAL_DIG    __DECIMAL_DIG__
+
+#endif /* C99 */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+/* Versions of DECIMAL_DIG for each floating-point type.  */
+#undef FLT_DECIMAL_DIG
+#undef DBL_DECIMAL_DIG
+#undef LDBL_DECIMAL_DIG
+#define FLT_DECIMAL_DIG                __FLT_DECIMAL_DIG__
+#define DBL_DECIMAL_DIG                __DBL_DECIMAL_DIG__
+#define LDBL_DECIMAL_DIG       __DECIMAL_DIG__
+
+/* Whether types support subnormal numbers.  */
+#undef FLT_HAS_SUBNORM
+#undef DBL_HAS_SUBNORM
+#undef LDBL_HAS_SUBNORM
+#define FLT_HAS_SUBNORM                __FLT_HAS_DENORM__
+#define DBL_HAS_SUBNORM                __DBL_HAS_DENORM__
+#define LDBL_HAS_SUBNORM       __LDBL_HAS_DENORM__
+
+/* Minimum positive values, including subnormals.  */
+#undef FLT_TRUE_MIN
+#undef DBL_TRUE_MIN
+#undef LDBL_TRUE_MIN
+#define FLT_TRUE_MIN   __FLT_DENORM_MIN__
+#define DBL_TRUE_MIN   __DBL_DENORM_MIN__
+#define LDBL_TRUE_MIN  __LDBL_DENORM_MIN__
+
+#endif /* C11 */
+
+#ifdef __STDC_WANT_DEC_FP__
+/* Draft Technical Report 24732, extension for decimal floating-point
+   arithmetic: Characteristic of decimal floating types <float.h>.  */
+
+/* Number of base-FLT_RADIX digits in the significand, p.  */
+#undef DEC32_MANT_DIG
+#undef DEC64_MANT_DIG
+#undef DEC128_MANT_DIG
+#define DEC32_MANT_DIG __DEC32_MANT_DIG__
+#define DEC64_MANT_DIG __DEC64_MANT_DIG__
+#define DEC128_MANT_DIG        __DEC128_MANT_DIG__
+
+/* Minimum exponent. */
+#undef DEC32_MIN_EXP
+#undef DEC64_MIN_EXP
+#undef DEC128_MIN_EXP
+#define DEC32_MIN_EXP  __DEC32_MIN_EXP__
+#define DEC64_MIN_EXP  __DEC64_MIN_EXP__
+#define DEC128_MIN_EXP __DEC128_MIN_EXP__
+
+/* Maximum exponent. */
+#undef DEC32_MAX_EXP
+#undef DEC64_MAX_EXP
+#undef DEC128_MAX_EXP
+#define DEC32_MAX_EXP  __DEC32_MAX_EXP__
+#define DEC64_MAX_EXP  __DEC64_MAX_EXP__
+#define DEC128_MAX_EXP __DEC128_MAX_EXP__
+
+/* Maximum representable finite decimal floating-point number
+   (there are 6, 15, and 33 9s after the decimal points respectively). */
+#undef DEC32_MAX
+#undef DEC64_MAX
+#undef DEC128_MAX
+#define DEC32_MAX   __DEC32_MAX__
+#define DEC64_MAX   __DEC64_MAX__
+#define DEC128_MAX  __DEC128_MAX__
+
+/* The difference between 1 and the least value greater than 1 that is
+   representable in the given floating point type. */
+#undef DEC32_EPSILON
+#undef DEC64_EPSILON
+#undef DEC128_EPSILON
+#define DEC32_EPSILON  __DEC32_EPSILON__
+#define DEC64_EPSILON  __DEC64_EPSILON__
+#define DEC128_EPSILON __DEC128_EPSILON__
+
+/* Minimum normalized positive floating-point number. */
+#undef DEC32_MIN
+#undef DEC64_MIN
+#undef DEC128_MIN
+#define DEC32_MIN      __DEC32_MIN__
+#define DEC64_MIN      __DEC64_MIN__
+#define DEC128_MIN     __DEC128_MIN__
+
+/* Minimum subnormal positive floating-point number. */
+#undef DEC32_SUBNORMAL_MIN
+#undef DEC64_SUBNORMAL_MIN
+#undef DEC128_SUBNORMAL_MIN
+#define DEC32_SUBNORMAL_MIN       __DEC32_SUBNORMAL_MIN__
+#define DEC64_SUBNORMAL_MIN       __DEC64_SUBNORMAL_MIN__
+#define DEC128_SUBNORMAL_MIN      __DEC128_SUBNORMAL_MIN__
+
+/* The floating-point expression evaluation method.
+         -1  indeterminate
+         0  evaluate all operations and constants just to the range and
+            precision of the type
+         1  evaluate operations and constants of type _Decimal32 
+           and _Decimal64 to the range and precision of the _Decimal64 
+            type, evaluate _Decimal128 operations and constants to the 
+           range and precision of the _Decimal128 type;
+        2  evaluate all operations and constants to the range and
+           precision of the _Decimal128 type.  */
+
+#undef DEC_EVAL_METHOD
+#define DEC_EVAL_METHOD        __DEC_EVAL_METHOD__
+
+#endif /* __STDC_WANT_DEC_FP__ */
+
+#endif /* _FLOAT_H___ */
diff --git a/Library/include/68000/iso646.h b/Library/include/68000/iso646.h
new file mode 100644 (file)
index 0000000..73c677f
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  7.9  Alternative spellings  <iso646.h>
+ */
+
+#ifndef _ISO646_H
+#define _ISO646_H
+
+#ifndef __cplusplus
+#define and    &&
+#define and_eq &=
+#define bitand &
+#define bitor  |
+#define compl  ~
+#define not    !
+#define not_eq !=
+#define or     ||
+#define or_eq  |=
+#define xor    ^
+#define xor_eq ^=
+#endif
+
+#endif
diff --git a/Library/include/68000/limits.h b/Library/include/68000/limits.h
new file mode 100644 (file)
index 0000000..984302e
--- /dev/null
@@ -0,0 +1,126 @@
+/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIMITS_H___
+#define _LIMITS_H___
+
+/* Number of bits in a `char'.  */
+#undef CHAR_BIT
+#define CHAR_BIT __CHAR_BIT__
+
+/* Maximum length of a multibyte character.  */
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 1
+#endif
+
+/* Minimum and maximum values a `signed char' can hold.  */
+#undef SCHAR_MIN
+#define SCHAR_MIN (-SCHAR_MAX - 1)
+#undef SCHAR_MAX
+#define SCHAR_MAX __SCHAR_MAX__
+
+/* Maximum value an `unsigned char' can hold.  (Minimum is 0).  */
+#undef UCHAR_MAX
+#if __SCHAR_MAX__ == __INT_MAX__
+# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
+#else
+# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `char' can hold.  */
+#ifdef __CHAR_UNSIGNED__
+# undef CHAR_MIN
+# if __SCHAR_MAX__ == __INT_MAX__
+#  define CHAR_MIN 0U
+# else
+#  define CHAR_MIN 0
+# endif
+# undef CHAR_MAX
+# define CHAR_MAX UCHAR_MAX
+#else
+# undef CHAR_MIN
+# define CHAR_MIN SCHAR_MIN
+# undef CHAR_MAX
+# define CHAR_MAX SCHAR_MAX
+#endif
+
+/* Minimum and maximum values a `signed short int' can hold.  */
+#undef SHRT_MIN
+#define SHRT_MIN (-SHRT_MAX - 1)
+#undef SHRT_MAX
+#define SHRT_MAX __SHRT_MAX__
+
+/* Maximum value an `unsigned short int' can hold.  (Minimum is 0).  */
+#undef USHRT_MAX
+#if __SHRT_MAX__ == __INT_MAX__
+# define USHRT_MAX (SHRT_MAX * 2U + 1U)
+#else
+# define USHRT_MAX (SHRT_MAX * 2 + 1)
+#endif
+
+/* Minimum and maximum values a `signed int' can hold.  */
+#undef INT_MIN
+#define INT_MIN (-INT_MAX - 1)
+#undef INT_MAX
+#define INT_MAX __INT_MAX__
+
+/* Maximum value an `unsigned int' can hold.  (Minimum is 0).  */
+#undef UINT_MAX
+#define UINT_MAX (INT_MAX * 2U + 1U)
+
+/* Minimum and maximum values a `signed long int' can hold.
+   (Same as `int').  */
+#undef LONG_MIN
+#define LONG_MIN (-LONG_MAX - 1L)
+#undef LONG_MAX
+#define LONG_MAX __LONG_MAX__
+
+/* Maximum value an `unsigned long int' can hold.  (Minimum is 0).  */
+#undef ULONG_MAX
+#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* Minimum and maximum values a `signed long long int' can hold.  */
+# undef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# undef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold.  (Minimum is 0).  */
+# undef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+#endif
+
+#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+/* Minimum and maximum values a `signed long long int' can hold.  */
+# undef LONG_LONG_MIN
+# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
+# undef LONG_LONG_MAX
+# define LONG_LONG_MAX __LONG_LONG_MAX__
+
+/* Maximum value an `unsigned long long int' can hold.  (Minimum is 0).  */
+# undef ULONG_LONG_MAX
+# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
+#endif
+
+#endif /* _LIMITS_H___ */
diff --git a/Library/include/68000/math-68881.h b/Library/include/68000/math-68881.h
new file mode 100644 (file)
index 0000000..6d9f8b2
--- /dev/null
@@ -0,0 +1,529 @@
+/******************************************************************\
+*                                                                 *
+*  <math-68881.h>              last modified: 23 May 1992.        *
+*                                                                 *
+*  Copyright (C) 1989 by Matthew Self.                            *
+*  You may freely distribute verbatim copies of this software     *
+*  provided that this copyright notice is retained in all copies.  *
+*  You may distribute modifications to this software under the     *
+*  conditions above if you also clearly note such modifications    *
+*  with their author and date.                                    *
+*                                                                 *
+*  Note:  errno is not set to EDOM when domain errors occur for    *
+*  most of these functions.  Rather, it is assumed that the       *
+*  68881's OPERR exception will be enabled and handled            *
+*  appropriately by the        operating system.  Similarly, overflow     *
+*  and underflow do not set errno to ERANGE.                      *
+*                                                                 *
+*  Send bugs to Matthew Self (self@bayes.arc.nasa.gov).                   *
+*                                                                 *
+\******************************************************************/
+
+/* This file is NOT a part of GCC, just distributed with it.  */
+
+/* If you find this in GCC,
+   please send bug reports to bug-gcc@prep.ai.mit.edu.  */
+
+/* Changed by Richard Stallman:
+   May 1993, add conditional to prevent multiple inclusion.
+   % inserted before a #.
+   New function `hypot' added.
+   Nans written in hex to avoid 0rnan.
+   May 1992, use %! for fpcr register.  Break lines before function names.
+   December 1989, add parens around `&' in pow.
+   November 1990, added alternate definition of HUGE_VAL for Sun.  */
+
+/* Changed by Jim Wilson:
+   September 1993, Use #undef before HUGE_VAL instead of #ifdef/#endif.  */
+
+/* Changed by Ian Lance Taylor:
+   September 1994, use extern inline instead of static inline.  */
+
+#ifndef __math_68881
+#define __math_68881
+
+#include <errno.h>
+
+#undef HUGE_VAL
+#ifdef __sun__
+/* The Sun assembler fails to handle the hex constant in the usual defn.  */
+#define HUGE_VAL                                                       \
+({                                                                     \
+  static union { int i[2]; double d; } u = { {0x7ff00000, 0} };                \
+  u.d;                                                                 \
+})
+#else
+#define HUGE_VAL                                                       \
+({                                                                     \
+  double huge_val;                                                     \
+                                                                       \
+  __asm ("fmove%.d #0x7ff0000000000000,%0"     /* Infinity */          \
+        : "=f" (huge_val)                                              \
+        : /* no inputs */);                                            \
+  huge_val;                                                            \
+})
+#endif
+
+__inline extern double
+sin (double x)
+{
+  double value;
+
+  __asm ("fsin%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+cos (double x)
+{
+  double value;
+
+  __asm ("fcos%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+tan (double x)
+{
+  double value;
+
+  __asm ("ftan%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+asin (double x)
+{
+  double value;
+
+  __asm ("fasin%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+acos (double x)
+{
+  double value;
+
+  __asm ("facos%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+atan (double x)
+{
+  double value;
+
+  __asm ("fatan%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+atan2 (double y, double x)
+{
+  double pi, pi_over_2;
+
+  __asm ("fmovecr%.x #0,%0"            /* extended precision pi */
+        : "=f" (pi)
+        : /* no inputs */ );
+  __asm ("fscale%.b #-1,%0"            /* no loss of accuracy */
+        : "=f" (pi_over_2)
+        : "0" (pi));
+  if (x > 0)
+    {
+      if (y > 0)
+       {
+         if (x > y)
+           return atan (y / x);
+         else
+           return pi_over_2 - atan (x / y);
+       }
+      else
+       {
+         if (x > -y)
+           return atan (y / x);
+         else
+           return - pi_over_2 - atan (x / y);
+       }
+    }
+  else
+    {
+      if (y < 0)
+       {
+         if (-x > -y)
+           return - pi + atan (y / x);
+         else
+           return - pi_over_2 - atan (x / y);
+       }
+      else
+       {
+         if (-x > y)
+           return pi + atan (y / x);
+         else if (y > 0)
+           return pi_over_2 - atan (x / y);
+         else
+           {
+             double value;
+
+             errno = EDOM;
+             __asm ("fmove%.d #0x7fffffffffffffff,%0"  /* quiet NaN */
+                    : "=f" (value)
+                    : /* no inputs */);
+             return value;
+           }
+       }
+    }
+}
+
+__inline extern double
+sinh (double x)
+{
+  double value;
+
+  __asm ("fsinh%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+cosh (double x)
+{
+  double value;
+
+  __asm ("fcosh%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+tanh (double x)
+{
+  double value;
+
+  __asm ("ftanh%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+atanh (double x)
+{
+  double value;
+
+  __asm ("fatanh%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+exp (double x)
+{
+  double value;
+
+  __asm ("fetox%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+expm1 (double x)
+{
+  double value;
+
+  __asm ("fetoxm1%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+log (double x)
+{
+  double value;
+
+  __asm ("flogn%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+log1p (double x)
+{
+  double value;
+
+  __asm ("flognp1%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+log10 (double x)
+{
+  double value;
+
+  __asm ("flog10%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+sqrt (double x)
+{
+  double value;
+
+  __asm ("fsqrt%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+hypot (double x, double y)
+{
+  return sqrt (x*x + y*y);
+}
+
+__inline extern double
+pow (double x, double y)
+{
+  if (x > 0)
+    return exp (y * log (x));
+  else if (x == 0)
+    {
+      if (y > 0)
+       return 0.0;
+      else
+       {
+         double value;
+
+         errno = EDOM;
+         __asm ("fmove%.d #0x7fffffffffffffff,%0"              /* quiet NaN */
+                : "=f" (value)
+                : /* no inputs */);
+         return value;
+       }
+    }
+  else
+    {
+      double temp;
+
+      __asm ("fintrz%.x %1,%0"
+            : "=f" (temp)                      /* integer-valued float */
+            : "f" (y));
+      if (y == temp)
+        {
+         int i = (int) y;
+
+         if ((i & 1) == 0)                     /* even */
+           return exp (y * log (-x));
+         else
+           return - exp (y * log (-x));
+        }
+      else
+        {
+         double value;
+
+         errno = EDOM;
+         __asm ("fmove%.d #0x7fffffffffffffff,%0"              /* quiet NaN */
+                : "=f" (value)
+                : /* no inputs */);
+         return value;
+        }
+    }
+}
+
+__inline extern double
+fabs (double x)
+{
+  double value;
+
+  __asm ("fabs%.x %1,%0"
+        : "=f" (value)
+        : "f" (x));
+  return value;
+}
+
+__inline extern double
+ceil (double x)
+{
+  int rounding_mode, round_up;
+  double value;
+
+  __asm volatile ("fmove%.l %!,%0"
+                 : "=dm" (rounding_mode)
+                 : /* no inputs */ );
+  round_up = rounding_mode | 0x30;
+  __asm volatile ("fmove%.l %0,%!"
+                 : /* no outputs */
+                 : "dmi" (round_up));
+  __asm volatile ("fint%.x %1,%0"
+                 : "=f" (value)
+                 : "f" (x));
+  __asm volatile ("fmove%.l %0,%!"
+                 : /* no outputs */
+                 : "dmi" (rounding_mode));
+  return value;
+}
+
+__inline extern double
+floor (double x)
+{
+  int rounding_mode, round_down;
+  double value;
+
+  __asm volatile ("fmove%.l %!,%0"
+                 : "=dm" (rounding_mode)
+                 : /* no inputs */ );
+  round_down = (rounding_mode & ~0x10)
+               | 0x20;
+  __asm volatile ("fmove%.l %0,%!"
+                 : /* no outputs */
+                 : "dmi" (round_down));
+  __asm volatile ("fint%.x %1,%0"
+                 : "=f" (value)
+                 : "f" (x));
+  __asm volatile ("fmove%.l %0,%!"
+                 : /* no outputs */
+                 : "dmi" (rounding_mode));
+  return value;
+}
+
+__inline extern double
+rint (double x)
+{
+  int rounding_mode, round_nearest;
+  double value;
+
+  __asm volatile ("fmove%.l %!,%0"
+                 : "=dm" (rounding_mode)
+                 : /* no inputs */ );
+  round_nearest = rounding_mode & ~0x30;
+  __asm volatile ("fmove%.l %0,%!"
+                 : /* no outputs */
+                 : "dmi" (round_nearest));
+  __asm volatile ("fint%.x %1,%0"
+                 : "=f" (value)
+                 : "f" (x));
+  __asm volatile ("fmove%.l %0,%!"
+                 : /* no outputs */
+                 : "dmi" (rounding_mode));
+  return value;
+}
+
+__inline extern double
+fmod (double x, double y)
+{
+  double value;
+
+  __asm ("fmod%.x %2,%0"
+        : "=f" (value)
+        : "0" (x),
+          "f" (y));
+  return value;
+}
+
+__inline extern double
+drem (double x, double y)
+{
+  double value;
+
+  __asm ("frem%.x %2,%0"
+        : "=f" (value)
+        : "0" (x),
+          "f" (y));
+  return value;
+}
+
+__inline extern double
+scalb (double x, int n)
+{
+  double value;
+
+  __asm ("fscale%.l %2,%0"
+        : "=f" (value)
+        : "0" (x),
+          "dmi" (n));
+  return value;
+}
+
+__inline extern double
+logb (double x)
+{
+  double exponent;
+
+  __asm ("fgetexp%.x %1,%0"
+        : "=f" (exponent)
+        : "f" (x));
+  return exponent;
+}
+
+__inline extern double
+ldexp (double x, int n)
+{
+  double value;
+
+  __asm ("fscale%.l %2,%0"
+        : "=f" (value)
+        : "0" (x),
+          "dmi" (n));
+  return value;
+}
+
+__inline extern double
+frexp (double x, int *exp)
+{
+  double float_exponent;
+  int int_exponent;
+  double mantissa;
+
+  __asm ("fgetexp%.x %1,%0"
+        : "=f" (float_exponent)        /* integer-valued float */
+        : "f" (x));
+  int_exponent = (int) float_exponent;
+  __asm ("fgetman%.x %1,%0"
+        : "=f" (mantissa)              /* 1.0 <= mantissa < 2.0 */
+        : "f" (x));
+  if (mantissa != 0)
+    {
+      __asm ("fscale%.b #-1,%0"
+            : "=f" (mantissa)          /* mantissa /= 2.0 */
+            : "0" (mantissa));
+      int_exponent += 1;
+    }
+  *exp = int_exponent;
+  return mantissa;
+}
+
+__inline extern double
+modf (double x, double *ip)
+{
+  double temp;
+
+  __asm ("fintrz%.x %1,%0"
+        : "=f" (temp)                  /* integer-valued float */
+        : "f" (x));
+  *ip = temp;
+  return x - temp;
+}
+
+#endif /* not __math_68881 */
diff --git a/Library/include/68000/stdalign.h b/Library/include/68000/stdalign.h
new file mode 100644 (file)
index 0000000..1615657
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (C) 2011-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* ISO C1X: 7.15 Alignment <stdalign.h>.  */
+
+#ifndef _STDALIGN_H
+#define _STDALIGN_H
+
+#ifndef __cplusplus
+
+#define alignas _Alignas
+#define alignof _Alignof
+
+#define __alignas_is_defined 1
+#define __alignof_is_defined 1
+
+#endif
+
+#endif /* stdalign.h */
diff --git a/Library/include/68000/stdarg.h b/Library/include/68000/stdarg.h
new file mode 100644 (file)
index 0000000..afc1cc5
--- /dev/null
@@ -0,0 +1,126 @@
+/* Copyright (C) 1989-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  7.15  Variable arguments  <stdarg.h>
+ */
+
+#ifndef _STDARG_H
+#ifndef _ANSI_STDARG_H_
+#ifndef __need___va_list
+#define _STDARG_H
+#define _ANSI_STDARG_H_
+#endif /* not __need___va_list */
+#undef __need___va_list
+
+/* Define __gnuc_va_list.  */
+
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+typedef __builtin_va_list __gnuc_va_list;
+#endif
+
+/* Define the standard macros for the user,
+   if this invocation was from the user program.  */
+#ifdef _STDARG_H
+
+#define va_start(v,l)  __builtin_va_start(v,l)
+#define va_end(v)      __builtin_va_end(v)
+#define va_arg(v,l)    __builtin_va_arg(v,l)
+#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__)
+#define va_copy(d,s)   __builtin_va_copy(d,s)
+#endif
+#define __va_copy(d,s) __builtin_va_copy(d,s)
+
+/* Define va_list, if desired, from __gnuc_va_list. */
+/* We deliberately do not define va_list when called from
+   stdio.h, because ANSI C says that stdio.h is not supposed to define
+   va_list.  stdio.h needs to have access to that data type, 
+   but must not use that name.  It should use the name __gnuc_va_list,
+   which is safe because it is reserved for the implementation.  */
+
+#ifdef _BSD_VA_LIST
+#undef _BSD_VA_LIST
+#endif
+
+#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
+/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
+   so we must avoid testing it and setting it here.
+   SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
+   have no conflict with that.  */
+#ifndef _VA_LIST_
+#define _VA_LIST_
+#ifdef __i860__
+#ifndef _VA_LIST
+#define _VA_LIST va_list
+#endif
+#endif /* __i860__ */
+typedef __gnuc_va_list va_list;
+#ifdef _SCO_DS
+#define __VA_LIST
+#endif
+#endif /* _VA_LIST_ */
+#else /* not __svr4__ || _SCO_DS */
+
+/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
+   But on BSD NET2 we must not test or define or undef it.
+   (Note that the comments in NET 2's ansi.h
+   are incorrect for _VA_LIST_--see stdio.h!)  */
+#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
+/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5  */
+#ifndef _VA_LIST_DEFINED
+/* The macro _VA_LIST is used in SCO Unix 3.2.  */
+#ifndef _VA_LIST
+/* The macro _VA_LIST_T_H is used in the Bull dpx2  */
+#ifndef _VA_LIST_T_H
+/* The macro __va_list__ is used by BeOS.  */
+#ifndef __va_list__
+typedef __gnuc_va_list va_list;
+#endif /* not __va_list__ */
+#endif /* not _VA_LIST_T_H */
+#endif /* not _VA_LIST */
+#endif /* not _VA_LIST_DEFINED */
+#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
+#define _VA_LIST_
+#endif
+#ifndef _VA_LIST
+#define _VA_LIST
+#endif
+#ifndef _VA_LIST_DEFINED
+#define _VA_LIST_DEFINED
+#endif
+#ifndef _VA_LIST_T_H
+#define _VA_LIST_T_H
+#endif
+#ifndef __va_list__
+#define __va_list__
+#endif
+
+#endif /* not _VA_LIST_, except on certain systems */
+
+#endif /* not __svr4__ */
+
+#endif /* _STDARG_H */
+
+#endif /* not _ANSI_STDARG_H_ */
+#endif /* not _STDARG_H */
diff --git a/Library/include/68000/stdatomic.h b/Library/include/68000/stdatomic.h
new file mode 100644 (file)
index 0000000..b961da2
--- /dev/null
@@ -0,0 +1,238 @@
+/* Copyright (C) 2013-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* ISO C11 Standard:  7.17  Atomics <stdatomic.h>.  */
+
+#ifndef _STDATOMIC_H
+#define _STDATOMIC_H
+
+typedef enum
+  {
+    memory_order_relaxed = __ATOMIC_RELAXED,
+    memory_order_consume = __ATOMIC_CONSUME,
+    memory_order_acquire = __ATOMIC_ACQUIRE,
+    memory_order_release = __ATOMIC_RELEASE,
+    memory_order_acq_rel = __ATOMIC_ACQ_REL,
+    memory_order_seq_cst = __ATOMIC_SEQ_CST
+  } memory_order;
+
+
+typedef _Atomic _Bool atomic_bool;
+typedef _Atomic char atomic_char;
+typedef _Atomic signed char atomic_schar;
+typedef _Atomic unsigned char atomic_uchar;
+typedef _Atomic short atomic_short;
+typedef _Atomic unsigned short atomic_ushort;
+typedef _Atomic int atomic_int;
+typedef _Atomic unsigned int atomic_uint;
+typedef _Atomic long atomic_long;
+typedef _Atomic unsigned long atomic_ulong;
+typedef _Atomic long long atomic_llong;
+typedef _Atomic unsigned long long atomic_ullong;
+typedef _Atomic __CHAR16_TYPE__ atomic_char16_t;
+typedef _Atomic __CHAR32_TYPE__ atomic_char32_t;
+typedef _Atomic __WCHAR_TYPE__ atomic_wchar_t;
+typedef _Atomic __INT_LEAST8_TYPE__ atomic_int_least8_t;
+typedef _Atomic __UINT_LEAST8_TYPE__ atomic_uint_least8_t;
+typedef _Atomic __INT_LEAST16_TYPE__ atomic_int_least16_t;
+typedef _Atomic __UINT_LEAST16_TYPE__ atomic_uint_least16_t;
+typedef _Atomic __INT_LEAST32_TYPE__ atomic_int_least32_t;
+typedef _Atomic __UINT_LEAST32_TYPE__ atomic_uint_least32_t;
+typedef _Atomic __INT_LEAST64_TYPE__ atomic_int_least64_t;
+typedef _Atomic __UINT_LEAST64_TYPE__ atomic_uint_least64_t;
+typedef _Atomic __INT_FAST8_TYPE__ atomic_int_fast8_t;
+typedef _Atomic __UINT_FAST8_TYPE__ atomic_uint_fast8_t;
+typedef _Atomic __INT_FAST16_TYPE__ atomic_int_fast16_t;
+typedef _Atomic __UINT_FAST16_TYPE__ atomic_uint_fast16_t;
+typedef _Atomic __INT_FAST32_TYPE__ atomic_int_fast32_t;
+typedef _Atomic __UINT_FAST32_TYPE__ atomic_uint_fast32_t;
+typedef _Atomic __INT_FAST64_TYPE__ atomic_int_fast64_t;
+typedef _Atomic __UINT_FAST64_TYPE__ atomic_uint_fast64_t;
+typedef _Atomic __INTPTR_TYPE__ atomic_intptr_t;
+typedef _Atomic __UINTPTR_TYPE__ atomic_uintptr_t;
+typedef _Atomic __SIZE_TYPE__ atomic_size_t;
+typedef _Atomic __PTRDIFF_TYPE__ atomic_ptrdiff_t;
+typedef _Atomic __INTMAX_TYPE__ atomic_intmax_t;
+typedef _Atomic __UINTMAX_TYPE__ atomic_uintmax_t;        
+
+
+#define ATOMIC_VAR_INIT(VALUE) (VALUE)
+#define atomic_init(PTR, VAL)                  \
+  do                                           \
+    {                                          \
+      *(PTR) = (VAL);                          \
+    }                                          \
+  while (0)
+
+#define kill_dependency(Y)                     \
+  __extension__                                        \
+  ({                                           \
+    __auto_type __kill_dependency_tmp = (Y);   \
+    __kill_dependency_tmp;                     \
+  })
+
+#define atomic_thread_fence(MO)        __atomic_thread_fence (MO)
+#define atomic_signal_fence(MO)        __atomic_signal_fence  (MO)
+#define atomic_is_lock_free(OBJ) __atomic_is_lock_free (sizeof (*(OBJ)), (OBJ))
+
+#define ATOMIC_BOOL_LOCK_FREE          __GCC_ATOMIC_BOOL_LOCK_FREE
+#define ATOMIC_CHAR_LOCK_FREE          __GCC_ATOMIC_CHAR_LOCK_FREE
+#define ATOMIC_CHAR16_T_LOCK_FREE      __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+#define ATOMIC_CHAR32_T_LOCK_FREE      __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+#define ATOMIC_WCHAR_T_LOCK_FREE       __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+#define ATOMIC_SHORT_LOCK_FREE         __GCC_ATOMIC_SHORT_LOCK_FREE
+#define ATOMIC_INT_LOCK_FREE           __GCC_ATOMIC_INT_LOCK_FREE
+#define ATOMIC_LONG_LOCK_FREE          __GCC_ATOMIC_LONG_LOCK_FREE
+#define ATOMIC_LLONG_LOCK_FREE         __GCC_ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_POINTER_LOCK_FREE       __GCC_ATOMIC_POINTER_LOCK_FREE
+
+
+/* Note that these macros require __typeof__ and __auto_type to remove
+   _Atomic qualifiers (and const qualifiers, if those are valid on
+   macro operands).
+   
+   Also note that the header file uses the generic form of __atomic
+   builtins, which requires the address to be taken of the value
+   parameter, and then we pass that value on.  This allows the macros
+   to work for any type, and the compiler is smart enough to convert
+   these to lock-free _N variants if possible, and throw away the
+   temps.  */
+
+#define atomic_store_explicit(PTR, VAL, MO)                            \
+  __extension__                                                                \
+  ({                                                                   \
+    __auto_type __atomic_store_ptr = (PTR);                            \
+    __typeof__ (*__atomic_store_ptr) __atomic_store_tmp = (VAL);       \
+    __atomic_store (__atomic_store_ptr, &__atomic_store_tmp, (MO));    \
+  })
+
+#define atomic_store(PTR, VAL)                         \
+  atomic_store_explicit (PTR, VAL, __ATOMIC_SEQ_CST)
+
+
+#define atomic_load_explicit(PTR, MO)                                  \
+  __extension__                                                                \
+  ({                                                                   \
+    __auto_type __atomic_load_ptr = (PTR);                             \
+    __typeof__ (*__atomic_load_ptr) __atomic_load_tmp;                 \
+    __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (MO));       \
+    __atomic_load_tmp;                                                 \
+  })
+
+#define atomic_load(PTR)  atomic_load_explicit (PTR, __ATOMIC_SEQ_CST)
+
+
+#define atomic_exchange_explicit(PTR, VAL, MO)                         \
+  __extension__                                                                \
+  ({                                                                   \
+    __auto_type __atomic_exchange_ptr = (PTR);                         \
+    __typeof__ (*__atomic_exchange_ptr) __atomic_exchange_val = (VAL); \
+    __typeof__ (*__atomic_exchange_ptr) __atomic_exchange_tmp;         \
+    __atomic_exchange (__atomic_exchange_ptr, &__atomic_exchange_val,  \
+                      &__atomic_exchange_tmp, (MO));                   \
+    __atomic_exchange_tmp;                                             \
+  })
+
+#define atomic_exchange(PTR, VAL)                      \
+  atomic_exchange_explicit (PTR, VAL, __ATOMIC_SEQ_CST)
+
+
+#define atomic_compare_exchange_strong_explicit(PTR, VAL, DES, SUC, FAIL) \
+  __extension__                                                                \
+  ({                                                                   \
+    __auto_type __atomic_compare_exchange_ptr = (PTR);                 \
+    __typeof__ (*__atomic_compare_exchange_ptr) __atomic_compare_exchange_tmp \
+      = (DES);                                                         \
+    __atomic_compare_exchange (__atomic_compare_exchange_ptr, (VAL),   \
+                              &__atomic_compare_exchange_tmp, 0,       \
+                              (SUC), (FAIL));                          \
+  })
+
+#define atomic_compare_exchange_strong(PTR, VAL, DES)                     \
+  atomic_compare_exchange_strong_explicit (PTR, VAL, DES, __ATOMIC_SEQ_CST, \
+                                          __ATOMIC_SEQ_CST)
+
+#define atomic_compare_exchange_weak_explicit(PTR, VAL, DES, SUC, FAIL) \
+  __extension__                                                                \
+  ({                                                                   \
+    __auto_type __atomic_compare_exchange_ptr = (PTR);                 \
+    __typeof__ (*__atomic_compare_exchange_ptr) __atomic_compare_exchange_tmp \
+      = (DES);                                                         \
+    __atomic_compare_exchange (__atomic_compare_exchange_ptr, (VAL),   \
+                              &__atomic_compare_exchange_tmp, 1,       \
+                              (SUC), (FAIL));                          \
+  })
+
+#define atomic_compare_exchange_weak(PTR, VAL, DES)                    \
+  atomic_compare_exchange_weak_explicit (PTR, VAL, DES, __ATOMIC_SEQ_CST, \
+                                        __ATOMIC_SEQ_CST)
+
+
+
+#define atomic_fetch_add(PTR, VAL) __atomic_fetch_add ((PTR), (VAL),   \
+                                                      __ATOMIC_SEQ_CST)
+#define atomic_fetch_add_explicit(PTR, VAL, MO)                        \
+                         __atomic_fetch_add ((PTR), (VAL), (MO))
+
+#define atomic_fetch_sub(PTR, VAL) __atomic_fetch_sub ((PTR), (VAL),   \
+                                                      __ATOMIC_SEQ_CST)
+#define atomic_fetch_sub_explicit(PTR, VAL, MO)                        \
+                         __atomic_fetch_sub ((PTR), (VAL), (MO))
+
+#define atomic_fetch_or(PTR, VAL) __atomic_fetch_or ((PTR), (VAL),     \
+                                                      __ATOMIC_SEQ_CST)
+#define atomic_fetch_or_explicit(PTR, VAL, MO)                         \
+                         __atomic_fetch_or ((PTR), (VAL), (MO))
+
+#define atomic_fetch_xor(PTR, VAL) __atomic_fetch_xor ((PTR), (VAL),   \
+                                                      __ATOMIC_SEQ_CST)
+#define atomic_fetch_xor_explicit(PTR, VAL, MO)                        \
+                         __atomic_fetch_xor ((PTR), (VAL), (MO))
+
+#define atomic_fetch_and(PTR, VAL) __atomic_fetch_and ((PTR), (VAL),   \
+                                                      __ATOMIC_SEQ_CST)
+#define atomic_fetch_and_explicit(PTR, VAL, MO)                        \
+                         __atomic_fetch_and ((PTR), (VAL), (MO))
+
+
+typedef _Atomic struct
+{
+#if __GCC_ATOMIC_TEST_AND_SET_TRUEVAL == 1
+  _Bool __val;
+#else
+  unsigned char __val;
+#endif
+} atomic_flag;
+
+#define ATOMIC_FLAG_INIT       { 0 }
+
+
+#define atomic_flag_test_and_set(PTR)                                  \
+                       __atomic_test_and_set ((PTR), __ATOMIC_SEQ_CST)
+#define atomic_flag_test_and_set_explicit(PTR, MO)                     \
+                       __atomic_test_and_set ((PTR), (MO))
+
+#define atomic_flag_clear(PTR) __atomic_clear ((PTR), __ATOMIC_SEQ_CST)
+#define atomic_flag_clear_explicit(PTR, MO)   __atomic_clear ((PTR), (MO))
+
+#endif  /* _STDATOMIC_H */
diff --git a/Library/include/68000/stdbool.h b/Library/include/68000/stdbool.h
new file mode 100644 (file)
index 0000000..a951510
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  7.16  Boolean type and values  <stdbool.h>
+ */
+
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+#ifndef __cplusplus
+
+#define bool   _Bool
+#define true   1
+#define false  0
+
+#else /* __cplusplus */
+
+/* Supporting _Bool in C++ is a GCC extension.  */
+#define _Bool  bool
+
+#if __cplusplus < 201103L
+/* Defining these macros in C++98 is a GCC extension.  */
+#define bool   bool
+#define false  false
+#define true   true
+#endif
+
+#endif /* __cplusplus */
+
+/* Signal that all the definitions are present.  */
+#define __bool_true_false_are_defined  1
+
+#endif /* stdbool.h */
diff --git a/Library/include/68000/stddef.h b/Library/include/68000/stddef.h
new file mode 100644 (file)
index 0000000..f20a41b
--- /dev/null
@@ -0,0 +1,443 @@
+/* Copyright (C) 1989-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  7.17  Common definitions  <stddef.h>
+ */
+#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
+     && !defined(__STDDEF_H__)) \
+    || defined(__need_wchar_t) || defined(__need_size_t) \
+    || defined(__need_ptrdiff_t) || defined(__need_NULL) \
+    || defined(__need_wint_t)
+
+/* Any one of these symbols __need_* means that GNU libc
+   wants us just to define one data type.  So don't define
+   the symbols that indicate this file's entire job has been done.  */
+#if (!defined(__need_wchar_t) && !defined(__need_size_t)       \
+     && !defined(__need_ptrdiff_t) && !defined(__need_NULL)    \
+     && !defined(__need_wint_t))
+#define _STDDEF_H
+#define _STDDEF_H_
+/* snaroff@next.com says the NeXT needs this.  */
+#define _ANSI_STDDEF_H
+#endif
+
+#ifndef __sys_stdtypes_h
+/* This avoids lossage on SunOS but only if stdtypes.h comes first.
+   There's no way to win with the other order!  Sun lossage.  */
+
+/* On 4.3bsd-net2, make sure ansi.h is included, so we have
+   one less case to deal with in the following.  */
+#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
+#include <machine/ansi.h>
+#endif
+/* On FreeBSD 5, machine/ansi.h does not exist anymore... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#include <sys/_types.h>
+#endif
+
+/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+   defined if the corresponding type is *not* defined.
+   FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
+   NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_)  || defined(_I386_ANSI_H_)
+#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
+#define _SIZE_T
+#endif
+#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
+#define _PTRDIFF_T
+#endif
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+   instead of _WCHAR_T_. */
+#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
+#ifndef _BSD_WCHAR_T_
+#define _WCHAR_T
+#endif
+#endif
+/* Undef _FOO_T_ if we are supposed to define foo_t.  */
+#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#if defined (__need_size_t) || defined (_STDDEF_H_)
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#if defined (__need_wchar_t) || defined (_STDDEF_H_)
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */
+
+/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
+   Just ignore it.  */
+#if defined (__sequent__) && defined (_PTRDIFF_T_)
+#undef _PTRDIFF_T_
+#endif
+
+/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
+   _TYPE_size_t which will typedef size_t.  fixincludes patched the
+   vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
+   not defined, and so that defining this macro defines _GCC_SIZE_T.
+   If we find that the macros are still defined at this point, we must
+   invoke them so that the type is defined as expected.  */
+#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
+_TYPE_ptrdiff_t;
+#undef _TYPE_ptrdiff_t
+#endif
+#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
+_TYPE_size_t;
+#undef _TYPE_size_t
+#endif
+#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
+_TYPE_wchar_t;
+#undef _TYPE_wchar_t
+#endif
+
+/* In case nobody has defined these types, but we aren't running under
+   GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
+   __WCHAR_TYPE__ have reasonable values.  This can happen if the
+   parts of GCC is compiled by an older compiler, that actually
+   include gstddef.h, such as collect2.  */
+
+/* Signed type of difference of two pointers.  */
+
+/* Define this type if we are doing the whole job,
+   or if we want this type in particular.  */
+#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
+#ifndef _PTRDIFF_T     /* in case <sys/types.h> has defined it. */
+#ifndef _T_PTRDIFF_
+#ifndef _T_PTRDIFF
+#ifndef __PTRDIFF_T
+#ifndef _PTRDIFF_T_
+#ifndef _BSD_PTRDIFF_T_
+#ifndef ___int_ptrdiff_t_h
+#ifndef _GCC_PTRDIFF_T
+#ifndef _PTRDIFF_T_DECLARED /* DragonFly */
+#define _PTRDIFF_T
+#define _T_PTRDIFF_
+#define _T_PTRDIFF
+#define __PTRDIFF_T
+#define _PTRDIFF_T_
+#define _BSD_PTRDIFF_T_
+#define ___int_ptrdiff_t_h
+#define _GCC_PTRDIFF_T
+#define _PTRDIFF_T_DECLARED
+#ifndef __PTRDIFF_TYPE__
+#define __PTRDIFF_TYPE__ long int
+#endif
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif /* _PTRDIFF_T_DECLARED */
+#endif /* _GCC_PTRDIFF_T */
+#endif /* ___int_ptrdiff_t_h */
+#endif /* _BSD_PTRDIFF_T_ */
+#endif /* _PTRDIFF_T_ */
+#endif /* __PTRDIFF_T */
+#endif /* _T_PTRDIFF */
+#endif /* _T_PTRDIFF_ */
+#endif /* _PTRDIFF_T */
+
+/* If this symbol has done its job, get rid of it.  */
+#undef __need_ptrdiff_t
+
+#endif /* _STDDEF_H or __need_ptrdiff_t.  */
+
+/* Unsigned type of `sizeof' something.  */
+
+/* Define this type if we are doing the whole job,
+   or if we want this type in particular.  */
+#if defined (_STDDEF_H) || defined (__need_size_t)
+#ifndef __size_t__     /* BeOS */
+#ifndef __SIZE_T__     /* Cray Unicos/Mk */
+#ifndef _SIZE_T        /* in case <sys/types.h> has defined it. */
+#ifndef _SYS_SIZE_T_H
+#ifndef _T_SIZE_
+#ifndef _T_SIZE
+#ifndef __SIZE_T
+#ifndef _SIZE_T_
+#ifndef _BSD_SIZE_T_
+#ifndef _SIZE_T_DEFINED_
+#ifndef _SIZE_T_DEFINED
+#ifndef _BSD_SIZE_T_DEFINED_   /* Darwin */
+#ifndef _SIZE_T_DECLARED       /* FreeBSD 5 */
+#ifndef ___int_size_t_h
+#ifndef _GCC_SIZE_T
+#ifndef _SIZET_
+#ifndef __size_t
+#define __size_t__     /* BeOS */
+#define __SIZE_T__     /* Cray Unicos/Mk */
+#define _SIZE_T
+#define _SYS_SIZE_T_H
+#define _T_SIZE_
+#define _T_SIZE
+#define __SIZE_T
+#define _SIZE_T_
+#define _BSD_SIZE_T_
+#define _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED
+#define _BSD_SIZE_T_DEFINED_   /* Darwin */
+#define _SIZE_T_DECLARED       /* FreeBSD 5 */
+#define ___int_size_t_h
+#define _GCC_SIZE_T
+#define _SIZET_
+#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+  || defined(__DragonFly__) \
+  || defined(__FreeBSD_kernel__)
+/* __size_t is a typedef on FreeBSD 5, must not trash it. */
+#elif defined (__VMS__)
+/* __size_t is also a typedef on VMS.  */
+#else
+#define __size_t
+#endif
+#ifndef __SIZE_TYPE__
+#define __SIZE_TYPE__ long unsigned int
+#endif
+#if !(defined (__GNUG__) && defined (size_t))
+typedef __SIZE_TYPE__ size_t;
+#ifdef __BEOS__
+typedef long ssize_t;
+#endif /* __BEOS__ */
+#endif /* !(defined (__GNUG__) && defined (size_t)) */
+#endif /* __size_t */
+#endif /* _SIZET_ */
+#endif /* _GCC_SIZE_T */
+#endif /* ___int_size_t_h */
+#endif /* _SIZE_T_DECLARED */
+#endif /* _BSD_SIZE_T_DEFINED_ */
+#endif /* _SIZE_T_DEFINED */
+#endif /* _SIZE_T_DEFINED_ */
+#endif /* _BSD_SIZE_T_ */
+#endif /* _SIZE_T_ */
+#endif /* __SIZE_T */
+#endif /* _T_SIZE */
+#endif /* _T_SIZE_ */
+#endif /* _SYS_SIZE_T_H */
+#endif /* _SIZE_T */
+#endif /* __SIZE_T__ */
+#endif /* __size_t__ */
+#undef __need_size_t
+#endif /* _STDDEF_H or __need_size_t.  */
+
+
+/* Wide character type.
+   Locale-writers should change this as necessary to
+   be big enough to hold unique values not between 0 and 127,
+   and not (wchar_t) -1, for each defined multibyte character.  */
+
+/* Define this type if we are doing the whole job,
+   or if we want this type in particular.  */
+#if defined (_STDDEF_H) || defined (__need_wchar_t)
+#ifndef __wchar_t__    /* BeOS */
+#ifndef __WCHAR_T__    /* Cray Unicos/Mk */
+#ifndef _WCHAR_T
+#ifndef _T_WCHAR_
+#ifndef _T_WCHAR
+#ifndef __WCHAR_T
+#ifndef _WCHAR_T_
+#ifndef _BSD_WCHAR_T_
+#ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_   /* Darwin */
+#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
+#ifndef _WCHAR_T_DEFINED_
+#ifndef _WCHAR_T_DEFINED
+#ifndef _WCHAR_T_H
+#ifndef ___int_wchar_t_h
+#ifndef __INT_WCHAR_T_H
+#ifndef _GCC_WCHAR_T
+#define __wchar_t__    /* BeOS */
+#define __WCHAR_T__    /* Cray Unicos/Mk */
+#define _WCHAR_T
+#define _T_WCHAR_
+#define _T_WCHAR
+#define __WCHAR_T
+#define _WCHAR_T_
+#define _BSD_WCHAR_T_
+#define _WCHAR_T_DEFINED_
+#define _WCHAR_T_DEFINED
+#define _WCHAR_T_H
+#define ___int_wchar_t_h
+#define __INT_WCHAR_T_H
+#define _GCC_WCHAR_T
+#define _WCHAR_T_DECLARED
+
+/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+   instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+   symbols in the _FOO_T_ family, stays defined even after its
+   corresponding type is defined).  If we define wchar_t, then we
+   must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
+   we undef _WCHAR_T_, then we must also define rune_t, since 
+   headers like runetype.h assume that if machine/ansi.h is included,
+   and _BSD_WCHAR_T_ is not defined, then rune_t is available.
+   machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
+   the same type." */
+#ifdef _BSD_WCHAR_T_
+#undef _BSD_WCHAR_T_
+#ifdef _BSD_RUNE_T_
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+typedef _BSD_RUNE_T_ rune_t;
+#define _BSD_WCHAR_T_DEFINED_
+#define _BSD_RUNE_T_DEFINED_   /* Darwin */
+#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
+/* Why is this file so hard to maintain properly?  In contrast to
+   the comment above regarding BSD/386 1.1, on FreeBSD for as long
+   as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
+   redundant typedefs will occur when stdlib.h is included after this file. */
+#undef _BSD_RUNE_T_
+#endif
+#endif
+#endif
+#endif
+/* FreeBSD 5 can't be handled well using "traditional" logic above
+   since it no longer defines _BSD_RUNE_T_ yet still desires to export
+   rune_t in some cases... */
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
+#if __BSD_VISIBLE
+#ifndef _RUNE_T_DECLARED
+typedef __rune_t        rune_t;
+#define _RUNE_T_DECLARED
+#endif
+#endif
+#endif
+#endif
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+#ifndef __cplusplus
+typedef __WCHAR_TYPE__ wchar_t;
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* _WCHAR_T_DECLARED */
+#endif /* _BSD_RUNE_T_DEFINED_ */
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif /* __WCHAR_T__ */
+#endif /* __wchar_t__ */
+#undef __need_wchar_t
+#endif /* _STDDEF_H or __need_wchar_t.  */
+
+#if defined (__need_wint_t)
+#ifndef _WINT_T
+#define _WINT_T
+
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ unsigned int
+#endif
+typedef __WINT_TYPE__ wint_t;
+#endif
+#undef __need_wint_t
+#endif
+
+/*  In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+    are already defined.  */
+/*  BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.  */
+/*  NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.  */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_)
+/*  The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
+    are probably typos and should be removed before 2.8 is released.  */
+#ifdef _GCC_PTRDIFF_T_
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T_
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T_
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+/*  The following ones are the real ones.  */
+#ifdef _GCC_PTRDIFF_T
+#undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
+#endif
+#ifdef _GCC_SIZE_T
+#undef _SIZE_T_
+#undef _BSD_SIZE_T_
+#endif
+#ifdef _GCC_WCHAR_T
+#undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
+#endif
+#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */
+
+#endif /* __sys_stdtypes_h */
+
+/* A null pointer constant.  */
+
+#if defined (_STDDEF_H) || defined (__need_NULL)
+#undef NULL            /* in case <stdio.h> has defined it. */
+#ifdef __GNUG__
+#define NULL __null
+#else   /* G++ */
+#ifndef __cplusplus
+#define NULL ((void *)0)
+#else   /* C++ */
+#define NULL 0
+#endif  /* C++ */
+#endif  /* G++ */
+#endif /* NULL not defined and <stddef.h> or need NULL.  */
+#undef __need_NULL
+
+#ifdef _STDDEF_H
+
+/* Offset of member MEMBER in a struct of type TYPE. */
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
+#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
+  || (defined(__cplusplus) && __cplusplus >= 201103L)
+#ifndef _GCC_MAX_ALIGN_T
+#define _GCC_MAX_ALIGN_T
+/* Type whose alignment is supported in every context and is at least
+   as great as that of any standard type not using alignment
+   specifiers.  */
+typedef struct {
+  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
+  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
+} max_align_t;
+#endif
+#endif /* C11 or C++11.  */
+
+#if defined(__cplusplus) && __cplusplus >= 201103L
+#ifndef _GXX_NULLPTR_T
+#define _GXX_NULLPTR_T
+  typedef decltype(nullptr) nullptr_t;
+#endif
+#endif /* C++11.  */
+
+#endif /* _STDDEF_H was defined this time */
+
+#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
+         || __need_XXX was not defined before */
diff --git a/Library/include/68000/stdfix.h b/Library/include/68000/stdfix.h
new file mode 100644 (file)
index 0000000..5429fb8
--- /dev/null
@@ -0,0 +1,204 @@
+/* Copyright (C) 2007-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* ISO/IEC JTC1 SC22 WG14 N1169
+ * Date: 2006-04-04
+ * ISO/IEC TR 18037
+ * Programming languages - C - Extensions to support embedded processors
+ */
+
+#ifndef _STDFIX_H
+#define _STDFIX_H
+
+/* 7.18a.1 Introduction.  */
+
+#undef fract
+#undef accum
+#undef sat
+#define fract          _Fract
+#define accum          _Accum
+#define sat            _Sat
+
+/* 7.18a.3 Precision macros.  */
+
+#undef SFRACT_FBIT
+#undef SFRACT_MIN
+#undef SFRACT_MAX
+#undef SFRACT_EPSILON
+#define SFRACT_FBIT    __SFRACT_FBIT__
+#define SFRACT_MIN     __SFRACT_MIN__
+#define SFRACT_MAX     __SFRACT_MAX__
+#define SFRACT_EPSILON __SFRACT_EPSILON__
+
+#undef USFRACT_FBIT
+#undef USFRACT_MIN
+#undef USFRACT_MAX
+#undef USFRACT_EPSILON
+#define USFRACT_FBIT   __USFRACT_FBIT__
+#define USFRACT_MIN    __USFRACT_MIN__         /* GCC extension.  */
+#define USFRACT_MAX    __USFRACT_MAX__
+#define USFRACT_EPSILON        __USFRACT_EPSILON__
+
+#undef FRACT_FBIT
+#undef FRACT_MIN
+#undef FRACT_MAX
+#undef FRACT_EPSILON
+#define FRACT_FBIT     __FRACT_FBIT__
+#define FRACT_MIN      __FRACT_MIN__
+#define FRACT_MAX      __FRACT_MAX__
+#define FRACT_EPSILON  __FRACT_EPSILON__
+
+#undef UFRACT_FBIT
+#undef UFRACT_MIN
+#undef UFRACT_MAX
+#undef UFRACT_EPSILON
+#define UFRACT_FBIT    __UFRACT_FBIT__
+#define UFRACT_MIN     __UFRACT_MIN__          /* GCC extension.  */
+#define UFRACT_MAX     __UFRACT_MAX__
+#define UFRACT_EPSILON __UFRACT_EPSILON__
+
+#undef LFRACT_FBIT
+#undef LFRACT_MIN
+#undef LFRACT_MAX
+#undef LFRACT_EPSILON
+#define LFRACT_FBIT    __LFRACT_FBIT__
+#define LFRACT_MIN     __LFRACT_MIN__
+#define LFRACT_MAX     __LFRACT_MAX__
+#define LFRACT_EPSILON __LFRACT_EPSILON__
+
+#undef ULFRACT_FBIT
+#undef ULFRACT_MIN
+#undef ULFRACT_MAX
+#undef ULFRACT_EPSILON
+#define ULFRACT_FBIT   __ULFRACT_FBIT__
+#define ULFRACT_MIN    __ULFRACT_MIN__         /* GCC extension.  */
+#define ULFRACT_MAX    __ULFRACT_MAX__
+#define ULFRACT_EPSILON        __ULFRACT_EPSILON__
+
+#undef LLFRACT_FBIT
+#undef LLFRACT_MIN
+#undef LLFRACT_MAX
+#undef LLFRACT_EPSILON
+#define LLFRACT_FBIT   __LLFRACT_FBIT__        /* GCC extension.  */
+#define LLFRACT_MIN    __LLFRACT_MIN__         /* GCC extension.  */
+#define LLFRACT_MAX    __LLFRACT_MAX__         /* GCC extension.  */
+#define LLFRACT_EPSILON        __LLFRACT_EPSILON__     /* GCC extension.  */
+
+#undef ULLFRACT_FBIT
+#undef ULLFRACT_MIN
+#undef ULLFRACT_MAX
+#undef ULLFRACT_EPSILON
+#define ULLFRACT_FBIT  __ULLFRACT_FBIT__       /* GCC extension.  */
+#define ULLFRACT_MIN   __ULLFRACT_MIN__        /* GCC extension.  */
+#define ULLFRACT_MAX   __ULLFRACT_MAX__        /* GCC extension.  */
+#define ULLFRACT_EPSILON       __ULLFRACT_EPSILON__    /* GCC extension.  */
+
+#undef SACCUM_FBIT
+#undef SACCUM_IBIT
+#undef SACCUM_MIN
+#undef SACCUM_MAX
+#undef SACCUM_EPSILON
+#define SACCUM_FBIT    __SACCUM_FBIT__
+#define SACCUM_IBIT    __SACCUM_IBIT__
+#define SACCUM_MIN     __SACCUM_MIN__
+#define SACCUM_MAX     __SACCUM_MAX__
+#define SACCUM_EPSILON __SACCUM_EPSILON__
+
+#undef USACCUM_FBIT
+#undef USACCUM_IBIT
+#undef USACCUM_MIN
+#undef USACCUM_MAX
+#undef USACCUM_EPSILON
+#define USACCUM_FBIT   __USACCUM_FBIT__
+#define USACCUM_IBIT   __USACCUM_IBIT__
+#define USACCUM_MIN    __USACCUM_MIN__         /* GCC extension.  */
+#define USACCUM_MAX    __USACCUM_MAX__
+#define USACCUM_EPSILON        __USACCUM_EPSILON__
+
+#undef ACCUM_FBIT
+#undef ACCUM_IBIT
+#undef ACCUM_MIN
+#undef ACCUM_MAX
+#undef ACCUM_EPSILON
+#define ACCUM_FBIT     __ACCUM_FBIT__
+#define ACCUM_IBIT     __ACCUM_IBIT__
+#define ACCUM_MIN      __ACCUM_MIN__
+#define ACCUM_MAX      __ACCUM_MAX__
+#define ACCUM_EPSILON  __ACCUM_EPSILON__
+
+#undef UACCUM_FBIT
+#undef UACCUM_IBIT
+#undef UACCUM_MIN
+#undef UACCUM_MAX
+#undef UACCUM_EPSILON
+#define UACCUM_FBIT    __UACCUM_FBIT__
+#define UACCUM_IBIT    __UACCUM_IBIT__
+#define UACCUM_MIN     __UACCUM_MIN__          /* GCC extension.  */
+#define UACCUM_MAX     __UACCUM_MAX__
+#define UACCUM_EPSILON __UACCUM_EPSILON__
+
+#undef LACCUM_FBIT
+#undef LACCUM_IBIT
+#undef LACCUM_MIN
+#undef LACCUM_MAX
+#undef LACCUM_EPSILON
+#define LACCUM_FBIT    __LACCUM_FBIT__
+#define LACCUM_IBIT    __LACCUM_IBIT__
+#define LACCUM_MIN     __LACCUM_MIN__
+#define LACCUM_MAX     __LACCUM_MAX__
+#define LACCUM_EPSILON __LACCUM_EPSILON__
+
+#undef ULACCUM_FBIT
+#undef ULACCUM_IBIT
+#undef ULACCUM_MIN
+#undef ULACCUM_MAX
+#undef ULACCUM_EPSILON
+#define ULACCUM_FBIT   __ULACCUM_FBIT__
+#define ULACCUM_IBIT   __ULACCUM_IBIT__
+#define ULACCUM_MIN    __ULACCUM_MIN__         /* GCC extension.  */
+#define ULACCUM_MAX    __ULACCUM_MAX__
+#define ULACCUM_EPSILON        __ULACCUM_EPSILON__
+
+#undef LLACCUM_FBIT
+#undef LLACCUM_IBIT
+#undef LLACCUM_MIN
+#undef LLACCUM_MAX
+#undef LLACCUM_EPSILON
+#define LLACCUM_FBIT   __LLACCUM_FBIT__        /* GCC extension.  */
+#define LLACCUM_IBIT   __LLACCUM_IBIT__        /* GCC extension.  */
+#define LLACCUM_MIN    __LLACCUM_MIN__         /* GCC extension.  */
+#define LLACCUM_MAX    __LLACCUM_MAX__         /* GCC extension.  */
+#define LLACCUM_EPSILON        __LLACCUM_EPSILON__     /* GCC extension.  */
+
+#undef ULLACCUM_FBIT
+#undef ULLACCUM_IBIT
+#undef ULLACCUM_MIN
+#undef ULLACCUM_MAX
+#undef ULLACCUM_EPSILON
+#define ULLACCUM_FBIT  __ULLACCUM_FBIT__       /* GCC extension.  */
+#define ULLACCUM_IBIT  __ULLACCUM_IBIT__       /* GCC extension.  */
+#define ULLACCUM_MIN   __ULLACCUM_MIN__        /* GCC extension.  */
+#define ULLACCUM_MAX   __ULLACCUM_MAX__        /* GCC extension.  */
+#define ULLACCUM_EPSILON       __ULLACCUM_EPSILON__    /* GCC extension.  */
+
+#endif /* _STDFIX_H */
diff --git a/Library/include/68000/stdint-gcc.h b/Library/include/68000/stdint-gcc.h
new file mode 100644 (file)
index 0000000..9129427
--- /dev/null
@@ -0,0 +1,263 @@
+/* Copyright (C) 2008-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/*
+ * ISO C Standard:  7.18  Integer types  <stdint.h>
+ */
+
+#ifndef _GCC_STDINT_H
+#define _GCC_STDINT_H
+
+/* 7.8.1.1 Exact-width integer types */
+
+#ifdef __INT8_TYPE__
+typedef __INT8_TYPE__ int8_t;
+#endif
+#ifdef __INT16_TYPE__
+typedef __INT16_TYPE__ int16_t;
+#endif
+#ifdef __INT32_TYPE__
+typedef __INT32_TYPE__ int32_t;
+#endif
+#ifdef __INT64_TYPE__
+typedef __INT64_TYPE__ int64_t;
+#endif
+#ifdef __UINT8_TYPE__
+typedef __UINT8_TYPE__ uint8_t;
+#endif
+#ifdef __UINT16_TYPE__
+typedef __UINT16_TYPE__ uint16_t;
+#endif
+#ifdef __UINT32_TYPE__
+typedef __UINT32_TYPE__ uint32_t;
+#endif
+#ifdef __UINT64_TYPE__
+typedef __UINT64_TYPE__ uint64_t;
+#endif
+
+/* 7.8.1.2 Minimum-width integer types */
+
+typedef __INT_LEAST8_TYPE__ int_least8_t;
+typedef __INT_LEAST16_TYPE__ int_least16_t;
+typedef __INT_LEAST32_TYPE__ int_least32_t;
+typedef __INT_LEAST64_TYPE__ int_least64_t;
+typedef __UINT_LEAST8_TYPE__ uint_least8_t;
+typedef __UINT_LEAST16_TYPE__ uint_least16_t;
+typedef __UINT_LEAST32_TYPE__ uint_least32_t;
+typedef __UINT_LEAST64_TYPE__ uint_least64_t;
+
+/* 7.8.1.3 Fastest minimum-width integer types */
+
+typedef __INT_FAST8_TYPE__ int_fast8_t;
+typedef __INT_FAST16_TYPE__ int_fast16_t;
+typedef __INT_FAST32_TYPE__ int_fast32_t;
+typedef __INT_FAST64_TYPE__ int_fast64_t;
+typedef __UINT_FAST8_TYPE__ uint_fast8_t;
+typedef __UINT_FAST16_TYPE__ uint_fast16_t;
+typedef __UINT_FAST32_TYPE__ uint_fast32_t;
+typedef __UINT_FAST64_TYPE__ uint_fast64_t;
+
+/* 7.8.1.4 Integer types capable of holding object pointers */
+
+#ifdef __INTPTR_TYPE__
+typedef __INTPTR_TYPE__ intptr_t;
+#endif
+#ifdef __UINTPTR_TYPE__
+typedef __UINTPTR_TYPE__ uintptr_t;
+#endif
+
+/* 7.8.1.5 Greatest-width integer types */
+
+typedef __INTMAX_TYPE__ intmax_t;
+typedef __UINTMAX_TYPE__ uintmax_t;
+
+#if (!defined __cplusplus || __cplusplus >= 201103L \
+     || defined __STDC_LIMIT_MACROS)
+
+/* 7.18.2 Limits of specified-width integer types */
+
+#ifdef __INT8_MAX__
+# undef INT8_MAX
+# define INT8_MAX __INT8_MAX__
+# undef INT8_MIN
+# define INT8_MIN (-INT8_MAX - 1)
+#endif
+#ifdef __UINT8_MAX__
+# undef UINT8_MAX
+# define UINT8_MAX __UINT8_MAX__
+#endif
+#ifdef __INT16_MAX__
+# undef INT16_MAX
+# define INT16_MAX __INT16_MAX__
+# undef INT16_MIN
+# define INT16_MIN (-INT16_MAX - 1)
+#endif
+#ifdef __UINT16_MAX__
+# undef UINT16_MAX
+# define UINT16_MAX __UINT16_MAX__
+#endif
+#ifdef __INT32_MAX__
+# undef INT32_MAX
+# define INT32_MAX __INT32_MAX__
+# undef INT32_MIN
+# define INT32_MIN (-INT32_MAX - 1)
+#endif
+#ifdef __UINT32_MAX__
+# undef UINT32_MAX
+# define UINT32_MAX __UINT32_MAX__
+#endif
+#ifdef __INT64_MAX__
+# undef INT64_MAX
+# define INT64_MAX __INT64_MAX__
+# undef INT64_MIN
+# define INT64_MIN (-INT64_MAX - 1)
+#endif
+#ifdef __UINT64_MAX__
+# undef UINT64_MAX
+# define UINT64_MAX __UINT64_MAX__
+#endif
+
+#undef INT_LEAST8_MAX
+#define INT_LEAST8_MAX __INT_LEAST8_MAX__
+#undef INT_LEAST8_MIN
+#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
+#undef UINT_LEAST8_MAX
+#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
+#undef INT_LEAST16_MAX
+#define INT_LEAST16_MAX __INT_LEAST16_MAX__
+#undef INT_LEAST16_MIN
+#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
+#undef UINT_LEAST16_MAX
+#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
+#undef INT_LEAST32_MAX
+#define INT_LEAST32_MAX __INT_LEAST32_MAX__
+#undef INT_LEAST32_MIN
+#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
+#undef UINT_LEAST32_MAX
+#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
+#undef INT_LEAST64_MAX
+#define INT_LEAST64_MAX __INT_LEAST64_MAX__
+#undef INT_LEAST64_MIN
+#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
+#undef UINT_LEAST64_MAX
+#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
+
+#undef INT_FAST8_MAX
+#define INT_FAST8_MAX __INT_FAST8_MAX__
+#undef INT_FAST8_MIN
+#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
+#undef UINT_FAST8_MAX
+#define UINT_FAST8_MAX __UINT_FAST8_MAX__
+#undef INT_FAST16_MAX
+#define INT_FAST16_MAX __INT_FAST16_MAX__
+#undef INT_FAST16_MIN
+#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
+#undef UINT_FAST16_MAX
+#define UINT_FAST16_MAX __UINT_FAST16_MAX__
+#undef INT_FAST32_MAX
+#define INT_FAST32_MAX __INT_FAST32_MAX__
+#undef INT_FAST32_MIN
+#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
+#undef UINT_FAST32_MAX
+#define UINT_FAST32_MAX __UINT_FAST32_MAX__
+#undef INT_FAST64_MAX
+#define INT_FAST64_MAX __INT_FAST64_MAX__
+#undef INT_FAST64_MIN
+#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
+#undef UINT_FAST64_MAX
+#define UINT_FAST64_MAX __UINT_FAST64_MAX__
+
+#ifdef __INTPTR_MAX__
+# undef INTPTR_MAX
+# define INTPTR_MAX __INTPTR_MAX__
+# undef INTPTR_MIN
+# define INTPTR_MIN (-INTPTR_MAX - 1)
+#endif
+#ifdef __UINTPTR_MAX__
+# undef UINTPTR_MAX
+# define UINTPTR_MAX __UINTPTR_MAX__
+#endif
+
+#undef INTMAX_MAX
+#define INTMAX_MAX __INTMAX_MAX__
+#undef INTMAX_MIN
+#define INTMAX_MIN (-INTMAX_MAX - 1)
+#undef UINTMAX_MAX
+#define UINTMAX_MAX __UINTMAX_MAX__
+
+/* 7.18.3 Limits of other integer types */
+
+#undef PTRDIFF_MAX
+#define PTRDIFF_MAX __PTRDIFF_MAX__
+#undef PTRDIFF_MIN
+#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
+
+#undef SIG_ATOMIC_MAX
+#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
+#undef SIG_ATOMIC_MIN
+#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
+
+#undef SIZE_MAX
+#define SIZE_MAX __SIZE_MAX__
+
+#undef WCHAR_MAX
+#define WCHAR_MAX __WCHAR_MAX__
+#undef WCHAR_MIN
+#define WCHAR_MIN __WCHAR_MIN__
+
+#undef WINT_MAX
+#define WINT_MAX __WINT_MAX__
+#undef WINT_MIN
+#define WINT_MIN __WINT_MIN__
+
+#endif /* (!defined __cplusplus || __cplusplus >= 201103L
+          || defined __STDC_LIMIT_MACROS)  */
+
+#if (!defined __cplusplus || __cplusplus >= 201103L \
+     || defined __STDC_CONSTANT_MACROS)
+
+#undef INT8_C
+#define INT8_C(c) __INT8_C(c)
+#undef INT16_C
+#define INT16_C(c) __INT16_C(c)
+#undef INT32_C
+#define INT32_C(c) __INT32_C(c)
+#undef INT64_C
+#define INT64_C(c) __INT64_C(c)
+#undef UINT8_C
+#define UINT8_C(c) __UINT8_C(c)
+#undef UINT16_C
+#define UINT16_C(c) __UINT16_C(c)
+#undef UINT32_C
+#define UINT32_C(c) __UINT32_C(c)
+#undef UINT64_C
+#define UINT64_C(c) __UINT64_C(c)
+#undef INTMAX_C
+#define INTMAX_C(c) __INTMAX_C(c)
+#undef UINTMAX_C
+#define UINTMAX_C(c) __UINTMAX_C(c)
+
+#endif /* (!defined __cplusplus || __cplusplus >= 201103L
+          || defined __STDC_CONSTANT_MACROS) */
+
+#endif /* _GCC_STDINT_H */
diff --git a/Library/include/68000/stdint.h b/Library/include/68000/stdint.h
new file mode 100644 (file)
index 0000000..3aa34a2
--- /dev/null
@@ -0,0 +1 @@
+#include "stdint-gcc.h"
diff --git a/Library/include/68000/stdnoreturn.h b/Library/include/68000/stdnoreturn.h
new file mode 100644 (file)
index 0000000..8137eee
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright (C) 2011-2015 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* ISO C1X: 7.23 _Noreturn <stdnoreturn.h>.  */
+
+#ifndef _STDNORETURN_H
+#define _STDNORETURN_H
+
+#ifndef __cplusplus
+
+#define noreturn _Noreturn
+
+#endif
+
+#endif /* stdnoreturn.h */
diff --git a/Library/include/68000/syslimits.h b/Library/include/68000/syslimits.h
new file mode 100644 (file)
index 0000000..a362802
--- /dev/null
@@ -0,0 +1,8 @@
+/* syslimits.h stands for the system's own limits.h file.
+   If we can use it ok unmodified, then we install this text.
+   If fixincludes fixes it, then the fixed version is installed
+   instead of this text.  */
+
+#define _GCC_NEXT_LIMITS_H             /* tell gcc's limits.h to recurse */
+#include_next <limits.h>
+#undef _GCC_NEXT_LIMITS_H
diff --git a/Library/include/68000/unwind.h b/Library/include/68000/unwind.h
new file mode 100644 (file)
index 0000000..26dbc6a
--- /dev/null
@@ -0,0 +1,295 @@
+/* Exception handling and frame unwind runtime interface routines.
+   Copyright (C) 2001-2015 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is derived from the C++ ABI for IA-64.  Where we diverge
+   for cross-architecture compatibility are noted with "@@@".  */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H
+
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
+/* Only for _GCC_specific_handler.  */
+#include <windows.h>
+#endif
+
+#ifndef HIDE_EXPORTS
+#pragma GCC visibility push(default)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Level 1: Base ABI  */
+
+/* @@@ The IA-64 ABI uses uint64 throughout.  Most places this is
+   inefficient for 32-bit and smaller machines.  */
+typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
+#if defined(__ia64__) && defined(__hpux__)
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
+#else
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+#endif
+typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
+
+/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
+   consumer of an exception.  We'll go along with this for now even on
+   32-bit machines.  We'll need to provide some other option for
+   16-bit machines and for machines with > 8 bits per byte.  */
+typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+
+/* The unwind interface uses reason codes in several contexts to
+   identify the reasons for failures or other actions.  */
+typedef enum
+{
+  _URC_NO_REASON = 0,
+  _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+  _URC_FATAL_PHASE2_ERROR = 2,
+  _URC_FATAL_PHASE1_ERROR = 3,
+  _URC_NORMAL_STOP = 4,
+  _URC_END_OF_STACK = 5,
+  _URC_HANDLER_FOUND = 6,
+  _URC_INSTALL_CONTEXT = 7,
+  _URC_CONTINUE_UNWIND = 8
+} _Unwind_Reason_Code;
+
+
+/* The unwind interface uses a pointer to an exception header object
+   as its representation of an exception being thrown. In general, the
+   full representation of an exception object is language- and
+   implementation-specific, but it will be prefixed by a header
+   understood by the unwind interface.  */
+
+struct _Unwind_Exception;
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+                                             struct _Unwind_Exception *);
+
+struct _Unwind_Exception
+{
+  _Unwind_Exception_Class exception_class;
+  _Unwind_Exception_Cleanup_Fn exception_cleanup;
+
+#if !defined (__USING_SJLJ_EXCEPTIONS__) && defined (__SEH__)
+  _Unwind_Word private_[6];
+#else
+  _Unwind_Word private_1;
+  _Unwind_Word private_2;
+#endif
+
+  /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+     Taking that literally does not make much sense generically.  Instead we
+     provide the maximum alignment required by any type for the machine.  */
+} __attribute__((__aligned__));
+
+
+/* The ACTIONS argument to the personality routine is a bitwise OR of one
+   or more of the following constants.  */
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE       1
+#define _UA_CLEANUP_PHASE      2
+#define _UA_HANDLER_FRAME      4
+#define _UA_FORCE_UNWIND       8
+#define _UA_END_OF_STACK       16
+
+/* The target can override this macro to define any back-end-specific
+   attributes required for the lowest-level stack frame.  */
+#ifndef LIBGCC2_UNWIND_ATTRIBUTE
+#define LIBGCC2_UNWIND_ATTRIBUTE
+#endif
+
+/* This is an opaque type used to refer to a system-specific data
+   structure used by the system unwinder. This context is created and
+   destroyed by the system, and passed to the personality routine
+   during unwinding.  */
+struct _Unwind_Context;
+
+/* Raise an exception, passing along the given exception object.  */
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_RaiseException (struct _Unwind_Exception *);
+
+/* Raise an exception for forced unwinding.  */
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+     (int, _Unwind_Action, _Unwind_Exception_Class,
+      struct _Unwind_Exception *, struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+
+/* Helper to invoke the exception_cleanup routine.  */
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+
+/* Resume propagation of an existing exception.  This is used after
+   e.g. executing cleanup code, and not to implement rethrowing.  */
+extern void LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Resume (struct _Unwind_Exception *);
+
+/* @@@ Resume propagation of a FORCE_UNWIND exception, or to rethrow
+   a normal exception that was handled.  */
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* @@@ Use unwind data to perform a stack backtrace.  The trace callback
+   is called for every stack frame in the call chain, but no cleanup
+   actions are performed.  */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
+     (struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* These functions are used for communicating information about the unwind
+   context (i.e. the unwind descriptors and the user register state) between
+   the unwind library and the personality routine and landing pad.  Only
+   selected registers may be manipulated.  */
+
+extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
+
+extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+
+/* @@@ Retrieve the CFA of the given context.  */
+extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
+
+extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
+
+extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+
+/* The personality routine is the function in the C++ (or other language)
+   runtime library which serves as an interface between the system unwind
+   library and language-specific exception handling semantics.  It is
+   specific to the code fragment described by an unwind info block, and
+   it is always referenced via the pointer in the unwind info block, and
+   hence it has no ABI-specified name.
+
+   Note that this implies that two different C++ implementations can
+   use different names, and have different contents in the language
+   specific data area.  Moreover, that the language specific data
+   area contains no version info because name of the function invoked
+   provides more effective versioning by detecting at link time the
+   lack of code to handle the different data format.  */
+
+typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
+     (int, _Unwind_Action, _Unwind_Exception_Class,
+      struct _Unwind_Exception *, struct _Unwind_Context *);
+
+/* @@@ The following alternate entry points are for setjmp/longjmp
+   based unwinding.  */
+
+struct SjLj_Function_Context;
+extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
+extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
+
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_RaiseException (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+extern void LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_Resume (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
+_Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* @@@ The following provide access to the base addresses for text
+   and data-relative addressing in the LDSA.  In order to stay link
+   compatible with the standard ABI for IA-64, we inline these.  */
+
+#ifdef __ia64__
+#ifndef inhibit_libc
+#include <stdlib.h>
+#endif
+
+static inline _Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
+{
+  /* The GP is stored in R1.  */
+  return _Unwind_GetGR (_C, 1);
+}
+
+static inline _Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
+{
+  abort ();
+  return 0;
+}
+
+/* @@@ Retrieve the Backing Store Pointer of the given context.  */
+extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
+#else
+extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+#endif
+
+/* @@@ Given an address, return the entry point of the function that
+   contains it.  */
+extern void * _Unwind_FindEnclosingFunction (void *pc);
+
+#ifndef __SIZEOF_LONG__
+  #error "__SIZEOF_LONG__ macro not defined"
+#endif
+
+#ifndef __SIZEOF_POINTER__
+  #error "__SIZEOF_POINTER__ macro not defined"
+#endif
+
+
+/* leb128 type numbers have a potentially unlimited size.
+   The target of the following definitions of _sleb128_t and _uleb128_t
+   is to have efficient data types large enough to hold the leb128 type
+   numbers used in the unwind code.
+   Mostly these types will simply be defined to long and unsigned long
+   except when a unsigned long data type on the target machine is not
+   capable of storing a pointer.  */
+
+#if __SIZEOF_LONG__ >= __SIZEOF_POINTER__
+  typedef long _sleb128_t;
+  typedef unsigned long _uleb128_t;
+#elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__
+  typedef long long _sleb128_t;
+  typedef unsigned long long _uleb128_t;
+#else
+# error "What type shall we use for _sleb128_t?"
+#endif
+
+#if defined (__SEH__) && !defined (__USING_SJLJ_EXCEPTIONS__)
+/* Handles the mapping from SEH to GCC interfaces.  */
+EXCEPTION_DISPOSITION _GCC_specific_handler (PEXCEPTION_RECORD, void *,
+                                            PCONTEXT, PDISPATCHER_CONTEXT,
+                                            _Unwind_Personality_Fn);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef HIDE_EXPORTS
+#pragma GCC visibility pop
+#endif
+
+#endif /* unwind.h */
diff --git a/Library/include/68000/varargs.h b/Library/include/68000/varargs.h
new file mode 100644 (file)
index 0000000..4b9803e
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _VARARGS_H
+#define _VARARGS_H
+
+#error "GCC no longer implements <varargs.h>."
+#error "Revise your code to use <stdarg.h>."
+
+#endif
diff --git a/Library/libs/Makefile.68000 b/Library/libs/Makefile.68000
new file mode 100644 (file)
index 0000000..bff4469
--- /dev/null
@@ -0,0 +1,151 @@
+CC = m68k-linux-gnu-gcc
+ASM = m68k-linux-gnu-as
+AR = m68k-linux-gnu-ar
+PLATFORM = 68000
+export PLATFORM
+CC_OPT = -m68000 -fno-strict-aliasing -fomit-frame-pointer -fno-builtin -Wall -m68000 -c -Os -I../include -I../include/68000 -I../include/68000/fixed
+ASM_OPT = -o
+# copied in from kernel tree
+KRN_HEADERS = userstructs.h drivewire.h
+KRN_HEADERS_SRC = $(addprefix ../../Kernel/include/,$(KRN_HEADERS))
+KRN_HEADERS_COPY = $(addprefix ../include/sys/,$(KRN_HEADERS))
+SRC_CRT0 = crt0_$(PLATFORM).s crt0nostdio_$(PLATFORM).s
+OBJ_CRT0 = $(SRC_CRT0:.s=.o)
+SRC_ASM = setjmp_68000.S
+OBJ_ASM = $(SRC_ASM:.S=.o)
+SRC_C =  __argv.c abort.c asctime.c assert.c atexit.c
+SRC_C += bcmp.c bcopy.c bsearch.c bzero.c calloc.c cfree.c clock.c closedir.c
+SRC_C += closedir_r.c clock_gettime.c clock_getres.c clock_settime.c
+SRC_C += creat.c crypt.c ctermid.c ctime.c cuserid.c
+SRC_C += difftime.c err.c errno.c error.c
+SRC_C += execl.c execv.c execvp.c exit.c
+SRC_C += fclose.c fdatasync.c fflush.c fgetc.c fgetgrent.c fgetpwent.c
+SRC_C += fgetpos.c fgets.c fopen.c fork.c fprintf.c fputc.c fputs.c fread.c
+SRC_C += free.c fsetpos.c fsync.c ftell.c fwrite.c getcwd.c
+SRC_C += getenv.c __getgrent.c getgrgid.c getgrnam.c getloadavg.c getlogin.c
+SRC_C += getopt.c
+SRC_C += getpw.c __getpwent.c getpwnam.c getpwuid.c gets.c gettimeofday.c
+SRC_C += getw.c gmtime.c gmtime_r.c grent.c
+SRC_C += inet_addr.c inet_aton.c inet_network.c inet_ntoa.c inet_ntop.c inet_pton.c
+SRC_C += index.c initgroups.c isatty.c killpg.c
+SRC_C += libintl.c
+SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c
+SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c opendir_r.c
+SRC_C += pause.c perror.c
+SRC_C += popen.c printf.c putenv.c putchar.c putpwent.c putw.c pwent.c qsort.c
+SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c
+SRC_C += regsub.c remove.c rewind.c rewinddir.c rindex.c seekdir.c setbuffer.c setenv.c
+SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c
+SRC_C += stat.c stdio0.c stime.c
+SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
+SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c strsignal.c
+SRC_C += strtod.c strtol.c swab.c system.c telldir.c time.c tmpfile.c tmpnam.c ttyname.c
+SRC_C += tzset.c ungetc.c usleep.c utent.c utimes.c utsname.c
+SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
+SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c
+# ctype
+SRC_C += isalnum.c isalpha.c isascii.c isblank.c iscntrl.c isdigit.c
+SRC_C += isgraph.c islower.c isprint.c ispunct.c isspace.c isupper.c
+SRC_C += isxdigit.c toupper.c tolower.c
+# tty layer
+SRC_C += tcgetattr.c tcsetattr.c tcdrain.c tcflow.c tcflush.c
+SRC_C += cfmakeraw.c cfspeed.c revoke.c
+# scanf
+SRC_C += fscanf.c scanf.c sscanf.c vfscanf.c vscanf.c vsscanf.c
+# Seems to give the compiler a hard time
+SRC_C += regexp.c
+# Pieces we inherit in this case from the compiler library instead
+SRC_C += strcpy.c strlen.c abs.c atof.c atoi.c atol.c labs.c
+SRC_C += strcat.c strchr.c strcmp.c strcspn.c strncat.c strncmp.c
+SRC_C += strncpy.c strpbrk.c strrchr.c strspn.c strstr.c strtok.c
+SRC_C += memchr.c memcmp.c memcpy.c memset.c memmove.c
+
+SRC_CT += termcap.c tgetent.c
+
+SRC_CURS = $(shell find curses -name '*.c')
+
+SRC_LM = vfscanf.c vfprintf.c
+OBJ_LM = vfscanf-libm.o vfprintf-libm.o
+
+OBJ_C = $(SRC_C:.c=.o)
+OBJ_CURS = $(SRC_CURS:.c=.o)
+OBJ_CT = $(SRC_CT:.c=.o)
+OBJ_HARD = $(SRC_HARD:.c=.o)
+OBJ_ALL = $(OBJ_ASM) $(OBJ_C) $(OBJ_HARD)
+
+all: syslib$(PLATFORM).lib liberror.txt $(OBJ_CRT0) curses$(PLATFORM).lib termcap$(PLATFORM).lib m$(PLATFORM).lib
+
+$(OBJ_ALL): $(KRN_HEADERS_COPY)
+
+$(KRN_HEADERS_COPY): $(KRN_HEADERS_SRC)
+       cp ../../Kernel/include/$(notdir $@) $@
+
+libc.l:%.l:$(OBJ_ALL)
+       ls $(OBJ_ALL) > libc.l
+
+syscall.l: fuzix$(PLATFORM)/syslib.l
+       ../tools/syscall_$(PLATFORM)
+       (cd fuzix$(PLATFORM); make)
+       cat fuzix$(PLATFORM)/syslib.l | tr " " "\\n" | sed -e "s/^/fuzix$(PLATFORM)\//" >syscall.l
+
+syslib$(PLATFORM).lib: syscall.l libc.l
+       cat libc.l syscall.l >syslib.l
+       $(AR) rc syslib$(PLATFORM).lib $$(cat syslib.l)
+       ln -sf syslib$(PLATFORM).lib libc$(PLATFORM).a
+
+fuzix$(PLATFORM)/syslib.l: ../tools/syscall_$(PLATFORM)
+       $<
+       make -C fuzix$(PLATFORM)
+
+../tools/syscall_$(PLATFORM): ../tools/syscall_$(PLATFORM).c
+       make -C .. tools/syscall_$(PLATFORM)
+
+liberror.txt: ../tools/liberror
+       $< -X > $@
+
+../tools/liberror: ../tools/liberror.c
+       make -C .. tools/liberror
+
+curses$(PLATFORM).lib: $(OBJ_CURS)
+       $(AR) rc curses$(PLATFORM).lib $(OBJ_CURS)
+       ln -sf curses$(PLATFORM).lib libcurses$(PLATFORM).a
+
+termcap$(PLATFORM).lib: $(OBJ_CT)
+       $(AR) rc termcap$(PLATFORM).lib $(OBJ_CT)
+       ln -sf termcap$(PLATFORM).lib libtermcap$(PLATFORM).a
+
+m$(PLATFORM).lib: $(OBJ_LM)
+       $(AR) rc m$(PLATFORM).lib $(OBJ_LM)
+       ln -sf m$(PLATFORM).lib libm$(PLATFORM).a
+
+$(OBJ_ASM):%.o: %.s
+       $(ASM) $(ASM_OPT) $@ $(@:.o=.s)
+
+$(OBJ_CRT0):%.o: %.s
+       $(ASM) $(ASM_OPT) $@ $(@:.o=.s)
+
+$(OBJ_C):%.o: %.c
+       $(CC) $(CC_OPT) $(@:.o=.c)
+
+$(OBJ_CT):%.o: %.c
+       $(CC) $(CC_OPT) $(@:.o=.c)
+
+$(OBJ_CURS):%.o: %.c
+       $(CC) $(CC_OPT) $(@:.o=.c) -o $@
+
+vfscanf-libm.o: vfscanf.c
+       $(CC) $(CC_OPT) -DBUILD_LIBM $< -o $@
+
+vfprintf-libm.o: vfprintf.c
+       $(CC) $(CC_OPT) -DBUILD_LIBM $< -o $@
+
+$(OBJ_HARD):%.o: %.c
+       $(CC) $(CC_NOOPT) $(@:.o=.c)
+
+clean:
+       rm -rf *.o *.asm *.sym *.lst *.lib *~ syscall.l libc.l syslib.l \
+       libc$(PLATFORM).a liberror.txt
+       -cd fuzix$(PLATFORM) && make clean
+       rm -rf fuzix$(PLATFORM)/Makefile
+       rm -f $(KRN_HEADERS_COPY)
+       -cd curses && rm -rf *.o *.asm *.sym *.lst *~
diff --git a/Library/libs/fuzix68000/Makefile b/Library/libs/fuzix68000/Makefile
new file mode 100644 (file)
index 0000000..fc31061
--- /dev/null
@@ -0,0 +1,121 @@
+# Autogenerated by tools/syscall_68000
+CROSS_AS=m68k-linux-gnu-gcc
+CROSS_LD=m68k-linux-gnu-ld
+CROSS_AR=m68k-linux-gnu-ar
+ASOPTS=
+
+ASRCS = syscall__exit.S
+ASRCS += syscall_open.S
+ASRCS += syscall_close.S
+ASRCS += syscall_rename.S
+ASRCS += syscall_mknod.S
+ASRCS += syscall_link.S
+ASRCS += syscall_unlink.S
+ASRCS += syscall_read.S
+ASRCS += syscall_write.S
+ASRCS += syscall__lseek.S
+ASRCS += syscall_chdir.S
+ASRCS += syscall_sync.S
+ASRCS += syscall_access.S
+ASRCS += syscall_chmod.S
+ASRCS += syscall_chown.S
+ASRCS += syscall__stat.S
+ASRCS += syscall__fstat.S
+ASRCS += syscall_dup.S
+ASRCS += syscall_getpid.S
+ASRCS += syscall_getppid.S
+ASRCS += syscall_getuid.S
+ASRCS += syscall_umask.S
+ASRCS += syscall__getfsys.S
+ASRCS += syscall_execve.S
+ASRCS += syscall__getdirent.S
+ASRCS += syscall_setuid.S
+ASRCS += syscall_setgid.S
+ASRCS += syscall__time.S
+ASRCS += syscall__stime.S
+ASRCS += syscall_ioctl.S
+ASRCS += syscall_brk.S
+ASRCS += syscall_sbrk.S
+ASRCS += syscall__fork.S
+ASRCS += syscall_mount.S
+ASRCS += syscall_umount.S
+ASRCS += syscall_signal.S
+ASRCS += syscall_dup2.S
+ASRCS += syscall__pause.S
+ASRCS += syscall_alarm.S
+ASRCS += syscall_kill.S
+ASRCS += syscall_pipe.S
+ASRCS += syscall_getgid.S
+ASRCS += syscall_times.S
+ASRCS += syscall_utime.S
+ASRCS += syscall_geteuid.S
+ASRCS += syscall_getegid.S
+ASRCS += syscall_chroot.S
+ASRCS += syscall_fcntl.S
+ASRCS += syscall_fchdir.S
+ASRCS += syscall_fchmod.S
+ASRCS += syscall_fchown.S
+ASRCS += syscall_mkdir.S
+ASRCS += syscall_rmdir.S
+ASRCS += syscall_setpgrp.S
+ASRCS += syscall__uname.S
+ASRCS += syscall_waitpid.S
+ASRCS += syscall__profil.S
+ASRCS += syscall_uadmin.S
+ASRCS += syscall_nice.S
+ASRCS += syscall__sigdisp.S
+ASRCS += syscall_flock.S
+ASRCS += syscall_getpgrp.S
+ASRCS += syscall_yield.S
+ASRCS += syscall_acct.S
+ASRCS += syscall_memalloc.S
+ASRCS += syscall_memfree.S
+ASRCS += syscall__nosys66.S
+ASRCS += syscall__nosys67.S
+ASRCS += syscall__nosys68.S
+ASRCS += syscall__nosys69.S
+ASRCS += syscall__nosys70.S
+ASRCS += syscall__nosys71.S
+ASRCS += syscall__select.S
+ASRCS += syscall_setgroups.S
+ASRCS += syscall_getgroups.S
+ASRCS += syscall_getrlimit.S
+ASRCS += syscall_setrlimit.S
+ASRCS += syscall_setpgid.S
+ASRCS += syscall_setsid.S
+ASRCS += syscall_getsid.S
+ASRCS += syscall__nosys80.S
+ASRCS += syscall__nosys81.S
+ASRCS += syscall__nosys82.S
+ASRCS += syscall__nosys83.S
+ASRCS += syscall__nosys84.S
+ASRCS += syscall__nosys85.S
+ASRCS += syscall__nosys86.S
+ASRCS += syscall__nosys87.S
+ASRCS += syscall__nosys88.S
+ASRCS += syscall__nosys89.S
+ASRCS += syscall_socket.S
+ASRCS += syscall_listen.S
+ASRCS += syscall_bind.S
+ASRCS += syscall_connect.S
+ASRCS += syscall__accept.S
+ASRCS += syscall__getsockaddrs.S
+ASRCS += syscall__sendto.S
+ASRCS += syscall__recvfrom.S
+ASRCS += syscall__shutdown.S
+
+
+ASRCALL = $(ASRCS) $(ASYS)
+
+AOBJS = $(ASRCALL:.S=.o)
+
+syslib.lib: $(AOBJS)
+       echo $(AOBJS) >syslib.l
+       $(CROSS_AR) rc syslib.lib $(AOBJS)
+
+$(AOBJS): %.o: %.S
+       $(CROSS_AS) $(ASOPTS) -c $<
+
+clean:
+       rm -f $(AOBJS) $(ASRCS) syslib.lib syslib.l *~
+
diff --git a/Library/libs/fuzix68000/syscall__accept.S b/Library/libs/fuzix68000/syscall__accept.S
new file mode 100644 (file)
index 0000000..b564c5c
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _accept
+
+_accept:
+.mri 1
+       move.w #94,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__exit.S b/Library/libs/fuzix68000/syscall__exit.S
new file mode 100644 (file)
index 0000000..cce32fc
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _exit
+
+_exit:
+.mri 1
+       move.w #0,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__exit.s b/Library/libs/fuzix68000/syscall__exit.s
new file mode 100644 (file)
index 0000000..c97eae2
--- /dev/null
@@ -0,0 +1,14 @@
+# 1 "syscall__exit.S"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "/usr/include/stdc-predef.h" 1 3 4
+# 1 "<command-line>" 2
+# 1 "syscall__exit.S"
+ .area .text
+
+ .globl __syscall
+ .globl __exit
+
+__exit:
+ move.w #0,d0
+ trap #14
diff --git a/Library/libs/fuzix68000/syscall__fork.S b/Library/libs/fuzix68000/syscall__fork.S
new file mode 100644 (file)
index 0000000..e39e9c5
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _fork
+
+_fork:
+.mri 1
+       move.w #32,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__fstat.S b/Library/libs/fuzix68000/syscall__fstat.S
new file mode 100644 (file)
index 0000000..fc0210b
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _fstat
+
+_fstat:
+.mri 1
+       move.w #16,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__getdirent.S b/Library/libs/fuzix68000/syscall__getdirent.S
new file mode 100644 (file)
index 0000000..b6bc3b6
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _getdirent
+
+_getdirent:
+.mri 1
+       move.w #24,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__getfsys.S b/Library/libs/fuzix68000/syscall__getfsys.S
new file mode 100644 (file)
index 0000000..1796d85
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _getfsys
+
+_getfsys:
+.mri 1
+       move.w #22,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__getsockaddrs.S b/Library/libs/fuzix68000/syscall__getsockaddrs.S
new file mode 100644 (file)
index 0000000..1c8a546
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _getsockaddrs
+
+_getsockaddrs:
+.mri 1
+       move.w #95,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__lseek.S b/Library/libs/fuzix68000/syscall__lseek.S
new file mode 100644 (file)
index 0000000..0cd6e5a
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _lseek
+
+_lseek:
+.mri 1
+       move.w #9,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys66.S b/Library/libs/fuzix68000/syscall__nosys66.S
new file mode 100644 (file)
index 0000000..797fbca
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys66
+
+_nosys66:
+.mri 1
+       move.w #66,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys67.S b/Library/libs/fuzix68000/syscall__nosys67.S
new file mode 100644 (file)
index 0000000..9be7508
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys67
+
+_nosys67:
+.mri 1
+       move.w #67,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys68.S b/Library/libs/fuzix68000/syscall__nosys68.S
new file mode 100644 (file)
index 0000000..d406b6f
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys68
+
+_nosys68:
+.mri 1
+       move.w #68,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys69.S b/Library/libs/fuzix68000/syscall__nosys69.S
new file mode 100644 (file)
index 0000000..8889348
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys69
+
+_nosys69:
+.mri 1
+       move.w #69,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys70.S b/Library/libs/fuzix68000/syscall__nosys70.S
new file mode 100644 (file)
index 0000000..6932eca
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys70
+
+_nosys70:
+.mri 1
+       move.w #70,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys71.S b/Library/libs/fuzix68000/syscall__nosys71.S
new file mode 100644 (file)
index 0000000..2eb5208
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys71
+
+_nosys71:
+.mri 1
+       move.w #71,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys80.S b/Library/libs/fuzix68000/syscall__nosys80.S
new file mode 100644 (file)
index 0000000..db83173
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys80
+
+_nosys80:
+.mri 1
+       move.w #80,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys81.S b/Library/libs/fuzix68000/syscall__nosys81.S
new file mode 100644 (file)
index 0000000..061ca02
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys81
+
+_nosys81:
+.mri 1
+       move.w #81,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys82.S b/Library/libs/fuzix68000/syscall__nosys82.S
new file mode 100644 (file)
index 0000000..75a1443
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys82
+
+_nosys82:
+.mri 1
+       move.w #82,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys83.S b/Library/libs/fuzix68000/syscall__nosys83.S
new file mode 100644 (file)
index 0000000..b19a0eb
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys83
+
+_nosys83:
+.mri 1
+       move.w #83,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys84.S b/Library/libs/fuzix68000/syscall__nosys84.S
new file mode 100644 (file)
index 0000000..8804cbb
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys84
+
+_nosys84:
+.mri 1
+       move.w #84,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys85.S b/Library/libs/fuzix68000/syscall__nosys85.S
new file mode 100644 (file)
index 0000000..feb11a3
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys85
+
+_nosys85:
+.mri 1
+       move.w #85,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys86.S b/Library/libs/fuzix68000/syscall__nosys86.S
new file mode 100644 (file)
index 0000000..2181cdd
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys86
+
+_nosys86:
+.mri 1
+       move.w #86,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys87.S b/Library/libs/fuzix68000/syscall__nosys87.S
new file mode 100644 (file)
index 0000000..de3b807
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys87
+
+_nosys87:
+.mri 1
+       move.w #87,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys88.S b/Library/libs/fuzix68000/syscall__nosys88.S
new file mode 100644 (file)
index 0000000..822b6df
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys88
+
+_nosys88:
+.mri 1
+       move.w #88,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__nosys89.S b/Library/libs/fuzix68000/syscall__nosys89.S
new file mode 100644 (file)
index 0000000..d38b701
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _nosys89
+
+_nosys89:
+.mri 1
+       move.w #89,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__pause.S b/Library/libs/fuzix68000/syscall__pause.S
new file mode 100644 (file)
index 0000000..1d5cd0c
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _pause
+
+_pause:
+.mri 1
+       move.w #37,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__profil.S b/Library/libs/fuzix68000/syscall__profil.S
new file mode 100644 (file)
index 0000000..b4ff5c0
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _profil
+
+_profil:
+.mri 1
+       move.w #56,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__recvfrom.S b/Library/libs/fuzix68000/syscall__recvfrom.S
new file mode 100644 (file)
index 0000000..57cafc4
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _recvfrom
+
+_recvfrom:
+.mri 1
+       move.w #97,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__select.S b/Library/libs/fuzix68000/syscall__select.S
new file mode 100644 (file)
index 0000000..bd4bdce
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _select
+
+_select:
+.mri 1
+       move.w #72,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__sendto.S b/Library/libs/fuzix68000/syscall__sendto.S
new file mode 100644 (file)
index 0000000..9b8c99d
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _sendto
+
+_sendto:
+.mri 1
+       move.w #96,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__shutdown.S b/Library/libs/fuzix68000/syscall__shutdown.S
new file mode 100644 (file)
index 0000000..e7f39e5
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _shutdown
+
+_shutdown:
+.mri 1
+       move.w #98,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__sigdisp.S b/Library/libs/fuzix68000/syscall__sigdisp.S
new file mode 100644 (file)
index 0000000..e18b809
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _sigdisp
+
+_sigdisp:
+.mri 1
+       move.w #59,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__stat.S b/Library/libs/fuzix68000/syscall__stat.S
new file mode 100644 (file)
index 0000000..51f20e2
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _stat
+
+_stat:
+.mri 1
+       move.w #15,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__stime.S b/Library/libs/fuzix68000/syscall__stime.S
new file mode 100644 (file)
index 0000000..cc33dae
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _stime
+
+_stime:
+.mri 1
+       move.w #28,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__time.S b/Library/libs/fuzix68000/syscall__time.S
new file mode 100644 (file)
index 0000000..64da197
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _time
+
+_time:
+.mri 1
+       move.w #27,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall__uname.S b/Library/libs/fuzix68000/syscall__uname.S
new file mode 100644 (file)
index 0000000..e8d4e5c
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl _uname
+
+_uname:
+.mri 1
+       move.w #54,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_access.S b/Library/libs/fuzix68000/syscall_access.S
new file mode 100644 (file)
index 0000000..45e7e70
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl access
+
+access:
+.mri 1
+       move.w #12,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_acct.S b/Library/libs/fuzix68000/syscall_acct.S
new file mode 100644 (file)
index 0000000..fffc7ca
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl acct
+
+acct:
+.mri 1
+       move.w #63,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_alarm.S b/Library/libs/fuzix68000/syscall_alarm.S
new file mode 100644 (file)
index 0000000..9a358ef
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl alarm
+
+alarm:
+.mri 1
+       move.w #38,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_bind.S b/Library/libs/fuzix68000/syscall_bind.S
new file mode 100644 (file)
index 0000000..eef7e93
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl bind
+
+bind:
+.mri 1
+       move.w #92,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_brk.S b/Library/libs/fuzix68000/syscall_brk.S
new file mode 100644 (file)
index 0000000..82f757f
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl brk
+
+brk:
+.mri 1
+       move.w #30,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_chdir.S b/Library/libs/fuzix68000/syscall_chdir.S
new file mode 100644 (file)
index 0000000..96809fe
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl chdir
+
+chdir:
+.mri 1
+       move.w #10,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_chmod.S b/Library/libs/fuzix68000/syscall_chmod.S
new file mode 100644 (file)
index 0000000..d772623
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl chmod
+
+chmod:
+.mri 1
+       move.w #13,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_chown.S b/Library/libs/fuzix68000/syscall_chown.S
new file mode 100644 (file)
index 0000000..435f1eb
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl chown
+
+chown:
+.mri 1
+       move.w #14,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_chroot.S b/Library/libs/fuzix68000/syscall_chroot.S
new file mode 100644 (file)
index 0000000..df193c6
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl chroot
+
+chroot:
+.mri 1
+       move.w #46,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_close.S b/Library/libs/fuzix68000/syscall_close.S
new file mode 100644 (file)
index 0000000..f57199a
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl close
+
+close:
+.mri 1
+       move.w #2,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_connect.S b/Library/libs/fuzix68000/syscall_connect.S
new file mode 100644 (file)
index 0000000..9875d6a
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl connect
+
+connect:
+.mri 1
+       move.w #93,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_dup.S b/Library/libs/fuzix68000/syscall_dup.S
new file mode 100644 (file)
index 0000000..4c1beb7
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl dup
+
+dup:
+.mri 1
+       move.w #17,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_dup2.S b/Library/libs/fuzix68000/syscall_dup2.S
new file mode 100644 (file)
index 0000000..f4f938d
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl dup2
+
+dup2:
+.mri 1
+       move.w #36,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_execve.S b/Library/libs/fuzix68000/syscall_execve.S
new file mode 100644 (file)
index 0000000..c5117e9
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl execve
+
+execve:
+.mri 1
+       move.w #23,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_fchdir.S b/Library/libs/fuzix68000/syscall_fchdir.S
new file mode 100644 (file)
index 0000000..59fed0d
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl fchdir
+
+fchdir:
+.mri 1
+       move.w #48,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_fchmod.S b/Library/libs/fuzix68000/syscall_fchmod.S
new file mode 100644 (file)
index 0000000..b830508
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl fchmod
+
+fchmod:
+.mri 1
+       move.w #49,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_fchown.S b/Library/libs/fuzix68000/syscall_fchown.S
new file mode 100644 (file)
index 0000000..48ff2f8
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl fchown
+
+fchown:
+.mri 1
+       move.w #50,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_fcntl.S b/Library/libs/fuzix68000/syscall_fcntl.S
new file mode 100644 (file)
index 0000000..5d27862
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl fcntl
+
+fcntl:
+.mri 1
+       move.w #47,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_flock.S b/Library/libs/fuzix68000/syscall_flock.S
new file mode 100644 (file)
index 0000000..923da3c
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl flock
+
+flock:
+.mri 1
+       move.w #60,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getegid.S b/Library/libs/fuzix68000/syscall_getegid.S
new file mode 100644 (file)
index 0000000..70ea7de
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getegid
+
+getegid:
+.mri 1
+       move.w #45,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_geteuid.S b/Library/libs/fuzix68000/syscall_geteuid.S
new file mode 100644 (file)
index 0000000..f6cc06b
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl geteuid
+
+geteuid:
+.mri 1
+       move.w #44,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getgid.S b/Library/libs/fuzix68000/syscall_getgid.S
new file mode 100644 (file)
index 0000000..3582e0f
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getgid
+
+getgid:
+.mri 1
+       move.w #41,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getgroups.S b/Library/libs/fuzix68000/syscall_getgroups.S
new file mode 100644 (file)
index 0000000..0d144e4
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getgroups
+
+getgroups:
+.mri 1
+       move.w #74,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getpgrp.S b/Library/libs/fuzix68000/syscall_getpgrp.S
new file mode 100644 (file)
index 0000000..552b707
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getpgrp
+
+getpgrp:
+.mri 1
+       move.w #61,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getpid.S b/Library/libs/fuzix68000/syscall_getpid.S
new file mode 100644 (file)
index 0000000..f7f0986
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getpid
+
+getpid:
+.mri 1
+       move.w #18,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getppid.S b/Library/libs/fuzix68000/syscall_getppid.S
new file mode 100644 (file)
index 0000000..29d53e4
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getppid
+
+getppid:
+.mri 1
+       move.w #19,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getrlimit.S b/Library/libs/fuzix68000/syscall_getrlimit.S
new file mode 100644 (file)
index 0000000..915b4a6
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getrlimit
+
+getrlimit:
+.mri 1
+       move.w #75,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getsid.S b/Library/libs/fuzix68000/syscall_getsid.S
new file mode 100644 (file)
index 0000000..c1f4339
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getsid
+
+getsid:
+.mri 1
+       move.w #79,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_getuid.S b/Library/libs/fuzix68000/syscall_getuid.S
new file mode 100644 (file)
index 0000000..669a889
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl getuid
+
+getuid:
+.mri 1
+       move.w #20,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_ioctl.S b/Library/libs/fuzix68000/syscall_ioctl.S
new file mode 100644 (file)
index 0000000..a6661c5
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl ioctl
+
+ioctl:
+.mri 1
+       move.w #29,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_kill.S b/Library/libs/fuzix68000/syscall_kill.S
new file mode 100644 (file)
index 0000000..bfa2d72
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl kill
+
+kill:
+.mri 1
+       move.w #39,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_link.S b/Library/libs/fuzix68000/syscall_link.S
new file mode 100644 (file)
index 0000000..cf623bc
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl link
+
+link:
+.mri 1
+       move.w #5,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_listen.S b/Library/libs/fuzix68000/syscall_listen.S
new file mode 100644 (file)
index 0000000..a69830e
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl listen
+
+listen:
+.mri 1
+       move.w #91,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_memalloc.S b/Library/libs/fuzix68000/syscall_memalloc.S
new file mode 100644 (file)
index 0000000..0f530a3
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl memalloc
+
+memalloc:
+.mri 1
+       move.w #64,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_memfree.S b/Library/libs/fuzix68000/syscall_memfree.S
new file mode 100644 (file)
index 0000000..a73d6c0
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl memfree
+
+memfree:
+.mri 1
+       move.w #65,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_mkdir.S b/Library/libs/fuzix68000/syscall_mkdir.S
new file mode 100644 (file)
index 0000000..2f2351f
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl mkdir
+
+mkdir:
+.mri 1
+       move.w #51,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_mknod.S b/Library/libs/fuzix68000/syscall_mknod.S
new file mode 100644 (file)
index 0000000..2fb1610
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl mknod
+
+mknod:
+.mri 1
+       move.w #4,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_mount.S b/Library/libs/fuzix68000/syscall_mount.S
new file mode 100644 (file)
index 0000000..d4d1963
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl mount
+
+mount:
+.mri 1
+       move.w #33,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_nice.S b/Library/libs/fuzix68000/syscall_nice.S
new file mode 100644 (file)
index 0000000..aa58f5c
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl nice
+
+nice:
+.mri 1
+       move.w #58,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_open.S b/Library/libs/fuzix68000/syscall_open.S
new file mode 100644 (file)
index 0000000..5de91bb
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl open
+
+open:
+.mri 1
+       move.w #1,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_pipe.S b/Library/libs/fuzix68000/syscall_pipe.S
new file mode 100644 (file)
index 0000000..380bebf
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl pipe
+
+pipe:
+.mri 1
+       move.w #40,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_read.S b/Library/libs/fuzix68000/syscall_read.S
new file mode 100644 (file)
index 0000000..f4c97db
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl read
+
+read:
+.mri 1
+       move.w #7,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_rename.S b/Library/libs/fuzix68000/syscall_rename.S
new file mode 100644 (file)
index 0000000..d0e25e8
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl rename
+
+rename:
+.mri 1
+       move.w #3,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_rmdir.S b/Library/libs/fuzix68000/syscall_rmdir.S
new file mode 100644 (file)
index 0000000..26f2da9
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl rmdir
+
+rmdir:
+.mri 1
+       move.w #52,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_sbrk.S b/Library/libs/fuzix68000/syscall_sbrk.S
new file mode 100644 (file)
index 0000000..7644400
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl sbrk
+
+sbrk:
+.mri 1
+       move.w #31,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setgid.S b/Library/libs/fuzix68000/syscall_setgid.S
new file mode 100644 (file)
index 0000000..c34e5a4
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setgid
+
+setgid:
+.mri 1
+       move.w #26,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setgroups.S b/Library/libs/fuzix68000/syscall_setgroups.S
new file mode 100644 (file)
index 0000000..52b2ad9
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setgroups
+
+setgroups:
+.mri 1
+       move.w #73,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setpgid.S b/Library/libs/fuzix68000/syscall_setpgid.S
new file mode 100644 (file)
index 0000000..0e34209
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setpgid
+
+setpgid:
+.mri 1
+       move.w #77,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setpgrp.S b/Library/libs/fuzix68000/syscall_setpgrp.S
new file mode 100644 (file)
index 0000000..a050d8b
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setpgrp
+
+setpgrp:
+.mri 1
+       move.w #53,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setrlimit.S b/Library/libs/fuzix68000/syscall_setrlimit.S
new file mode 100644 (file)
index 0000000..1a2be73
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setrlimit
+
+setrlimit:
+.mri 1
+       move.w #76,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setsid.S b/Library/libs/fuzix68000/syscall_setsid.S
new file mode 100644 (file)
index 0000000..67049f6
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setsid
+
+setsid:
+.mri 1
+       move.w #78,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_setuid.S b/Library/libs/fuzix68000/syscall_setuid.S
new file mode 100644 (file)
index 0000000..0f87f19
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl setuid
+
+setuid:
+.mri 1
+       move.w #25,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_signal.S b/Library/libs/fuzix68000/syscall_signal.S
new file mode 100644 (file)
index 0000000..9a66090
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl signal
+
+signal:
+.mri 1
+       move.w #35,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_socket.S b/Library/libs/fuzix68000/syscall_socket.S
new file mode 100644 (file)
index 0000000..cf582df
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl socket
+
+socket:
+.mri 1
+       move.w #90,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_sync.S b/Library/libs/fuzix68000/syscall_sync.S
new file mode 100644 (file)
index 0000000..027b347
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl sync
+
+sync:
+.mri 1
+       move.w #11,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_times.S b/Library/libs/fuzix68000/syscall_times.S
new file mode 100644 (file)
index 0000000..a949a35
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl times
+
+times:
+.mri 1
+       move.w #42,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_uadmin.S b/Library/libs/fuzix68000/syscall_uadmin.S
new file mode 100644 (file)
index 0000000..151cfa2
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl uadmin
+
+uadmin:
+.mri 1
+       move.w #57,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_umask.S b/Library/libs/fuzix68000/syscall_umask.S
new file mode 100644 (file)
index 0000000..0554835
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl umask
+
+umask:
+.mri 1
+       move.w #21,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_umount.S b/Library/libs/fuzix68000/syscall_umount.S
new file mode 100644 (file)
index 0000000..5b21746
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl umount
+
+umount:
+.mri 1
+       move.w #34,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_unlink.S b/Library/libs/fuzix68000/syscall_unlink.S
new file mode 100644 (file)
index 0000000..b6ccc9f
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl unlink
+
+unlink:
+.mri 1
+       move.w #6,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_utime.S b/Library/libs/fuzix68000/syscall_utime.S
new file mode 100644 (file)
index 0000000..d13e662
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl utime
+
+utime:
+.mri 1
+       move.w #43,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_waitpid.S b/Library/libs/fuzix68000/syscall_waitpid.S
new file mode 100644 (file)
index 0000000..ea9b487
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl waitpid
+
+waitpid:
+.mri 1
+       move.w #55,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_write.S b/Library/libs/fuzix68000/syscall_write.S
new file mode 100644 (file)
index 0000000..eb252f1
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl write
+
+write:
+.mri 1
+       move.w #8,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/libs/fuzix68000/syscall_yield.S b/Library/libs/fuzix68000/syscall_yield.S
new file mode 100644 (file)
index 0000000..4525408
--- /dev/null
@@ -0,0 +1,14 @@
+       .text
+
+       .globl yield
+
+yield:
+.mri 1
+       move.w #62,d0
+       trap #14
+       ext.l d1
+       bne _error
+       rts
+_error:
+       move.l d1,errno
+       rts
diff --git a/Library/tools/syscall_68000.c b/Library/tools/syscall_68000.c
new file mode 100644 (file)
index 0000000..f817d31
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ *     Generate the syscall functions
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "syscall_name.h"
+
+static char namebuf[128];
+
+static void write_call(int n)
+{
+  FILE *fp;
+  snprintf(namebuf, 128, "fuzix68000/syscall_%s.S", syscall_name[n]);
+  fp = fopen(namebuf, "w");
+  if (fp == NULL) {
+    perror(namebuf);
+    exit(1);
+  }
+  fprintf(fp, "\t.text\n\n"
+             "\t.globl %1$s\n\n"
+             "%1$s:\n", syscall_name[n]);
+  fprintf(fp, ".mri 1\n");
+  fprintf(fp, "\tmove.w #%d,d0\n"
+             "\ttrap #14\n", n);
+  /* ext is the same speed as tst so we might as well do the ext in case
+     it is an error code. We have to ext the error because while we use
+     shorts in kernel for such things and speed the standard says errno
+     is integer */
+  fprintf(fp, "\text.l d1\n"
+              "\tbne _error\n"
+              "\trts\n"
+              "_error:\n"
+              "\tmove.l d1,errno\n"
+              "\trts\n");
+  fclose(fp);
+}
+
+static void write_call_table(void)
+{
+  int i;
+  for (i = 0; i < NR_SYSCALL; i++)
+    write_call(i);
+}
+
+static void write_makefile(void)
+{
+  int i;
+  FILE *fp = fopen("fuzix68000/Makefile", "w");
+  if (fp == NULL) {
+    perror("Makefile");
+    exit(1);
+  }
+  fprintf(fp, "# Autogenerated by tools/syscall_68000\n");
+  fprintf(fp, "CROSS_AS=m68k-linux-gnu-gcc\nCROSS_LD=m68k-linux-gnu-ld\nCROSS_AR=m68k-linux-gnu-ar\n");
+  fprintf(fp, "ASOPTS=\n\n");
+  fprintf(fp, "ASRCS = syscall_%s.S\n", syscall_name[0]);
+  for (i = 1; i < NR_SYSCALL; i++)
+    fprintf(fp, "ASRCS += syscall_%s.S\n", syscall_name[i]);
+  fprintf(fp, "\n\nASRCALL = $(ASRCS) $(ASYS)\n");
+  fprintf(fp, "\nAOBJS = $(ASRCALL:.S=.o)\n\n");
+  fprintf(fp, "syslib.lib: $(AOBJS)\n");
+  fprintf(fp, "\techo $(AOBJS) >syslib.l\n");
+  fprintf(fp, "\t$(CROSS_AR) rc syslib.lib $(AOBJS)\n\n");
+  fprintf(fp, "$(AOBJS): %%.o: %%.S\n");
+  fprintf(fp, "\t$(CROSS_AS) $(ASOPTS) -c $<\n\n");
+  fprintf(fp, "clean:\n");
+  fprintf(fp, "\trm -f $(AOBJS) $(ASRCS) syslib.lib syslib.l *~\n\n");
+  fclose(fp);
+}
+
+int main(int argc, char *argv[])
+{
+  write_makefile();
+  write_call_table();
+  exit(0);
+}