2000-02-18 03:39:52 +08:00
|
|
|
#ifndef __SYS_CONFIG_H__
|
|
|
|
#define __SYS_CONFIG_H__
|
|
|
|
|
|
|
|
/* exceptions first */
|
|
|
|
/* ??? Why is much of this stuff duplicated with machine/ieeefp.h? */
|
|
|
|
#if defined(__H8300__) || defined(__H8500__) || defined (__H8300H__) || defined(__W65__) || defined (__H8300S__)
|
|
|
|
#define _FLOAT_ARG float
|
|
|
|
#define __SMALL_BITFIELDS
|
|
|
|
#define _DOUBLE_IS_32BITS
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
/* ??? This conditional is true for the h8500 and the w65, defining H8300
|
|
|
|
in those cases probably isn't the right thing to do. */
|
|
|
|
#define H8300 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __W65__
|
|
|
|
#define _DOUBLE_IS_32BITS
|
|
|
|
#define __SMALL_BITFIELDS
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#undef INT_MAX
|
|
|
|
#undef UINT_MAX
|
|
|
|
#define INT_MAX 32767
|
|
|
|
#define UINT_MAX 65535
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* 16 bit integer machines */
|
2000-06-28 03:51:33 +08:00
|
|
|
#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) || defined (__AVR__)
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
#undef INT_MAX
|
|
|
|
#undef UINT_MAX
|
|
|
|
#define INT_MAX 32767
|
|
|
|
#define UINT_MAX 65535
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__D10V__)
|
|
|
|
#undef INT_MAX
|
|
|
|
#undef UINT_MAX
|
|
|
|
#define INT_MAX __INT_MAX__
|
|
|
|
#define UINT_MAX (__INT_MAX__ * 2U + 1)
|
2002-01-08 03:33:23 +08:00
|
|
|
#if __DOUBLE__ == 32
|
2000-02-18 03:39:52 +08:00
|
|
|
#define _DOUBLE_IS_32BITS
|
2002-01-08 03:33:23 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
#define _POINTER_INT short
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ___AM29K__
|
|
|
|
#define _FLOAT_RET double
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __i386__
|
|
|
|
#ifndef __unix__
|
|
|
|
/* in other words, go32 */
|
|
|
|
#define _FLOAT_RET double
|
|
|
|
#endif
|
2002-05-17 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Copy and install headers from sys/machine/include
directory. Also pass $toollibdir to lower-level directories.
* Makefile.in: Regenerated.
* libc/include/stdio.h[!_REENT_ONLY]: Change stdin, stdout, and
stderr to use _REENT macro instead of _impure_ptr directly.
* libc/include/sys/config.h[__i386__][__linux__]: Define
__DYNAMIC_REENT__.
* libc/include/sys/reent.h[!_REENT_ONLY]: Change _REENT macro to be
call to __getreent() function if !__SINGLE_THREAD__ and
__DYNAMIC_REENT__ is set.
* libc/reent/Makefile.am: Add support for getreent.c.
* libc/reent/Makefile.in: Regenerated.
* libc/string/strerror.c: Add check if EOPNOTSUPP and ENOTSUP are same.
* libc/sys/linux/Makefile.am: Add support for new files.
* libc/sys/linux/configure.in: Add $EXTRA_DIRS variable.
* libc/sys/linux/Makefile.in: Regenerated.
* libc/sys/linux/configure: Ditto.
* libc/sys/linux/io.c: Add poll syscall. Also weak-alias
__close, __read, __write, __poll, __open, __lseek, __fcntl from
their __libc_ counterparts.
* libc/sys/linux/io64.c: Add __libc_ prefix to lseek64 and open64
and weak-alias to regular names.
* libc/sys/linux/pread64.c: Rename to __libc_pread64 and weak-alias
to pread64 and __pread64.
* libc/sys/linux/process.c: Weak_alias __libc_getpid to __getpid.
* libc/sys/linux/pwrite64.c: Rename to __libc_pwrite64 and
weak-alias to pwrite64.
* libc/sys/linux/sched.c: Weak-alias __libc_sched_getparam,
__libc_sched_getscheduler, __libc_sched_get_priority_max,
__libc_sched_get_priority_min, and __libc_sched_setschedule to
name with __ instead of __libc_.
* libc/sys/linux/siglongjmp.c: Include <machine/weakalias.h>.
Rename siglongjmp to __libc_siglongjmp and weak-alias to siglongjmp.
Call __libc_longjmp instead of longjmp, from __libc_siglongjmp.
* libc/sys/linux/signal.c: Rename raise to __libc_raise and weak-alias
to raise.
* libc/sys/linux/socket.c: Weak-alias __libc_connect to __connect and
__libc_send to __send.
* libc/sys/linux/time.c: Weak-alias __libc_gettimeofday to
__gettimeofday.
* libc/sys/linux/wait.c: Rename wait to __libc_wait and weak-alias
it to wait. Rename wait3 to __libc_wait3 and weak-alias it to wait3.
* libc/sys/linux/include/setjmp.h: Use __jmp_buf in sigjmp_buf
type and typedef __jmp_buf to jmp_buf.
* libc/sys/linux/machine/i386/Makefile.am: Add syscalls.c and
setjmp.S.
* libc/sys/linux/machine/i386/Makefile.in: Regenerated.
* libc/sys/linux/machine/i386/crt0.c: Add support to clear .bss
section.
* libc/sys/linux/machine/i386/socketcall.h: Change to use __libc_
prefix for function macros and then use weak_alias() to regular names.
* libc/sys/linux/machine/i386/syscall.h: Ditto.
* libc/sys/linux/sys/errno.h: Define EOPNOTSUP to be ENOTSUP.
* libc/sys/linux/sys/stdio.h: Define _flockfile and _funlockfile
to be flockfile() and funlockfile() respectively.
* libc/sys/linux/sys/types.h
* libc/reent/getreent.c: New file.
* libc/sys/linux/flockfile.c: Ditto.
* libc/sys/linux/funlockfile.c: Ditto.
* libc/sys/linux/getreent.c: Ditto.
* libc/sys/linux/pread.c: Ditto.
* libc/sys/linux/pwrite.c: Ditto.
* libc/sys/linux/raise.c: Ditto.
* libc/sys/linux/system.c: Ditto.
* libc/sys/linux/tcdrain.c: Ditto.
* libc/sys/linux/machine/i386/i386mach.h: Ditto.
* libc/sys/linux/machine/i386/setjmp.S: Ditto.
* libc/sys/linux/machine/i386/syscalls.c: Ditto.
* libc/sys/linux/machine/i386/weakalias.h: Ditto.
* libc/sys/linux/machine/i386/include/setjmp.h: Ditto.
2002-05-18 07:39:39 +08:00
|
|
|
#ifdef __linux__
|
|
|
|
/* we want the reentrancy structure to be returned by a function */
|
|
|
|
#define __DYNAMIC_REENT__
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __M32R__
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __m68k__
|
|
|
|
/* This is defined in machine/ieeefp.h; need to check is it redundant here? */
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __mn10300__
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __mn10200__
|
|
|
|
#define _DOUBLE_IS_32BITS
|
|
|
|
#define __SMALL_BITFIELDS
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
2001-11-12 Hans-Peter Nilsson <hp@bitrange.com>
* libc/include/machine/ieeefp.h: Add support for mmix target.
* libc/include/machine/setjmp.h: Ditto.
* configure.host: Ditto.
* libc/sys/mmixware/Makefile.am, libc/sys/mmixware/_exit.c,
libc/sys/mmixware/access.c, libc/sys/mmixware/aclocal.m4,
libc/sys/mmixware/chmod.c, libc/sys/mmixware/chown.c,
libc/sys/mmixware/close.c, libc/sys/mmixware/configure.in,
libc/sys/mmixware/creat.c, libc/sys/mmixware/crt0.c,
libc/sys/mmixware/execv.c, libc/sys/mmixware/execve.c,
libc/sys/mmixware/fork.c, libc/sys/mmixware/fstat.c,
libc/sys/mmixware/getpid.c, libc/sys/mmixware/gettime.c,
libc/sys/mmixware/isatty.c, libc/sys/mmixware/kill.c,
libc/sys/mmixware/lseek.c, libc/sys/mmixware/open.c,
libc/sys/mmixware/pipe.c, libc/sys/mmixware/read.c,
libc/sys/mmixware/sbrk.c, libc/sys/mmixware/setjmp.S,
libc/sys/mmixware/stat.c, libc/sys/mmixware/sys/syscall.h,
libc/sys/mmixware/time.c, libc/sys/mmixware/times.c,
libc/sys/mmixware/unlink.c, libc/sys/mmixware/utime.c,
libc/sys/mmixware/wait.c, libc/sys/mmixware/write.c: New files.
* libc/sys/mmixware/configure, libc/sys/mmixware/Makefile.in,
libc/sys/mmixware/aclocal.m4: Generate.
2001-11-13 05:04:41 +08:00
|
|
|
#ifdef __MMIX__
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
2000-06-28 03:51:33 +08:00
|
|
|
#ifdef __AVR__
|
|
|
|
#define _DOUBLE_IS_32BITS
|
|
|
|
#define __SMALL_BITFIELDS
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#define _POINTER_INT short
|
|
|
|
#endif
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#ifdef __TIC80__
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __v850
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __D30V__
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
|
|
|
|
#if defined(__PPC__) && defined(_CALL_SYSV)
|
|
|
|
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __sparc__
|
|
|
|
#ifdef __LITTLE_ENDIAN_DATA__
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#else
|
|
|
|
#define __IEEE_BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2001-12-23 06:47:58 +08:00
|
|
|
#ifdef __xstormy16__
|
|
|
|
#define __IEEE_LITTLE_ENDIAN
|
|
|
|
#define __SMALL_BITFIELDS
|
|
|
|
#undef INT_MAX
|
|
|
|
#undef UINT_MAX
|
|
|
|
#define INT_MAX __INT_MAX__
|
|
|
|
#define UINT_MAX (__INT_MAX__ * 2U + 1)
|
|
|
|
#define SIZE_T_SMALLER_THAN_LONG
|
|
|
|
#define MALLOC_ALIGNMENT 8
|
|
|
|
#define _POINTER_INT short
|
|
|
|
#define __BUFSIZ__ 16
|
2002-02-03 17:24:18 +08:00
|
|
|
#define _REENT_SMALL
|
2001-12-23 06:47:58 +08:00
|
|
|
#endif
|
|
|
|
|
2002-02-16 05:19:40 +08:00
|
|
|
typedef short int __int16_t;
|
|
|
|
typedef unsigned short int __uint16_t;
|
|
|
|
|
2002-04-20 07:52:48 +08:00
|
|
|
/* This block should be kept in sync with GCC's limits.h. The point
|
|
|
|
of having these definitions here is to not include limits.h, which
|
|
|
|
would pollute the user namespace, while still using types of the
|
|
|
|
the correct widths when deciding how to define __int32_t and
|
|
|
|
__int64_t. */
|
|
|
|
#ifndef __INT_MAX__
|
|
|
|
# ifdef INT_MAX
|
|
|
|
# define __INT_MAX__ INT_MAX
|
|
|
|
# else
|
|
|
|
# define __INT_MAX__ 2147483647
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __LONG_MAX__
|
|
|
|
# ifdef LONG_MAX
|
|
|
|
# define __LONG_MAX__ LONG_MAX
|
|
|
|
# else
|
|
|
|
# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \
|
|
|
|
|| defined (__sparcv9)
|
|
|
|
# define __LONG_MAX__ 9223372036854775807L
|
|
|
|
# else
|
|
|
|
# define __LONG_MAX__ 2147483647L
|
|
|
|
# endif /* __alpha__ || sparc64 */
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
/* End of block that should be kept in sync with GCC's limits.h. */
|
|
|
|
|
|
|
|
#if __INT_MAX__ == 32767
|
2000-02-18 03:39:52 +08:00
|
|
|
typedef long int __int32_t;
|
|
|
|
typedef unsigned long int __uint32_t;
|
|
|
|
#else
|
|
|
|
typedef int __int32_t;
|
|
|
|
typedef unsigned int __uint32_t;
|
|
|
|
#endif
|
|
|
|
|
2002-04-20 07:52:48 +08:00
|
|
|
#if __LONG_MAX__ > 2147483647 || !defined(__GNUC__)
|
2002-02-16 05:19:40 +08:00
|
|
|
typedef long int __int64_t;
|
|
|
|
typedef unsigned long int __uint64_t;
|
|
|
|
#else
|
2002-02-26 07:51:10 +08:00
|
|
|
__extension__ typedef long long __int64_t;
|
|
|
|
__extension__ typedef unsigned long long __uint64_t;
|
2002-02-16 05:19:40 +08:00
|
|
|
#endif
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#ifndef _POINTER_INT
|
|
|
|
#define _POINTER_INT long
|
|
|
|
#endif
|
|
|
|
|
2000-06-09 09:13:36 +08:00
|
|
|
#undef __RAND_MAX
|
2002-04-20 07:52:48 +08:00
|
|
|
#if __INT_MAX__ == 32767
|
2000-06-09 09:13:36 +08:00
|
|
|
#define __RAND_MAX 32767
|
|
|
|
#else
|
|
|
|
#define __RAND_MAX 0x7fffffff
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2000-08-02 04:51:51 +08:00
|
|
|
|
|
|
|
#if defined(__CYGWIN32__) || defined(__CYGWIN__)
|
2001-02-01 04:11:48 +08:00
|
|
|
#define __FILENAME_MAX__ (260 - 1 /* NUL */)
|
2001-08-30 03:47:43 +08:00
|
|
|
#define _READ_WRITE_RETURN_TYPE _ssize_t
|
2000-08-02 04:51:51 +08:00
|
|
|
#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
|
|
|
|
#define __IMPORT
|
|
|
|
#else
|
|
|
|
#define __IMPORT __declspec(dllimport)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2001-02-01 04:11:48 +08:00
|
|
|
#if defined(__rtems__)
|
|
|
|
#define __FILENAME_MAX__ 255
|
2001-08-30 03:47:43 +08:00
|
|
|
#define _READ_WRITE_RETURN_TYPE _ssize_t
|
2001-02-01 04:11:48 +08:00
|
|
|
#endif
|
|
|
|
|
2000-08-02 04:51:51 +08:00
|
|
|
#ifndef __IMPORT
|
|
|
|
#define __IMPORT
|
|
|
|
#endif
|
|
|
|
|
2001-03-06 09:04:43 +08:00
|
|
|
/* Define return type of read/write routines. In POSIX, the return type
|
|
|
|
for read()/write() is "ssize_t" but legacy newlib code has been using
|
|
|
|
"int" for some time. If not specified, "int" is defaulted. */
|
|
|
|
#ifndef _READ_WRITE_RETURN_TYPE
|
|
|
|
#define _READ_WRITE_RETURN_TYPE int
|
|
|
|
#endif
|
2000-08-02 04:51:51 +08:00
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#endif /* __SYS_CONFIG_H__ */
|