diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2006-01-06 18:53:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2006-01-06 18:53:07 +0000 |
commit | 4f6f4abee953638d3409775c050227c9537c9e8c (patch) | |
tree | 38d3a984a5a051627704f25d9151930244be39c5 /sys | |
parent | a835e97a88caf4a2d77874683640dd0e6c0225d1 (diff) |
Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable
Diffstat (limited to 'sys')
29 files changed, 333 insertions, 190 deletions
diff --git a/sys/arch/alpha/include/stdarg.h b/sys/arch/alpha/include/stdarg.h index 3d64c0fb39e..03b50b40166 100644 --- a/sys/arch/alpha/include/stdarg.h +++ b/sys/arch/alpha/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.8 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.4 1996/10/09 21:13:05 cgd Exp $ */ /*- @@ -36,9 +36,9 @@ #define _ALPHA_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/amd64/include/stdarg.h b/sys/arch/amd64/include/stdarg.h index 370b624166f..feeb97970a7 100644 --- a/sys/arch/amd64/include/stdarg.h +++ b/sys/arch/amd64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2005/12/14 21:46:30 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.2 2003/04/28 23:16:17 bjh21 Exp $ */ /*- @@ -36,17 +36,28 @@ #define _AMD64_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> /* for __va_list */ -typedef _BSD_VA_LIST_ va_list; +/* + * NOTE: this file is only used by lint and non-GNU compilers + */ + +typedef __va_list va_list; + +#define __va_size(type) \ + (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) __builtin_stdarg_start((ap), (last)) -#define va_arg __builtin_va_arg -#define va_end(ap) __builtin_va_end(ap) -#define __va_copy(dest, src) __builtin_va_copy((dest), (src)) +#define va_start(ap, last) \ + ((ap) = (va_list)&(last) + __va_size(last)) + +#define va_arg(ap, type) \ + (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) #if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) __va_copy((dest), (src)) +#define va_copy(dest, src) \ + ((dest) = (src)) #endif +#define va_end(ap) + #endif /* !_AMD64_STDARG_H_ */ diff --git a/sys/arch/arm/include/stdarg.h b/sys/arch/arm/include/stdarg.h index 4af3e313bb8..ad025c06942 100644 --- a/sys/arch/arm/include/stdarg.h +++ b/sys/arch/arm/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.4 2005/12/14 21:46:30 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.7 2003/08/07 16:26:53 agc Exp $ */ /* @@ -36,9 +36,9 @@ #define _ARM32_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #ifdef __lint__ #define __builtin_next_arg(t) ((t) ? 0 : 0) #define __builtin_stdarg_start(a, l) ((a) = ((l) ? 0 : 0)) diff --git a/sys/arch/hppa/hppa/genassym.cf b/sys/arch/hppa/hppa/genassym.cf index 3942e2971fa..842af4daa32 100644 --- a/sys/arch/hppa/hppa/genassym.cf +++ b/sys/arch/hppa/hppa/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.27 2005/04/21 04:39:35 mickey Exp $ +# $OpenBSD: genassym.cf,v 1.28 2006/01/06 18:53:05 millert Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -42,7 +42,6 @@ include <sys/user.h> include <uvm/uvm.h> -include <machine/types.h> include <machine/cpu.h> include <machine/psl.h> include <machine/reg.h> diff --git a/sys/arch/hppa/include/stdarg.h b/sys/arch/hppa/include/stdarg.h index 3bfcc43f46c..712395bdcb5 100644 --- a/sys/arch/hppa/include/stdarg.h +++ b/sys/arch/hppa/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.6 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.7 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,8 +35,9 @@ #define _MACHINE_STDARG_H_ #include <sys/cdefs.h> +#include <machine/_types.h> -typedef double *va_list; +typedef __va_list va_list; #ifdef __GNUC__ #define va_start(ap,lastarg) ((ap) = (va_list)__builtin_saveregs()) diff --git a/sys/arch/hppa64/include/stdarg.h b/sys/arch/hppa64/include/stdarg.h index e8de77c5e4f..697d41a8b9f 100644 --- a/sys/arch/hppa64/include/stdarg.h +++ b/sys/arch/hppa64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,8 +35,9 @@ #define _MACHINE_STDARG_H_ #include <sys/cdefs.h> +#include <machine/_types.h> -typedef double *va_list; +typedef __va_list va_list; #ifdef __GNUC__ #define va_start(ap,lastarg) ((ap) = (va_list)__builtin_saveregs()) diff --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h index 473b059b105..4df981d3d9a 100644 --- a/sys/arch/i386/include/stdarg.h +++ b/sys/arch/i386/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.8 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.9 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */ /*- @@ -36,9 +36,9 @@ #define _I386_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/m68k/include/stdarg.h b/sys/arch/m68k/include/stdarg.h index cb457c20574..b6bc860cbb5 100644 --- a/sys/arch/m68k/include/stdarg.h +++ b/sys/arch/m68k/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.8 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.9 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.14 1995/12/25 23:15:33 mycroft Exp $ */ /*- @@ -36,9 +36,9 @@ #define _M68K_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/m88k/include/stdarg.h b/sys/arch/m88k/include/stdarg.h index 2c918f9fe95..1b42ef6d009 100644 --- a/sys/arch/m88k/include/stdarg.h +++ b/sys/arch/m88k/include/stdarg.h @@ -1,9 +1,9 @@ -/* $OpenBSD: stdarg.h,v 1.1 2004/04/26 12:34:05 miod Exp $ */ +/* $OpenBSD: stdarg.h,v 1.2 2006/01/06 18:53:05 millert Exp $ */ #ifndef _M88K_STDARGS_H_ #define _M88K_STDARGS_H_ -#include <machine/ansi.h> +#include <machine/_types.h> #ifndef _STDARG_H #define _STDARG_H @@ -11,6 +11,6 @@ #include <machine/va-m88k.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* _M88K_STDARGS_H_ */ diff --git a/sys/arch/m88k/include/va-m88k.h b/sys/arch/m88k/include/va-m88k.h index 1920fdd8410..3b9665803c0 100644 --- a/sys/arch/m88k/include/va-m88k.h +++ b/sys/arch/m88k/include/va-m88k.h @@ -1,4 +1,4 @@ -/* $OpenBSD: va-m88k.h,v 1.7 2005/12/20 14:42:05 millert Exp $ */ +/* $OpenBSD: va-m88k.h,v 1.8 2006/01/06 18:53:05 millert Exp $ */ /* Define __gnuc_va_list. */ @@ -11,7 +11,7 @@ typedef struct __va_list_tag { unsigned int __va_arg; /* argument number */ unsigned int *__va_stk; /* start of args passed on stack */ unsigned int *__va_reg; /* start of args passed in regs */ -} __va_list[1], __gnuc_va_list[1]; +} __gnuc_va_list[1]; #endif /* not __GNUC_VA_LIST */ diff --git a/sys/arch/m88k/include/varargs.h b/sys/arch/m88k/include/varargs.h index 85a3d759cd0..a399f55b2a2 100644 --- a/sys/arch/m88k/include/varargs.h +++ b/sys/arch/m88k/include/varargs.h @@ -1,13 +1,13 @@ -/* $OpenBSD: varargs.h,v 1.1 2004/04/26 12:34:05 miod Exp $ */ +/* $OpenBSD: varargs.h,v 1.2 2006/01/06 18:53:05 millert Exp $ */ #ifndef _M88K_VARARGS_H_ #define _M88K_VARARGS_H_ #define _VARARGS_H -#include <machine/ansi.h> +#include <machine/_types.h> #include <machine/va-m88k.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* _M88K_VARARGS_H_ */ diff --git a/sys/arch/mips64/include/stdarg.h b/sys/arch/mips64/include/stdarg.h index 60e066da7d9..94450d105c0 100644 --- a/sys/arch/mips64/include/stdarg.h +++ b/sys/arch/mips64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.4 2005/12/14 23:51:33 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -35,9 +35,9 @@ #define _MIPS_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST diff --git a/sys/arch/powerpc/include/frame.h b/sys/arch/powerpc/include/frame.h index 674f7c2e9fa..4eda8735ee7 100644 --- a/sys/arch/powerpc/include/frame.h +++ b/sys/arch/powerpc/include/frame.h @@ -1,4 +1,4 @@ -/* $OpenBSD: frame.h,v 1.6 2005/08/02 21:02:49 drahn Exp $ */ +/* $OpenBSD: frame.h,v 1.7 2006/01/06 18:53:05 millert Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -33,8 +33,6 @@ #ifndef _POWERPC_FRAME_H_ #define _POWERPC_FRAME_H_ -#include <machine/types.h> - /* * This is to ensure alignment of the stackpointer */ diff --git a/sys/arch/powerpc/include/signal.h b/sys/arch/powerpc/include/signal.h index d25ec5e6fe6..89f2bb0dc84 100644 --- a/sys/arch/powerpc/include/signal.h +++ b/sys/arch/powerpc/include/signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.h,v 1.5 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: signal.h,v 1.6 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: signal.h,v 1.1 1996/09/30 16:34:34 ws Exp $ */ /* @@ -39,7 +39,7 @@ typedef int sig_atomic_t; #if __BSD_VISIBLE -#include <machine/types.h> +#include <machine/_types.h> /* * We have to save all registers on every trap, because @@ -51,16 +51,16 @@ typedef int sig_atomic_t; * */ struct trapframe { - u_int32_t fixreg[32]; - u_int32_t lr; - u_int32_t cr; - u_int32_t xer; - u_int32_t ctr; + __register_t fixreg[32]; + __register_t lr; + __register_t cr; + __register_t xer; + __register_t ctr; int srr0; int srr1; int dar; /* dar & dsisr are only filled on a DSI trap */ int dsisr; - u_int32_t exc; + __register_t exc; }; struct sigcontext { diff --git a/sys/arch/powerpc/include/stdarg.h b/sys/arch/powerpc/include/stdarg.h index 9c23da50f7e..76e3cda1d08 100644 --- a/sys/arch/powerpc/include/stdarg.h +++ b/sys/arch/powerpc/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.5 2003/06/02 23:27:53 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.6 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.1 1996/09/30 16:34:35 ws Exp $ */ /*- @@ -35,13 +35,13 @@ #ifndef _POWERPC_STDARG_H_ #define _POWERPC_STDARG_H_ -#include <machine/ansi.h> +#include <machine/_types.h> #ifndef _STDARG_H #define _STDARG_H #endif #include <machine/va-ppc.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* !_POWERPC_STDARG_H_ */ diff --git a/sys/arch/powerpc/include/va-ppc.h b/sys/arch/powerpc/include/va-ppc.h index 028bae06382..86353c6b2ef 100644 --- a/sys/arch/powerpc/include/va-ppc.h +++ b/sys/arch/powerpc/include/va-ppc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: va-ppc.h,v 1.11 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: va-ppc.h,v 1.12 2006/01/06 18:53:05 millert Exp $ */ /* GNU C varargs support for the PowerPC with either the V.4 or Windows NT calling sequences */ #include <sys/cdefs.h> @@ -29,7 +29,7 @@ typedef struct __va_list_tag { char *overflow_arg_area; /* location on stack that holds the next overflow argument */ char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */ -} __va_list[1], __gnuc_va_list[1]; +} __gnuc_va_list[1]; #else /* _SYS_VA_LIST */ diff --git a/sys/arch/powerpc/include/varargs.h b/sys/arch/powerpc/include/varargs.h index 4330af8f837..e17efff0df7 100644 --- a/sys/arch/powerpc/include/varargs.h +++ b/sys/arch/powerpc/include/varargs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: varargs.h,v 1.4 2003/06/02 23:27:53 millert Exp $ */ +/* $OpenBSD: varargs.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: varargs.h,v 1.1 1996/09/30 16:34:37 ws Exp $ */ /*- @@ -42,9 +42,9 @@ #define _VARARGS_H -#include <machine/ansi.h> +#include <machine/_types.h> #include <machine/va-ppc.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* !_POWERPC_VARARGS_H_ */ diff --git a/sys/arch/sparc/include/stdarg.h b/sys/arch/sparc/include/stdarg.h index bbddc6e4914..fe878fec5d4 100644 --- a/sys/arch/sparc/include/stdarg.h +++ b/sys/arch/sparc/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.11 2005/12/15 13:44:52 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.12 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.10 1996/12/27 20:55:28 pk Exp $ */ /* @@ -45,13 +45,13 @@ #define _SPARC_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> #ifdef __lint__ #define __builtin_classify_type(t) (0) #endif -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/sparc64/include/bus.h b/sys/arch/sparc64/include/bus.h index 14f61133f02..38ab7a81f64 100644 --- a/sys/arch/sparc64/include/bus.h +++ b/sys/arch/sparc64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.17 2005/07/10 00:23:11 brad Exp $ */ +/* $OpenBSD: bus.h,v 1.18 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: bus.h,v 1.31 2001/09/21 15:30:41 wiz Exp $ */ /*- @@ -73,7 +73,6 @@ #ifndef _SPARC_BUS_H_ #define _SPARC_BUS_H_ -#include <machine/types.h> #include <machine/ctlreg.h> /* diff --git a/sys/arch/sparc64/include/stdarg.h b/sys/arch/sparc64/include/stdarg.h index 58e56a19799..cd01cc9b967 100644 --- a/sys/arch/sparc64/include/stdarg.h +++ b/sys/arch/sparc64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.4 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp $ */ /* @@ -45,7 +45,7 @@ #define _SPARC64_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> #ifdef __lint__ #define __builtin_saveregs(t) (0) @@ -53,7 +53,7 @@ #define __builtin_next_arg(t) ((t) ? 0 : 0) #endif -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define va_start(ap, last) \ (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) diff --git a/sys/arch/vax/include/stdarg.h b/sys/arch/vax/include/stdarg.h index 2ebf9dc7f26..b3aca7c0a8a 100644 --- a/sys/arch/vax/include/stdarg.h +++ b/sys/arch/vax/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.7 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.8 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.11 1999/05/03 16:30:34 christos Exp $ */ /*- @@ -36,9 +36,9 @@ #define _VAX_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #ifdef __lint__ #define __builtin_next_arg(t) ((t) ? 0 : 0) diff --git a/sys/lib/libsa/stand.h b/sys/lib/libsa/stand.h index e6522686309..92f9d3efa0f 100644 --- a/sys/lib/libsa/stand.h +++ b/sys/lib/libsa/stand.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stand.h,v 1.43 2004/01/03 14:08:53 espie Exp $ */ +/* $OpenBSD: stand.h,v 1.44 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stand.h,v 1.18 1996/11/30 04:35:51 gwr Exp $ */ /*- @@ -136,7 +136,7 @@ u_int dkcksum(struct disklabel *); void printf(const char *, ...); int snprintf(char *, size_t, const char *, ...); -void vprintf(const char *, _BSD_VA_LIST_); +void vprintf(const char *, __va_list); void twiddle(void); void gets(char *); __dead void panic(const char *, ...) __attribute__((noreturn)); diff --git a/sys/sys/_types.h b/sys/sys/_types.h new file mode 100644 index 00000000000..7a91283339b --- /dev/null +++ b/sys/sys/_types.h @@ -0,0 +1,69 @@ +/* $OpenBSD: _types.h,v 1.1 2006/01/06 18:53:05 millert Exp $ */ + +/*- + * 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. 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 + */ + +#ifndef _SYS__TYPES_H_ +#define _SYS__TYPES_H_ + +#include <machine/_types.h> + +typedef unsigned long __cpuid_t; /* CPU id */ +typedef __int32_t __dev_t; /* device number */ +typedef __uint32_t __fixpt_t; /* fixed point number */ +typedef __uint32_t __gid_t; /* group id */ +typedef __uint32_t __id_t; /* may contain pid, uid or gid */ +typedef __uint32_t __in_addr_t; /* base type for internet address */ +typedef __uint16_t __in_port_t; /* IP port type */ +typedef __uint32_t __ino_t; /* inode number */ +typedef long __key_t; /* IPC key (for Sys V IPC) */ +typedef __uint32_t __mode_t; /* permissions */ +typedef __uint32_t __nlink_t; /* link count */ +typedef __int32_t __pid_t; /* process id */ +typedef __uint64_t __rlim_t; /* resource limit */ +typedef __uint8_t __sa_family_t; /* sockaddr address family type */ +typedef __int32_t __segsz_t; /* segment size */ +typedef __uint32_t __socklen_t; /* length type for network syscalls */ +typedef __int32_t __swblk_t; /* swap offset */ +typedef __uint32_t __uid_t; /* user id */ +typedef __uint32_t __useconds_t; /* microseconds */ +typedef __int32_t __suseconds_t; /* microseconds (signed) */ + +/* + * 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 /* !_SYS__TYPES_H_ */ diff --git a/sys/sys/endian.h b/sys/sys/endian.h index 5b3efae7554..14d79a68087 100644 --- a/sys/sys/endian.h +++ b/sys/sys/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.16 2005/12/14 18:28:40 millert Exp $ */ +/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -52,25 +52,25 @@ #ifdef __GNUC__ #define __swap16gen(x) __statement({ \ - u_int16_t __swap16gen_x = (x); \ + __uint16_t __swap16gen_x = (x); \ \ - (u_int16_t)((__swap16gen_x & 0xff) << 8 | \ + (__uint16_t)((__swap16gen_x & 0xff) << 8 | \ (__swap16gen_x & 0xff00) >> 8); \ }) #define __swap32gen(x) __statement({ \ - u_int32_t __swap32gen_x = (x); \ + __uint32_t __swap32gen_x = (x); \ \ - (u_int32_t)((__swap32gen_x & 0xff) << 24 | \ + (__uint32_t)((__swap32gen_x & 0xff) << 24 | \ (__swap32gen_x & 0xff00) << 8 | \ (__swap32gen_x & 0xff0000) >> 8 | \ (__swap32gen_x & 0xff000000) >> 24); \ }) #define __swap64gen(x) __statement({ \ - u_int64_t __swap64gen_x = (x); \ + __uint64_t __swap64gen_x = (x); \ \ - (u_int64_t)((__swap64gen_x & 0xff) << 56 | \ + (__uint64_t)((__swap64gen_x & 0xff) << 56 | \ (__swap64gen_x & 0xff00ULL) << 40 | \ (__swap64gen_x & 0xff0000ULL) << 24 | \ (__swap64gen_x & 0xff000000ULL) << 8 | \ @@ -84,22 +84,22 @@ /* Note that these macros evaluate their arguments several times. */ #define __swap16gen(x) \ - (u_int16_t)(((u_int16_t)(x) & 0xff) << 8 | ((u_int16_t)(x) & 0xff00) >> 8) + (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8) #define __swap32gen(x) \ - (u_int32_t)(((u_int32_t)(x) & 0xff) << 24 | \ - ((u_int32_t)(x) & 0xff00) << 8 | ((u_int32_t)(x) & 0xff0000) >> 8 | \ - ((u_int32_t)(x) & 0xff000000) >> 24) + (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 | \ + ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\ + ((__uint32_t)(x) & 0xff000000) >> 24) #define __swap64gen(x) \ - (u_int64_t)((((u_int64_t)(x) & 0xff) << 56) | \ - ((u_int64_t)(x) & 0xff00ULL) << 40 | \ - ((u_int64_t)(x) & 0xff0000ULL) << 24 | \ - ((u_int64_t)(x) & 0xff000000ULL) << 8 | \ - ((u_int64_t)(x) & 0xff00000000ULL) >> 8 | \ - ((u_int64_t)(x) & 0xff0000000000ULL) >> 24 | \ - ((u_int64_t)(x) & 0xff000000000000ULL) >> 40 | \ - ((u_int64_t)(x) & 0xff00000000000000ULL) >> 56) + (__uint64_t)((((__uint64_t)(x) & 0xff) << 56) | \ + ((__uint64_t)(x) & 0xff00ULL) << 40 | \ + ((__uint64_t)(x) & 0xff0000ULL) << 24 | \ + ((__uint64_t)(x) & 0xff000000ULL) << 8 | \ + ((__uint64_t)(x) & 0xff00000000ULL) >> 8 | \ + ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 | \ + ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 | \ + ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) #endif /* __GNUC__ */ @@ -113,21 +113,21 @@ #if __GNUC__ #define __swap16(x) __statement({ \ - u_int16_t __swap16_x = (x); \ + __uint16_t __swap16_x = (x); \ \ __builtin_constant_p(x) ? __swap16gen(__swap16_x) : \ __swap16md(__swap16_x); \ }) #define __swap32(x) __statement({ \ - u_int32_t __swap32_x = (x); \ + __uint32_t __swap32_x = (x); \ \ __builtin_constant_p(x) ? __swap32gen(__swap32_x) : \ __swap32md(__swap32_x); \ }) #define __swap64(x) __statement({ \ - u_int64_t __swap64_x = (x); \ + __uint64_t __swap64_x = (x); \ \ __builtin_constant_p(x) ? __swap64gen(__swap64_x) : \ __swap64md(__swap64_x); \ @@ -142,8 +142,8 @@ #endif /* MD_SWAP */ #define __swap16_multi(v, n) do { \ - size_t __swap16_multi_n = (n); \ - u_int16_t *__swap16_multi_v = (v); \ + __size_t __swap16_multi_n = (n); \ + __uint16_t *__swap16_multi_v = (v); \ \ while (__swap16_multi_n) { \ *__swap16_multi_v = swap16(*__swap16_multi_v); \ @@ -159,19 +159,19 @@ #define swap16_multi __swap16_multi __BEGIN_DECLS -u_int64_t htobe64(u_int64_t); -u_int32_t htobe32(u_int32_t); -u_int16_t htobe16(u_int16_t); -u_int64_t betoh64(u_int64_t); -u_int32_t betoh32(u_int32_t); -u_int16_t betoh16(u_int16_t); - -u_int64_t htole64(u_int64_t); -u_int32_t htole32(u_int32_t); -u_int16_t htole16(u_int16_t); -u_int64_t letoh64(u_int64_t); -u_int32_t letoh32(u_int32_t); -u_int16_t letoh16(u_int16_t); +__uint64_t htobe64(__uint64_t); +__uint32_t htobe32(__uint32_t); +__uint16_t htobe16(__uint16_t); +__uint64_t betoh64(__uint64_t); +__uint32_t betoh32(__uint32_t); +__uint16_t betoh16(__uint16_t); + +__uint64_t htole64(__uint64_t); +__uint32_t htole32(__uint32_t); +__uint16_t htole16(__uint16_t); +__uint64_t letoh64(__uint64_t); +__uint32_t letoh32(__uint32_t); +__uint16_t letoh16(__uint16_t); __END_DECLS #endif /* __BSD_VISIBLE */ diff --git a/sys/sys/exec_elf.h b/sys/sys/exec_elf.h index a2974761461..f72f81e145e 100644 --- a/sys/sys/exec_elf.h +++ b/sys/sys/exec_elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.h,v 1.40 2004/10/10 15:02:18 kettenis Exp $ */ +/* $OpenBSD: exec_elf.h,v 1.41 2006/01/06 18:53:05 millert Exp $ */ /* * Copyright (c) 1995, 1996 Erik Theisen. All rights reserved. * @@ -33,34 +33,34 @@ #ifndef _SYS_EXEC_ELF_H_ #define _SYS_EXEC_ELF_H_ -#include <machine/types.h> +#include <machine/_types.h> #include <machine/exec.h> -typedef u_int8_t Elf_Byte; +typedef __uint8_t Elf_Byte; -typedef u_int32_t Elf32_Addr; /* Unsigned program address */ -typedef u_int32_t Elf32_Off; /* Unsigned file offset */ -typedef int32_t Elf32_Sword; /* Signed large integer */ -typedef u_int32_t Elf32_Word; /* Unsigned large integer */ -typedef u_int16_t Elf32_Half; /* Unsigned medium integer */ +typedef __uint32_t Elf32_Addr; /* Unsigned program address */ +typedef __uint32_t Elf32_Off; /* Unsigned file offset */ +typedef __int32_t Elf32_Sword; /* Signed large integer */ +typedef __uint32_t Elf32_Word; /* Unsigned large integer */ +typedef __uint16_t Elf32_Half; /* Unsigned medium integer */ -typedef u_int64_t Elf64_Addr; -typedef u_int64_t Elf64_Off; -typedef int32_t Elf64_Shalf; +typedef __uint64_t Elf64_Addr; +typedef __uint64_t Elf64_Off; +typedef __int32_t Elf64_Shalf; #ifdef __alpha__ -typedef int64_t Elf64_Sword; -typedef u_int64_t Elf64_Word; +typedef __int64_t Elf64_Sword; +typedef __uint64_t Elf64_Word; #else -typedef int32_t Elf64_Sword; -typedef u_int32_t Elf64_Word; +typedef __int32_t Elf64_Sword; +typedef __uint32_t Elf64_Word; #endif -typedef int64_t Elf64_Sxword; -typedef u_int64_t Elf64_Xword; +typedef __int64_t Elf64_Sxword; +typedef __uint64_t Elf64_Xword; -typedef u_int32_t Elf64_Half; -typedef u_int16_t Elf64_Quarter; +typedef __uint32_t Elf64_Half; +typedef __uint16_t Elf64_Quarter; /* * e_ident[] identification indexes @@ -367,7 +367,7 @@ typedef struct { #define ELF64_R_SYM(info) ((info) >> 32) #define ELF64_R_TYPE(info) ((info) & 0xFFFFFFFF) -#define ELF64_R_INFO(s,t) (((s) << 32) + (u_int32_t)(t)) +#define ELF64_R_INFO(s,t) (((s) << 32) + (__uint32_t)(t)) /* Program Header */ typedef struct { @@ -492,7 +492,7 @@ typedef struct { Elf32_Word au_v; /* 32-bit value */ } Aux32Info; -#define ELF64_NO_ADDR ((u_int64_t) ~0)/* Indicates addr. not yet filled in */ +#define ELF64_NO_ADDR ((__uint64_t) ~0)/* Indicates addr. not yet filled in */ #define ELF64_AUX_ENTRIES 8 /* Size of aux array passed to loader */ typedef struct { diff --git a/sys/sys/stdarg.h b/sys/sys/stdarg.h index 40d3a82e6df..f1d3bc13d39 100644 --- a/sys/sys/stdarg.h +++ b/sys/sys/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2004/02/26 17:21:59 drahn Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:06 millert Exp $ */ /* * Copyright (c) 2003, 2004 Marc espie <espie@openbsd.org> * @@ -19,7 +19,6 @@ #define _STDARG_H_ #if defined(__GNUC__) && __GNUC__ >= 3 -#include <machine/ansi.h> /* Define __gnuc_va_list. */ diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h index 8b003e9a831..5445227bec8 100644 --- a/sys/sys/syslog.h +++ b/sys/sys/syslog.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syslog.h,v 1.11 2003/08/24 01:27:07 avsm Exp $ */ +/* $OpenBSD: syslog.h,v 1.12 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: syslog.h,v 1.14 1996/04/03 20:46:44 christos Exp $ */ /* @@ -187,10 +187,10 @@ struct syslog_data { * 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 <machine/_types.h> and use it. */ -#include <machine/ansi.h> #include <sys/cdefs.h> +#include <machine/_types.h> __BEGIN_DECLS void closelog(void); @@ -198,14 +198,13 @@ void openlog(const char *, int, int); int setlogmask(int); void syslog(int, const char *, ...) __attribute__((__format__(__syslog__,2,3))); -void vsyslog(int, const char *, _BSD_VA_LIST_); +void vsyslog(int, const char *, __va_list); void closelog_r(struct syslog_data *); void openlog_r(const char *, int, int, struct syslog_data *); int setlogmask_r(int, struct syslog_data *); void syslog_r(int, struct syslog_data *, const char *, ...) __attribute__((__format__(__syslog__,3,4))); -void vsyslog_r(int, struct syslog_data *, const char *, - _BSD_VA_LIST_); +void vsyslog_r(int, struct syslog_data *, const char *, __va_list); __END_DECLS #else /* !_KERNEL */ diff --git a/sys/sys/times.h b/sys/sys/times.h index 2edbb2f327f..7d7a47ba481 100644 --- a/sys/sys/times.h +++ b/sys/sys/times.h @@ -1,4 +1,4 @@ -/* $OpenBSD: times.h,v 1.4 2003/06/02 23:28:22 millert Exp $ */ +/* $OpenBSD: times.h,v 1.5 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: times.h,v 1.8 1995/03/26 20:24:54 jtc Exp $ */ /*- @@ -40,11 +40,12 @@ #ifndef _SYS_TIMES_H_ #define _SYS_TIMES_H_ -#include <machine/ansi.h> +#include <sys/cdefs.h> +#include <machine/_types.h> -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DEFINED_ +#define _CLOCK_T_DEFINED_ +typedef __clock_t clock_t; #endif struct tms { @@ -55,8 +56,6 @@ struct tms { }; #ifndef _KERNEL -#include <sys/cdefs.h> - __BEGIN_DECLS clock_t times(struct tms *); __END_DECLS diff --git a/sys/sys/types.h b/sys/sys/types.h index c71e948e6b6..404697e2104 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: types.h,v 1.28 2005/12/13 00:35:23 millert Exp $ */ +/* $OpenBSD: types.h,v 1.29 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */ /*- @@ -41,8 +41,7 @@ #define _SYS_TYPES_H_ #include <sys/cdefs.h> -#include <machine/types.h> -#include <machine/ansi.h> +#include <sys/_types.h> #include <machine/endian.h> #if __BSD_VISIBLE @@ -56,76 +55,145 @@ typedef unsigned short ushort; /* Sys V compatibility */ typedef unsigned int uint; /* Sys V compatibility */ typedef unsigned long ulong; /* Sys V compatibility */ -typedef unsigned long cpuid_t; +typedef __cpuid_t cpuid_t; /* CPU id */ +typedef __register_t register_t; /* register-sized type */ +#endif /* __BSD_VISIBLE */ + +/* + * XXX The exact-width bit types should only be exposed if __BSD_VISIBLE + * but the rest of the includes are not ready for that yet. + */ +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ +#endif + +#ifndef _INT8_T_DEFINED_ +#define _INT8_T_DEFINED_ +typedef __int8_t int8_t; +#endif + +#ifndef _UINT8_T_DEFINED_ +#define _UINT8_T_DEFINED_ +typedef __uint8_t uint8_t; +#endif + +#ifndef _INT16_T_DEFINED_ +#define _INT16_T_DEFINED_ +typedef __int16_t int16_t; #endif -typedef u_int64_t u_quad_t; /* quads */ -typedef int64_t quad_t; +#ifndef _UINT16_T_DEFINED_ +#define _UINT16_T_DEFINED_ +typedef __uint16_t uint16_t; +#endif + +#ifndef _INT32_T_DEFINED_ +#define _INT32_T_DEFINED_ +typedef __int32_t int32_t; +#endif + +#ifndef _UINT32_T_DEFINED_ +#define _UINT32_T_DEFINED_ +typedef __uint32_t uint32_t; +#endif + +#ifndef _INT64_T_DEFINED_ +#define _INT64_T_DEFINED_ +typedef __int64_t int64_t; +#endif + +#ifndef _UINT64_T_DEFINED_ +#define _UINT64_T_DEFINED_ +typedef __uint64_t uint64_t; +#endif + +/* BSD-style unsigned bits types */ +typedef __uint8_t u_int8_t; +typedef __uint16_t u_int16_t; +typedef __uint32_t u_int32_t; +typedef __uint64_t u_int64_t; + +/* quads, deprecated in favor of 64 bit int types */ +typedef __int64_t quad_t; +typedef __uint64_t u_quad_t; typedef quad_t * qaddr_t; +#if __BSD_VISIBLE +/* VM system types */ +typedef __vaddr_t vaddr_t; +typedef __paddr_t paddr_t; +typedef __vsize_t vsize_t; +typedef __psize_t psize_t; +#endif /* __BSD_VISIBLE */ + +/* Standard system types */ typedef char * caddr_t; /* core address */ -typedef int32_t daddr_t; /* disk address */ -typedef int32_t dev_t; /* device number */ -typedef u_int32_t fixpt_t; /* fixed point number */ -typedef u_int32_t gid_t; /* group id */ -typedef u_int32_t id_t; /* may contain pid, uid or gid */ -typedef u_int32_t ino_t; /* inode number */ -typedef long key_t; /* IPC key (for Sys V IPC) */ -typedef u_int32_t mode_t; /* permissions */ -typedef u_int32_t nlink_t; /* link count */ -typedef int32_t pid_t; /* process id */ -typedef u_quad_t rlim_t; /* resource limit */ -typedef int32_t segsz_t; /* segment size */ -typedef int32_t swblk_t; /* swap offset */ -typedef u_int32_t uid_t; /* user id */ -typedef u_int32_t useconds_t; /* microseconds */ -typedef int32_t suseconds_t; /* microseconds (signed) */ +typedef __int32_t daddr_t; /* disk address */ +typedef __dev_t dev_t; /* device number */ +typedef __fixpt_t fixpt_t; /* fixed point number */ +typedef __gid_t gid_t; /* group id */ +typedef __id_t id_t; /* may contain pid, uid or gid */ +typedef __ino_t ino_t; /* inode number */ +typedef __key_t key_t; /* IPC key (for Sys V IPC) */ +typedef __mode_t mode_t; /* permissions */ +typedef __nlink_t nlink_t; /* link count */ +typedef __pid_t pid_t; /* process id */ +typedef __rlim_t rlim_t; /* resource limit */ +typedef __segsz_t segsz_t; /* segment size */ +typedef __swblk_t swblk_t; /* swap offset */ +typedef __uid_t uid_t; /* user id */ +typedef __useconds_t useconds_t; /* microseconds */ +typedef __suseconds_t suseconds_t; /* microseconds (signed) */ /* * XPG4.2 states that inclusion of <netinet/in.h> must pull these * in and that inclusion of <sys/socket.h> must pull in sa_family_t. * We put these here because there are other headers that require * these types and <sys/socket.h> and <netinet/in.h> will indirectly - * include <sys/types.h>. Thus we are compliant without too many hoops. + * include <sys/types.h>. + * XXX - now that we have protected versions these should move. */ -typedef u_int32_t in_addr_t; /* base type for internet address */ -typedef u_int16_t in_port_t; /* IP port type */ -typedef u_int8_t sa_family_t; /* sockaddr address family type */ -typedef u_int32_t socklen_t; /* length type for network syscalls */ +typedef __in_addr_t in_addr_t; /* base type for internet address */ +typedef __in_port_t in_port_t; /* IP port type */ +typedef __sa_family_t sa_family_t; /* sockaddr address family type */ +typedef __socklen_t socklen_t; /* length type for network syscalls */ -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +/* + * The following types may be defined in multiple header files. + */ +#ifndef _CLOCK_T_DEFINED_ +#define _CLOCK_T_DEFINED_ +typedef __clock_t clock_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _CLOCKID_T_DEFINED_ +#define _CLOCKID_T_DEFINED_ +typedef __clockid_t clockid_t; #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _SSIZE_T_DEFINED_ +#define _SSIZE_T_DEFINED_ +typedef __ssize_t ssize_t; #endif -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _TIME_T_DEFINED_ +#define _TIME_T_DEFINED_ +typedef __time_t time_t; #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DEFINED_ +#define _TIMER_T_DEFINED_ +typedef __timer_t timer_t; #endif -#ifdef _BSD_OFF_T_ -typedef _BSD_OFF_T_ off_t; -#undef _BSD_OFF_T_ +#ifndef _OFF_T_DEFINED_ +#define _OFF_T_DEFINED_ +typedef __off_t off_t; #endif /* |