summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/include/_types.h147
-rw-r--r--sys/alpha/include/ansi.h113
-rw-r--r--sys/alpha/include/endian.h2
-rw-r--r--sys/alpha/include/stdarg.h4
-rw-r--r--sys/alpha/include/types.h62
-rw-r--r--sys/alpha/include/varargs.h4
-rw-r--r--sys/amd64/include/_types.h139
-rw-r--r--sys/amd64/include/endian.h2
-rw-r--r--sys/amd64/include/stdarg.h4
-rw-r--r--sys/amd64/include/varargs.h4
-rw-r--r--sys/arm/include/_types.h151
-rw-r--r--sys/arm/include/ansi.h123
-rw-r--r--sys/arm/include/types.h59
-rw-r--r--sys/i386/include/_types.h151
-rw-r--r--sys/i386/include/ansi.h123
-rw-r--r--sys/i386/include/endian.h2
-rw-r--r--sys/i386/include/stdarg.h4
-rw-r--r--sys/i386/include/types.h59
-rw-r--r--sys/i386/include/varargs.h4
-rw-r--r--sys/ia64/include/_types.h143
-rw-r--r--sys/ia64/include/ansi.h110
-rw-r--r--sys/ia64/include/endian.h2
-rw-r--r--sys/ia64/include/stdarg.h4
-rw-r--r--sys/ia64/include/types.h62
-rw-r--r--sys/ia64/include/varargs.h4
-rw-r--r--sys/netinet/in.h6
-rw-r--r--sys/netinet6/in6.h6
-rw-r--r--sys/powerpc/include/_types.h151
-rw-r--r--sys/powerpc/include/ansi.h117
-rw-r--r--sys/powerpc/include/endian.h2
-rw-r--r--sys/powerpc/include/stdarg.h4
-rw-r--r--sys/powerpc/include/types.h61
-rw-r--r--sys/powerpc/include/varargs.h4
-rw-r--r--sys/sparc64/include/_types.h143
-rw-r--r--sys/sparc64/include/ansi.h108
-rw-r--r--sys/sparc64/include/endian.h2
-rw-r--r--sys/sparc64/include/stdarg.h4
-rw-r--r--sys/sparc64/include/types.h61
-rw-r--r--sys/sparc64/include/varargs.h4
-rw-r--r--sys/sys/_timespec.h6
-rw-r--r--sys/sys/_types.h12
-rw-r--r--sys/sys/dirent.h2
-rw-r--r--sys/sys/sbuf.h4
-rw-r--r--sys/sys/signal.h6
-rw-r--r--sys/sys/socket.h12
-rw-r--r--sys/sys/stat.h8
-rw-r--r--sys/sys/statvfs.h4
-rw-r--r--sys/sys/stdint.h2
-rw-r--r--sys/sys/syslog.h6
-rw-r--r--sys/sys/systm.h10
-rw-r--r--sys/sys/times.h8
-rw-r--r--sys/sys/timespec.h8
-rw-r--r--sys/sys/types.h84
-rw-r--r--sys/sys/un.h6
54 files changed, 1155 insertions, 1178 deletions
diff --git a/sys/alpha/include/_types.h b/sys/alpha/include/_types.h
new file mode 100644
index 0000000..9669323
--- /dev/null
+++ b/sys/alpha/include/_types.h
@@ -0,0 +1,147 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+typedef long __int64_t;
+typedef unsigned long __uint64_t;
+
+/*
+ * Standard type definitions.
+ */
+typedef __int32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int64_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int64_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int64_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int64_t __register_t;
+typedef __int64_t __segsz_t; /* segment size (in pages) */
+typedef __uint64_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int64_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint64_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint64_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint64_t __u_register_t;
+typedef __uint64_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint64_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#else
+typedef struct {
+ char *__base;
+ int __offset;
+ int __pad;
+} __va_list;
+#endif /* post GCC 2.95 */
+#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h
index d9e4022..11dbf03 100644
--- a/sys/alpha/include/ansi.h
+++ b/sys/alpha/include/ansi.h
@@ -39,73 +39,6 @@
#define _MACHINE_ANSI_H_
/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ int /* clock() */
-#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
-#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
-#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SEGSZ_T_ __int64_t /* segment size (in pages) */
-#define _BSD_SIZE_T_ unsigned long /* sizeof() */
-#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */
-#define _BSD_SSIZE_T_ long /* byte count or error */
-#define _BSD_TIME_T_ int /* time()... */
-#define _BSD_TIMER_T_ int /* timer_gettime()... */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ long /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
-#else
-typedef struct {
- char *__base;
- int __offset;
- int __pad;
-} __va_list;
-#define _BSD_VA_LIST_ __va_list /* va_list */
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
-/*
- * The rune type above is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- *
- * NOTE: rune_t is not covered by ANSI nor other standards, and should not
- * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
- * rune_t must be the same type. Also wint_t must be no narrower than
- * wchar_t, and should also be able to hold all members of the largest
- * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
- */
-
-/*
* Frequencies of the clock ticks reported by clock() and times(). They
* are the same as stathz for bogus historical reasons. They should be
* 1e6 because clock() and times() are implemented using getrusage() and
@@ -118,50 +51,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long __int64_t;
-typedef unsigned long __uint64_t;
-
-typedef long __intptr_t;
-typedef unsigned long __uintptr_t;
-
-typedef __signed char __int_least8_t;
-typedef unsigned char __uint_least8_t;
-typedef short __int_least16_t;
-typedef unsigned short __uint_least16_t;
-typedef int __int_least32_t;
-typedef unsigned int __uint_least32_t;
-typedef long __int_least64_t;
-typedef unsigned long __uint_least64_t;
-
-typedef int __int_fast8_t;
-typedef unsigned int __uint_fast8_t;
-typedef int __int_fast16_t;
-typedef unsigned int __uint_fast16_t;
-typedef int __int_fast32_t;
-typedef unsigned int __uint_fast32_t;
-typedef long __int_fast64_t;
-typedef unsigned long __uint_fast64_t;
-
-typedef long __intmax_t;
-typedef unsigned long __uintmax_t;
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- char __mbstate8[128];
- __int64_t _mbstateL; /* for alignment */
-} __mbstate_t;
-
#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/alpha/include/endian.h b/sys/alpha/include/endian.h
index 9294f35..968d78c 100644
--- a/sys/alpha/include/endian.h
+++ b/sys/alpha/include/endian.h
@@ -39,7 +39,7 @@
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
diff --git a/sys/alpha/include/stdarg.h b/sys/alpha/include/stdarg.h
index 1632add..5ecd44b 100644
--- a/sys/alpha/include/stdarg.h
+++ b/sys/alpha/include/stdarg.h
@@ -39,9 +39,9 @@
#ifndef _ALPHA_STDARG_H_
#define _ALPHA_STDARG_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
diff --git a/sys/alpha/include/types.h b/sys/alpha/include/types.h
deleted file mode 100644
index e0b82b4..0000000
--- a/sys/alpha/include/types.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- * $NetBSD: types.h,v 1.8 1997/04/06 08:47:45 cgd Exp $
- * $FreeBSD$
- */
-
-#ifndef _MACHTYPES_H_
-#define _MACHTYPES_H_
-
-#include <sys/cdefs.h>
-
-typedef unsigned long vm_offset_t;
-typedef long vm_ooffset_t;
-typedef unsigned long vm_pindex_t;
-typedef unsigned long vm_size_t;
-
-typedef __int64_t register_t;
-typedef __uint64_t u_register_t;
-
-#ifdef _KERNEL
-typedef long intfptr_t;
-typedef unsigned long uintfptr_t;
-#endif
-
-/* Critical section value */
-typedef register_t critical_t;
-
-/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
-
-#endif /* _MACHTYPES_H_ */
diff --git a/sys/alpha/include/varargs.h b/sys/alpha/include/varargs.h
index bcf9ed3..a5a997d 100644
--- a/sys/alpha/include/varargs.h
+++ b/sys/alpha/include/varargs.h
@@ -46,9 +46,9 @@
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_alist __builtin_va_alist
diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h
new file mode 100644
index 0000000..4c62a9a
--- /dev/null
+++ b/sys/amd64/include/_types.h
@@ -0,0 +1,139 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+typedef long __int64_t;
+typedef unsigned long __uint64_t;
+
+/*
+ * Standard type definitions.
+ */
+typedef __int32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int64_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int64_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int64_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int64_t __register_t;
+typedef __int64_t __segsz_t; /* segment size (in pages) */
+typedef __uint64_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int64_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint64_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint64_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint64_t __u_register_t;
+typedef __uint64_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint64_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/amd64/include/endian.h b/sys/amd64/include/endian.h
index a5ce643..c979683 100644
--- a/sys/amd64/include/endian.h
+++ b/sys/amd64/include/endian.h
@@ -38,7 +38,7 @@
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
diff --git a/sys/amd64/include/stdarg.h b/sys/amd64/include/stdarg.h
index a2ec697..4048d13 100644
--- a/sys/amd64/include/stdarg.h
+++ b/sys/amd64/include/stdarg.h
@@ -31,9 +31,9 @@
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
#define va_start(ap, last) \
__builtin_stdarg_start((ap), (last))
diff --git a/sys/amd64/include/varargs.h b/sys/amd64/include/varargs.h
index bcaf875..5d8511e 100644
--- a/sys/amd64/include/varargs.h
+++ b/sys/amd64/include/varargs.h
@@ -45,9 +45,9 @@
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_alist __builtin_va_alist
diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h
new file mode 100644
index 0000000..34cf3e8
--- /dev/null
+++ b/sys/arm/include/_types.h
@@ -0,0 +1,151 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+
+#if defined(__GNUC__)
+typedef int __attribute__((__mode__(__DI__))) __int64_t;
+typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
+#else
+/* LONGLONG */
+typedef long long __int64_t;
+/* LONGLONG */
+typedef unsigned long long __uint64_t;
+#endif
+
+/*
+ * Standard type definitions.
+ */
+typedef __uint32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int32_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int32_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int32_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int32_t __register_t;
+typedef __int32_t __segsz_t; /* segment size (in pages) */
+typedef __uint32_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int32_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint32_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint32_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint32_t __u_register_t;
+typedef __uint32_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint32_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#else
+typedef char * __va_list;
+#endif /* post GCC 2.95 */
+#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/arm/include/ansi.h b/sys/arm/include/ansi.h
index 2596276..5525ef7 100644
--- a/sys/arm/include/ansi.h
+++ b/sys/arm/include/ansi.h
@@ -38,66 +38,6 @@
#define _MACHINE_ANSI_H_
/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ unsigned long /* clock()... */
-#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
-#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SIZE_T_ unsigned int /* sizeof() */
-#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */
-#define _BSD_SSIZE_T_ int /* byte count or error */
-#define _BSD_TIME_T_ int /* time()... */
-#define _BSD_TIMER_T_ int /* timer_gettime()... */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ __int64_t /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
-#else
-#define _BSD_VA_LIST_ char * /* va_list */
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
-/*
- * The rune type above is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- *
- * NOTE: rune_t is not covered by ANSI nor other standards, and should not
- * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
- * rune_t must be the same type. Also wint_t must be no narrower than
- * wchar_t, and should also be able to hold all members of the largest
- * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
- */
-
-/*
* Frequencies of the clock ticks reported by clock() and times(). They
* are the same as stathz for bogus historical reasons. They should be
* 1e6 because clock() and times() are implemented using getrusage() and
@@ -110,65 +50,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * XXX this paragraph is very out of date.
- * Typedefs for especially magic types. #define's wouldn't work in the
- * __GNUC__ case, since __attribute__(()) only works in certain contexts.
- * This is not in <machine/types.h>, since that has too much namespace
- * pollution for inclusion in ANSI headers, yet we need __int64_t in at
- * least <stdio.h>.
- */
-#ifdef __GNUC__
-typedef int __attribute__((__mode__(__DI__))) __int64_t;
-typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
-#else
-/* LONGLONG */
-typedef long long __int64_t;
-/* LONGLONG */
-typedef unsigned long long __uint64_t;
-#endif
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-
-typedef int __intptr_t;
-typedef unsigned int __uintptr_t;
-
-typedef __signed char __int_least8_t;
-typedef unsigned char __uint_least8_t;
-typedef short __int_least16_t;
-typedef unsigned short __uint_least16_t;
-typedef int __int_least32_t;
-typedef unsigned int __uint_least32_t;
-typedef __int64_t __int_least64_t;
-typedef __uint64_t __uint_least64_t;
-
-typedef int __int_fast8_t;
-typedef unsigned int __uint_fast8_t;
-typedef int __int_fast16_t;
-typedef unsigned int __uint_fast16_t;
-typedef int __int_fast32_t;
-typedef unsigned int __uint_fast32_t;
-typedef __int64_t __int_fast64_t;
-typedef __uint64_t __uint_fast64_t;
-
-typedef __int64_t __intmax_t;
-typedef __uint64_t __uintmax_t;
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- char __mbstate8[128];
- __int64_t _mbstateL; /* for alignment */
-} __mbstate_t;
-
-#endif /* _MACHINE_ANSI_H_ */
+#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/arm/include/types.h b/sys/arm/include/types.h
deleted file mode 100644
index 0769856..0000000
--- a/sys/arm/include/types.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- * $FreeBSD$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-typedef unsigned int vm_offset_t;
-typedef __int64_t vm_ooffset_t;
-typedef __uint64_t vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-typedef __int32_t register_t;
-typedef __uint32_t u_register_t;
-
-#ifdef _KERNEL
-typedef int intfptr_t;
-typedef unsigned int uintfptr_t;
-#endif
-
-/* Critical section value */
-typedef register_t critical_t;
-
-/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
-
-#endif /* !_MACHINE_TYPES_H_ */
diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h
new file mode 100644
index 0000000..34cf3e8
--- /dev/null
+++ b/sys/i386/include/_types.h
@@ -0,0 +1,151 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+
+#if defined(__GNUC__)
+typedef int __attribute__((__mode__(__DI__))) __int64_t;
+typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
+#else
+/* LONGLONG */
+typedef long long __int64_t;
+/* LONGLONG */
+typedef unsigned long long __uint64_t;
+#endif
+
+/*
+ * Standard type definitions.
+ */
+typedef __uint32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int32_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int32_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int32_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int32_t __register_t;
+typedef __int32_t __segsz_t; /* segment size (in pages) */
+typedef __uint32_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int32_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint32_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint32_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint32_t __u_register_t;
+typedef __uint32_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint32_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#else
+typedef char * __va_list;
+#endif /* post GCC 2.95 */
+#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index 45f86fe..06916b2 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -38,68 +38,6 @@
#define _MACHINE_ANSI_H_
/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ unsigned long /* clock()... */
-#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
-#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
-#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SEGSZ_T_ __int32_t /* segment size (in pages) */
-#define _BSD_SIZE_T_ unsigned int /* sizeof() */
-#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */
-#define _BSD_SSIZE_T_ int /* byte count or error */
-#define _BSD_TIME_T_ int /* time()... */
-#define _BSD_TIMER_T_ int /* timer_gettime()... */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ __int64_t /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
-#else
-#define _BSD_VA_LIST_ char * /* va_list */
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
-/*
- * The rune type above is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- *
- * NOTE: rune_t is not covered by ANSI nor other standards, and should not
- * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
- * rune_t must be the same type. Also wint_t must be no narrower than
- * wchar_t, and should also be able to hold all members of the largest
- * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
- */
-
-/*
* Frequencies of the clock ticks reported by clock() and times(). They
* are the same as stathz for bogus historical reasons. They should be
* 1e6 because clock() and times() are implemented using getrusage() and
@@ -112,65 +50,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
#define _BSD_CLK_TCK_ 128
#define _BSD_CLOCKS_PER_SEC_ 128
-/*
- * XXX this paragraph is very out of date.
- * Typedefs for especially magic types. #define's wouldn't work in the
- * __GNUC__ case, since __attribute__(()) only works in certain contexts.
- * This is not in <machine/types.h>, since that has too much namespace
- * pollution for inclusion in ANSI headers, yet we need __int64_t in at
- * least <stdio.h>.
- */
-#ifdef __GNUC__
-typedef int __attribute__((__mode__(__DI__))) __int64_t;
-typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
-#else
-/* LONGLONG */
-typedef long long __int64_t;
-/* LONGLONG */
-typedef unsigned long long __uint64_t;
-#endif
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-
-typedef int __intptr_t;
-typedef unsigned int __uintptr_t;
-
-typedef __signed char __int_least8_t;
-typedef unsigned char __uint_least8_t;
-typedef short __int_least16_t;
-typedef unsigned short __uint_least16_t;
-typedef int __int_least32_t;
-typedef unsigned int __uint_least32_t;
-typedef __int64_t __int_least64_t;
-typedef __uint64_t __uint_least64_t;
-
-typedef int __int_fast8_t;
-typedef unsigned int __uint_fast8_t;
-typedef int __int_fast16_t;
-typedef unsigned int __uint_fast16_t;
-typedef int __int_fast32_t;
-typedef unsigned int __uint_fast32_t;
-typedef __int64_t __int_fast64_t;
-typedef __uint64_t __uint_fast64_t;
-
-typedef __int64_t __intmax_t;
-typedef __uint64_t __uintmax_t;
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- char __mbstate8[128];
- __int64_t _mbstateL; /* for alignment */
-} __mbstate_t;
-
#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/i386/include/endian.h b/sys/i386/include/endian.h
index 84e7fe6..c8b86ee 100644
--- a/sys/i386/include/endian.h
+++ b/sys/i386/include/endian.h
@@ -38,7 +38,7 @@
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
diff --git a/sys/i386/include/stdarg.h b/sys/i386/include/stdarg.h
index 51416f7..1432c6c 100644
--- a/sys/i386/include/stdarg.h
+++ b/sys/i386/include/stdarg.h
@@ -38,9 +38,9 @@
#ifndef _STDARG_H_
#define _STDARG_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
diff --git a/sys/i386/include/types.h b/sys/i386/include/types.h
deleted file mode 100644
index 0769856..0000000
--- a/sys/i386/include/types.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- * $FreeBSD$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-typedef unsigned int vm_offset_t;
-typedef __int64_t vm_ooffset_t;
-typedef __uint64_t vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-typedef __int32_t register_t;
-typedef __uint32_t u_register_t;
-
-#ifdef _KERNEL
-typedef int intfptr_t;
-typedef unsigned int uintfptr_t;
-#endif
-
-/* Critical section value */
-typedef register_t critical_t;
-
-/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
-
-#endif /* !_MACHINE_TYPES_H_ */
diff --git a/sys/i386/include/varargs.h b/sys/i386/include/varargs.h
index bcaf875..5d8511e 100644
--- a/sys/i386/include/varargs.h
+++ b/sys/i386/include/varargs.h
@@ -45,9 +45,9 @@
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_alist __builtin_va_alist
diff --git a/sys/ia64/include/_types.h b/sys/ia64/include/_types.h
new file mode 100644
index 0000000..3ca3584
--- /dev/null
+++ b/sys/ia64/include/_types.h
@@ -0,0 +1,143 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+typedef long __int64_t;
+typedef unsigned long __uint64_t;
+
+/*
+ * Standard type definitions.
+ */
+typedef __int32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int64_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int64_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int64_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int64_t __register_t;
+typedef __int64_t __segsz_t; /* segment size (in pages) */
+typedef __uint64_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int64_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint64_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint64_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint64_t __u_register_t;
+typedef __uint64_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint64_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+#ifdef __GNUC__
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#if !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+#else
+#error Must add va_list support for this non-GCC compiler.
+#endif /* __GNUC__ */
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/ia64/include/ansi.h b/sys/ia64/include/ansi.h
index a7cde5b..11dbf03 100644
--- a/sys/ia64/include/ansi.h
+++ b/sys/ia64/include/ansi.h
@@ -39,68 +39,6 @@
#define _MACHINE_ANSI_H_
/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ int /* clock() */
-#define _BSD_CLOCKID_T_ int /* clockid_t */
-#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
-#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SEGSZ_T_ __int64_t /* segment size (in pages) */
-#define _BSD_SIZE_T_ unsigned long /* sizeof() */
-#define _BSD_SOCKLEN_T_ __uint32_t
-#define _BSD_SSIZE_T_ long /* byte count or error */
-#define _BSD_TIME_T_ int /* time() */
-#define _BSD_TIMER_T_ int /* timer_t */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ long /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-
-#ifdef __GNUC__
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
-#if !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-#else
-#error Must add va_list support for this non-GCC compiler.
-#endif /*__GNUC__*/
-
-/*
- * The rune type above is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- *
- * NOTE: rune_t is not covered by ANSI nor other standards, and should not
- * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
- * rune_t must be the same type. Also wint_t must be no narrower than
- * wchar_t, and should also be able to hold all members of the largest
- * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
- */
-
-/*
* Frequencies of the clock ticks reported by clock() and times(). They
* are the same as stathz for bogus historical reasons. They should be
* 1e6 because clock() and times() are implemented using getrusage() and
@@ -113,50 +51,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long __int64_t;
-typedef unsigned long __uint64_t;
-
-typedef long __intptr_t;
-typedef unsigned long __uintptr_t;
-
-typedef __signed char __int_least8_t;
-typedef unsigned char __uint_least8_t;
-typedef short __int_least16_t;
-typedef unsigned short __uint_least16_t;
-typedef int __int_least32_t;
-typedef unsigned int __uint_least32_t;
-typedef long __int_least64_t;
-typedef unsigned long __uint_least64_t;
-
-typedef int __int_fast8_t;
-typedef unsigned int __uint_fast8_t;
-typedef int __int_fast16_t;
-typedef unsigned int __uint_fast16_t;
-typedef int __int_fast32_t;
-typedef unsigned int __uint_fast32_t;
-typedef long __int_fast64_t;
-typedef unsigned long __uint_fast64_t;
-
-typedef long __intmax_t;
-typedef unsigned long __uintmax_t;
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- char __mbstate8[128];
- __int64_t _mbstateL; /* for alignment */
-} __mbstate_t;
-
-#endif /* _MACHINE_ANSI_H_ */
+#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/ia64/include/endian.h b/sys/ia64/include/endian.h
index 5ae1ac5..7ba8bbf 100644
--- a/sys/ia64/include/endian.h
+++ b/sys/ia64/include/endian.h
@@ -39,7 +39,7 @@
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
diff --git a/sys/ia64/include/stdarg.h b/sys/ia64/include/stdarg.h
index 4a0bcf8..f48a20b 100644
--- a/sys/ia64/include/stdarg.h
+++ b/sys/ia64/include/stdarg.h
@@ -38,9 +38,9 @@
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
diff --git a/sys/ia64/include/types.h b/sys/ia64/include/types.h
deleted file mode 100644
index e898159..0000000
--- a/sys/ia64/include/types.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- * $NetBSD: types.h,v 1.8 1997/04/06 08:47:45 cgd Exp $
- * $FreeBSD$
- */
-
-#ifndef _MACHTYPES_H_
-#define _MACHTYPES_H_
-
-#include <sys/cdefs.h>
-
-typedef unsigned long vm_offset_t;
-typedef long vm_ooffset_t;
-typedef unsigned long vm_pindex_t;
-typedef unsigned long vm_size_t;
-
-typedef __int64_t register_t;
-typedef __uint64_t u_register_t;
-
-#ifdef _KERNEL
-typedef long intfptr_t;
-typedef unsigned long uintfptr_t;
-#endif
-
-/* Critical section value */
-typedef register_t critical_t;
-
-/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint64_t intrmask_t;
-
-#endif /* _MACHTYPES_H_ */
diff --git a/sys/ia64/include/varargs.h b/sys/ia64/include/varargs.h
index f378b00..fcc78c2 100644
--- a/sys/ia64/include/varargs.h
+++ b/sys/ia64/include/varargs.h
@@ -43,9 +43,9 @@
#ifndef _MACHINE_VARARGS_H_
#define _MACHINE_VARARGS_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_alist __builtin_va_alist
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 282415d..e543a75 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -75,9 +75,9 @@ typedef uint16_t in_port_t;
#define _IN_PORT_T_DECLARED
#endif
-#ifdef _BSD_SA_FAMILY_T_
-typedef _BSD_SA_FAMILY_T_ sa_family_t;
-#undef _BSD_SA_FAMILY_T_
+#ifndef _SA_FAMILY_T_DECLARED
+typedef __sa_family_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
#endif
/* Internet address (a structure for historical reasons). */
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 731c665..1a504c8 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -616,9 +616,9 @@ void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam));
extern int (*faithprefix_p)(struct in6_addr *);
#endif /* _KERNEL */
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
#endif
__BEGIN_DECLS
diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h
new file mode 100644
index 0000000..dac8f97
--- /dev/null
+++ b/sys/powerpc/include/_types.h
@@ -0,0 +1,151 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+/* LONGLONG */
+typedef long long __int64_t;
+/* LONGLONG */
+typedef unsigned long long __uint64_t;
+
+/*
+ * Standard type definitions.
+ */
+typedef __uint32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int32_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int32_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int32_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int32_t __register_t;
+typedef __int32_t __segsz_t; /* segment size (in pages) */
+typedef __uint32_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int32_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint32_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint32_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint32_t __u_register_t;
+typedef __uint32_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint32_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#else
+typedef struct {
+ char __gpr;
+ char __fpr;
+ char __pad[2];
+ char *__stack;
+ char *__base;
+} __va_list;
+#endif /* post GCC 2.95 */
+#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/powerpc/include/ansi.h b/sys/powerpc/include/ansi.h
index 19fcc5a..5525ef7 100644
--- a/sys/powerpc/include/ansi.h
+++ b/sys/powerpc/include/ansi.h
@@ -38,75 +38,6 @@
#define _MACHINE_ANSI_H_
/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ int /* clock() */
-#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
-#define _BSD_CLOCKID_T_ int /* clockid_t */
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
-#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SEGSZ_T_ __int32_t /* segment size (in pages) */
-#define _BSD_SIZE_T_ unsigned int /* sizeof() */
-#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */
-#define _BSD_SSIZE_T_ long /* byte count or error */
-#define _BSD_TIME_T_ int /* time() */
-#define _BSD_TIMER_T_ int /* timer_t */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ __int64_t /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
-#else
-typedef struct {
- char __gpr;
- char __fpr;
- char __pad[2];
- char *__stack;
- char *__base;
-} __va_list;
-#define _BSD_VA_LIST_ __va_list /* va_list */
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
-/*
- * The rune type above is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- *
- * NOTE: rune_t is not covered by ANSI nor other standards, and should not
- * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
- * rune_t must be the same type. Also wint_t must be no narrower than
- * wchar_t, and should also be able to hold all members of the largest
- * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
- */
-
-/*
* Frequencies of the clock ticks reported by clock() and times(). They
* are the same as stathz for bogus historical reasons. They should be
* 1e6 because clock() and times() are implemented using getrusage() and
@@ -119,50 +50,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long long __int64_t;
-typedef unsigned long long __uint64_t;
-
-typedef int __intptr_t;
-typedef unsigned int __uintptr_t;
-
-typedef __signed char __int_least8_t;
-typedef unsigned char __uint_least8_t;
-typedef short __int_least16_t;
-typedef unsigned short __uint_least16_t;
-typedef int __int_least32_t;
-typedef unsigned int __uint_least32_t;
-typedef long long __int_least64_t;
-typedef unsigned long long __uint_least64_t;
-
-typedef int __int_fast8_t;
-typedef unsigned int __uint_fast8_t;
-typedef int __int_fast16_t;
-typedef unsigned int __uint_fast16_t;
-typedef int __int_fast32_t;
-typedef unsigned int __uint_fast32_t;
-typedef long long __int_fast64_t;
-typedef unsigned long long __uint_fast64_t;
-
-typedef long long __intmax_t;
-typedef unsigned long long __uintmax_t;
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- char __mbstate8[128];
- __int64_t _mbstateL; /* for alignment */
-} __mbstate_t;
-
-#endif /* _MACHINE_ANSI_H_ */
+#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/powerpc/include/endian.h b/sys/powerpc/include/endian.h
index fc33095..a0f08a0 100644
--- a/sys/powerpc/include/endian.h
+++ b/sys/powerpc/include/endian.h
@@ -39,7 +39,7 @@
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
diff --git a/sys/powerpc/include/stdarg.h b/sys/powerpc/include/stdarg.h
index 87b5965..f71971d 100644
--- a/sys/powerpc/include/stdarg.h
+++ b/sys/powerpc/include/stdarg.h
@@ -31,9 +31,9 @@
#ifndef _POWERPC_STDARG_H_
#define _POWERPC_STDARG_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
diff --git a/sys/powerpc/include/types.h b/sys/powerpc/include/types.h
deleted file mode 100644
index 6ea3f31..0000000
--- a/sys/powerpc/include/types.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- * $FreeBSD$
- */
-
-#ifndef _MACHTYPES_H_
-#define _MACHTYPES_H_
-
-#include <sys/cdefs.h>
-
-typedef unsigned int vm_offset_t;
-typedef __int64_t vm_ooffset_t;
-typedef __uint64_t vm_pindex_t;
-typedef unsigned int vm_size_t;
-
-typedef __int32_t register_t;
-typedef __uint32_t u_register_t;
-
-#ifdef _KERNEL
-typedef int intfptr_t;
-typedef unsigned int uintfptr_t;
-#endif
-
-/* Critical section value */
-typedef register_t critical_t;
-
-/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
-
-#endif /* _MACHTYPES_H_ */
diff --git a/sys/powerpc/include/varargs.h b/sys/powerpc/include/varargs.h
index 6e0f346..6ac271a 100644
--- a/sys/powerpc/include/varargs.h
+++ b/sys/powerpc/include/varargs.h
@@ -33,9 +33,9 @@
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_alist __builtin_va_alist
diff --git a/sys/sparc64/include/_types.h b/sys/sparc64/include/_types.h
new file mode 100644
index 0000000..0e6d6ae
--- /dev/null
+++ b/sys/sparc64/include/_types.h
@@ -0,0 +1,143 @@
+/*-
+ * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
+ * From: @(#)types.h 8.3 (Berkeley) 1/5/94
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE__TYPES_H_
+#define _MACHINE__TYPES_H_
+
+/*
+ * Basic types upon which most other types are built.
+ */
+typedef __signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+typedef long __int64_t;
+typedef unsigned long __uint64_t;
+
+/*
+ * Standard type definitions.
+ */
+typedef __int32_t __clock_t; /* clock()... */
+typedef __int32_t __clockid_t; /* clock_gettime()... */
+typedef __int64_t __critical_t;
+typedef __uint32_t __fflags_t; /* file flags */
+typedef __int64_t __intfptr_t;
+typedef __int64_t __intmax_t;
+typedef __int64_t __intptr_t;
+typedef __uint32_t __intrmask_t;
+typedef __int32_t __int_fast8_t;
+typedef __int32_t __int_fast16_t;
+typedef __int32_t __int_fast32_t;
+typedef __int64_t __int_fast64_t;
+typedef __int8_t __int_least8_t;
+typedef __int16_t __int_least16_t;
+typedef __int32_t __int_least32_t;
+typedef __int64_t __int_least64_t;
+typedef __int64_t __off_t; /* file offset */
+typedef __int32_t __pid_t; /* process [group] */
+typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */
+typedef __int64_t __register_t;
+typedef __int64_t __segsz_t; /* segment size (in pages) */
+typedef __uint64_t __size_t; /* sizeof() */
+typedef __uint32_t __socklen_t;
+typedef __int64_t __ssize_t; /* byte count or error */
+typedef __int32_t __time_t; /* time()... */
+typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint64_t __uintfptr_t;
+typedef __uint64_t __uintmax_t;
+typedef __uint64_t __uintptr_t;
+typedef __uint32_t __uint_fast8_t;
+typedef __uint32_t __uint_fast16_t;
+typedef __uint32_t __uint_fast32_t;
+typedef __uint64_t __uint_fast64_t;
+typedef __uint8_t __uint_least8_t;
+typedef __uint16_t __uint_least16_t;
+typedef __uint32_t __uint_least32_t;
+typedef __uint64_t __uint_least64_t;
+typedef __uint64_t __u_register_t;
+typedef __uint64_t __vm_offset_t;
+typedef __int64_t __vm_ooffset_t;
+typedef __uint64_t __vm_pindex_t;
+typedef __uint64_t __vm_size_t;
+
+/*
+ * Unusual type definitions.
+ */
+/*
+ * The rune type above is declared to be an ``int'' instead of the more natural
+ * ``unsigned long'' or ``long''. Two things are happening here. It is not
+ * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
+ * it looks like 10646 will be a 31 bit standard. This means that if your
+ * ints cannot hold 32 bits, you will be in trouble. The reason an int was
+ * chosen over a long is that the is*() and to*() routines take ints (says
+ * ANSI C), but they use __ct_rune_t instead of int. By changing it here, you
+ * lose a bit of ANSI conformance, but your programs will still work.
+ *
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
+ * rune_t must be the same type. Also wint_t must be no narrower than
+ * wchar_t, and should also be able to hold all members of the largest
+ * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
+ */
+typedef __int32_t __ct_rune_t;
+typedef __int32_t __rune_t;
+typedef __int32_t __wchar_t;
+typedef __int32_t __wint_t;
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+} __mbstate_t;
+
+#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
+typedef __builtin_va_list __va_list; /* internally known to gcc */
+#else
+typedef char * __va_list;
+#endif /* post GCC 2.95 */
+#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
+#define __GNUC_VA_LIST
+typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
+#endif
+
+#endif /* !_MACHINE__TYPES_H_ */
diff --git a/sys/sparc64/include/ansi.h b/sys/sparc64/include/ansi.h
index 86f2cf6..11dbf03 100644
--- a/sys/sparc64/include/ansi.h
+++ b/sys/sparc64/include/ansi.h
@@ -39,68 +39,6 @@
#define _MACHINE_ANSI_H_
/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ int /* clock() */
-#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
-#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
-#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SEGSZ_T_ __int64_t /* segment size (in pages) */
-#define _BSD_SIZE_T_ unsigned long /* sizeof() */
-#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t (duh) */
-#define _BSD_SSIZE_T_ long /* byte count or error */
-#define _BSD_TIME_T_ int /* time()... */
-#define _BSD_TIMER_T_ int /* timer_gettime()... */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ long /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-
-#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
-#else
-#define _BSD_VA_LIST_ char * /* va_list */
-#endif /* post GCC 2.95 */
-#if defined __GNUC__ && !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
-#define __GNUC_VA_LIST
-typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
-#endif
-
-/*
- * The rune type above is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- *
- * NOTE: rune_t is not covered by ANSI nor other standards, and should not
- * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
- * rune_t must be the same type. Also wint_t must be no narrower than
- * wchar_t, and should also be able to hold all members of the largest
- * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
- */
-
-/*
* Frequencies of the clock ticks reported by clock() and times(). They
* are the same as stathz for bogus historical reasons. They should be
* 1e6 because clock() and times() are implemented using getrusage() and
@@ -113,50 +51,4 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
#define _BSD_CLK_TCK_ 100
#define _BSD_CLOCKS_PER_SEC_ 100
-/*
- * Internal names for basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-typedef __signed char __int8_t;
-typedef unsigned char __uint8_t;
-typedef short __int16_t;
-typedef unsigned short __uint16_t;
-typedef int __int32_t;
-typedef unsigned int __uint32_t;
-typedef long __int64_t;
-typedef unsigned long __uint64_t;
-
-typedef long __intptr_t;
-typedef unsigned long __uintptr_t;
-
-typedef __signed char __int_least8_t;
-typedef unsigned char __uint_least8_t;
-typedef short __int_least16_t;
-typedef unsigned short __uint_least16_t;
-typedef int __int_least32_t;
-typedef unsigned int __uint_least32_t;
-typedef long __int_least64_t;
-typedef unsigned long __uint_least64_t;
-
-typedef int __int_fast8_t;
-typedef unsigned int __uint_fast8_t;
-typedef int __int_fast16_t;
-typedef unsigned int __uint_fast16_t;
-typedef int __int_fast32_t;
-typedef unsigned int __uint_fast32_t;
-typedef long __int_fast64_t;
-typedef unsigned long __uint_fast64_t;
-
-typedef long __intmax_t;
-typedef unsigned long __uintmax_t;
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- char __mbstate8[128];
- __int64_t _mbstateL; /* for alignment */
-} __mbstate_t;
-
#endif /* !_MACHINE_ANSI_H_ */
diff --git a/sys/sparc64/include/endian.h b/sys/sparc64/include/endian.h
index 830cf2e..e8ee184 100644
--- a/sys/sparc64/include/endian.h
+++ b/sys/sparc64/include/endian.h
@@ -38,7 +38,7 @@
#define _MACHINE_ENDIAN_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Define the order of 32-bit words in 64-bit words.
diff --git a/sys/sparc64/include/stdarg.h b/sys/sparc64/include/stdarg.h
index c126af0..f81a67c 100644
--- a/sys/sparc64/include/stdarg.h
+++ b/sys/sparc64/include/stdarg.h
@@ -41,9 +41,9 @@
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
diff --git a/sys/sparc64/include/types.h b/sys/sparc64/include/types.h
deleted file mode 100644
index 3d0439f..0000000
--- a/sys/sparc64/include/types.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- * $FreeBSD$
- */
-
-#ifndef _MACHINE_TYPES_H_
-#define _MACHINE_TYPES_H_
-
-#include <sys/cdefs.h>
-
-typedef unsigned long vm_offset_t;
-typedef long vm_ooffset_t;
-typedef unsigned long vm_pindex_t;
-typedef unsigned long vm_size_t;
-
-typedef __int64_t register_t;
-typedef __uint64_t u_register_t;
-
-#ifdef _KERNEL
-typedef long intfptr_t;
-typedef unsigned long uintfptr_t;
-#endif
-
-/* Critical section value */
-typedef register_t critical_t;
-
-/* Interrupt mask (spl, xxx_imask, etc) */
-typedef __uint32_t intrmask_t;
-
-#endif /* !_MACHINE_TYPES_H_ */
diff --git a/sys/sparc64/include/varargs.h b/sys/sparc64/include/varargs.h
index dd7e3a3..a93b89f 100644
--- a/sys/sparc64/include/varargs.h
+++ b/sys/sparc64/include/varargs.h
@@ -51,9 +51,9 @@
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ > 95 || __GNUC__ >= 3)
-#include <machine/ansi.h>
+#include <sys/_types.h>
-typedef _BSD_VA_LIST_ va_list;
+typedef __va_list va_list;
typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
#define va_alist __builtin_va_alist
diff --git a/sys/sys/_timespec.h b/sys/sys/_timespec.h
index 69b8fdd..48cef5a 100644
--- a/sys/sys/_timespec.h
+++ b/sys/sys/_timespec.h
@@ -36,7 +36,7 @@
*/
/*
- * Prerequisites: <sys/cdefs.h>, <machine/ansi.h>
+ * Prerequisites: <sys/cdefs.h>, <sys/_types.h>
*
* This file must be kept synchronized with <sys/timespec.h>.
* It defines a structure which must be a type pun for
@@ -49,8 +49,8 @@
#define _SYS__TIMESPEC_H_
struct __timespec {
-#ifdef _BSD_TIME_T_
- _BSD_TIME_T_ __tv_sec; /* seconds, but time_t is not yet defined */
+#ifndef _TIME_T_DECLARED
+ __time_t __tv_sec; /* seconds, but time_t is not yet defined */
#else
time_t __tv_sec; /* seconds */
#endif
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index cbc430b..864ba71 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -30,12 +30,12 @@
#define _SYS__TYPES_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <machine/_types.h>
-#define _BSD_FSBLKCNT_T_ __uint64_t
-#define _BSD_FSFILCNT_T_ __uint64_t
-#define _BSD_GID_T_ __uint32_t
-#define _BSD_SA_FAMILY_T_ __uint8_t
-#define _BSD_UID_T_ __uint32_t
+typedef __uint64_t __fsblkcnt_t;
+typedef __uint64_t __fsfilcnt_t;
+typedef __uint32_t __gid_t;
+typedef __uint8_t __sa_family_t;
+typedef __uint32_t __uid_t;
#endif /* !_SYS__TYPES_H_ */
diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h
index b9c39d1..9f8cfad 100644
--- a/sys/sys/dirent.h
+++ b/sys/sys/dirent.h
@@ -37,7 +37,7 @@
#ifndef _SYS_DIRENT_H_
#define _SYS_DIRENT_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* The dirent structure defines the format of directory entries returned by
diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h
index bd2e9e9..a63603e 100644
--- a/sys/sys/sbuf.h
+++ b/sys/sys/sbuf.h
@@ -31,7 +31,7 @@
#ifndef _SYS_SBUF_H_
#define _SYS_SBUF_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
/*
* Structure definition
@@ -63,7 +63,7 @@ int sbuf_bcpy(struct sbuf *, const char *, size_t);
int sbuf_cat(struct sbuf *, const char *);
int sbuf_cpy(struct sbuf *, const char *);
int sbuf_printf(struct sbuf *, const char *, ...) __printflike(2, 3);
-int sbuf_vprintf(struct sbuf *, const char *, _BSD_VA_LIST_) __printflike(2, 0);
+int sbuf_vprintf(struct sbuf *, const char *, __va_list) __printflike(2, 0);
int sbuf_putc(struct sbuf *, int);
int sbuf_trim(struct sbuf *);
int sbuf_overflowed(struct sbuf *);
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index f0668a9..9098326 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -215,9 +215,9 @@ typedef void __siginfohandler_t(int, struct __siginfo *, void *);
typedef __sighandler_t *sig_t; /* type of pointer to a signal function */
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
#endif
/*
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 4254c72..0f81be1 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -49,14 +49,14 @@
/*
* Data types.
*/
-#ifdef _BSD_SA_FAMILY_T_
-typedef _BSD_SA_FAMILY_T_ sa_family_t;
-#undef _BSD_SA_FAMILY_T_
+#ifndef _SA_FAMILY_T_DECLARED
+typedef __sa_family_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
#endif
-#ifdef _BSD_SOCKLEN_T_
-typedef _BSD_SOCKLEN_T_ socklen_t;
-#undef _BSD_SOCKLEN_T_
+#ifndef _SOCKLEN_T_DECLARED
+typedef __socklen_t socklen_t;
+#define _SOCKLEN_T_DECLARED
#endif
/*
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index d7e28f3..a1d207f 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -43,11 +43,11 @@
#define _SYS_STAT_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/_types.h>
-#ifdef _BSD_FFLAGS_T_
-typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */
-#undef _BSD_FFLAGS_T_
+#ifndef _FFLAGS_T_DECLARED
+typedef __fflags_t fflags_t; /* file flags */
+#define _FFLAGS_T_DECLARED
#endif
#if !defined(_KERNEL) && !defined(_POSIX_SOURCE)
diff --git a/sys/sys/statvfs.h b/sys/sys/statvfs.h
index ef722c1..15be8ce 100644
--- a/sys/sys/statvfs.h
+++ b/sys/sys/statvfs.h
@@ -43,8 +43,8 @@
* a quality implementation should.)
*/
#ifndef _FSBLKCNT_T_DECLARED /* always declared together */
-typedef _BSD_FSBLKCNT_T_ fsblkcnt_t;
-typedef _BSD_FSFILCNT_T_ fsfilcnt_t;
+typedef __fsblkcnt_t fsblkcnt_t;
+typedef __fsfilcnt_t fsfilcnt_t;
#define _FSBLKCNT_T_DECLARED
#endif
diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h
index 1f870fc..27f6dae 100644
--- a/sys/sys/stdint.h
+++ b/sys/sys/stdint.h
@@ -30,8 +30,8 @@
#define _SYS_STDINT_H_
#include <sys/cdefs.h>
+#include <sys/_types.h>
-#include <machine/ansi.h>
#include <machine/_stdint.h>
#ifndef _INT8_T_DECLARED
diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h
index 80cac0a..2b45ca4 100644
--- a/sys/sys/syslog.h
+++ b/sys/sys/syslog.h
@@ -186,17 +186,17 @@ CODE facilitynames[] = {
* places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
* of them here we may collide with the utility's includes. It's unreasonable
* for utilities to have to include one of them to include syslog.h, so we get
- * _BSD_VA_LIST_ from <machine/ansi.h> and use it.
+ * __va_list from <sys/_types.h> and use it.
*/
-#include <machine/ansi.h>
#include <sys/cdefs.h>
+#include <sys/_types.h>
__BEGIN_DECLS
void closelog(void);
void openlog(const char *, int, int);
int setlogmask(int);
void syslog(int, const char *, ...) __printflike(2, 3);
-void vsyslog(int, const char *, _BSD_VA_LIST_) __printflike(2, 0);
+void vsyslog(int, const char *, __va_list) __printflike(2, 0);
__END_DECLS
#endif /* !_KERNEL */
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 597f58e..2029412 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -143,19 +143,19 @@ void init_param1(void);
void init_param2(int physpages);
void tablefull(const char *);
int kvprintf(char const *, void (*)(int, void*), void *, int,
- _BSD_VA_LIST_) __printflike(1, 0);
+ __va_list) __printflike(1, 0);
void log(int, const char *, ...) __printflike(2, 3);
void log_console(struct uio *);
int printf(const char *, ...) __printflike(1, 2);
int snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
int sprintf(char *buf, const char *, ...) __printflike(2, 3);
int uprintf(const char *, ...) __printflike(1, 2);
-int vprintf(const char *, _BSD_VA_LIST_) __printflike(1, 0);
-int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_) __printflike(3, 0);
-int vsprintf(char *buf, const char *, _BSD_VA_LIST_) __printflike(2, 0);
+int vprintf(const char *, __va_list) __printflike(1, 0);
+int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0);
+int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0);
int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3);
int sscanf(const char *, char const *, ...);
-int vsscanf(const char *, char const *, _BSD_VA_LIST_);
+int vsscanf(const char *, char const *, __va_list);
long strtol(const char *, char **, int);
u_long strtoul(const char *, char **, int);
quad_t strtoq(const char *, char **, int);
diff --git a/sys/sys/times.h b/sys/sys/times.h
index eb68bd0..dfa3124 100644
--- a/sys/sys/times.h
+++ b/sys/sys/times.h
@@ -42,11 +42,11 @@
#ifndef _SYS_TIMES_H_
#define _SYS_TIMES_H_
-#include <machine/ansi.h>
+#include <sys/_types.h>
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
+#ifndef _CLOCK_T_DECLARED
+typedef __clock_t clock_t;
+#define _CLOCK_T_DECLARED
#endif
struct tms {
diff --git a/sys/sys/timespec.h b/sys/sys/timespec.h
index 038db28..9f17828 100644
--- a/sys/sys/timespec.h
+++ b/sys/sys/timespec.h
@@ -36,15 +36,15 @@
*/
/*
- * Prerequisites: <sys/cdefs.h>, <machine/ansi.h>
+ * Prerequisites: <sys/cdefs.h>, <sys/_types.h>
*/
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
+#ifndef _TIME_T_DECLARED
+typedef __time_t time_t;
+#define _TIME_T_DECLARED
#endif
struct timespec {
diff --git a/sys/sys/types.h b/sys/sys/types.h
index ded6f77..a0af2b9 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -45,9 +45,7 @@
#include <sys/cdefs.h>
/* Machine type dependent parameters. */
-#include <machine/ansi.h>
#include <machine/endian.h>
-#include <machine/types.h>
#include <sys/_types.h>
#ifndef _POSIX_SOURCE
@@ -126,36 +124,42 @@ typedef quad_t * qaddr_t;
typedef char * caddr_t; /* core address */
typedef __const char * c_caddr_t; /* core address, pointer to const */
typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */
+typedef __critical_t critical_t; /* Critical section value */
typedef int64_t daddr_t; /* disk address */
typedef u_int32_t fixpt_t; /* fixed point number */
-#ifdef _BSD_GID_T_
-typedef _BSD_GID_T_ gid_t; /* group id */
-#undef _BSD_GID_T_
+#ifndef _GID_T_DECLARED
+typedef __gid_t gid_t; /* group id */
+#define _GID_T_DECLARED
#endif
typedef u_int32_t ino_t; /* inode number */
+typedef __intrmask_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */
typedef long key_t; /* IPC key (for Sys V IPC) */
typedef u_int16_t mode_t; /* permissions */
typedef u_int16_t nlink_t; /* link count */
-typedef _BSD_OFF_T_ off_t; /* file offset */
-typedef _BSD_PID_T_ pid_t; /* process id */
+typedef __off_t off_t; /* file offset */
+typedef __pid_t pid_t; /* process id */
+typedef __register_t register_t;
typedef quad_t rlim_t; /* resource limit */
-
-#ifdef _BSD_SEGSZ_T_
-typedef _BSD_SEGSZ_T_ segsz_t; /* segment size (in pages) */
-#undef _BSD_SEGSZ_T_
-#endif
-
+typedef __segsz_t segsz_t; /* segment size (in pages) */
typedef int32_t swblk_t; /* swap offset */
+typedef __u_register_t u_register_t;
-#ifdef _BSD_UID_T_
-typedef _BSD_UID_T_ uid_t; /* user id */
-#undef _BSD_UID_T_
+#ifndef _UID_T_DECLARED
+typedef __uid_t uid_t; /* user id */
+#define _UID_T_DECLARED
#endif
+typedef __vm_offset_t vm_offset_t;
+typedef __vm_ooffset_t vm_ooffset_t;
+typedef __vm_pindex_t vm_pindex_t;
+typedef __vm_size_t vm_size_t;
+
#ifdef _KERNEL
typedef int boolean_t;
+typedef __intfptr_t intfptr_t;
+typedef __uintfptr_t uintfptr_t;
typedef u_int64_t uoff_t;
typedef struct vm_page *vm_page_t;
@@ -186,45 +190,45 @@ typedef u_int32_t dev_t; /* device number */
#endif /* !_KERNEL */
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
+#ifndef _CLOCK_T_DECLARED
+typedef __clock_t clock_t;
+#define _CLOCK_T_DECLARED
#endif
-#ifdef _BSD_CLOCKID_T_
-typedef _BSD_CLOCKID_T_ clockid_t;
-#undef _BSD_CLOCKID_T_
+#ifndef _CLOCKID_T_DECLARED
+typedef __clockid_t clockid_t;
+#define _CLOCKID_T_DECLARED
#endif
-#ifdef _BSD_FFLAGS_T_
-typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */
-#undef _BSD_FFLAGS_T_
+#ifndef _FFLAGS_T_DECLARED
+typedef __fflags_t fflags_t; /* file flags */
+#define _FFLAGS_T_DECLARED
#endif
#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */
-typedef _BSD_FSBLKCNT_T_ fsblkcnt_t;
-typedef _BSD_FSFILCNT_T_ fsfilcnt_t;
-#define _FSBLKCNT_T_DECLARED
+typedef __fsblkcnt_t fsblkcnt_t;
+typedef __fsfilcnt_t fsfilcnt_t;
+#define _FSBLKCNT_T_DECLARED
#endif
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
#endif
-#ifdef _BSD_SSIZE_T_
-typedef _BSD_SSIZE_T_ ssize_t;
-#undef _BSD_SSIZE_T_
+#ifndef _SSIZE_T_DECLARED
+typedef __ssize_t ssize_t;
+#define _SSIZE_T_DECLARED
#endif
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
+#ifndef _TIME_T_DECLARED
+typedef __time_t time_t;
+#define _TIME_T_DECLARED
#endif
-#ifdef _BSD_TIMER_T_
-typedef _BSD_TIMER_T_ timer_t;
-#undef _BSD_TIMER_T_
+#ifndef _TIMER_T_DECLARED
+typedef __timer_t timer_t;
+#define _TIMER_T_DECLARED
#endif
#if __BSD_VISIBLE
diff --git a/sys/sys/un.h b/sys/sys/un.h
index 65d246b6..12ca360 100644
--- a/sys/sys/un.h
+++ b/sys/sys/un.h
@@ -40,9 +40,9 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
-#ifdef _BSD_SA_FAMILY_T_
-typedef _BSD_SA_FAMILY_T_ sa_family_t;
-#undef _BSD_SA_FAMILY_T_
+#ifndef _SA_FAMILY_T_DECLARED
+typedef __sa_family_t sa_family_t;
+#define _SA_FAMILY_T_DECLARED
#endif
/*
OpenPOWER on IntegriCloud