From e2565a420c314ab8c32546e5604fa2eee8a8d5da Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 9 Nov 2003 02:22:37 +0000 Subject: [PATCH] Core integer types header file reorganization stage 1/2: Create and/or modify intttypes.h and stdint.h plus the opaque underlying support in sys/ and machine/ according to the OpenGroup specifications. These changes are loosely based on FreeBSD-5 but use far saner type names and include dependancies. --- include/Makefile | 12 +- include/ctype.h | 33 ++- include/dlfcn.h | 10 +- include/err.h | 23 +- .../Osd/OsdStream.c => include/inttypes.h | 45 +-- include/netdb.h | 23 +- include/runetype.h | 26 +- include/search.h | 10 +- include/signal.h | 12 +- .../Osd/OsdStream.c => include/stdarg.h | 35 +-- include/stddef.h | 33 ++- include/{wctype.h => stdint.h} | 76 ++--- include/stdio.h | 49 ++-- include/stdlib.h | 28 +- include/string.h | 25 +- include/time.h | 37 ++- include/vis.h | 11 +- include/wchar.h | 42 ++- include/wctype.h | 12 +- sys/boot/alpha/libalpha/srmdisk.c | 10 +- sys/boot/arc/lib/arcdisk.c | 10 +- sys/boot/common/dev_net.c | 10 +- sys/boot/common/panic.c | 8 +- sys/boot/ficl/vm.c | 8 +- sys/boot/i386/boot2/boot2.c | 14 +- sys/boot/i386/libi386/bioscd.c | 10 +- sys/boot/i386/libi386/biosdisk.c | 10 +- sys/boot/i386/libi386/biospnp.c | 10 +- sys/boot/i386/libi386/pxe.c | 10 +- sys/boot/pc32/boot2/boot2.c | 14 +- sys/boot/pc32/libi386/bioscd.c | 10 +- sys/boot/pc32/libi386/biosdisk.c | 10 +- sys/boot/pc32/libi386/biospnp.c | 10 +- sys/boot/pc32/libi386/pxe.c | 10 +- sys/boot/pc98/libpc98/biosdisk.c | 10 +- sys/bus/cam/scsi/scsi_ses.c | 8 +- sys/bus/isa/pnpparse.c | 8 +- sys/bus/ppbus/ppb_msq.c | 16 +- sys/cpu/i386/include/db_machdep.h | 4 +- sys/cpu/i386/include/inttypes.h | 221 +++++++++++++++ sys/cpu/i386/include/stdarg.h | 36 ++- sys/cpu/i386/include/stdint.h | 262 ++++++++++++++++++ sys/cpu/i386/include/types.h | 11 +- sys/crypto/sha2/sha2.c | 9 +- sys/ddb/db_output.c | 24 +- sys/dev/acpica/Osd/OsdStream.c | 10 +- sys/dev/acpica/acpi.c | 10 +- sys/dev/crypto/rndtest/rndtest.c | 8 +- sys/dev/disk/ata/ata-all.c | 14 +- sys/dev/disk/fd/fd.c | 18 +- sys/dev/disk/isp/isp_freebsd.c | 8 +- sys/dev/disk/scd/scd.c | 10 +- sys/dev/raid/iir/iir.c | 8 +- sys/dev/raid/vinum/vinumconfig.c | 8 +- sys/dev/serial/si/si.c | 8 +- sys/dev/video/bktr/bktr_core.c | 4 +- sys/dev/video/fb/gfb.c | 14 +- sys/dev/video/fb/tga.c | 14 +- sys/i386/boot/dosboot/types.h | 28 +- sys/i386/i386/bios.c | 20 +- sys/i386/include/ansi.h | 150 ---------- sys/i386/include/db_machdep.h | 4 +- sys/i386/include/inttypes.h | 221 +++++++++++++++ sys/i386/include/stdarg.h | 36 ++- sys/i386/include/stdint.h | 262 ++++++++++++++++++ sys/i386/include/types.h | 11 +- .../OsdStream.c => i386/include/uvparam.h} | 41 ++- sys/kern/kern_conf.c | 8 +- sys/kern/kern_shutdown.c | 11 +- sys/kern/lwkt_thread.c | 20 +- sys/kern/subr_blist.c | 8 +- sys/kern/subr_bus.c | 8 +- sys/kern/subr_prf.c | 115 ++++---- sys/kern/subr_sbuf.c | 10 +- sys/kern/subr_scanf.c | 34 +-- sys/net/if.c | 8 +- sys/net/sppp/if_spppsubr.c | 14 +- sys/netinet6/raw_ip6.c | 20 +- sys/netproto/ipsec/ipsec_input.c | 12 +- sys/netproto/ipsec/key.c | 19 +- sys/netproto/ipsec/keysock.c | 16 +- sys/netproto/ipsec/xform_ipip.c | 10 +- sys/netproto/key/key.c | 19 +- sys/netproto/key/keysock.c | 16 +- sys/netproto/smb/smb_subr.c | 8 +- sys/platform/pc32/boot/dosboot/types.h | 28 +- sys/platform/pc32/i386/bios.c | 20 +- sys/platform/pc32/include/ansi.h | 150 ---------- .../pc32/include/uvparam.h} | 41 ++- sys/sys/dirent.h | 6 +- sys/sys/inttypes.h | 25 -- sys/sys/malloc.h | 6 +- sys/sys/queue.h | 6 +- sys/sys/sbuf.h | 19 +- sys/sys/signal.h | 12 +- sys/sys/socket.h | 27 +- sys/sys/stdint.h | 42 +++ sys/sys/syslog.h | 13 +- sys/sys/systm.h | 18 +- sys/sys/time.h | 4 +- sys/sys/times.h | 12 +- sys/sys/types.h | 87 +++--- 102 files changed, 1877 insertions(+), 1207 deletions(-) copy sys/dev/acpica/Osd/OsdStream.c => include/inttypes.h (60%) copy sys/dev/acpica/Osd/OsdStream.c => include/stdarg.h (72%) copy include/{wctype.h => stdint.h} (51%) create mode 100644 sys/cpu/i386/include/inttypes.h create mode 100644 sys/cpu/i386/include/stdint.h delete mode 100644 sys/i386/include/ansi.h create mode 100644 sys/i386/include/inttypes.h create mode 100644 sys/i386/include/stdint.h copy sys/{dev/acpica/Osd/OsdStream.c => i386/include/uvparam.h} (58%) delete mode 100644 sys/platform/pc32/include/ansi.h copy sys/{dev/acpica/Osd/OsdStream.c => platform/pc32/include/uvparam.h} (58%) delete mode 100644 sys/sys/inttypes.h create mode 100644 sys/sys/stdint.h diff --git a/include/Makefile b/include/Makefile index 9c5395c374..c42ceea66d 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.2 (Berkeley) 1/4/94 # $FreeBSD: src/include/Makefile,v 1.109.2.27 2003/01/24 05:12:29 sam Exp $ -# $DragonFly: src/include/Makefile,v 1.8 2003/08/30 15:21:57 asmodai Exp $ +# $DragonFly: src/include/Makefile,v 1.9 2003/11/09 02:22:28 dillon Exp $ # # Doing a make install builds /usr/include # @@ -13,17 +13,17 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h ctype.h db.h \ dirent.h disktab.h \ dlfcn.h elf.h elf-hints.h err.h fnmatch.h fstab.h \ fts.h glob.h grp.h strhash.h histedit.h ieeefp.h ifaddrs.h iso646.h \ + inttypes.h \ langinfo.h libgen.h limits.h link.h locale.h malloc.h memory.h \ mpool.h ndbm.h netdb.h nl_types.h nlist.h objformat.h \ paths.h pthread.h pthread_np.h pwd.h \ ranlib.h readpassphrase.h regex.h regexp.h resolv.h rmd160.h rune.h \ - runetype.h \ - search.h setjmp.h sgtty.h \ - signal.h stab.h stdbool.h stddef.h stdio.h stdlib.h \ + runetype.h search.h setjmp.h sgtty.h \ + signal.h stab.h stdarg.h stdbool.h stddef.h stdint.h stdio.h stdlib.h \ string.h stringlist.h strings.h struct.h sysexits.h tar.h time.h \ timers.h ttyent.h unistd.h utime.h utmp.h vis.h wchar.h wctype.h -MHDRS= float.h floatingpoint.h stdarg.h varargs.h +MHDRS= float.h floatingpoint.h varargs.h # posix4/aio.h conflicts with dysons and isn't installed: PHDRS= mqueue.h sched.h semaphore.h # aio.h @@ -31,7 +31,7 @@ PHDRS= mqueue.h sched.h semaphore.h # aio.h # Only for default SHARED=copies case SHDRS= soundcard.h joystick.h -LHDRS= aio.h errno.h fcntl.h inttypes.h linker_set.h poll.h syslog.h \ +LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h syslog.h \ termios.h ucontext.h # directories which also contain header files that need to be coiped. diff --git a/include/ctype.h b/include/ctype.h index 164af3d065..60d3b12007 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -40,12 +40,16 @@ * * @(#)ctype.h 8.4 (Berkeley) 1/21/94 * $FreeBSD: src/include/ctype.h,v 1.16 2000/02/08 07:43:23 obrien Exp $ - * $DragonFly: src/include/ctype.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/ctype.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _CTYPE_H_ #define _CTYPE_H_ +#ifndef _SYS_STDINT_H_ +#include /* __ct_rune_t and friends */ +#endif + /* * XXX brings massive namespace pollution (rune_t and struct * member names). @@ -125,11 +129,10 @@ __END_DECLS #define toascii(c) ((c) & 0x7F) #endif -/* See comments in about _BSD_CT_RUNE_T_. */ __BEGIN_DECLS -unsigned long ___runetype __P((_BSD_CT_RUNE_T_)); -_BSD_CT_RUNE_T_ ___tolower __P((_BSD_CT_RUNE_T_)); -_BSD_CT_RUNE_T_ ___toupper __P((_BSD_CT_RUNE_T_)); +unsigned long ___runetype __P((__ct_rune_t)); +__ct_rune_t ___tolower __P((__ct_rune_t)); +__ct_rune_t ___toupper __P((__ct_rune_t)); __END_DECLS /* @@ -148,28 +151,28 @@ __END_DECLS #if !defined(_DONT_USE_CTYPE_INLINE_) && \ (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) static __inline int -__maskrune(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__maskrune(__ct_rune_t _c, unsigned long _f) { return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : _CurrentRuneLocale->runetype[_c]) & _f; } static __inline int -__isctype(_BSD_CT_RUNE_T_ _c, unsigned long _f) +__isctype(__ct_rune_t _c, unsigned long _f) { return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : !!(_DefaultRuneLocale.runetype[_c] & _f); } -static __inline _BSD_CT_RUNE_T_ -__toupper(_BSD_CT_RUNE_T_ _c) +static __inline __ct_rune_t +__toupper(__ct_rune_t _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : _CurrentRuneLocale->mapupper[_c]; } -static __inline _BSD_CT_RUNE_T_ -__tolower(_BSD_CT_RUNE_T_ _c) +static __inline __ct_rune_t +__tolower(__ct_rune_t _c) { return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : _CurrentRuneLocale->maplower[_c]; @@ -178,10 +181,10 @@ __tolower(_BSD_CT_RUNE_T_ _c) #else /* not using inlines */ __BEGIN_DECLS -int __maskrune __P((_BSD_CT_RUNE_T_, unsigned long)); -int __isctype __P((_BSD_CT_RUNE_T_, unsigned long)); -_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_)); -_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_)); +int __maskrune __P((__ct_rune_t, unsigned long)); +int __isctype __P((__ct_rune_t, unsigned long)); +__ct_rune_t __toupper __P((__ct_rune_t)); +__ct_rune_t __tolower __P((__ct_rune_t)); __END_DECLS #endif /* using inlines */ diff --git a/include/dlfcn.h b/include/dlfcn.h index f3a1599470..dbdffb6c3f 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -31,14 +31,14 @@ * SUCH DAMAGE. * * $FreeBSD: src/include/dlfcn.h,v 1.10.2.3 2003/02/20 20:42:45 kan Exp $ - * $DragonFly: src/include/dlfcn.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/dlfcn.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _DLFCN_H_ #define _DLFCN_H_ #include -#include +#include /* size_t */ /* * Modes and flags for dlopen(). @@ -78,10 +78,6 @@ typedef struct dl_info { /* * Avoid sys/types.h namespace pollution. */ -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ -#endif /* * Structures, returned by the RTLD_DI_SERINFO dlinfo() request. @@ -92,7 +88,7 @@ typedef struct dl_serpath { } Dl_serpath; typedef struct dl_serinfo { - size_t dls_size; /* total buffer size */ + __size_t dls_size; /* total buffer size */ unsigned int dls_cnt; /* number of path entries */ Dl_serpath dls_serpath[1]; /* there may be more than one */ } Dl_serinfo; diff --git a/include/err.h b/include/err.h index af7d9b19e5..08f58ecdb2 100644 --- a/include/err.h +++ b/include/err.h @@ -32,7 +32,7 @@ * * @(#)err.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/include/err.h,v 1.8 1999/08/27 23:44:49 peter Exp $ - * $DragonFly: src/include/err.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/err.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _ERR_H_ @@ -43,27 +43,32 @@ * places ( and ), 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 err.h, so we get - * _BSD_VA_LIST_ from and use it. + * __va_list from and use it. */ -#include #include +#ifndef _MACHINE_STDINT_H_ +#include +#endif +#ifndef _MACHINE_STDARG_H_ +#include +#endif __BEGIN_DECLS void err __P((int, const char *, ...)) __dead2 __printf0like(2, 3); -void verr __P((int, const char *, _BSD_VA_LIST_)) __dead2 +void verr __P((int, const char *, __va_list)) __dead2 __printf0like(2, 0); void errc __P((int, int, const char *, ...)) __dead2 __printf0like(3, 4); -void verrc __P((int, int, const char *, _BSD_VA_LIST_)) __dead2 +void verrc __P((int, int, const char *, __va_list)) __dead2 __printf0like(3, 0); void errx __P((int, const char *, ...)) __dead2 __printf0like(2, 3); -void verrx __P((int, const char *, _BSD_VA_LIST_)) __dead2 +void verrx __P((int, const char *, __va_list)) __dead2 __printf0like(2, 0); void warn __P((const char *, ...)) __printf0like(1, 2); -void vwarn __P((const char *, _BSD_VA_LIST_)) __printf0like(1, 0); +void vwarn __P((const char *, __va_list)) __printf0like(1, 0); void warnc __P((int, const char *, ...)) __printf0like(2, 3); -void vwarnc __P((int, const char *, _BSD_VA_LIST_)) __printf0like(2, 0); +void vwarnc __P((int, const char *, __va_list)) __printf0like(2, 0); void warnx __P((const char *, ...)) __printflike(1, 2); -void vwarnx __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0); +void vwarnx __P((const char *, __va_list)) __printflike(1, 0); void err_set_file __P((void *)); void err_set_exit __P((void (*)(int))); __END_DECLS diff --git a/sys/dev/acpica/Osd/OsdStream.c b/include/inttypes.h similarity index 60% copy from sys/dev/acpica/Osd/OsdStream.c copy to include/inttypes.h index 8254ae842a..888c89a08a 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/include/inttypes.h @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2000 Michael Smith - * Copyright (c) 2000 BSDi + * Copyright (c) 2001 Mike Barcroft * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,29 +23,33 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/Osd/OsdStream.c,v 1.3.4.1 2003/08/22 20:49:21 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdStream.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $FreeBSD: src/include/inttypes.h,v 1.8 2002/09/22 08:06:45 tjr Exp $ + * $DragonFly: src/include/inttypes.h,v 1.1 2003/11/09 02:22:28 dillon Exp $ */ -/* - * 6.6 : Stream I/O - */ +#ifndef _INTTYPES_H_ +#define _INTTYPES_H_ -#include "acpi.h" +#include +#include -void -AcpiOsPrintf (const char *Format, ...) -{ - va_list ap; +typedef struct { + intmax_t quot; /* Quotient. */ + intmax_t rem; /* Remainder. */ +} imaxdiv_t; - va_start(ap, Format); - vprintf(Format, ap); - va_end(ap); -} +__BEGIN_DECLS +intmax_t imaxabs(intmax_t) __pure2; +imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; -void -AcpiOsVprintf (const char *Format, va_list Args) -{ - vprintf(Format, Args); -} +intmax_t strtoimax(const char * __restrict, char ** __restrict, int); +uintmax_t strtoumax(const char * __restrict, char ** __restrict, int); +#ifndef __cplusplus +intmax_t wcstoimax(const __wchar_t * __restrict, + __wchar_t ** __restrict, int); +uintmax_t wcstoumax(const __wchar_t * __restrict, + __wchar_t ** __restrict, int); +#endif +__END_DECLS +#endif /* !_INTTYPES_H_ */ diff --git a/include/netdb.h b/include/netdb.h index 081b975d82..0a6f665a2b 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -56,18 +56,25 @@ * @(#)netdb.h 8.1 (Berkeley) 6/2/93 * From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $ * $FreeBSD: src/include/netdb.h,v 1.14.2.5 2001/08/29 08:46:51 alfred Exp $ - * $DragonFly: src/include/netdb.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/netdb.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _NETDB_H_ #define _NETDB_H_ -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif #include -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; +#endif + +#ifndef _SOCKLEN_T_DECLARED_ +#define _SOCKLEN_T_DECLARED_ +typedef __socklen_t socklen_t; #endif #ifndef _PATH_HEQUIV @@ -123,7 +130,7 @@ struct addrinfo { int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ - size_t ai_addrlen; /* length of ai_addr */ + size_t ai_addrlen; /* length of ai_addr */ char *ai_canonname; /* canonical name for hostname */ struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */ @@ -201,10 +208,6 @@ struct addrinfo { /* * data types - basically forward decl for getnameinfo() */ -#ifdef _BSD_SOCKLEN_T_ -typedef _BSD_SOCKLEN_T_ socklen_t; -#undef _BSD_SOCKLEN_T_ -#endif __BEGIN_DECLS void endhostent __P((void)); diff --git a/include/runetype.h b/include/runetype.h index b7622f2d01..725e7c704c 100644 --- a/include/runetype.h +++ b/include/runetype.h @@ -35,29 +35,25 @@ * * @(#)runetype.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/include/runetype.h,v 1.3.8.1 2002/08/08 02:42:29 imp Exp $ - * $DragonFly: src/include/Attic/runetype.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/Attic/runetype.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _RUNETYPE_H_ #define _RUNETYPE_H_ #include -#include - -#ifdef _BSD_RUNE_T_ -typedef _BSD_RUNE_T_ rune_t; -#undef _BSD_RUNE_T_ +#ifndef _SYS_STDINT_H_ +#include /* for __rune_t and friends */ #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _RUNE_T_DECLARED_ +#define _RUNE_T_DECLARED_ +typedef __rune_t rune_t; #endif - #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED_ +#define _WCHAR_T_DECLARED_ +typedef __wchar_t wchar_t; #endif #endif @@ -84,9 +80,9 @@ typedef struct { char encoding[32]; /* ASCII name of this encoding */ rune_t (*sgetrune) - __P((const char *, size_t, char const **)); + __P((const char *, __size_t, char const **)); int (*sputrune) - __P((rune_t, char *, size_t, char **)); + __P((rune_t, char *, __size_t, char **)); rune_t invalid_rune; unsigned long runetype[_CACHED_RUNES]; diff --git a/include/search.h b/include/search.h index e6c6702ae4..d0d9654224 100644 --- a/include/search.h +++ b/include/search.h @@ -1,6 +1,6 @@ /* $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ */ /* $FreeBSD: src/include/search.h,v 1.3.2.1 2000/08/17 07:38:34 jhb Exp $ */ -/* $DragonFly: src/include/search.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ */ +/* $DragonFly: src/include/search.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ /* * Written by J.T. Conklin @@ -11,11 +11,11 @@ #define _SEARCH_H_ #include -#include +#include -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; #endif typedef struct entry { diff --git a/include/signal.h b/include/signal.h index d6ea1666be..89ae87e584 100644 --- a/include/signal.h +++ b/include/signal.h @@ -33,7 +33,7 @@ * @(#)signal.h 8.3 (Berkeley) 3/30/94 * * $FreeBSD: src/include/signal.h,v 1.14 1999/10/02 19:33:23 marcel Exp $ - * $DragonFly: src/include/signal.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/signal.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _SIGNAL_H_ @@ -41,7 +41,9 @@ #include #include -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif #include #include @@ -54,7 +56,7 @@ extern __const int sys_nsig; __BEGIN_DECLS int raise __P((int)); #ifndef _ANSI_SOURCE -int kill __P((_BSD_PID_T_, int)); +int kill __P((__pid_t, int)); int sigaction __P((int, const struct sigaction *, struct sigaction *)); int sigaddset __P((sigset_t *, int)); int sigdelset __P((sigset_t *, int)); @@ -70,14 +72,14 @@ int sigwait __P((const sigset_t *, int *)); #ifdef _P1003_1B_VISIBLE __BEGIN_DECLS -int sigqueue __P((_BSD_PID_T_, int, const union sigval)); +int sigqueue __P((__pid_t, int, const union sigval)); int sigtimedwait __P((const sigset_t *, siginfo_t *, const struct timespec *)); int sigwaitinfo __P((const sigset_t *, siginfo_t *)); __END_DECLS #endif #ifndef _POSIX_SOURCE -int killpg __P((_BSD_PID_T_, int)); +int killpg __P((__pid_t, int)); int sigaltstack __P((const stack_t *, stack_t *)); int sigblock __P((int)); int siginterrupt __P((int, int)); diff --git a/sys/dev/acpica/Osd/OsdStream.c b/include/stdarg.h similarity index 72% copy from sys/dev/acpica/Osd/OsdStream.c copy to include/stdarg.h index 8254ae842a..9ab0dd4f40 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/include/stdarg.h @@ -1,6 +1,5 @@ -/*- - * Copyright (c) 2000 Michael Smith - * Copyright (c) 2000 BSDi +/* + * Copyright (c) 2003 Matthew Dillon * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,29 +23,21 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/Osd/OsdStream.c,v 1.3.4.1 2003/08/22 20:49:21 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdStream.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $DragonFly: src/include/stdarg.h,v 1.1 2003/11/09 02:22:28 dillon Exp $ */ -/* - * 6.6 : Stream I/O - */ +#ifndef _STDARG_H_ +#define _STDARG_H_ -#include "acpi.h" +#ifndef _MACHINE_STDARG_H_ +#include +#endif -void -AcpiOsPrintf (const char *Format, ...) -{ - va_list ap; +typedef __va_list va_list; - va_start(ap, Format); - vprintf(Format, ap); - va_end(ap); -} +#define va_start(ap, last) __va_start(ap, last) +#define va_arg(ap, type) __va_arg(ap, type) +#define va_end(ap) __va_end(ap) -void -AcpiOsVprintf (const char *Format, va_list Args) -{ - vprintf(Format, Args); -} +#endif diff --git a/include/stddef.h b/include/stddef.h index d2a25dae29..12fee5d8ad 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -33,32 +33,37 @@ * @(#)stddef.h 8.1 (Berkeley) 6/2/93 * * $FreeBSD: src/include/stddef.h,v 1.2.8.4 2002/08/07 15:49:32 imp Exp $ - * $DragonFly: src/include/stddef.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/stddef.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _STDDEF_H_ #define _STDDEF_H_ -#include - -typedef _BSD_PTRDIFF_T_ ptrdiff_t; +#ifndef _SYS_STDINT_H_ +#include /* __rune_t and friends */ +#endif -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -#ifdef _BSD_RUNE_T_ -typedef _BSD_RUNE_T_ rune_t; -#undef _BSD_RUNE_T_ +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; /* open group */ #endif + +#ifndef _PTRDIFF_T_DECLARED_ +#define _PTRDIFF_T_DECLARED_ +typedef __ptrdiff_t ptrdiff_t; /* open group */ #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#ifndef _RUNE_T_DECLARED_ +#define _RUNE_T_DECLARED_ +typedef __rune_t rune_t; +#endif #endif #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED_ +#define _WCHAR_T_DECLARED_ +typedef __wchar_t wchar_t; /* open group */ #endif #endif diff --git a/include/wctype.h b/include/stdint.h similarity index 51% copy from include/wctype.h copy to include/stdint.h index c1d19fb495..ed20f5c595 100644 --- a/include/wctype.h +++ b/include/stdint.h @@ -1,5 +1,5 @@ -/*- - * Copyright (c)1999 Citrus Project, +/* + * Copyright (c) 2003 Matthew Dillon * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,45 +23,51 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp - * $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $ - * $FreeBSD: src/include/wctype.h,v 1.3.2.1 2001/07/11 23:48:38 obrien Exp $ - * $DragonFly: src/include/wctype.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/stdint.h,v 1.1 2003/11/09 02:22:28 dillon Exp $ */ -#if 0 -/* XXX: not implemented */ -#ifndef _WCTYPE_H_ -#define _WCTYPE_H_ +#ifndef _STDINT_H_ +#define _STDINT_H_ -#include -#include +#include -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ -#endif +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; + +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; + +typedef __intptr_t intptr_t; +typedef __uintptr_t uintptr_t; -#ifndef WEOF -#define WEOF ((wint_t)-1) +typedef __intmax_t intmax_t; +typedef __uintmax_t uintmax_t; + +#ifndef _PTRDIFF_T_DECLARED_ +#define _PTRDIFF_T_DECLARED_ +typedef __ptrdiff_t ptrdiff_t; /* ptr1 - ptr2 */ #endif -__BEGIN_DECLS -int iswalnum __P((wint_t)); -int iswalpha __P((wint_t)); -int iswblank __P((wint_t)); -int iswcntrl __P((wint_t)); -int iswdigit __P((wint_t)); -int iswgraph __P((wint_t)); -int iswlower __P((wint_t)); -int iswprint __P((wint_t)); -int iswpunct __P((wint_t)); -int iswspace __P((wint_t)); -int iswupper __P((wint_t)); -int iswxdigit __P((wint_t)); -wint_t towlower __P((wint_t)); -wint_t towupper __P((wint_t)); -__END_DECLS +typedef __int_fast8_t int_fast8_t; +typedef __int_fast16_t int_fast16_t; +typedef __int_fast32_t int_fast32_t; +typedef __int_fast64_t int_fast64_t; +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; +typedef __uint_fast8_t uint_fast8_t; +typedef __uint_fast16_t uint_fast16_t; +typedef __uint_fast32_t uint_fast32_t; +typedef __uint_fast64_t uint_fast64_t; +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; -#endif /* _WCTYPE_H_ */ #endif + diff --git a/include/stdio.h b/include/stdio.h index 4ef9cfd08c..a825232b6f 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -35,25 +35,30 @@ * * @(#)stdio.h 8.5 (Berkeley) 4/29/95 * $FreeBSD: src/include/stdio.h,v 1.24.2.5 2002/11/09 08:07:20 imp Exp $ - * $DragonFly: src/include/stdio.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/stdio.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _STDIO_H_ #define _STDIO_H_ #include -#include +#ifndef _SYS_STDINT_H_ +#include +#endif +#ifndef _MACHINE_STDARG_H_ +#include +#endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; #endif #ifndef NULL #define NULL 0 #endif -typedef _BSD_OFF_T_ fpos_t; +typedef __off_t fpos_t; #define _FSTDIO /* Define for new stdio with functions. */ @@ -211,13 +216,13 @@ FILE *fopen __P((const char *, const char *)); int fprintf __P((FILE *, const char *, ...)); int fputc __P((int, FILE *)); int fputs __P((const char *, FILE *)); -size_t fread __P((void *, size_t, size_t, FILE *)); +size_t fread __P((void *, size_t, size_t, FILE *)); FILE *freopen __P((const char *, const char *, FILE *)); int fscanf __P((FILE *, const char *, ...)); int fseek __P((FILE *, long, int)); int fsetpos __P((FILE *, const fpos_t *)); long ftell __P((FILE *)); -size_t fwrite __P((const void *, size_t, size_t, FILE *)); +size_t fwrite __P((const void *, size_t, size_t, FILE *)); int getc __P((FILE *)); int getchar __P((void)); char *gets __P((char *)); @@ -241,9 +246,9 @@ int sscanf __P((const char *, const char *, ...)); FILE *tmpfile __P((void)); char *tmpnam __P((char *)); int ungetc __P((int, FILE *)); -int vfprintf __P((FILE *, const char *, _BSD_VA_LIST_)); -int vprintf __P((const char *, _BSD_VA_LIST_)); -int vsprintf __P((char *, const char *, _BSD_VA_LIST_)); +int vfprintf __P((FILE *, const char *, __va_list)); +int vprintf __P((const char *, __va_list)); +int vsprintf __P((char *, const char *, __va_list)); __END_DECLS /* @@ -272,19 +277,19 @@ __END_DECLS __BEGIN_DECLS #ifndef _FTRUNCATE_DECLARED #define _FTRUNCATE_DECLARED -int ftruncate __P((int, _BSD_OFF_T_)); +int ftruncate __P((int, __off_t)); #endif #ifndef _LSEEK_DECLARED #define _LSEEK_DECLARED -_BSD_OFF_T_ lseek __P((int, _BSD_OFF_T_, int)); +__off_t lseek __P((int, __off_t, int)); #endif #ifndef _MMAP_DECLARED #define _MMAP_DECLARED -void *mmap __P((void *, size_t, int, int, int, _BSD_OFF_T_)); +void *mmap __P((void *, size_t, int, int, int, __off_t)); #endif #ifndef _TRUNCATE_DECLARED #define _TRUNCATE_DECLARED -int truncate __P((const char *, _BSD_OFF_T_)); +int truncate __P((const char *, __off_t)); #endif __END_DECLS #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ @@ -304,8 +309,8 @@ char *fgetln __P((FILE *, size_t *)); #endif __const char *fmtcheck __P((const char *, const char *)) __ATTR_FORMAT_ARG; int fpurge __P((FILE *)); -int fseeko __P((FILE *, _BSD_OFF_T_, int)); -_BSD_OFF_T_ ftello __P((FILE *)); +int fseeko __P((FILE *, __off_t, int)); +__off_t ftello __P((FILE *)); int getw __P((FILE *)); int pclose __P((FILE *)); FILE *popen __P((const char *, const char *)); @@ -314,12 +319,12 @@ void setbuffer __P((FILE *, char *, int)); int setlinebuf __P((FILE *)); char *tempnam __P((const char *, const char *)); int snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4); -int vasprintf __P((char **, const char *, _BSD_VA_LIST_)) +int vasprintf __P((char **, const char *, __va_list)) __printflike(2, 0); -int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_)) +int vsnprintf __P((char *, size_t, const char *, __va_list)) __printflike(3, 0); -int vscanf __P((const char *, _BSD_VA_LIST_)) __scanflike(1, 0); -int vsscanf __P((const char *, const char *, _BSD_VA_LIST_)) +int vscanf __P((const char *, __va_list)) __scanflike(1, 0); +int vsscanf __P((const char *, const char *, __va_list)) __scanflike(2, 0); __END_DECLS @@ -349,7 +354,7 @@ __END_DECLS */ __BEGIN_DECLS int __srget __P((FILE *)); -int __svfscanf __P((FILE *, const char *, _BSD_VA_LIST_)); +int __svfscanf __P((FILE *, const char *, __va_list)); int __swbuf __P((int, FILE *)); __END_DECLS diff --git a/include/stdlib.h b/include/stdlib.h index 6ac40b253e..36bfb71df4 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -32,7 +32,7 @@ * * @(#)stdlib.h 8.5 (Berkeley) 5/19/95 * $FreeBSD: src/include/stdlib.h,v 1.16.2.5 2002/12/13 01:34:00 tjr Exp $ - * $DragonFly: src/include/stdlib.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/stdlib.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _STDLIB_H_ @@ -40,25 +40,27 @@ #include -#include +#ifndef _SYS_STDINT_H_ +#include +#endif #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -#ifdef _BSD_RUNE_T_ -typedef _BSD_RUNE_T_ rune_t; -#undef _BSD_RUNE_T_ +#ifndef _RUNE_T_DECLARED_ +#define _RUNE_T_DECLARED_ +typedef __rune_t rune_t; #endif #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef __cplusplus +#ifndef _WCHAR_T_DECLARED_ +#define _WCHAR_T_DECLARED_ +typedef __wchar_t wchar_t; #endif - -#ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ #endif + +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; #endif typedef struct { diff --git a/include/string.h b/include/string.h index 7cbc86694a..613f3fa6c1 100644 --- a/include/string.h +++ b/include/string.h @@ -32,16 +32,19 @@ * * @(#)string.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/include/string.h,v 1.6.2.3 2001/12/25 00:36:57 ache Exp $ - * $DragonFly: src/include/string.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/string.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _STRING_H_ #define _STRING_H_ -#include -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _MACHINE_STDINT_H_ +#include +#endif + +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; /* open group */ #endif #ifndef NULL @@ -61,18 +64,18 @@ char *strchr __P((const char *, int)); int strcmp __P((const char *, const char *)); int strcoll __P((const char *, const char *)); char *strcpy __P((char *, const char *)); -size_t strcspn __P((const char *, const char *)); +size_t strcspn __P((const char *, const char *)); char *strerror __P((int)); -size_t strlen __P((const char *)); +size_t strlen __P((const char *)); char *strncat __P((char *, const char *, size_t)); int strncmp __P((const char *, const char *, size_t)); char *strncpy __P((char *, const char *, size_t)); char *strpbrk __P((const char *, const char *)); char *strrchr __P((const char *, int)); -size_t strspn __P((const char *, const char *)); +size_t strspn __P((const char *, const char *)); char *strstr __P((const char *, const char *)); char *strtok __P((char *, const char *)); -size_t strxfrm __P((char *, const char *, size_t)); +size_t strxfrm __P((char *, const char *, size_t)); /* Nonstandard routines */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) @@ -87,8 +90,8 @@ int strcasecmp __P((const char *, const char *)); char *strcasestr __P((const char *, const char *)); char *strdup __P((const char *)); int strerror_r __P((int, char *, size_t)); -size_t strlcat __P((char *, const char *, size_t)); -size_t strlcpy __P((char *, const char *, size_t)); +size_t strlcat __P((char *, const char *, size_t)); +size_t strlcpy __P((char *, const char *, size_t)); void strmode __P((int, char *)); int strncasecmp __P((const char *, const char *, size_t)); char *strnstr __P((const char *, const char *, size_t)); diff --git a/include/time.h b/include/time.h index a9baa50ff1..9ff7a2d72b 100644 --- a/include/time.h +++ b/include/time.h @@ -36,12 +36,16 @@ * SUCH DAMAGE. * * @(#)time.h 8.3 (Berkeley) 1/21/94 + * $DragonFly: src/include/time.h,v 1.2 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _TIME_H_ #define _TIME_H_ -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif +#include #include #ifndef _ANSI_SOURCE @@ -59,19 +63,14 @@ #define NULL 0 #endif -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ -#endif - -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _CLOCK_T_DECLARED_ +#define _CLOCK_T_DECLARED_ +typedef __clock_t clock_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _TIME_T_DECLARED_ +#define _TIME_T_DECLARED_ +typedef __time_t time_t; #endif /* XXX I'm not sure if _ANSI_SOURCE is playing properly @@ -81,14 +80,14 @@ typedef _BSD_SIZE_T_ size_t; /* * New in POSIX 1003.1b-1993. */ -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _CLOCKID_T_DECLARED_ +#define _CLOCKID_T_DECLARED_ +typedef __clockid_t clockid_t; #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DECLARED_ +#define _TIMER_T_DECLARED_ +typedef __timer_t timer_t; #endif #ifndef _TIMESPEC_DECLARED @@ -128,7 +127,7 @@ double difftime __P((time_t, time_t)); struct tm *gmtime __P((const time_t *)); struct tm *localtime __P((const time_t *)); time_t mktime __P((struct tm *)); -size_t strftime __P((char *, size_t, const char *, const struct tm *)); +__size_t strftime __P((char *, __size_t, const char *, const struct tm *)); time_t time __P((time_t *)); #ifndef _ANSI_SOURCE diff --git a/include/vis.h b/include/vis.h index 489776ded0..ad3463936c 100644 --- a/include/vis.h +++ b/include/vis.h @@ -32,17 +32,14 @@ * * @(#)vis.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/include/vis.h,v 1.6.2.1 2000/08/17 08:25:53 jhb Exp $ - * $DragonFly: src/include/vis.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/vis.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #ifndef _VIS_H_ #define _VIS_H_ -#include - -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _MACHINE_STDINT_H_ +#include #endif /* @@ -86,7 +83,7 @@ typedef _BSD_SIZE_T_ size_t; __BEGIN_DECLS char *vis __P((char *, int, int, int)); int strvis __P((char *, const char *, int)); -int strvisx __P((char *, const char *, size_t, int)); +int strvisx __P((char *, const char *, __size_t, int)); int strunvis __P((char *, const char *)); int unvis __P((char *, int, int *, int)); __END_DECLS diff --git a/include/wchar.h b/include/wchar.h index 9f73e77e71..bb19423150 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/include/wchar.h,v 1.3.2.2 2002/08/08 02:42:29 imp Exp $ - * $DragonFly: src/include/wchar.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/wchar.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ /*- @@ -69,31 +69,34 @@ #define _WCHAR_H_ #include -#include +#ifndef _SYS_STDINT_H_ +#include /* __wchar_t and friends */ +#endif + #ifndef NULL #define NULL 0 #endif #ifndef __cplusplus -#ifdef _BSD_WCHAR_T_ -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ +#ifndef _WCHAR_T_DECLARED_ +#define _WCHAR_T_DECLARED_ +typedef __wchar_t wchar_t; #endif #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ +#ifndef _MBSTATE_T_DECLARED_ +#define _MBSTATE_T_DECLARED_ +typedef __mbstate_t mbstate_t; #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DECLARED_ +#define _WINT_T_DECLARED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; /* open group */ #endif #ifndef WEOF @@ -101,16 +104,7 @@ typedef _BSD_SIZE_T_ size_t; #endif __BEGIN_DECLS -#if 0 -/* XXX: not implemented */ -size_t mbrlen __P((const char * __restrict, size_t, mbstate_t * __restrict)); -size_t mbrtowc __P((wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict)); -int mbsinit __P((const mbstate_t *)); -size_t mbsrtowcs __P((wchar_t * __restrict, const char ** __restrict, size_t, - mbstate_t * __restrict)); -size_t wcrtomb __P((char * __restrict, wchar_t, mbstate_t * __restrict)); -#endif + wchar_t *wcscat __P((wchar_t * __restrict, const wchar_t * __restrict)); wchar_t *wcschr __P((const wchar_t *, wchar_t)); int wcscmp __P((const wchar_t *, const wchar_t *)); diff --git a/include/wctype.h b/include/wctype.h index c1d19fb495..5c0722beae 100644 --- a/include/wctype.h +++ b/include/wctype.h @@ -26,7 +26,7 @@ * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp * $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $ * $FreeBSD: src/include/wctype.h,v 1.3.2.1 2001/07/11 23:48:38 obrien Exp $ - * $DragonFly: src/include/wctype.h,v 1.2 2003/06/17 04:25:56 dillon Exp $ + * $DragonFly: src/include/wctype.h,v 1.3 2003/11/09 02:22:28 dillon Exp $ */ #if 0 @@ -35,11 +35,13 @@ #define _WCTYPE_H_ #include -#include +#ifndef _SYS_STDINT_H_ +#include +#endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DECLARED_ +#define _WINT_T_DECLARED_ +typedef __wint_t wint_t; #endif #ifndef WEOF diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c index 9c08001fdc..7f9f80172d 100644 --- a/sys/boot/alpha/libalpha/srmdisk.c +++ b/sys/boot/alpha/libalpha/srmdisk.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/alpha/libalpha/srmdisk.c,v 1.8.2.2 2001/08/01 20:52:03 mjacob Exp $ - * $DragonFly: src/sys/boot/alpha/libalpha/Attic/srmdisk.c,v 1.2 2003/06/17 04:28:16 dillon Exp $ + * $DragonFly: src/sys/boot/alpha/libalpha/Attic/srmdisk.c,v 1.3 2003/11/09 02:22:29 dillon Exp $ */ /* @@ -153,7 +153,7 @@ bd_print(int verbose) static int bd_open(struct open_file *f, ...) { - va_list args; + __va_list args; struct alpha_devdesc *dev; struct dos_partition *dptr; struct open_disk *od; @@ -163,9 +163,9 @@ bd_open(struct open_file *f, ...) int unit, fd; prom_return_t ret; - va_start(args, f); - dev = va_arg(args, struct alpha_devdesc*); - va_end(args); + __va_start(args, f); + dev = __va_arg(args, struct alpha_devdesc*); + __va_end(args); unit = dev->d_kind.srmdisk.unit; if (unit >= nbdinfo) { diff --git a/sys/boot/arc/lib/arcdisk.c b/sys/boot/arc/lib/arcdisk.c index ac1ebe0545..a128ce4904 100644 --- a/sys/boot/arc/lib/arcdisk.c +++ b/sys/boot/arc/lib/arcdisk.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/arc/lib/arcdisk.c,v 1.3.2.1 2001/01/05 17:37:51 mjacob Exp $ - * $DragonFly: src/sys/boot/arc/lib/Attic/arcdisk.c,v 1.2 2003/06/17 04:28:16 dillon Exp $ + * $DragonFly: src/sys/boot/arc/lib/Attic/arcdisk.c,v 1.3 2003/11/09 02:22:30 dillon Exp $ */ /* @@ -150,11 +150,11 @@ bd_open(struct open_file *f, ...) int error; int unit; u_int32_t fd; - va_list ap; + __va_list ap; - va_start(ap, f); - dev = va_arg(ap, struct arc_devdesc *); - va_end(ap); + __va_start(ap, f); + dev = __va_arg(ap, struct arc_devdesc *); + __va_end(ap); unit = dev->d_kind.arcdisk.unit; if (unit >= nbdinfo) { diff --git a/sys/boot/common/dev_net.c b/sys/boot/common/dev_net.c index 57bfe21574..3559417bed 100644 --- a/sys/boot/common/dev_net.c +++ b/sys/boot/common/dev_net.c @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/boot/common/dev_net.c,v 1.6.2.5 2001/03/04 04:44:42 obrien Exp $ - * $DragonFly: src/sys/boot/common/dev_net.c,v 1.2 2003/06/17 04:28:16 dillon Exp $ + * $DragonFly: src/sys/boot/common/dev_net.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ * From: $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ */ @@ -113,13 +113,13 @@ net_init(void) int net_open(struct open_file *f, ...) { - va_list args; + __va_list args; char *devname; /* Device part of file name (or NULL). */ int error = 0; - va_start(args, f); - devname = va_arg(args, char*); - va_end(args); + __va_start(args, f); + devname = __va_arg(args, char*); + __va_end(args); /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { diff --git a/sys/boot/common/panic.c b/sys/boot/common/panic.c index b4c9ef4935..a0fcbc4bfd 100644 --- a/sys/boot/common/panic.c +++ b/sys/boot/common/panic.c @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/boot/common/panic.c,v 1.5 1999/08/28 00:39:51 peter Exp $ - * $DragonFly: src/sys/boot/common/panic.c,v 1.2 2003/06/17 04:28:17 dillon Exp $ + * $DragonFly: src/sys/boot/common/panic.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ * From: $NetBSD: panic.c,v 1.2 1997/03/22 01:48:36 thorpej Exp $ */ @@ -43,12 +43,12 @@ void panic(const char *fmt,...) { - va_list ap; + __va_list ap; printf("panic: "); - va_start(ap, fmt); + __va_start(ap, fmt); vprintf(fmt, ap); - va_end(ap); + __va_end(ap); printf("\n"); exit(1); diff --git a/sys/boot/ficl/vm.c b/sys/boot/ficl/vm.c index 7389d69ef5..f22d57749c 100644 --- a/sys/boot/ficl/vm.c +++ b/sys/boot/ficl/vm.c @@ -14,7 +14,7 @@ */ /* $FreeBSD: src/sys/boot/ficl/vm.c,v 1.5.2.1 2000/07/06 23:51:45 obrien Exp $ */ -/* $DragonFly: src/sys/boot/ficl/vm.c,v 1.2 2003/06/17 04:28:17 dillon Exp $ */ +/* $DragonFly: src/sys/boot/ficl/vm.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ #ifdef TESTMAIN #include @@ -433,11 +433,11 @@ void vmThrow(FICL_VM *pVM, int except) void vmThrowErr(FICL_VM *pVM, char *fmt, ...) { - va_list va; - va_start(va, fmt); + __va_list va; + __va_start(va, fmt); vsprintf(pVM->pad, fmt, va); vmTextOut(pVM, pVM->pad, 1); - va_end(va); + __va_end(va); longjmp(*(pVM->pState), VM_ERREXIT); } diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index d2d8e386f8..389647be38 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -15,7 +15,7 @@ /* * $FreeBSD: src/sys/boot/i386/boot2/boot2.c,v 1.28.2.7 2002/10/10 15:53:24 iwasaki Exp $ - * $DragonFly: src/sys/boot/i386/boot2/Attic/boot2.c,v 1.3 2003/08/07 21:16:44 dillon Exp $ + * $DragonFly: src/sys/boot/i386/boot2/Attic/boot2.c,v 1.4 2003/11/09 02:22:33 dillon Exp $ */ #include @@ -658,28 +658,28 @@ static int printf(const char *fmt,...) { static const char digits[16] = "0123456789abcdef"; - va_list ap; + __va_list ap; char buf[10]; char *s; unsigned r, u; int c; - va_start(ap, fmt); + __va_start(ap, fmt); while ((c = *fmt++)) { if (c == '%') { c = *fmt++; switch (c) { case 'c': - putchar(va_arg(ap, int)); + putchar(__va_arg(ap, int)); continue; case 's': - for (s = va_arg(ap, char *); *s; s++) + for (s = __va_arg(ap, char *); *s; s++) putchar(*s); continue; case 'u': case 'x': r = c == 'u' ? 10U : 16U; - u = va_arg(ap, unsigned); + u = __va_arg(ap, unsigned); s = buf; do *s++ = digits[u % r]; @@ -691,7 +691,7 @@ printf(const char *fmt,...) } putchar(c); } - va_end(ap); + __va_end(ap); return 0; } diff --git a/sys/boot/i386/libi386/bioscd.c b/sys/boot/i386/libi386/bioscd.c index a88cbb6dec..e3c36e262c 100644 --- a/sys/boot/i386/libi386/bioscd.c +++ b/sys/boot/i386/libi386/bioscd.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/bioscd.c,v 1.2.2.1 2001/12/21 22:19:58 jhb Exp $ - * $DragonFly: src/sys/boot/i386/libi386/Attic/bioscd.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/i386/libi386/Attic/bioscd.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -191,13 +191,13 @@ bc_print(int verbose) static int bc_open(struct open_file *f, ...) { - va_list ap; + __va_list ap; struct i386_devdesc *dev; int error; - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); + __va_start(ap, f); + dev = __va_arg(ap, struct i386_devdesc *); + __va_end(ap); if (dev->d_kind.bioscd.unit >= nbcinfo) { DEBUG("attempt to open nonexistent disk"); return(ENXIO); diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c index b728e8da4e..91f787f8e7 100644 --- a/sys/boot/i386/libi386/biosdisk.c +++ b/sys/boot/i386/libi386/biosdisk.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.26.2.6 2000/12/28 13:10:47 ps Exp $ - * $DragonFly: src/sys/boot/i386/libi386/Attic/biosdisk.c,v 1.3 2003/07/21 05:50:22 dillon Exp $ + * $DragonFly: src/sys/boot/i386/libi386/Attic/biosdisk.c,v 1.4 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -416,14 +416,14 @@ bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix, static int bd_open(struct open_file *f, ...) { - va_list ap; + __va_list ap; struct i386_devdesc *dev; struct open_disk *od; int error; - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); + __va_start(ap, f); + dev = __va_arg(ap, struct i386_devdesc *); + __va_end(ap); if ((error = bd_opendisk(&od, dev))) return(error); diff --git a/sys/boot/i386/libi386/biospnp.c b/sys/boot/i386/libi386/biospnp.c index 6ce0ea8c97..fcf757f725 100644 --- a/sys/boot/i386/libi386/biospnp.c +++ b/sys/boot/i386/libi386/biospnp.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.4.2.1 2000/12/28 13:12:39 ps Exp $ - * $DragonFly: src/sys/boot/i386/libi386/Attic/biospnp.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/i386/libi386/Attic/biospnp.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -247,7 +247,7 @@ biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn) static int biospnp_call(int func, const char *fmt, ...) { - va_list ap; + __va_list ap; const char *p; u_int8_t *argp; u_int32_t args[4]; @@ -259,18 +259,18 @@ biospnp_call(int func, const char *fmt, ...) argp += sizeof(u_int16_t); /* take args according to format */ - va_start(ap, fmt); + __va_start(ap, fmt); for (p = fmt; *p != 0; p++) { switch(*p) { case 'w': - i = va_arg(ap, u_int16_t); + i = __va_arg(ap, u_int16_t); *(u_int16_t *)argp = i; argp += sizeof(u_int16_t); break; case 'l': - i = va_arg(ap, u_int32_t); + i = __va_arg(ap, u_int32_t); *(u_int32_t *)argp = i; argp += sizeof(u_int32_t); break; diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c index 63372cfdab..ed90c3b3f2 100644 --- a/sys/boot/i386/libi386/pxe.c +++ b/sys/boot/i386/libi386/pxe.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/pxe.c,v 1.3.2.9 2001/03/15 08:35:54 ps Exp $ - * $DragonFly: src/sys/boot/i386/libi386/Attic/pxe.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/i386/libi386/Attic/pxe.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ #include @@ -252,15 +252,15 @@ pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t size, static int pxe_open(struct open_file *f, ...) { - va_list args; + __va_list args; char *devname; /* Device part of file name (or NULL). */ char temp[FNAME_SIZE]; int error = 0; int i; - va_start(args, f); - devname = va_arg(args, char*); - va_end(args); + __va_start(args, f); + devname = __va_arg(args, char*); + __va_end(args); /* On first open, do netif open, mount, etc. */ if (pxe_opens == 0) { diff --git a/sys/boot/pc32/boot2/boot2.c b/sys/boot/pc32/boot2/boot2.c index 6a09c4d267..eb4e26d85b 100644 --- a/sys/boot/pc32/boot2/boot2.c +++ b/sys/boot/pc32/boot2/boot2.c @@ -15,7 +15,7 @@ /* * $FreeBSD: src/sys/boot/i386/boot2/boot2.c,v 1.28.2.7 2002/10/10 15:53:24 iwasaki Exp $ - * $DragonFly: src/sys/boot/pc32/boot2/boot2.c,v 1.3 2003/08/07 21:16:44 dillon Exp $ + * $DragonFly: src/sys/boot/pc32/boot2/boot2.c,v 1.4 2003/11/09 02:22:33 dillon Exp $ */ #include @@ -658,28 +658,28 @@ static int printf(const char *fmt,...) { static const char digits[16] = "0123456789abcdef"; - va_list ap; + __va_list ap; char buf[10]; char *s; unsigned r, u; int c; - va_start(ap, fmt); + __va_start(ap, fmt); while ((c = *fmt++)) { if (c == '%') { c = *fmt++; switch (c) { case 'c': - putchar(va_arg(ap, int)); + putchar(__va_arg(ap, int)); continue; case 's': - for (s = va_arg(ap, char *); *s; s++) + for (s = __va_arg(ap, char *); *s; s++) putchar(*s); continue; case 'u': case 'x': r = c == 'u' ? 10U : 16U; - u = va_arg(ap, unsigned); + u = __va_arg(ap, unsigned); s = buf; do *s++ = digits[u % r]; @@ -691,7 +691,7 @@ printf(const char *fmt,...) } putchar(c); } - va_end(ap); + __va_end(ap); return 0; } diff --git a/sys/boot/pc32/libi386/bioscd.c b/sys/boot/pc32/libi386/bioscd.c index 45e9ed72fb..e95fcdea97 100644 --- a/sys/boot/pc32/libi386/bioscd.c +++ b/sys/boot/pc32/libi386/bioscd.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/bioscd.c,v 1.2.2.1 2001/12/21 22:19:58 jhb Exp $ - * $DragonFly: src/sys/boot/pc32/libi386/bioscd.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/pc32/libi386/bioscd.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -191,13 +191,13 @@ bc_print(int verbose) static int bc_open(struct open_file *f, ...) { - va_list ap; + __va_list ap; struct i386_devdesc *dev; int error; - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); + __va_start(ap, f); + dev = __va_arg(ap, struct i386_devdesc *); + __va_end(ap); if (dev->d_kind.bioscd.unit >= nbcinfo) { DEBUG("attempt to open nonexistent disk"); return(ENXIO); diff --git a/sys/boot/pc32/libi386/biosdisk.c b/sys/boot/pc32/libi386/biosdisk.c index 3a25fd2bc3..1bc934193b 100644 --- a/sys/boot/pc32/libi386/biosdisk.c +++ b/sys/boot/pc32/libi386/biosdisk.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.26.2.6 2000/12/28 13:10:47 ps Exp $ - * $DragonFly: src/sys/boot/pc32/libi386/biosdisk.c,v 1.3 2003/07/21 05:50:22 dillon Exp $ + * $DragonFly: src/sys/boot/pc32/libi386/biosdisk.c,v 1.4 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -416,14 +416,14 @@ bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix, static int bd_open(struct open_file *f, ...) { - va_list ap; + __va_list ap; struct i386_devdesc *dev; struct open_disk *od; int error; - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); + __va_start(ap, f); + dev = __va_arg(ap, struct i386_devdesc *); + __va_end(ap); if ((error = bd_opendisk(&od, dev))) return(error); diff --git a/sys/boot/pc32/libi386/biospnp.c b/sys/boot/pc32/libi386/biospnp.c index 0ab476b7fe..1c681e02e5 100644 --- a/sys/boot/pc32/libi386/biospnp.c +++ b/sys/boot/pc32/libi386/biospnp.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/biospnp.c,v 1.4.2.1 2000/12/28 13:12:39 ps Exp $ - * $DragonFly: src/sys/boot/pc32/libi386/biospnp.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/pc32/libi386/biospnp.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -247,7 +247,7 @@ biospnp_scanresdata(struct pnpinfo *pi, struct pnp_devNode *dn) static int biospnp_call(int func, const char *fmt, ...) { - va_list ap; + __va_list ap; const char *p; u_int8_t *argp; u_int32_t args[4]; @@ -259,18 +259,18 @@ biospnp_call(int func, const char *fmt, ...) argp += sizeof(u_int16_t); /* take args according to format */ - va_start(ap, fmt); + __va_start(ap, fmt); for (p = fmt; *p != 0; p++) { switch(*p) { case 'w': - i = va_arg(ap, u_int16_t); + i = __va_arg(ap, u_int16_t); *(u_int16_t *)argp = i; argp += sizeof(u_int16_t); break; case 'l': - i = va_arg(ap, u_int32_t); + i = __va_arg(ap, u_int32_t); *(u_int32_t *)argp = i; argp += sizeof(u_int32_t); break; diff --git a/sys/boot/pc32/libi386/pxe.c b/sys/boot/pc32/libi386/pxe.c index 4594bda274..af3dfb48e7 100644 --- a/sys/boot/pc32/libi386/pxe.c +++ b/sys/boot/pc32/libi386/pxe.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/pxe.c,v 1.3.2.9 2001/03/15 08:35:54 ps Exp $ - * $DragonFly: src/sys/boot/pc32/libi386/pxe.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/pc32/libi386/pxe.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ #include @@ -252,15 +252,15 @@ pxe_strategy(void *devdata, int flag, daddr_t dblk, size_t size, static int pxe_open(struct open_file *f, ...) { - va_list args; + __va_list args; char *devname; /* Device part of file name (or NULL). */ char temp[FNAME_SIZE]; int error = 0; int i; - va_start(args, f); - devname = va_arg(args, char*); - va_end(args); + __va_start(args, f); + devname = __va_arg(args, char*); + __va_end(args); /* On first open, do netif open, mount, etc. */ if (pxe_opens == 0) { diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c index f61649e7b9..6108cbff7a 100644 --- a/sys/boot/pc98/libpc98/biosdisk.c +++ b/sys/boot/pc98/libpc98/biosdisk.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.11.2.7 2003/01/13 08:52:53 nyan Exp $ - * $DragonFly: src/sys/boot/pc98/libpc98/Attic/biosdisk.c,v 1.2 2003/06/17 04:28:18 dillon Exp $ + * $DragonFly: src/sys/boot/pc98/libpc98/Attic/biosdisk.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ */ /* @@ -510,14 +510,14 @@ bd_printbsdslice(struct open_disk *od, daddr_t offset, char *prefix, static int bd_open(struct open_file *f, ...) { - va_list ap; + __va_list ap; struct i386_devdesc *dev; struct open_disk *od; int error; - va_start(ap, f); - dev = va_arg(ap, struct i386_devdesc *); - va_end(ap); + __va_start(ap, f); + dev = __va_arg(ap, struct i386_devdesc *); + __va_end(ap); if ((error = bd_opendisk(&od, dev))) return(error); diff --git a/sys/bus/cam/scsi/scsi_ses.c b/sys/bus/cam/scsi/scsi_ses.c index bba6850459..3cbe414e75 100644 --- a/sys/bus/cam/scsi/scsi_ses.c +++ b/sys/bus/cam/scsi/scsi_ses.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/cam/scsi/scsi_ses.c,v 1.8.2.2 2000/08/08 23:19:21 mjacob Exp $ */ -/* $DragonFly: src/sys/bus/cam/scsi/scsi_ses.c,v 1.6 2003/08/07 21:16:45 dillon Exp $ */ +/* $DragonFly: src/sys/bus/cam/scsi/scsi_ses.c,v 1.7 2003/11/09 02:22:33 dillon Exp $ */ /* * Copyright (c) 2000 Matthew Jacob * All rights reserved. @@ -720,12 +720,12 @@ ses_runcmd(struct ses_softc *ssc, char *cdb, int cdbl, char *dptr, int *dlenp) static void ses_log(struct ses_softc *ssc, const char *fmt, ...) { - va_list ap; + __va_list ap; printf("%s%d: ", ssc->periph->periph_name, ssc->periph->unit_number); - va_start(ap, fmt); + __va_start(ap, fmt); vprintf(fmt, ap); - va_end(ap); + __va_end(ap); } /* diff --git a/sys/bus/isa/pnpparse.c b/sys/bus/isa/pnpparse.c index 1723fda522..3ed607158f 100644 --- a/sys/bus/isa/pnpparse.c +++ b/sys/bus/isa/pnpparse.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/pnpparse.c,v 1.14 2003/06/11 00:32:45 obrien Exp $ - * $DragonFly: src/sys/bus/isa/pnpparse.c,v 1.4 2003/11/08 02:55:16 dillon Exp $ + * $DragonFly: src/sys/bus/isa/pnpparse.c,v 1.5 2003/11/09 02:22:33 dillon Exp $ */ #include @@ -47,12 +47,12 @@ void pnp_printf(u_int32_t id, char *fmt, ...) { - va_list ap; + __va_list ap; - va_start(ap, fmt); + __va_start(ap, fmt); printf("%s: ", pnp_eisaformat(id)); vprintf(fmt, ap); - va_end(ap); + __va_end(ap); } /* parse a single descriptor */ diff --git a/sys/bus/ppbus/ppb_msq.c b/sys/bus/ppbus/ppb_msq.c index fec6da1edd..52f51a4ecb 100644 --- a/sys/bus/ppbus/ppb_msq.c +++ b/sys/bus/ppbus/ppb_msq.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/ppb_msq.c,v 1.9.2.1 2000/05/24 00:20:57 n_hibma Exp $ - * $DragonFly: src/sys/bus/ppbus/ppb_msq.c,v 1.3 2003/08/07 21:16:47 dillon Exp $ + * $DragonFly: src/sys/bus/ppbus/ppb_msq.c,v 1.4 2003/11/09 02:22:33 dillon Exp $ * */ #include @@ -190,13 +190,13 @@ ppb_MS_init_msq(struct ppb_microseq *msq, int nbparam, ...) { int i; int param, ins, arg, type; - va_list p_list; + __va_list p_list; - va_start(p_list, nbparam); + __va_start(p_list, nbparam); for (i=0; i 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 +/* + * Standard va types and macros + */ #define __va_size(type) \ (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) #ifdef __GNUC__ -#define va_start(ap, last) \ - ((ap) = (va_list)__builtin_next_arg(last)) +#define __va_start(ap, last) \ + ((ap) = (__va_list)__builtin_next_arg(last)) #else -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) +#define __va_start(ap, last) \ + ((ap) = (__va_list)&(last) + __va_size(last)) #endif -#define va_arg(ap, type) \ +#define __va_arg(ap, type) \ (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) +#define __va_end(ap) + +#endif -#endif /* !_STDARG_H_ */ diff --git a/sys/cpu/i386/include/stdint.h b/sys/cpu/i386/include/stdint.h new file mode 100644 index 0000000000..2aa442f7c0 --- /dev/null +++ b/sys/cpu/i386/include/stdint.h @@ -0,0 +1,262 @@ +/*- + * Copyright (c) 2001, 2002 Mike Barcroft + * Copyright (c) 2001 The NetBSD Foundation, Inc. All rights reserved. + * Copyright (c) 1990, 1993 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * 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 NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + * + * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.1 2002/07/29 17:41:07 mike Exp $ + * $DragonFly: src/sys/cpu/i386/include/stdint.h,v 1.1 2003/11/09 02:22:35 dillon Exp $ + */ + +#ifndef _MACHINE_STDINT_H_ +#define _MACHINE_STDINT_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; + +/* + * This mess is to override compiler options that might restrict long long + * and for lint which doesn't understand GNUC attributes. + */ +#if defined(lint) +typedef long long __int64_t; +typedef unsigned long long __uint64_t; +#elif defined(__GNUC__) +typedef int __attribute__((__mode__(__DI__))) __int64_t; +typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; +#else +typedef long long __int64_t; +typedef unsigned long long __uint64_t; +#endif + +/* + * 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; + +/* + * Standard type definitions. + */ +typedef __int64_t __intmax_t; +typedef __uint64_t __uintmax_t; + +typedef __int32_t __intptr_t; +typedef __uint32_t __uintptr_t; + +typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ + +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 __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; + +/* + * System types conveniently placed in this header file in order to put them + * in proximity with the limit macros below and for convenient access by + * other include files which need to pick and choose particular types but + * do not wish to overly pollute their namespaces. + */ + +typedef __uint32_t __size_t; +typedef __int32_t __ssize_t; +typedef long __time_t; +typedef int __timer_t; +typedef __int32_t __register_t; +typedef __uint32_t __u_register_t; +typedef __int32_t __sig_atomic_t; +typedef unsigned long __clock_t; +typedef unsigned long __clockid_t; +typedef __uint32_t __socklen_t; + +/* + * Its convenient to put these here rather then create another header file. + */ +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#define __arysize(ary) (sizeof(ary)/sizeof((ary)[0])) + +#endif /* _MACHINE_STDINT_H_ */ + +/* + * OpenGroup stdint.h extensions. Since these are protected by a define we + * do not have to generate __ versions of them. + */ +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) +#ifndef _MACHINE_STDINT_H_STDC_CONSTANT_MACROS_ +#define _MACHINE_STDINT_H_STDC_CONSTANT_MACROS_ + +#define INT8_C(c) (c) +#define INT16_C(c) (c) +#define INT32_C(c) (c) +#define INT64_C(c) (c ## LL) + +#define UINT8_C(c) (c) +#define UINT16_C(c) (c) +#define UINT32_C(c) (c ## U) +#define UINT64_C(c) (c ## ULL) + +#define INTMAX_C(c) (c ## LL) +#define UINTMAX_C(c) (c ## ULL) + +#endif +#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef _MACHINE_STDINT_H_STDC_LIMIT_MAVROS_ +#define _MACHINE_STDINT_H_STDC_LIMIT_MAVROS_ + +/* + * ISO/IEC 9899:1999 + * 7.18.2.1 Limits of exact-width integer types + */ +/* Minimum values of exact-width signed integer types. */ +#define INT8_MIN (-0x7f-1) +#define INT16_MIN (-0x7fff-1) +#define INT32_MIN (-0x7fffffff-1) +#define INT64_MIN (-0x7fffffffffffffffLL-1) + +/* Maximum values of exact-width signed integer types. */ +#define INT8_MAX 0x7f +#define INT16_MAX 0x7fff +#define INT32_MAX 0x7fffffff +#define INT64_MAX 0x7fffffffffffffffLL + +/* Maximum values of exact-width unsigned integer types. */ +#define UINT8_MAX 0xff +#define UINT16_MAX 0xffff +#define UINT32_MAX 0xffffffffU +#define UINT64_MAX 0xffffffffffffffffULL + +/* + * ISO/IEC 9899:1999 + * 7.18.2.4 Limits of integer types capable of holding object pointers + */ +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.5 Limits of greatest-width integer types + */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.3 Limits of other integer types + */ +/* Limits of ptrdiff_t. */ +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX + +/* Limits of sig_atomic_t. */ +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +/* Limit of size_t. */ +#define SIZE_MAX UINT32_MAX + +/* NOTE: wchar and wint macros in sys/stdint.h */ + +/* + * ISO/IEC 9899:1999 + * 7.18.2.2 Limits of minimum-width integer types + */ +/* Minimum values of minimum-width signed integer types. */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +/* Maximum values of minimum-width signed integer types. */ +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +/* Maximum values of minimum-width unsigned integer types. */ +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.3 Limits of fastest minimum-width integer types + */ +/* Minimum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MIN INT32_MIN +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +/* Maximum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MAX INT32_MAX +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +/* Maximum values of fastest minimum-width unsigned integer types. */ +#define UINT_FAST8_MAX UINT32_MAX +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +#endif +#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ + diff --git a/sys/cpu/i386/include/types.h b/sys/cpu/i386/include/types.h index f791f2f8db..8edd26016d 100644 --- a/sys/cpu/i386/include/types.h +++ b/sys/cpu/i386/include/types.h @@ -32,7 +32,7 @@ * * @(#)types.h 8.3 (Berkeley) 1/5/94 * $FreeBSD: src/sys/i386/include/types.h,v 1.19.2.1 2001/03/21 10:50:58 peter Exp $ - * $DragonFly: src/sys/cpu/i386/include/types.h,v 1.7 2003/11/03 22:50:15 dillon Exp $ + * $DragonFly: src/sys/cpu/i386/include/types.h,v 1.8 2003/11/09 02:22:35 dillon Exp $ */ #ifndef _MACHINE_TYPES_H_ @@ -66,15 +66,14 @@ typedef unsigned int uintfptr_t; /* * MMU page tables */ -typedef __uint32_t pd_entry_t; -typedef __uint32_t pt_entry_t; +typedef __uint32_t pd_entry_t; +typedef __uint32_t pt_entry_t; #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ #define PTESIZE sizeof(pt_entry_t) /* for assembly files */ /* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; -typedef __int64_t intmax_t; -typedef __uint64_t uintmax_t; +typedef __uint32_t intrmask_t; #endif /* !_MACHINE_TYPES_H_ */ + diff --git a/sys/crypto/sha2/sha2.c b/sys/crypto/sha2/sha2.c index 406f321a50..c069c2fa07 100644 --- a/sys/crypto/sha2/sha2.c +++ b/sys/crypto/sha2/sha2.c @@ -1,7 +1,8 @@ -/* $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ */ -/* $DragonFly: src/sys/crypto/sha2/sha2.c,v 1.2 2003/06/17 04:28:20 dillon Exp $ */ -/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */ - +/* + * $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ + * $FreeBSD: src/sys/crypto/sha2/sha2.c,v 1.2.2.2 2002/03/05 08:36:47 ume Exp $ + * $DragonFly: src/sys/crypto/sha2/sha2.c,v 1.3 2003/11/09 02:22:33 dillon Exp $ + */ /* * sha2.c * diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index 995d2ccbec..56872b2a1f 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -24,7 +24,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/ddb/db_output.c,v 1.26 1999/08/28 00:41:09 peter Exp $ - * $DragonFly: src/sys/ddb/db_output.c,v 1.4 2003/08/27 10:47:13 rob Exp $ + * $DragonFly: src/sys/ddb/db_output.c,v 1.5 2003/11/09 02:22:34 dillon Exp $ */ /* @@ -152,40 +152,30 @@ db_print_position() * Printing */ void -#if __STDC__ db_printf(const char *fmt, ...) -#else -db_printf(fmt) - const char *fmt; -#endif { - va_list listp; + __va_list listp; - va_start(listp, fmt); + __va_start(listp, fmt); kvprintf (fmt, db_putchar, NULL, db_radix, listp); - va_end(listp); + __va_end(listp); } int db_indent; void -#if __STDC__ db_iprintf(const char *fmt,...) -#else -db_iprintf(fmt) - const char *fmt; -#endif { int i; - va_list listp; + __va_list listp; for (i = db_indent; i >= 8; i -= 8) db_printf("\t"); while (--i >= 0) db_printf(" "); - va_start(listp, fmt); + __va_start(listp, fmt); kvprintf (fmt, db_putchar, NULL, db_radix, listp); - va_end(listp); + __va_end(listp); } /* diff --git a/sys/dev/acpica/Osd/OsdStream.c b/sys/dev/acpica/Osd/OsdStream.c index 8254ae842a..d15cb40540 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/sys/dev/acpica/Osd/OsdStream.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/Osd/OsdStream.c,v 1.3.4.1 2003/08/22 20:49:21 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdStream.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdStream.c,v 1.2 2003/11/09 02:22:34 dillon Exp $ */ /* @@ -37,15 +37,15 @@ void AcpiOsPrintf (const char *Format, ...) { - va_list ap; + __va_list ap; - va_start(ap, Format); + __va_start(ap, Format); vprintf(Format, ap); - va_end(ap); + __va_end(ap); } void -AcpiOsVprintf (const char *Format, va_list Args) +AcpiOsVprintf (const char *Format, __va_list Args) { vprintf(Format, Args); } diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0cfffb3a42..a54ea2a5dc 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.95.2.1 2003/08/22 20:49:20 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Attic/acpi.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $DragonFly: src/sys/dev/acpica/Attic/acpi.c,v 1.2 2003/11/09 02:22:34 dillon Exp $ */ #include "opt_acpi.h" @@ -2142,7 +2142,7 @@ acpi_pm_func(u_long cmd, void *arg, ...) int state, acpi_state; int error; struct acpi_softc *sc; - va_list ap; + __va_list ap; error = 0; switch (cmd) { @@ -2153,9 +2153,9 @@ acpi_pm_func(u_long cmd, void *arg, ...) goto out; } - va_start(ap, arg); - state = va_arg(ap, int); - va_end(ap); + __va_start(ap, arg); + state = __va_arg(ap, int); + __va_end(ap); switch (state) { case POWER_SLEEP_STATE_STANDBY: diff --git a/sys/dev/crypto/rndtest/rndtest.c b/sys/dev/crypto/rndtest/rndtest.c index 97c6ed29f4..636e8df3a5 100644 --- a/sys/dev/crypto/rndtest/rndtest.c +++ b/sys/dev/crypto/rndtest/rndtest.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/rndtest/rndtest.c,v 1.1.4.1 2003/06/04 17:10:30 sam Exp $ */ -/* $DragonFly: src/sys/dev/crypto/rndtest/rndtest.c,v 1.3 2003/08/07 21:16:49 dillon Exp $ */ +/* $DragonFly: src/sys/dev/crypto/rndtest/rndtest.c,v 1.4 2003/11/09 02:22:34 dillon Exp $ */ /* $OpenBSD$ */ /* @@ -172,15 +172,15 @@ static void rndtest_report(struct rndtest_state *rsp, int failure, const char *fmt, ...) { char buf[80]; - va_list ap; + __va_list ap; if (rndtest_verbose == 0) return; if (!failure && rndtest_verbose == 1) /* don't report successes */ return; - va_start(ap, fmt); + __va_start(ap, fmt); vsnprintf(buf, sizeof (buf), fmt, ap); - va_end(ap); + __va_end(ap); device_printf(rsp->rs_parent, "rndtest: %s\n", buf); } diff --git a/sys/dev/disk/ata/ata-all.c b/sys/dev/disk/ata/ata-all.c index 04b51c73d5..e459d5bfb2 100644 --- a/sys/dev/disk/ata/ata-all.c +++ b/sys/dev/disk/ata/ata-all.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.50.2.45 2003/03/12 14:47:12 sos Exp $ - * $DragonFly: src/sys/dev/disk/ata/ata-all.c,v 1.7 2003/08/07 21:16:51 dillon Exp $ + * $DragonFly: src/sys/dev/disk/ata/ata-all.c,v 1.8 2003/11/09 02:22:34 dillon Exp $ */ #include "opt_ata.h" @@ -1362,7 +1362,7 @@ ata_change_mode(struct ata_device *atadev, int mode) int ata_printf(struct ata_channel *ch, int device, const char * fmt, ...) { - va_list ap; + __va_list ap; int ret; if (device == -1) @@ -1374,16 +1374,16 @@ ata_printf(struct ata_channel *ch, int device, const char * fmt, ...) ret = printf("ata%d-%s: ", device_get_unit(ch->dev), (device == ATA_MASTER) ? "master" : "slave"); } - va_start(ap, fmt); + __va_start(ap, fmt); ret += vprintf(fmt, ap); - va_end(ap); + __va_end(ap); return ret; } int ata_prtdev(struct ata_device *atadev, const char * fmt, ...) { - va_list ap; + __va_list ap; int ret; if (atadev->name) @@ -1391,9 +1391,9 @@ ata_prtdev(struct ata_device *atadev, const char * fmt, ...) else ret = printf("ata%d-%s: ", device_get_unit(atadev->channel->dev), (atadev->unit == ATA_MASTER) ? "master" : "slave"); - va_start(ap, fmt); + __va_start(ap, fmt); ret += vprintf(fmt, ap); - va_end(ap); + __va_end(ap); return ret; } diff --git a/sys/dev/disk/fd/fd.c b/sys/dev/disk/fd/fd.c index f62a2169a3..3bc9be7733 100644 --- a/sys/dev/disk/fd/fd.c +++ b/sys/dev/disk/fd/fd.c @@ -51,7 +51,7 @@ * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 * $FreeBSD: src/sys/isa/fd.c,v 1.176.2.8 2002/05/15 21:56:14 joerg Exp $ - * $DragonFly: src/sys/dev/disk/fd/fd.c,v 1.10 2003/08/07 21:16:52 dillon Exp $ + * $DragonFly: src/sys/dev/disk/fd/fd.c,v 1.11 2003/11/09 02:22:34 dillon Exp $ * */ @@ -384,15 +384,15 @@ fd_cmd(struct fdc_data *fdc, int n_out, ...) u_char cmd; int n_in; int n; - va_list ap; + __va_list ap; - va_start(ap, n_out); - cmd = (u_char)(va_arg(ap, int)); - va_end(ap); - va_start(ap, n_out); + __va_start(ap, n_out); + cmd = (u_char)(__va_arg(ap, int)); + __va_end(ap); + __va_start(ap, n_out); for (n = 0; n < n_out; n++) { - if (out_fdc(fdc, va_arg(ap, int)) < 0) + if (out_fdc(fdc, __va_arg(ap, int)) < 0) { char msg[50]; snprintf(msg, sizeof(msg), @@ -401,10 +401,10 @@ fd_cmd(struct fdc_data *fdc, int n_out, ...) return fdc_err(fdc, msg); } } - n_in = va_arg(ap, int); + n_in = __va_arg(ap, int); for (n = 0; n < n_in; n++) { - int *ptr = va_arg(ap, int *); + int *ptr = __va_arg(ap, int *); if (fd_in(fdc, ptr) < 0) { char msg[50]; diff --git a/sys/dev/disk/isp/isp_freebsd.c b/sys/dev/disk/isp/isp_freebsd.c index 9dd8f6c40b..7b8165c12a 100644 --- a/sys/dev/disk/isp/isp_freebsd.c +++ b/sys/dev/disk/isp/isp_freebsd.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.32.2.20 2002/10/11 18:49:25 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/isp/isp_freebsd.c,v 1.6 2003/08/07 21:16:52 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/isp/isp_freebsd.c,v 1.7 2003/11/09 02:22:34 dillon Exp $ */ /* * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. * @@ -2877,13 +2877,13 @@ isp_uninit(struct ispsoftc *isp) void isp_prt(struct ispsoftc *isp, int level, const char *fmt, ...) { - va_list ap; + __va_list ap; if (level != ISP_LOGALL && (level & isp->isp_dblev) == 0) { return; } printf("%s: ", device_get_nameunit(isp->isp_dev)); - va_start(ap, fmt); + __va_start(ap, fmt); vprintf(fmt, ap); - va_end(ap); + __va_end(ap); printf("\n"); } diff --git a/sys/dev/disk/scd/scd.c b/sys/dev/disk/scd/scd.c index 7fcde8c9d2..1f2780c44d 100644 --- a/sys/dev/disk/scd/scd.c +++ b/sys/dev/disk/scd/scd.c @@ -42,7 +42,7 @@ /* $FreeBSD: src/sys/i386/isa/scd.c,v 1.54 2000/01/29 16:00:30 peter Exp $ */ -/* $DragonFly: src/sys/dev/disk/scd/Attic/scd.c,v 1.7 2003/08/07 21:16:54 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/scd/Attic/scd.c,v 1.8 2003/11/09 02:22:34 dillon Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -1318,7 +1318,7 @@ get_result(u_int unit, int result_len, u_char *result) static int send_cmd(u_int unit, u_char cmd, u_int nargs, ...) { - va_list ap; + __va_list ap; u_int port = scd_data[unit].iobase; u_int reg; u_char c; @@ -1343,14 +1343,14 @@ send_cmd(u_int unit, u_char cmd, u_int nargs, ...) return -EIO; } - va_start(ap, nargs); + __va_start(ap, nargs); reg = port + OREG_WPARAMS; for (i = 0; i < nargs; i++) { - c = (u_char)va_arg(ap, int); + c = (u_char)__va_arg(ap, int); outb(reg, c); XDEBUG(1, (",{0x%x}", c)); } - va_end(ap); + __va_end(ap); XDEBUG(1, ("\n")); outb(port+OREG_COMMAND, cmd); diff --git a/sys/dev/raid/iir/iir.c b/sys/dev/raid/iir/iir.c index 7854a8091e..55a24deb3f 100644 --- a/sys/dev/raid/iir/iir.c +++ b/sys/dev/raid/iir/iir.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/iir/iir.c,v 1.2.2.3 2002/05/05 08:18:12 asmodai Exp $ */ -/* $DragonFly: src/sys/dev/raid/iir/iir.c,v 1.4 2003/08/07 21:17:09 dillon Exp $ */ +/* $DragonFly: src/sys/dev/raid/iir/iir.c,v 1.5 2003/11/09 02:22:35 dillon Exp $ */ /* * Copyright (c) 2000-01 Intel Corporation * All Rights Reserved @@ -126,13 +126,13 @@ static void ser_putc(int c) int ser_printf(const char *fmt, ...) { - va_list args; + __va_list args; int i; - va_start(args,fmt); + __va_start(args,fmt); i = vsprintf(strbuf,fmt,args); ser_puts(strbuf); - va_end(args); + __va_end(args); return i; } #endif diff --git a/sys/dev/raid/vinum/vinumconfig.c b/sys/dev/raid/vinum/vinumconfig.c index ed868a9e13..173a1ea35b 100644 --- a/sys/dev/raid/vinum/vinumconfig.c +++ b/sys/dev/raid/vinum/vinumconfig.c @@ -47,7 +47,7 @@ * * $Id: vinumconfig.c,v 1.30 2000/05/01 09:45:50 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumconfig.c,v 1.32.2.6 2002/02/03 00:43:35 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumconfig.c,v 1.4 2003/08/07 21:17:09 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumconfig.c,v 1.5 2003/11/09 02:22:35 dillon Exp $ */ #define STATIC static @@ -95,14 +95,14 @@ void throw_rude_remark(int error, char *msg,...) { int retval; - va_list ap; + __va_list ap; char *text; static int finishing; /* don't recurse */ int was_finishing; if ((vinum_conf.flags & VF_LOCKED) == 0) /* bug catcher */ panic ("throw_rude_remark: called without config lock"); - va_start(ap, msg); + __va_start(ap, msg); if ((ioctl_reply != NULL) /* we're called from the user */ &&(!(vinum_conf.flags & VF_READING_CONFIG))) { /* and not reading from disk: return msg */ /* @@ -127,7 +127,7 @@ throw_rude_remark(int error, char *msg,...) vprintf(msg, ap); /* print to the console */ printf("\n"); } - va_end(ap); + __va_end(ap); if (vinum_conf.flags & VF_READING_CONFIG) { /* go through to the bitter end, */ if ((vinum_conf.flags & VF_READING_CONFIG) /* we're reading from disk, */ diff --git a/sys/dev/serial/si/si.c b/sys/dev/serial/si/si.c index 634dae89a4..082136525b 100644 --- a/sys/dev/serial/si/si.c +++ b/sys/dev/serial/si/si.c @@ -31,7 +31,7 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/sys/dev/si/si.c,v 1.101.2.1 2001/02/26 04:23:06 jlemon Exp $ - * $DragonFly: src/sys/dev/serial/si/si.c,v 1.7 2003/08/07 21:17:11 dillon Exp $ + * $DragonFly: src/sys/dev/serial/si/si.c,v 1.8 2003/11/09 02:22:35 dillon Exp $ */ #ifndef lint @@ -2145,7 +2145,7 @@ si_disc_optim(struct tty *tp, struct termios *t, struct si_port *pp) void si_dprintf(struct si_port *pp, int flags, const char *fmt, ...) { - va_list ap; + __va_list ap; if ((pp == NULL && (si_debug&flags)) || (pp != NULL && ((pp->sp_debug&flags) || (si_debug&flags)))) { @@ -2153,9 +2153,9 @@ si_dprintf(struct si_port *pp, int flags, const char *fmt, ...) printf("%ci%d(%d): ", 's', (int)SI_CARD(minor(pp->sp_tty->t_dev)), (int)SI_PORT(minor(pp->sp_tty->t_dev))); - va_start(ap, fmt); + __va_start(ap, fmt); vprintf(fmt, ap); - va_end(ap); + __va_end(ap); } } diff --git a/sys/dev/video/bktr/bktr_core.c b/sys/dev/video/bktr/bktr_core.c index a2aa0f5fa5..3510ad1702 100644 --- a/sys/dev/video/bktr/bktr_core.c +++ b/sys/dev/video/bktr/bktr_core.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.103.2.4 2000/11/01 09:36:14 roger Exp $ */ -/* $DragonFly: src/sys/dev/video/bktr/bktr_core.c,v 1.7 2003/08/11 17:50:15 drhodus Exp $ */ +/* $DragonFly: src/sys/dev/video/bktr/bktr_core.c,v 1.8 2003/11/09 02:22:35 dillon Exp $ */ /* * This is part of the Driver for Video Capture Cards (Frame grabbers) @@ -201,7 +201,7 @@ typedef unsigned int uintptr_t; #include #endif -#include /* uintptr_t */ +#include /* uintptr_t */ #include #include #include diff --git a/sys/dev/video/fb/gfb.c b/sys/dev/video/fb/gfb.c index ed1732b2e0..18b8d43251 100644 --- a/sys/dev/video/fb/gfb.c +++ b/sys/dev/video/fb/gfb.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/gfb.c,v 1.1.2.1 2001/11/01 08:33:14 obrien Exp $ - * $DragonFly: src/sys/dev/video/fb/Attic/gfb.c,v 1.3 2003/08/07 21:17:16 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/Attic/gfb.c,v 1.4 2003/11/09 02:22:35 dillon Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -518,23 +518,23 @@ gfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) int gfb_bitblt(video_adapter_t *adp, ...) { - va_list args; + __va_list args; vm_offset_t src, dst; int count, i; u_int32_t val; - va_start(args, adp); + __va_start(args, adp); - src = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + src = (__va_arg(args, vm_offset_t) + adp->va_window_orig) & 0x0000000000fffff8; - dst = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + dst = (__va_arg(args, vm_offset_t) + adp->va_window_orig) & 0x0000000000fffff8; - count = va_arg(args, int); + count = __va_arg(args, int); for(i = 0; i < count; i++, src++, dst++) { val = READ_GFB_BUFFER(adp, src); WRITE_GFB_BUFFER(adp, dst, val); } - va_end(args); + __va_end(args); return(0); } diff --git a/sys/dev/video/fb/tga.c b/sys/dev/video/fb/tga.c index 38c5bd4b2c..894a4fc7a6 100644 --- a/sys/dev/video/fb/tga.c +++ b/sys/dev/video/fb/tga.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/tga.c,v 1.1.2.1 2001/11/01 08:33:14 obrien Exp $ - * $DragonFly: src/sys/dev/video/fb/Attic/tga.c,v 1.3 2003/08/07 21:17:16 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/Attic/tga.c,v 1.4 2003/11/09 02:22:35 dillon Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -872,13 +872,13 @@ tga_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) { static int tga_bitblt(video_adapter_t *adp, ...) { - va_list args; + __va_list args; int i, count; gfb_reg_t gmor; gfb_reg_t gopr; vm_offset_t src, dst; - va_start(args, adp); + __va_start(args, adp); /* Save the pixel mode... */ gmor = READ_GFB_REGISTER(adp, TGA_REG_GMOR); @@ -893,11 +893,11 @@ tga_bitblt(video_adapter_t *adp, ...) { /* Set the raster op (src)... */ WRITE_GFB_REGISTER(adp, TGA_REG_GOPR, (gopr & 0xfffffff0) | 0x3); - src = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + src = (__va_arg(args, vm_offset_t) + adp->va_window_orig) & 0x0000000000fffff8; - dst = (va_arg(args, vm_offset_t) + adp->va_window_orig) & + dst = (__va_arg(args, vm_offset_t) + adp->va_window_orig) & 0x0000000000fffff8; - count = va_arg(args, int); + count = __va_arg(args, int); for(i = 0; i < count; i+= 64, src += 64, dst += 64) { WRITE_GFB_REGISTER(adp, TGA_REG_GCSR, src); WRITE_GFB_REGISTER(adp, TGA_REG_GCDR, dst); @@ -909,7 +909,7 @@ tga_bitblt(video_adapter_t *adp, ...) { /* Restore the pixel mode... */ WRITE_GFB_REGISTER(adp, TGA_REG_GMOR, gmor); - va_end(args); + __va_end(args); return(0); } diff --git a/sys/i386/boot/dosboot/types.h b/sys/i386/boot/dosboot/types.h index ba68660b26..a842867f31 100644 --- a/sys/i386/boot/dosboot/types.h +++ b/sys/i386/boot/dosboot/types.h @@ -37,7 +37,7 @@ * * @(#)types.h 8.4 (Berkeley) 1/21/94 * $FreeBSD: src/sys/i386/boot/dosboot/types.h,v 1.6 1999/12/29 04:32:52 peter Exp $ - * $DragonFly: src/sys/i386/boot/dosboot/Attic/types.h,v 1.3 2003/08/26 21:42:17 rob Exp $ + * $DragonFly: src/sys/i386/boot/dosboot/Attic/types.h,v 1.4 2003/11/09 02:22:35 dillon Exp $ */ #ifndef _SYS_TYPES_H_ @@ -101,28 +101,12 @@ __END_DECLS #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) /* create dev_t */ #endif -#include "ansi.h" -/*#include */ +#include "stdint.h" -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ -#endif - -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ -#endif - -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ -#endif - -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ -#endif +typedef __clock_t clock_t; +typedef __size_t size_t; +typedef __ssize_t ssize_t; +typedef __time_t time_t; #ifndef _POSIX_SOURCE #define NBBY 8 /* number of bits in a byte */ diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index 75b23027cb..7c703383ad 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/bios.c,v 1.29.2.3 2001/07/19 18:07:35 imp Exp $ - * $DragonFly: src/sys/i386/i386/Attic/bios.c,v 1.7 2003/11/08 02:55:17 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/bios.c,v 1.8 2003/11/09 02:22:35 dillon Exp $ */ /* @@ -317,7 +317,7 @@ int bios16(struct bios_args *args, char *fmt, ...) { char *p, *stack, *stack_top; - va_list ap; + __va_list ap; int flags = BIOSCODE_FLAG | BIOSDATA_FLAG; u_int i, arg_start, arg_end; pt_entry_t *pte; @@ -336,11 +336,11 @@ bios16(struct bios_args *args, char *fmt, ...) */ stack = (caddr_t)PAGE_SIZE - 32; - va_start(ap, fmt); + __va_start(ap, fmt); for (p = fmt; p && *p; p++) { switch (*p) { case 'p': /* 32-bit pointer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); arg_start = min(arg_start, i); arg_end = max(arg_end, i); flags |= BIOSARGS_FLAG; @@ -348,7 +348,7 @@ bios16(struct bios_args *args, char *fmt, ...) break; case 'i': /* 32-bit integer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); stack -= 4; break; @@ -361,7 +361,7 @@ bios16(struct bios_args *args, char *fmt, ...) break; case 's': /* 16-bit integer passed as an int */ - i = va_arg(ap, int); + i = __va_arg(ap, int); stack -= 2; break; @@ -401,18 +401,18 @@ bios16(struct bios_args *args, char *fmt, ...) invltlb(); stack_top = stack; - va_start(ap, fmt); + __va_start(ap, fmt); for (p = fmt; p && *p; p++) { switch (*p) { case 'p': /* 32-bit pointer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); *(u_int *)stack = (i - arg_start) | (GSEL(GBIOSARGS_SEL, SEL_KPL) << 16); stack += 4; break; case 'i': /* 32-bit integer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); *(u_int *)stack = i; stack += 4; break; @@ -433,7 +433,7 @@ bios16(struct bios_args *args, char *fmt, ...) break; case 's': /* 16-bit integer passed as an int */ - i = va_arg(ap, int); + i = __va_arg(ap, int); *(u_short *)stack = i; stack += 2; break; diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h deleted file mode 100644 index 5973295189..0000000000 --- a/sys/i386/include/ansi.h +++ /dev/null @@ -1,150 +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. - * - * @(#)ansi.h 8.2 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/i386/include/ansi.h,v 1.18.2.4 2001/06/03 17:15:54 obrien Exp $ - * $DragonFly: src/sys/i386/include/Attic/ansi.h,v 1.3 2003/08/10 19:10:42 asmodai Exp $ - */ - -#ifndef _MACHINE_ANSI_H_ -#define _MACHINE_ANSI_H_ - -/* - * Types which are fundamental to the implementation and must be declared - * 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_ long /* 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] */ -#define _BSD_VA_LIST_ char * /* va_list */ - -/* - * 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 - * there is no good reason why they should be less accurate. There is - * the bad reason that (broken) programs might not like clock_t or - * CLOCKS_PER_SEC being ``double'' (``unsigned long'' is not large enough - * to hold the required 24 hours worth of ticks if the frequency is - * 1000000ul, and ``unsigned long long'' would be nonstandard). - */ -#define _BSD_CLK_TCK_ 128 -#define _BSD_CLOCKS_PER_SEC_ 128 - -/* - * We define this here since both and needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* - * 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 , since that has too much namespace - * pollution for inclusion in ANSI headers, yet we need __int64_t in at - * least . - */ -#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; - -/* - * 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/db_machdep.h b/sys/i386/include/db_machdep.h index 88dd002b6f..024c1d74b7 100644 --- a/sys/i386/include/db_machdep.h +++ b/sys/i386/include/db_machdep.h @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * $FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/04 13:55:35 marcel Exp $ - * $DragonFly: src/sys/i386/include/Attic/db_machdep.h,v 1.5 2003/11/07 06:00:32 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/db_machdep.h,v 1.6 2003/11/09 02:22:35 dillon Exp $ */ #ifndef _MACHINE_DB_MACHDEP_H_ @@ -37,7 +37,7 @@ #define i386_saved_state trapframe -typedef vm_offset_t db_addr_t; /* address - unsigned */ +typedef __uint32_t db_addr_t; /* address - unsigned */ typedef int db_expr_t; /* expression - signed */ typedef struct i386_saved_state db_regs_t; diff --git a/sys/i386/include/inttypes.h b/sys/i386/include/inttypes.h new file mode 100644 index 0000000000..e65d3d6235 --- /dev/null +++ b/sys/i386/include/inttypes.h @@ -0,0 +1,221 @@ +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * 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 NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $ + * $FreeBSD: src/sys/i386/include/_inttypes.h,v 1.2 2002/06/30 05:48:02 mike Exp $ + * $DragonFly: src/sys/i386/include/Attic/inttypes.h,v 1.1 2003/11/09 02:22:35 dillon Exp $ + */ + +#ifndef _MACHINE_INTTYPES_H_ +#define _MACHINE_INTTYPES_H_ + +/* + * Macros for format specifiers. + */ + +/* fprintf(3) macros for signed integers. */ + +#define PRId8 "d" /* int8_t */ +#define PRId16 "d" /* int16_t */ +#define PRId32 "d" /* int32_t */ +#define PRId64 "lld" /* int64_t */ +#define PRIdLEAST8 "d" /* int_least8_t */ +#define PRIdLEAST16 "d" /* int_least16_t */ +#define PRIdLEAST32 "d" /* int_least32_t */ +#define PRIdLEAST64 "lld" /* int_least64_t */ +#define PRIdFAST8 "d" /* int_fast8_t */ +#define PRIdFAST16 "d" /* int_fast16_t */ +#define PRIdFAST32 "d" /* int_fast32_t */ +#define PRIdFAST64 "lld" /* int_fast64_t */ +#define PRIdMAX "jd" /* intmax_t */ +#define PRIdPTR "d" /* intptr_t */ + +#define PRIi8 "i" /* int8_t */ +#define PRIi16 "i" /* int16_t */ +#define PRIi32 "i" /* int32_t */ +#define PRIi64 "lli" /* int64_t */ +#define PRIiLEAST8 "i" /* int_least8_t */ +#define PRIiLEAST16 "i" /* int_least16_t */ +#define PRIiLEAST32 "i" /* int_least32_t */ +#define PRIiLEAST64 "lli" /* int_least64_t */ +#define PRIiFAST8 "i" /* int_fast8_t */ +#define PRIiFAST16 "i" /* int_fast16_t */ +#define PRIiFAST32 "i" /* int_fast32_t */ +#define PRIiFAST64 "lli" /* int_fast64_t */ +#define PRIiMAX "ji" /* intmax_t */ +#define PRIiPTR "i" /* intptr_t */ + +/* fprintf(3) macros for unsigned integers. */ + +#define PRIo8 "o" /* uint8_t */ +#define PRIo16 "o" /* uint16_t */ +#define PRIo32 "o" /* uint32_t */ +#define PRIo64 "llo" /* uint64_t */ +#define PRIoLEAST8 "o" /* uint_least8_t */ +#define PRIoLEAST16 "o" /* uint_least16_t */ +#define PRIoLEAST32 "o" /* uint_least32_t */ +#define PRIoLEAST64 "llo" /* uint_least64_t */ +#define PRIoFAST8 "o" /* uint_fast8_t */ +#define PRIoFAST16 "o" /* uint_fast16_t */ +#define PRIoFAST32 "o" /* uint_fast32_t */ +#define PRIoFAST64 "llo" /* uint_fast64_t */ +#define PRIoMAX "jo" /* uintmax_t */ +#define PRIoPTR "o" /* uintptr_t */ + +#define PRIu8 "u" /* uint8_t */ +#define PRIu16 "u" /* uint16_t */ +#define PRIu32 "u" /* uint32_t */ +#define PRIu64 "llu" /* uint64_t */ +#define PRIuLEAST8 "u" /* uint_least8_t */ +#define PRIuLEAST16 "u" /* uint_least16_t */ +#define PRIuLEAST32 "u" /* uint_least32_t */ +#define PRIuLEAST64 "llu" /* uint_least64_t */ +#define PRIuFAST8 "u" /* uint_fast8_t */ +#define PRIuFAST16 "u" /* uint_fast16_t */ +#define PRIuFAST32 "u" /* uint_fast32_t */ +#define PRIuFAST64 "llu" /* uint_fast64_t */ +#define PRIuMAX "ju" /* uintmax_t */ +#define PRIuPTR "u" /* uintptr_t */ + +#define PRIx8 "x" /* uint8_t */ +#define PRIx16 "x" /* uint16_t */ +#define PRIx32 "x" /* uint32_t */ +#define PRIx64 "llx" /* uint64_t */ +#define PRIxLEAST8 "x" /* uint_least8_t */ +#define PRIxLEAST16 "x" /* uint_least16_t */ +#define PRIxLEAST32 "x" /* uint_least32_t */ +#define PRIxLEAST64 "llx" /* uint_least64_t */ +#define PRIxFAST8 "x" /* uint_fast8_t */ +#define PRIxFAST16 "x" /* uint_fast16_t */ +#define PRIxFAST32 "x" /* uint_fast32_t */ +#define PRIxFAST64 "llx" /* uint_fast64_t */ +#define PRIxMAX "jx" /* uintmax_t */ +#define PRIxPTR "x" /* uintptr_t */ + +#define PRIX8 "X" /* uint8_t */ +#define PRIX16 "X" /* uint16_t */ +#define PRIX32 "X" /* uint32_t */ +#define PRIX64 "llX" /* uint64_t */ +#define PRIXLEAST8 "X" /* uint_least8_t */ +#define PRIXLEAST16 "X" /* uint_least16_t */ +#define PRIXLEAST32 "X" /* uint_least32_t */ +#define PRIXLEAST64 "llX" /* uint_least64_t */ +#define PRIXFAST8 "X" /* uint_fast8_t */ +#define PRIXFAST16 "X" /* uint_fast16_t */ +#define PRIXFAST32 "X" /* uint_fast32_t */ +#define PRIXFAST64 "llX" /* uint_fast64_t */ +#define PRIXMAX "jX" /* uintmax_t */ +#define PRIXPTR "X" /* uintptr_t */ + +/* fscanf(3) macros for signed integers. */ + +#define SCNd8 "hhd" /* int8_t */ +#define SCNd16 "hd" /* int16_t */ +#define SCNd32 "d" /* int32_t */ +#define SCNd64 "lld" /* int64_t */ +#define SCNdLEAST8 "hhd" /* int_least8_t */ +#define SCNdLEAST16 "hd" /* int_least16_t */ +#define SCNdLEAST32 "d" /* int_least32_t */ +#define SCNdLEAST64 "lld" /* int_least64_t */ +#define SCNdFAST8 "d" /* int_fast8_t */ +#define SCNdFAST16 "d" /* int_fast16_t */ +#define SCNdFAST32 "d" /* int_fast32_t */ +#define SCNdFAST64 "lld" /* int_fast64_t */ +#define SCNdMAX "jd" /* intmax_t */ +#define SCNdPTR "d" /* intptr_t */ + +#define SCNi8 "hhi" /* int8_t */ +#define SCNi16 "hi" /* int16_t */ +#define SCNi32 "i" /* int32_t */ +#define SCNi64 "lli" /* int64_t */ +#define SCNiLEAST8 "hhi" /* int_least8_t */ +#define SCNiLEAST16 "hi" /* int_least16_t */ +#define SCNiLEAST32 "i" /* int_least32_t */ +#define SCNiLEAST64 "lli" /* int_least64_t */ +#define SCNiFAST8 "i" /* int_fast8_t */ +#define SCNiFAST16 "i" /* int_fast16_t */ +#define SCNiFAST32 "i" /* int_fast32_t */ +#define SCNiFAST64 "lli" /* int_fast64_t */ +#define SCNiMAX "ji" /* intmax_t */ +#define SCNiPTR "i" /* intptr_t */ + +/* fscanf(3) macros for unsigned integers. */ + +#define SCNo8 "hho" /* uint8_t */ +#define SCNo16 "ho" /* uint16_t */ +#define SCNo32 "o" /* uint32_t */ +#define SCNo64 "llo" /* uint64_t */ +#define SCNoLEAST8 "hho" /* uint_least8_t */ +#define SCNoLEAST16 "ho" /* uint_least16_t */ +#define SCNoLEAST32 "o" /* uint_least32_t */ +#define SCNoLEAST64 "llo" /* uint_least64_t */ +#define SCNoFAST8 "o" /* uint_fast8_t */ +#define SCNoFAST16 "o" /* uint_fast16_t */ +#define SCNoFAST32 "o" /* uint_fast32_t */ +#define SCNoFAST64 "llo" /* uint_fast64_t */ +#define SCNoMAX "jo" /* uintmax_t */ +#define SCNoPTR "o" /* uintptr_t */ + +#define SCNu8 "hhu" /* uint8_t */ +#define SCNu16 "hu" /* uint16_t */ +#define SCNu32 "u" /* uint32_t */ +#define SCNu64 "llu" /* uint64_t */ +#define SCNuLEAST8 "hhu" /* uint_least8_t */ +#define SCNuLEAST16 "hu" /* uint_least16_t */ +#define SCNuLEAST32 "u" /* uint_least32_t */ +#define SCNuLEAST64 "llu" /* uint_least64_t */ +#define SCNuFAST8 "u" /* uint_fast8_t */ +#define SCNuFAST16 "u" /* uint_fast16_t */ +#define SCNuFAST32 "u" /* uint_fast32_t */ +#define SCNuFAST64 "llu" /* uint_fast64_t */ +#define SCNuMAX "ju" /* uintmax_t */ +#define SCNuPTR "u" /* uintptr_t */ + +#define SCNx8 "hhx" /* uint8_t */ +#define SCNx16 "hx" /* uint16_t */ +#define SCNx32 "x" /* uint32_t */ +#define SCNx64 "llx" /* uint64_t */ +#define SCNxLEAST8 "hhx" /* uint_least8_t */ +#define SCNxLEAST16 "hx" /* uint_least16_t */ +#define SCNxLEAST32 "x" /* uint_least32_t */ +#define SCNxLEAST64 "llx" /* uint_least64_t */ +#define SCNxFAST8 "x" /* uint_fast8_t */ +#define SCNxFAST16 "x" /* uint_fast16_t */ +#define SCNxFAST32 "x" /* uint_fast32_t */ +#define SCNxFAST64 "llx" /* uint_fast64_t */ +#define SCNxMAX "jx" /* uintmax_t */ +#define SCNxPTR "x" /* uintptr_t */ + +#endif /* !_MACHINE_INTTYPES_H_ */ diff --git a/sys/i386/include/stdarg.h b/sys/i386/include/stdarg.h index b2b8e4f434..02c88ebdaf 100644 --- a/sys/i386/include/stdarg.h +++ b/sys/i386/include/stdarg.h @@ -32,29 +32,43 @@ * * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/i386/include/stdarg.h,v 1.10 1999/08/28 00:44:26 peter Exp $ - * $DragonFly: src/sys/i386/include/Attic/stdarg.h,v 1.3 2003/06/28 04:16:03 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/stdarg.h,v 1.4 2003/11/09 02:22:35 dillon Exp $ */ -#if !defined(_STDARG_H_) && !defined(_MACHINE_STDARG_H_) -#define _STDARG_H_ +#ifndef _MACHINE_STDARG_H_ #define _MACHINE_STDARG_H_ -typedef char *va_list; +/* + * GNUC mess + */ +#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 +/* + * Standard va types and macros + */ #define __va_size(type) \ (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) #ifdef __GNUC__ -#define va_start(ap, last) \ - ((ap) = (va_list)__builtin_next_arg(last)) +#define __va_start(ap, last) \ + ((ap) = (__va_list)__builtin_next_arg(last)) #else -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) +#define __va_start(ap, last) \ + ((ap) = (__va_list)&(last) + __va_size(last)) #endif -#define va_arg(ap, type) \ +#define __va_arg(ap, type) \ (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) +#define __va_end(ap) + +#endif -#endif /* !_STDARG_H_ */ diff --git a/sys/i386/include/stdint.h b/sys/i386/include/stdint.h new file mode 100644 index 0000000000..bfd8e8ec95 --- /dev/null +++ b/sys/i386/include/stdint.h @@ -0,0 +1,262 @@ +/*- + * Copyright (c) 2001, 2002 Mike Barcroft + * Copyright (c) 2001 The NetBSD Foundation, Inc. All rights reserved. + * Copyright (c) 1990, 1993 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Klaus Klein. + * + * 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 NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + * + * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.1 2002/07/29 17:41:07 mike Exp $ + * $DragonFly: src/sys/i386/include/Attic/stdint.h,v 1.1 2003/11/09 02:22:35 dillon Exp $ + */ + +#ifndef _MACHINE_STDINT_H_ +#define _MACHINE_STDINT_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; + +/* + * This mess is to override compiler options that might restrict long long + * and for lint which doesn't understand GNUC attributes. + */ +#if defined(lint) +typedef long long __int64_t; +typedef unsigned long long __uint64_t; +#elif defined(__GNUC__) +typedef int __attribute__((__mode__(__DI__))) __int64_t; +typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; +#else +typedef long long __int64_t; +typedef unsigned long long __uint64_t; +#endif + +/* + * 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; + +/* + * Standard type definitions. + */ +typedef __int64_t __intmax_t; +typedef __uint64_t __uintmax_t; + +typedef __int32_t __intptr_t; +typedef __uint32_t __uintptr_t; + +typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ + +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 __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; + +/* + * System types conveniently placed in this header file in order to put them + * in proximity with the limit macros below and for convenient access by + * other include files which need to pick and choose particular types but + * do not wish to overly pollute their namespaces. + */ + +typedef __uint32_t __size_t; +typedef __int32_t __ssize_t; +typedef long __time_t; +typedef int __timer_t; +typedef __int32_t __register_t; +typedef __uint32_t __u_register_t; +typedef __int32_t __sig_atomic_t; +typedef unsigned long __clock_t; +typedef unsigned long __clockid_t; +typedef __uint32_t __socklen_t; + +/* + * Its convenient to put these here rather then create another header file. + */ +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#define __arysize(ary) (sizeof(ary)/sizeof((ary)[0])) + +#endif /* _MACHINE_STDINT_H_ */ + +/* + * OpenGroup stdint.h extensions. Since these are protected by a define we + * do not have to generate __ versions of them. + */ +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) +#ifndef _MACHINE_STDINT_H_STDC_CONSTANT_MACROS_ +#define _MACHINE_STDINT_H_STDC_CONSTANT_MACROS_ + +#define INT8_C(c) (c) +#define INT16_C(c) (c) +#define INT32_C(c) (c) +#define INT64_C(c) (c ## LL) + +#define UINT8_C(c) (c) +#define UINT16_C(c) (c) +#define UINT32_C(c) (c ## U) +#define UINT64_C(c) (c ## ULL) + +#define INTMAX_C(c) (c ## LL) +#define UINTMAX_C(c) (c ## ULL) + +#endif +#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef _MACHINE_STDINT_H_STDC_LIMIT_MAVROS_ +#define _MACHINE_STDINT_H_STDC_LIMIT_MAVROS_ + +/* + * ISO/IEC 9899:1999 + * 7.18.2.1 Limits of exact-width integer types + */ +/* Minimum values of exact-width signed integer types. */ +#define INT8_MIN (-0x7f-1) +#define INT16_MIN (-0x7fff-1) +#define INT32_MIN (-0x7fffffff-1) +#define INT64_MIN (-0x7fffffffffffffffLL-1) + +/* Maximum values of exact-width signed integer types. */ +#define INT8_MAX 0x7f +#define INT16_MAX 0x7fff +#define INT32_MAX 0x7fffffff +#define INT64_MAX 0x7fffffffffffffffLL + +/* Maximum values of exact-width unsigned integer types. */ +#define UINT8_MAX 0xff +#define UINT16_MAX 0xffff +#define UINT32_MAX 0xffffffffU +#define UINT64_MAX 0xffffffffffffffffULL + +/* + * ISO/IEC 9899:1999 + * 7.18.2.4 Limits of integer types capable of holding object pointers + */ +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.5 Limits of greatest-width integer types + */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.3 Limits of other integer types + */ +/* Limits of ptrdiff_t. */ +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX + +/* Limits of sig_atomic_t. */ +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +/* Limit of size_t. */ +#define SIZE_MAX UINT32_MAX + +/* NOTE: wchar and wint macros in sys/stdint.h */ + +/* + * ISO/IEC 9899:1999 + * 7.18.2.2 Limits of minimum-width integer types + */ +/* Minimum values of minimum-width signed integer types. */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +/* Maximum values of minimum-width signed integer types. */ +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +/* Maximum values of minimum-width unsigned integer types. */ +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* + * ISO/IEC 9899:1999 + * 7.18.2.3 Limits of fastest minimum-width integer types + */ +/* Minimum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MIN INT32_MIN +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +/* Maximum values of fastest minimum-width signed integer types. */ +#define INT_FAST8_MAX INT32_MAX +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +/* Maximum values of fastest minimum-width unsigned integer types. */ +#define UINT_FAST8_MAX UINT32_MAX +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +#endif +#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ + diff --git a/sys/i386/include/types.h b/sys/i386/include/types.h index ff931ee5e6..8346289018 100644 --- a/sys/i386/include/types.h +++ b/sys/i386/include/types.h @@ -32,7 +32,7 @@ * * @(#)types.h 8.3 (Berkeley) 1/5/94 * $FreeBSD: src/sys/i386/include/types.h,v 1.19.2.1 2001/03/21 10:50:58 peter Exp $ - * $DragonFly: src/sys/i386/include/Attic/types.h,v 1.7 2003/11/03 22:50:15 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/types.h,v 1.8 2003/11/09 02:22:35 dillon Exp $ */ #ifndef _MACHINE_TYPES_H_ @@ -66,15 +66,14 @@ typedef unsigned int uintfptr_t; /* * MMU page tables */ -typedef __uint32_t pd_entry_t; -typedef __uint32_t pt_entry_t; +typedef __uint32_t pd_entry_t; +typedef __uint32_t pt_entry_t; #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ #define PTESIZE sizeof(pt_entry_t) /* for assembly files */ /* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; -typedef __int64_t intmax_t; -typedef __uint64_t uintmax_t; +typedef __uint32_t intrmask_t; #endif /* !_MACHINE_TYPES_H_ */ + diff --git a/sys/dev/acpica/Osd/OsdStream.c b/sys/i386/include/uvparam.h similarity index 58% copy from sys/dev/acpica/Osd/OsdStream.c copy to sys/i386/include/uvparam.h index 8254ae842a..53f92193c8 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/sys/i386/include/uvparam.h @@ -1,6 +1,5 @@ -/*- - * Copyright (c) 2000 Michael Smith - * Copyright (c) 2000 BSDi +/* + * Copyright (c) 2003 Matthew Dillon * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,29 +23,29 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/Osd/OsdStream.c,v 1.3.4.1 2003/08/22 20:49:21 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdStream.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $DragonFly: src/sys/i386/include/Attic/uvparam.h,v 1.1 2003/11/09 02:22:35 dillon Exp $ */ /* - * 6.6 : Stream I/O + * This header file contains random parameters that other includes may need + * to make user visible. */ -#include "acpi.h" - -void -AcpiOsPrintf (const char *Format, ...) -{ - va_list ap; +#ifndef _MACHINE_UVPARAM_H_ +#define _MACHINE_UVPARAM_H_ - va_start(ap, Format); - vprintf(Format, ap); - va_end(ap); -} +/* + * 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 + * there is no good reason why they should be less accurate. There is + * the bad reason that (broken) programs might not like clock_t or + * CLOCKS_PER_SEC being ``double'' (``unsigned long'' is not large enough + * to hold the required 24 hours worth of ticks if the frequency is + * 1000000ul, and ``unsigned long long'' would be nonstandard). + */ +#define _BSD_CLK_TCK_ 128 +#define _BSD_CLOCKS_PER_SEC_ 128 -void -AcpiOsVprintf (const char *Format, va_list Args) -{ - vprintf(Format, Args); -} +#endif diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 986cdc5cb5..c91d7c0b0c 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_conf.c,v 1.73.2.3 2003/03/10 02:18:25 imp Exp $ - * $DragonFly: src/sys/kern/kern_conf.c,v 1.4 2003/07/22 17:03:33 dillon Exp $ + * $DragonFly: src/sys/kern/kern_conf.c,v 1.5 2003/11/09 02:22:36 dillon Exp $ */ #include @@ -201,15 +201,15 @@ dev_t make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...) { dev_t dev; - va_list ap; + __va_list ap; int i; compile_devsw(devsw); dev = makedev(devsw->d_maj, minor); - va_start(ap, fmt); + __va_start(ap, fmt); i = kvprintf(fmt, NULL, dev->si_name, 32, ap); dev->si_name[i] = '\0'; - va_end(ap); + __va_end(ap); dev->si_devsw = devsw; return (dev); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 80d0b25799..056660ab46 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -37,7 +37,7 @@ * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/kern_shutdown.c,v 1.72.2.12 2002/02/21 19:15:10 dillon Exp $ - * $DragonFly: src/sys/kern/kern_shutdown.c,v 1.12 2003/09/05 17:46:54 hsu Exp $ + * $DragonFly: src/sys/kern/kern_shutdown.c,v 1.13 2003/11/09 02:22:36 dillon Exp $ */ #include "opt_ddb.h" @@ -79,7 +79,8 @@ /* * Note that stdarg.h and the ANSI style va_start macro is used for both - * ANSI and traditional C compilers. + * ANSI and traditional C compilers. We use the machine version to stay + * within the confines of the kernel header files. */ #include @@ -571,7 +572,7 @@ void panic(const char *fmt, ...) { int bootopt, newpanic; - va_list ap; + __va_list ap; static char buf[256]; bootopt = RB_AUTOBOOT | RB_DUMP; @@ -583,11 +584,11 @@ panic(const char *fmt, ...) newpanic = 1; } - va_start(ap, fmt); + __va_start(ap, fmt); (void)vsnprintf(buf, sizeof(buf), fmt, ap); if (panicstr == fmt) panicstr = buf; - va_end(ap); + __va_end(ap); printf("panic: %s\n", buf); #ifdef SMP /* three seperate prints in case of an unmapped page and trap */ diff --git a/sys/kern/lwkt_thread.c b/sys/kern/lwkt_thread.c index 0e8fe802db..2357372e90 100644 --- a/sys/kern/lwkt_thread.c +++ b/sys/kern/lwkt_thread.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/lwkt_thread.c,v 1.40 2003/11/03 02:08:35 dillon Exp $ + * $DragonFly: src/sys/kern/lwkt_thread.c,v 1.41 2003/11/09 02:22:36 dillon Exp $ */ /* @@ -241,11 +241,11 @@ lwkt_init_thread(thread_t td, void *stack, int flags, struct globaldata *gd) void lwkt_set_comm(thread_t td, const char *ctl, ...) { - va_list va; + __va_list va; - va_start(va, ctl); + __va_start(va, ctl); vsnprintf(td->td_comm, sizeof(td->td_comm), ctl, va); - va_end(va); + __va_end(va); } void @@ -1200,7 +1200,7 @@ lwkt_create(void (*func)(void *), void *arg, const char *fmt, ...) { thread_t td; - va_list ap; + __va_list ap; td = lwkt_alloc_thread(template, cpu); if (tdp) @@ -1214,9 +1214,9 @@ lwkt_create(void (*func)(void *), void *arg, /* * Set up arg0 for 'ps' etc */ - va_start(ap, fmt); + __va_start(ap, fmt); vsnprintf(td->td_comm, sizeof(td->td_comm), fmt, ap); - va_end(ap); + __va_end(ap); /* * Schedule the thread to run @@ -1260,7 +1260,7 @@ kthread_create(void (*func)(void *), void *arg, struct thread **tdp, const char *fmt, ...) { thread_t td; - va_list ap; + __va_list ap; td = lwkt_alloc_thread(NULL, -1); if (tdp) @@ -1274,9 +1274,9 @@ kthread_create(void (*func)(void *), void *arg, /* * Set up arg0 for 'ps' etc */ - va_start(ap, fmt); + __va_start(ap, fmt); vsnprintf(td->td_comm, sizeof(td->td_comm), fmt, ap); - va_end(ap); + __va_end(ap); /* * Schedule the thread to run diff --git a/sys/kern/subr_blist.c b/sys/kern/subr_blist.c index 2a185ef103..8158afd682 100644 --- a/sys/kern/subr_blist.c +++ b/sys/kern/subr_blist.c @@ -61,7 +61,7 @@ * This code can be compiled stand-alone for debugging. * * $FreeBSD: src/sys/kern/subr_blist.c,v 1.5.2.2 2003/01/12 09:23:12 dillon Exp $ - * $DragonFly: src/sys/kern/subr_blist.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/subr_blist.c,v 1.3 2003/11/09 02:22:36 dillon Exp $ */ #ifdef _KERNEL @@ -915,12 +915,12 @@ main(int ac, char **av) void panic(const char *ctl, ...) { - va_list va; + __va_list va; - va_start(va, ctl); + __va_start(va, ctl); vfprintf(stderr, ctl, va); fprintf(stderr, "\n"); - va_end(va); + __va_end(va); exit(1); } diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index dac3263244..a33e8426c8 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_bus.c,v 1.54.2.9 2002/10/10 15:13:32 jhb Exp $ - * $DragonFly: src/sys/kern/subr_bus.c,v 1.3 2003/07/06 21:23:51 dillon Exp $ + * $DragonFly: src/sys/kern/subr_bus.c,v 1.4 2003/11/09 02:22:36 dillon Exp $ */ #include "opt_bus.h" @@ -920,13 +920,13 @@ device_print_prettyname(device_t dev) int device_printf(device_t dev, const char * fmt, ...) { - va_list ap; + __va_list ap; int retval; retval = device_print_prettyname(dev); - va_start(ap, fmt); + __va_start(ap, fmt); retval += vprintf(fmt, ap); - va_end(ap); + __va_end(ap); return retval; } diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 87bac74a1e..1d9ccb8989 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -37,7 +37,7 @@ * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/subr_prf.c,v 1.61.2.5 2002/08/31 18:22:08 dwmalone Exp $ - * $DragonFly: src/sys/kern/subr_prf.c,v 1.6 2003/08/26 21:09:02 rob Exp $ + * $DragonFly: src/sys/kern/subr_prf.c,v 1.7 2003/11/09 02:22:36 dillon Exp $ */ #include @@ -56,7 +56,8 @@ /* * Note that stdarg.h and the ANSI style va_start macro is used for both - * ANSI and traditional C compilers. + * ANSI and traditional C compilers. We use the __ machine version to stay + * within the kernel header file set. */ #include @@ -118,18 +119,18 @@ int uprintf(const char *fmt, ...) { struct proc *p = curproc; - va_list ap; + __va_list ap; struct putchar_arg pca; int retval = 0; if (p && p->p_flag & P_CONTROLT && p->p_session->s_ttyvp) { - va_start(ap, fmt); + __va_start(ap, fmt); pca.tty = p->p_session->s_ttyp; pca.flags = TOTTY; retval = kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + __va_end(ap); } return retval; } @@ -162,7 +163,7 @@ tprintf(tpr_t tpr, const char *fmt, ...) struct session *sess = (struct session *)tpr; struct tty *tp = NULL; int flags = TOLOG; - va_list ap; + __va_list ap; struct putchar_arg pca; int retval; @@ -170,12 +171,12 @@ tprintf(tpr_t tpr, const char *fmt, ...) flags |= TOTTY; tp = sess->s_ttyp; } - va_start(ap, fmt); + __va_start(ap, fmt); pca.tty = tp; pca.flags = flags; pca.pri = LOG_INFO; retval = kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + __va_end(ap); msgbuftrigger = 1; return retval; } @@ -188,15 +189,15 @@ tprintf(tpr_t tpr, const char *fmt, ...) int ttyprintf(struct tty *tp, const char *fmt, ...) { - va_list ap; + __va_list ap; struct putchar_arg pca; int retval; - va_start(ap, fmt); + __va_start(ap, fmt); pca.tty = tp; pca.flags = TOTTY; retval = kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + __va_end(ap); return retval; } @@ -208,7 +209,7 @@ ttyprintf(struct tty *tp, const char *fmt, ...) int log(int level, const char *fmt, ...) { - va_list ap; + __va_list ap; int retval; struct putchar_arg pca; @@ -216,9 +217,9 @@ log(int level, const char *fmt, ...) pca.pri = level; pca.flags = log_open ? TOLOG : TOCONS; - va_start(ap, fmt); + __va_start(ap, fmt); retval = kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + __va_end(ap); msgbuftrigger = 1; return (retval); @@ -227,7 +228,7 @@ log(int level, const char *fmt, ...) int addlog(const char *fmt, ...) { - va_list ap; + __va_list ap; int retval; struct putchar_arg pca; @@ -235,9 +236,9 @@ addlog(const char *fmt, ...) pca.pri = -1; pca.flags = log_open ? TOLOG : TOCONS; - va_start(ap, fmt); + __va_start(ap, fmt); retval = kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + __va_end(ap); msgbuftrigger = 1; return (retval); @@ -291,21 +292,21 @@ log_console(struct uio *uio) int printf(const char *fmt, ...) { - va_list ap; + __va_list ap; int savintr; struct putchar_arg pca; int retval; savintr = consintr; /* disable interrupts */ consintr = 0; - va_start(ap, fmt); + __va_start(ap, fmt); pca.tty = NULL; pca.flags = TOCONS | TOLOG; pca.pri = -1; cons_lock(); retval = kvprintf(fmt, putchar, &pca, 10, ap); cons_unlock(); - va_end(ap); + __va_end(ap); if (!panicstr) msgbuftrigger = 1; consintr = savintr; /* reenable interrupts */ @@ -313,7 +314,7 @@ printf(const char *fmt, ...) } int -vprintf(const char *fmt, va_list ap) +vprintf(const char *fmt, __va_list ap) { int savintr; struct putchar_arg pca; @@ -366,12 +367,12 @@ int sprintf(char *buf, const char *cfmt, ...) { int retval; - va_list ap; + __va_list ap; - va_start(ap, cfmt); + __va_start(ap, cfmt); retval = kvprintf(cfmt, NULL, (void *)buf, 10, ap); buf[retval] = '\0'; - va_end(ap); + __va_end(ap); return retval; } @@ -379,7 +380,7 @@ sprintf(char *buf, const char *cfmt, ...) * Scaled down version of vsprintf(3). */ int -vsprintf(char *buf, const char *cfmt, va_list ap) +vsprintf(char *buf, const char *cfmt, __va_list ap) { int retval; @@ -395,11 +396,11 @@ int snprintf(char *str, size_t size, const char *format, ...) { int retval; - va_list ap; + __va_list ap; - va_start(ap, format); + __va_start(ap, format); retval = vsnprintf(str, size, format, ap); - va_end(ap); + __va_end(ap); return(retval); } @@ -407,7 +408,7 @@ snprintf(char *str, size_t size, const char *format, ...) * Scaled down version of vsnprintf(3). */ int -vsnprintf(char *str, size_t size, const char *format, va_list ap) +vsnprintf(char *str, size_t size, const char *format, __va_list ap) { struct snprintf_arg info; int retval; @@ -500,7 +501,7 @@ ksprintqn(nbuf, uq, base, lenp) * ("%*D", len, ptr, " " -> XX XX XX XX ... */ int -kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_list ap) +kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, __va_list ap) { #define PCHAR(c) {int cc=(c); if (func) (*func)(cc,arg); else *d++ = cc; retval++; } char nbuf[MAXNBUF]; @@ -555,13 +556,13 @@ reswitch: switch (ch = (u_char)*fmt++) { break; case '*': if (!dot) { - width = va_arg(ap, int); + width = __va_arg(ap, int); if (width < 0) { ladjust = !ladjust; width = -width; } } else { - dwidth = va_arg(ap, int); + dwidth = __va_arg(ap, int); } goto reswitch; case '0': @@ -583,8 +584,8 @@ reswitch: switch (ch = (u_char)*fmt++) { width = n; goto reswitch; case 'b': - ul = va_arg(ap, int); - p = va_arg(ap, char *); + ul = __va_arg(ap, int); + p = __va_arg(ap, char *); for (q = ksprintn(nbuf, ul, *p++, NULL); *q;) PCHAR(*q--); @@ -606,11 +607,11 @@ reswitch: switch (ch = (u_char)*fmt++) { PCHAR('>'); break; case 'c': - PCHAR(va_arg(ap, int)); + PCHAR(__va_arg(ap, int)); break; case 'D': - up = va_arg(ap, u_char *); - p = va_arg(ap, char *); + up = __va_arg(ap, u_char *); + p = __va_arg(ap, char *); if (!width) width = 16; while(width--) { @@ -624,11 +625,11 @@ reswitch: switch (ch = (u_char)*fmt++) { break; case 'd': if (qflag) - uq = va_arg(ap, quad_t); + uq = __va_arg(ap, quad_t); else if (lflag) - ul = va_arg(ap, long); + ul = __va_arg(ap, long); else - ul = va_arg(ap, int); + ul = __va_arg(ap, int); sign = 1; base = 10; goto number; @@ -641,15 +642,15 @@ reswitch: switch (ch = (u_char)*fmt++) { goto reswitch; case 'o': if (qflag) - uq = va_arg(ap, u_quad_t); + uq = __va_arg(ap, u_quad_t); else if (lflag) - ul = va_arg(ap, u_long); + ul = __va_arg(ap, u_long); else - ul = va_arg(ap, u_int); + ul = __va_arg(ap, u_int); base = 8; goto nosign; case 'p': - ul = (uintptr_t)va_arg(ap, void *); + ul = (uintptr_t)__va_arg(ap, void *); base = 16; sharpflag = (width == 0); goto nosign; @@ -659,16 +660,16 @@ reswitch: switch (ch = (u_char)*fmt++) { case 'n': case 'r': if (qflag) - uq = va_arg(ap, u_quad_t); + uq = __va_arg(ap, u_quad_t); else if (lflag) - ul = va_arg(ap, u_long); + ul = __va_arg(ap, u_long); else ul = sign ? - (u_long)va_arg(ap, int) : va_arg(ap, u_int); + (u_long)__va_arg(ap, int) : __va_arg(ap, u_int); base = radix; goto number; case 's': - p = va_arg(ap, char *); + p = __va_arg(ap, char *); if (p == NULL) p = "(null)"; if (!dot) @@ -690,31 +691,31 @@ reswitch: switch (ch = (u_char)*fmt++) { break; case 'u': if (qflag) - uq = va_arg(ap, u_quad_t); + uq = __va_arg(ap, u_quad_t); else if (lflag) - ul = va_arg(ap, u_long); + ul = __va_arg(ap, u_long); else - ul = va_arg(ap, u_int); + ul = __va_arg(ap, u_int); base = 10; goto nosign; case 'x': case 'X': if (qflag) - uq = va_arg(ap, u_quad_t); + uq = __va_arg(ap, u_quad_t); else if (lflag) - ul = va_arg(ap, u_long); + ul = __va_arg(ap, u_long); else - ul = va_arg(ap, u_int); + ul = __va_arg(ap, u_int); base = 16; goto nosign; case 'z': if (qflag) - uq = va_arg(ap, u_quad_t); + uq = __va_arg(ap, u_quad_t); else if (lflag) - ul = va_arg(ap, u_long); + ul = __va_arg(ap, u_long); else ul = sign ? - (u_long)va_arg(ap, int) : va_arg(ap, u_int); + (u_long)__va_arg(ap, int) : __va_arg(ap, u_int); base = 16; goto number; nosign: sign = 0; diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index eb37352535..d87036df1a 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_sbuf.c,v 1.11.2.2 2002/03/12 01:01:07 archie Exp $ - * $DragonFly: src/sys/kern/subr_sbuf.c,v 1.3 2003/07/29 21:30:02 hmp Exp $ + * $DragonFly: src/sys/kern/subr_sbuf.c,v 1.4 2003/11/09 02:22:36 dillon Exp $ */ #include @@ -397,7 +397,7 @@ sbuf_cpy(struct sbuf *s, const char *str) * Format the given argument list and append the resulting string to an sbuf. */ int -sbuf_vprintf(struct sbuf *s, const char *fmt, va_list ap) +sbuf_vprintf(struct sbuf *s, const char *fmt, __va_list ap) { int len; @@ -443,12 +443,12 @@ sbuf_vprintf(struct sbuf *s, const char *fmt, va_list ap) int sbuf_printf(struct sbuf *s, const char *fmt, ...) { - va_list ap; + __va_list ap; int result; - va_start(ap, fmt); + __va_start(ap, fmt); result = sbuf_vprintf(s, fmt, ap); - va_end(ap); + __va_end(ap); return(result); } diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c index fa15c2b68f..d74e5c7f86 100644 --- a/sys/kern/subr_scanf.c +++ b/sys/kern/subr_scanf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_scanf.c,v 1.13 1999/11/24 01:03:01 archie Exp $ - * $DragonFly: src/sys/kern/subr_scanf.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/subr_scanf.c,v 1.3 2003/11/09 02:22:36 dillon Exp $ * From: Id: vfscanf.c,v 1.13 1998/09/25 12:20:27 obrien Exp * From: static char sccsid[] = "@(#)strtol.c 8.1 (Berkeley) 6/4/93"; * From: static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; @@ -91,17 +91,17 @@ static const u_char *__sccl(char *, const u_char *); int sscanf(const char *ibuf, const char *fmt, ...) { - va_list ap; + __va_list ap; int ret; - va_start(ap, fmt); + __va_start(ap, fmt); ret = vsscanf(ibuf, fmt, ap); - va_end(ap); + __va_end(ap); return(ret); } int -vsscanf(const char *inp, char const *fmt0, va_list ap) +vsscanf(const char *inp, char const *fmt0, __va_list ap) { int inr; const u_char *fmt = (const u_char *)fmt0; @@ -239,13 +239,13 @@ literal: if (flags & SUPPRESS) /* ??? */ continue; if (flags & SHORT) - *va_arg(ap, short *) = nread; + *__va_arg(ap, short *) = nread; else if (flags & LONG) - *va_arg(ap, long *) = nread; + *__va_arg(ap, long *) = nread; else if (flags & QUAD) - *va_arg(ap, quad_t *) = nread; + *__va_arg(ap, quad_t *) = nread; else - *va_arg(ap, int *) = nread; + *__va_arg(ap, int *) = nread; continue; } @@ -302,7 +302,7 @@ literal: } nread += sum; } else { - bcopy(inp, va_arg(ap, char *), width); + bcopy(inp, __va_arg(ap, char *), width); inr -= width; inp += width; nread += width; @@ -331,7 +331,7 @@ literal: if (n == 0) goto match_failure; } else { - p0 = p = va_arg(ap, char *); + p0 = p = __va_arg(ap, char *); while (ccltab[(unsigned char)*inp]) { inr--; *p++ = *inp++; @@ -368,7 +368,7 @@ literal: } nread += n; } else { - p0 = p = va_arg(ap, char *); + p0 = p = __va_arg(ap, char *); while (!isspace(*inp)) { inr--; *p++ = *inp++; @@ -511,16 +511,16 @@ literal: *p = 0; res = (*ccfn)(buf, (char **)NULL, base); if (flags & POINTER) - *va_arg(ap, void **) = + *__va_arg(ap, void **) = (void *)(uintptr_t)res; else if (flags & SHORT) - *va_arg(ap, short *) = res; + *__va_arg(ap, short *) = res; else if (flags & LONG) - *va_arg(ap, long *) = res; + *__va_arg(ap, long *) = res; else if (flags & QUAD) - *va_arg(ap, quad_t *) = res; + *__va_arg(ap, quad_t *) = res; else - *va_arg(ap, int *) = res; + *__va_arg(ap, int *) = res; nassigned++; } nread += p - buf; diff --git a/sys/net/if.c b/sys/net/if.c index 729689b0ec..8581a9d5a5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -32,7 +32,7 @@ * * @(#)if.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/net/if.c,v 1.85.2.23 2003/04/15 18:11:19 fjoe Exp $ - * $DragonFly: src/sys/net/if.c,v 1.8 2003/09/14 16:35:58 dillon Exp $ + * $DragonFly: src/sys/net/if.c,v 1.9 2003/11/09 02:22:36 dillon Exp $ */ #include "opt_compat.h" @@ -1650,13 +1650,13 @@ ifmaof_ifpforaddr(sa, ifp) int if_printf(struct ifnet *ifp, const char *fmt, ...) { - va_list ap; + __va_list ap; int retval; retval = printf("%s%d: ", ifp->if_name, ifp->if_unit); - va_start(ap, fmt); + __va_start(ap, fmt); retval += vprintf(fmt, ap); - va_end(ap); + __va_end(ap); return (retval); } diff --git a/sys/net/sppp/if_spppsubr.c b/sys/net/sppp/if_spppsubr.c index 349c765f64..eeb45d1de2 100644 --- a/sys/net/sppp/if_spppsubr.c +++ b/sys/net/sppp/if_spppsubr.c @@ -18,7 +18,7 @@ * From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997 * * $FreeBSD: src/sys/net/if_spppsubr.c,v 1.59.2.13 2002/07/03 15:44:41 joerg Exp $ - * $DragonFly: src/sys/net/sppp/if_spppsubr.c,v 1.5 2003/09/15 23:38:14 hsu Exp $ + * $DragonFly: src/sys/net/sppp/if_spppsubr.c,v 1.6 2003/11/09 02:22:36 dillon Exp $ */ #include @@ -4614,7 +4614,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, int len; unsigned int mlen; const char *msg; - va_list ap; + __va_list ap; MGETHDR (m, M_DONTWAIT, MT_DATA); if (! m) @@ -4631,14 +4631,14 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, lh->ident = id; p = (u_char*) (lh+1); - va_start(ap, id); + __va_start(ap, id); len = 0; - while ((mlen = (unsigned int)va_arg(ap, size_t)) != 0) { - msg = va_arg(ap, const char *); + while ((mlen = (unsigned int)__va_arg(ap, size_t)) != 0) { + msg = __va_arg(ap, const char *); len += mlen; if (len > MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN) { - va_end(ap); + __va_end(ap); m_freem(m); return; } @@ -4646,7 +4646,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, bcopy(msg, p, mlen); p += mlen; } - va_end(ap); + __va_end(ap); m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + LCP_HEADER_LEN + len; lh->len = htons (LCP_HEADER_LEN + len); diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index c924a4c8fd..a1daa0ef92 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet6/raw_ip6.c,v 1.7.2.7 2003/01/24 05:11:35 sam Exp $ - * $DragonFly: src/sys/netinet6/raw_ip6.c,v 1.8 2003/08/23 11:02:46 rob Exp $ + * $DragonFly: src/sys/netinet6/raw_ip6.c,v 1.9 2003/11/09 02:22:36 dillon Exp $ */ /* @@ -313,13 +313,7 @@ rip6_ctlinput(cmd, sa, d) * Tack on options user may have setup with control call. */ int -#if __STDC__ rip6_output(struct mbuf *m, ...) -#else -rip6_output(m, va_alist) - struct mbuf *m; - va_dcl -#endif { struct socket *so; struct sockaddr_in6 *dstsock; @@ -333,13 +327,13 @@ rip6_output(m, va_alist) struct ifnet *oifp = NULL; int type = 0, code = 0; /* for ICMPv6 output statistics only */ int priv = 0; - va_list ap; + __va_list ap; - va_start(ap, m); - so = va_arg(ap, struct socket *); - dstsock = va_arg(ap, struct sockaddr_in6 *); - control = va_arg(ap, struct mbuf *); - va_end(ap); + __va_start(ap, m); + so = __va_arg(ap, struct socket *); + dstsock = __va_arg(ap, struct sockaddr_in6 *); + control = __va_arg(ap, struct mbuf *); + __va_end(ap); in6p = sotoin6pcb(so); diff --git a/sys/netproto/ipsec/ipsec_input.c b/sys/netproto/ipsec/ipsec_input.c index a82312df31..db28ecdd96 100644 --- a/sys/netproto/ipsec/ipsec_input.c +++ b/sys/netproto/ipsec/ipsec_input.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netipsec/ipsec_input.c,v 1.2.4.2 2003/03/28 20:32:53 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/ipsec_input.c,v 1.3 2003/08/07 21:17:37 dillon Exp $ */ +/* $DragonFly: src/sys/netproto/ipsec/ipsec_input.c,v 1.4 2003/11/09 02:22:36 dillon Exp $ */ /* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -225,13 +225,13 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) int ipsec4_common_input(struct mbuf *m, ...) { - va_list ap; + __va_list ap; int off, nxt; - va_start(ap, m); - off = va_arg(ap, int); - nxt = va_arg(ap, int); - va_end(ap); + __va_start(ap, m); + off = __va_arg(ap, int); + nxt = __va_arg(ap, int); + __va_end(ap); return ipsec_common_input(m, off, offsetof(struct ip, ip_p), AF_INET, nxt); diff --git a/sys/netproto/ipsec/key.c b/sys/netproto/ipsec/key.c index 57b17d3346..16b206ae2a 100644 --- a/sys/netproto/ipsec/key.c +++ b/sys/netproto/ipsec/key.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.1 2003/01/24 05:11:35 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/key.c,v 1.4 2003/08/23 10:06:23 rob Exp $ */ +/* $DragonFly: src/sys/netproto/ipsec/key.c,v 1.5 2003/11/09 02:22:36 dillon Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ /* @@ -1587,19 +1587,10 @@ key_sp2msg(sp) /* m will not be freed nor modified */ static struct mbuf * -#ifdef __STDC__ key_gather_mbuf(struct mbuf *m, const struct sadb_msghdr *mhp, int ndeep, int nitem, ...) -#else -key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) - struct mbuf *m; - const struct sadb_msghdr *mhp; - int ndeep; - int nitem; - va_dcl -#endif { - va_list ap; + __va_list ap; int idx; int i; struct mbuf *result = NULL, *n; @@ -1608,9 +1599,9 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) if (m == NULL || mhp == NULL) panic("null pointer passed to key_gather"); - va_start(ap, nitem); + __va_start(ap, nitem); for (i = 0; i < nitem; i++) { - idx = va_arg(ap, int); + idx = __va_arg(ap, int); if (idx < 0 || idx > SADB_EXT_MAX) goto fail; /* don't attempt to pull empty extension */ @@ -1655,7 +1646,7 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) else result = n; } - va_end(ap); + __va_end(ap); if ((result->m_flags & M_PKTHDR) != 0) { result->m_pkthdr.len = 0; diff --git a/sys/netproto/ipsec/keysock.c b/sys/netproto/ipsec/keysock.c index 5bad379dec..9c7a42f644 100644 --- a/sys/netproto/ipsec/keysock.c +++ b/sys/netproto/ipsec/keysock.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/keysock.c,v 1.4 2003/08/23 10:06:23 rob Exp $ */ +/* $DragonFly: src/sys/netproto/ipsec/keysock.c,v 1.5 2003/11/09 02:22:36 dillon Exp $ */ /* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */ /* @@ -78,23 +78,17 @@ struct pfkeystat pfkeystat; * key_output() */ int -#if __STDC__ key_output(struct mbuf *m, ...) -#else -key_output(m, va_alist) - struct mbuf *m; - va_dcl -#endif { struct sadb_msg *msg; int len, error = 0; int s; struct socket *so; - va_list ap; + __va_list ap; - va_start(ap, m); - so = va_arg(ap, struct socket *); - va_end(ap); + __va_start(ap, m); + so = __va_arg(ap, struct socket *); + __va_end(ap); if (m == 0) panic("key_output: NULL pointer was passed.\n"); diff --git a/sys/netproto/ipsec/xform_ipip.c b/sys/netproto/ipsec/xform_ipip.c index f77d853f13..6c7b218422 100644 --- a/sys/netproto/ipsec/xform_ipip.c +++ b/sys/netproto/ipsec/xform_ipip.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netipsec/xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/xform_ipip.c,v 1.4 2003/08/07 21:17:37 dillon Exp $ */ +/* $DragonFly: src/sys/netproto/ipsec/xform_ipip.c,v 1.5 2003/11/09 02:22:36 dillon Exp $ */ /* $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -135,7 +135,7 @@ ip4_input6(struct mbuf **m, int *offp, int proto) void ip4_input(struct mbuf *m, ...) { - va_list ap; + __va_list ap; int iphlen; #if 0 @@ -147,9 +147,9 @@ ip4_input(struct mbuf *m, ...) return; } #endif - va_start(ap, m); - iphlen = va_arg(ap, int); - va_end(ap); + __va_start(ap, m); + iphlen = __va_arg(ap, int); + __va_end(ap); _ipip_input(m, iphlen, NULL); } diff --git a/sys/netproto/key/key.c b/sys/netproto/key/key.c index 9ca6e8b00d..a3d5ffbddf 100644 --- a/sys/netproto/key/key.c +++ b/sys/netproto/key/key.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netkey/key.c,v 1.16.2.13 2002/07/24 18:17:40 ume Exp $ */ -/* $DragonFly: src/sys/netproto/key/key.c,v 1.4 2003/08/23 10:06:24 rob Exp $ */ +/* $DragonFly: src/sys/netproto/key/key.c,v 1.5 2003/11/09 02:22:37 dillon Exp $ */ /* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */ /* @@ -1624,19 +1624,10 @@ key_sp2msg(sp) /* m will not be freed nor modified */ static struct mbuf * -#ifdef __STDC__ key_gather_mbuf(struct mbuf *m, const struct sadb_msghdr *mhp, int ndeep, int nitem, ...) -#else -key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) - struct mbuf *m; - const struct sadb_msghdr *mhp; - int ndeep; - int nitem; - va_dcl -#endif { - va_list ap; + __va_list ap; int idx; int i; struct mbuf *result = NULL, *n; @@ -1645,9 +1636,9 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) if (m == NULL || mhp == NULL) panic("null pointer passed to key_gather"); - va_start(ap, nitem); + __va_start(ap, nitem); for (i = 0; i < nitem; i++) { - idx = va_arg(ap, int); + idx = __va_arg(ap, int); if (idx < 0 || idx > SADB_EXT_MAX) goto fail; /* don't attempt to pull empty extension */ @@ -1692,7 +1683,7 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) else result = n; } - va_end(ap); + __va_end(ap); if ((result->m_flags & M_PKTHDR) != 0) { result->m_pkthdr.len = 0; diff --git a/sys/netproto/key/keysock.c b/sys/netproto/key/keysock.c index ddf178a5c8..3edfcd1378 100644 --- a/sys/netproto/key/keysock.c +++ b/sys/netproto/key/keysock.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netkey/keysock.c,v 1.1.2.4 2003/01/11 19:10:59 ume Exp $ */ -/* $DragonFly: src/sys/netproto/key/keysock.c,v 1.6 2003/08/23 10:06:24 rob Exp $ */ +/* $DragonFly: src/sys/netproto/key/keysock.c,v 1.7 2003/11/09 02:22:37 dillon Exp $ */ /* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */ /* @@ -73,23 +73,17 @@ struct pfkeystat pfkeystat; * key_output() */ int -#if __STDC__ key_output(struct mbuf *m, ...) -#else -key_output(m, va_alist) - struct mbuf *m; - va_dcl -#endif { struct sadb_msg *msg; int len, error = 0; int s; struct socket *so; - va_list ap; + __va_list ap; - va_start(ap, m); - so = va_arg(ap, struct socket *); - va_end(ap); + __va_start(ap, m); + so = __va_arg(ap, struct socket *); + __va_end(ap); if (m == 0) panic("key_output: NULL pointer was passed.\n"); diff --git a/sys/netproto/smb/smb_subr.c b/sys/netproto/smb/smb_subr.c index 02d3ab5623..d315f08167 100644 --- a/sys/netproto/smb/smb_subr.c +++ b/sys/netproto/smb/smb_subr.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_subr.c,v 1.1.2.2 2001/09/03 08:55:11 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_subr.c,v 1.8 2003/08/07 21:17:39 dillon Exp $ + * $DragonFly: src/sys/netproto/smb/smb_subr.c,v 1.9 2003/11/09 02:22:37 dillon Exp $ */ #include #include @@ -391,7 +391,7 @@ kthread_create2(void (*func)(void *), void *arg, struct proc **newpp, int flags, const char *fmt, ...) { int error; - va_list ap; + __va_list ap; struct proc *p2; if (!proc0.p_stats || proc0.p_stats->p_start.tv_sec == 0) { @@ -412,9 +412,9 @@ kthread_create2(void (*func)(void *), void *arg, PHOLD(p2); /* set up arg0 for 'ps', et al */ - va_start(ap, fmt); + __va_start(ap, fmt); vsnprintf(p2->p_comm, sizeof(p2->p_comm), fmt, ap); - va_end(ap); + __va_end(ap); /* call the processes' main()... */ cpu_set_fork_handler(p2, func, arg); diff --git a/sys/platform/pc32/boot/dosboot/types.h b/sys/platform/pc32/boot/dosboot/types.h index 8016ba5e09..2de2d8b0ec 100644 --- a/sys/platform/pc32/boot/dosboot/types.h +++ b/sys/platform/pc32/boot/dosboot/types.h @@ -37,7 +37,7 @@ * * @(#)types.h 8.4 (Berkeley) 1/21/94 * $FreeBSD: src/sys/i386/boot/dosboot/types.h,v 1.6 1999/12/29 04:32:52 peter Exp $ - * $DragonFly: src/sys/platform/pc32/boot/dosboot/Attic/types.h,v 1.3 2003/08/26 21:42:17 rob Exp $ + * $DragonFly: src/sys/platform/pc32/boot/dosboot/Attic/types.h,v 1.4 2003/11/09 02:22:35 dillon Exp $ */ #ifndef _SYS_TYPES_H_ @@ -101,28 +101,12 @@ __END_DECLS #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) /* create dev_t */ #endif -#include "ansi.h" -/*#include */ +#include "stdint.h" -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ -#endif - -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ -#endif - -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ -#endif - -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ -#endif +typedef __clock_t clock_t; +typedef __size_t size_t; +typedef __ssize_t ssize_t; +typedef __time_t time_t; #ifndef _POSIX_SOURCE #define NBBY 8 /* number of bits in a byte */ diff --git a/sys/platform/pc32/i386/bios.c b/sys/platform/pc32/i386/bios.c index 55dad4461e..a95ad4c522 100644 --- a/sys/platform/pc32/i386/bios.c +++ b/sys/platform/pc32/i386/bios.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/bios.c,v 1.29.2.3 2001/07/19 18:07:35 imp Exp $ - * $DragonFly: src/sys/platform/pc32/i386/bios.c,v 1.7 2003/11/08 02:55:17 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/bios.c,v 1.8 2003/11/09 02:22:35 dillon Exp $ */ /* @@ -317,7 +317,7 @@ int bios16(struct bios_args *args, char *fmt, ...) { char *p, *stack, *stack_top; - va_list ap; + __va_list ap; int flags = BIOSCODE_FLAG | BIOSDATA_FLAG; u_int i, arg_start, arg_end; pt_entry_t *pte; @@ -336,11 +336,11 @@ bios16(struct bios_args *args, char *fmt, ...) */ stack = (caddr_t)PAGE_SIZE - 32; - va_start(ap, fmt); + __va_start(ap, fmt); for (p = fmt; p && *p; p++) { switch (*p) { case 'p': /* 32-bit pointer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); arg_start = min(arg_start, i); arg_end = max(arg_end, i); flags |= BIOSARGS_FLAG; @@ -348,7 +348,7 @@ bios16(struct bios_args *args, char *fmt, ...) break; case 'i': /* 32-bit integer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); stack -= 4; break; @@ -361,7 +361,7 @@ bios16(struct bios_args *args, char *fmt, ...) break; case 's': /* 16-bit integer passed as an int */ - i = va_arg(ap, int); + i = __va_arg(ap, int); stack -= 2; break; @@ -401,18 +401,18 @@ bios16(struct bios_args *args, char *fmt, ...) invltlb(); stack_top = stack; - va_start(ap, fmt); + __va_start(ap, fmt); for (p = fmt; p && *p; p++) { switch (*p) { case 'p': /* 32-bit pointer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); *(u_int *)stack = (i - arg_start) | (GSEL(GBIOSARGS_SEL, SEL_KPL) << 16); stack += 4; break; case 'i': /* 32-bit integer */ - i = va_arg(ap, u_int); + i = __va_arg(ap, u_int); *(u_int *)stack = i; stack += 4; break; @@ -433,7 +433,7 @@ bios16(struct bios_args *args, char *fmt, ...) break; case 's': /* 16-bit integer passed as an int */ - i = va_arg(ap, int); + i = __va_arg(ap, int); *(u_short *)stack = i; stack += 2; break; diff --git a/sys/platform/pc32/include/ansi.h b/sys/platform/pc32/include/ansi.h deleted file mode 100644 index 0810dfc991..0000000000 --- a/sys/platform/pc32/include/ansi.h +++ /dev/null @@ -1,150 +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. - * - * @(#)ansi.h 8.2 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/i386/include/ansi.h,v 1.18.2.4 2001/06/03 17:15:54 obrien Exp $ - * $DragonFly: src/sys/platform/pc32/include/Attic/ansi.h,v 1.3 2003/08/10 19:10:42 asmodai Exp $ - */ - -#ifndef _MACHINE_ANSI_H_ -#define _MACHINE_ANSI_H_ - -/* - * Types which are fundamental to the implementation and must be declared - * 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_ long /* 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] */ -#define _BSD_VA_LIST_ char * /* va_list */ - -/* - * 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 - * there is no good reason why they should be less accurate. There is - * the bad reason that (broken) programs might not like clock_t or - * CLOCKS_PER_SEC being ``double'' (``unsigned long'' is not large enough - * to hold the required 24 hours worth of ticks if the frequency is - * 1000000ul, and ``unsigned long long'' would be nonstandard). - */ -#define _BSD_CLK_TCK_ 128 -#define _BSD_CLOCKS_PER_SEC_ 128 - -/* - * We define this here since both and needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* - * 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 , since that has too much namespace - * pollution for inclusion in ANSI headers, yet we need __int64_t in at - * least . - */ -#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; - -/* - * 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/dev/acpica/Osd/OsdStream.c b/sys/platform/pc32/include/uvparam.h similarity index 58% copy from sys/dev/acpica/Osd/OsdStream.c copy to sys/platform/pc32/include/uvparam.h index 8254ae842a..dc126aea65 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/sys/platform/pc32/include/uvparam.h @@ -1,6 +1,5 @@ -/*- - * Copyright (c) 2000 Michael Smith - * Copyright (c) 2000 BSDi +/* + * Copyright (c) 2003 Matthew Dillon * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,29 +23,29 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/Osd/OsdStream.c,v 1.3.4.1 2003/08/22 20:49:21 jhb Exp $ - * $DragonFly: src/sys/dev/acpica/Osd/Attic/OsdStream.c,v 1.1 2003/09/24 03:32:16 drhodus Exp $ + * $DragonFly: src/sys/platform/pc32/include/uvparam.h,v 1.1 2003/11/09 02:22:35 dillon Exp $ */ /* - * 6.6 : Stream I/O + * This header file contains random parameters that other includes may need + * to make user visible. */ -#include "acpi.h" - -void -AcpiOsPrintf (const char *Format, ...) -{ - va_list ap; +#ifndef _MACHINE_UVPARAM_H_ +#define _MACHINE_UVPARAM_H_ - va_start(ap, Format); - vprintf(Format, ap); - va_end(ap); -} +/* + * 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 + * there is no good reason why they should be less accurate. There is + * the bad reason that (broken) programs might not like clock_t or + * CLOCKS_PER_SEC being ``double'' (``unsigned long'' is not large enough + * to hold the required 24 hours worth of ticks if the frequency is + * 1000000ul, and ``unsigned long long'' would be nonstandard). + */ +#define _BSD_CLK_TCK_ 128 +#define _BSD_CLOCKS_PER_SEC_ 128 -void -AcpiOsVprintf (const char *Format, va_list Args) -{ - vprintf(Format, Args); -} +#endif diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h index 11288fea0d..5ac4709072 100644 --- a/sys/sys/dirent.h +++ b/sys/sys/dirent.h @@ -32,13 +32,15 @@ * * @(#)dirent.h 8.3 (Berkeley) 8/10/94 * $FreeBSD: src/sys/sys/dirent.h,v 1.11 1999/12/29 04:24:39 peter Exp $ - * $DragonFly: src/sys/sys/dirent.h,v 1.2 2003/06/17 04:28:58 dillon Exp $ + * $DragonFly: src/sys/sys/dirent.h,v 1.3 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_DIRENT_H_ #define _SYS_DIRENT_H_ -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif /* * The dirent structure defines the format of directory entries returned by diff --git a/sys/sys/inttypes.h b/sys/sys/inttypes.h deleted file mode 100644 index 53b389ff6d..0000000000 --- a/sys/sys/inttypes.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is in the public domain. - * $FreeBSD: src/sys/sys/inttypes.h,v 1.2 1999/08/28 00:51:47 peter Exp $ - * $DragonFly: src/sys/sys/Attic/inttypes.h,v 1.2 2003/06/17 04:28:58 dillon Exp $ - */ - -#ifndef _SYS_INTTYPES_H_ -#define _SYS_INTTYPES_H_ - -#include - -typedef __int8_t int8_t; -typedef __int16_t int16_t; -typedef __int32_t int32_t; -typedef __int64_t int64_t; - -typedef __uint8_t uint8_t; -typedef __uint16_t uint16_t; -typedef __uint32_t uint32_t; -typedef __uint64_t uint64_t; - -typedef __intptr_t intptr_t; -typedef __uintptr_t uintptr_t; - -#endif /* !_SYS_INTTYPES_H_ */ diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index b0aeb26eac..9e2a590bc4 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -32,7 +32,7 @@ * * @(#)malloc.h 8.5 (Berkeley) 5/3/95 * $FreeBSD: src/sys/sys/malloc.h,v 1.48.2.2 2002/03/16 02:19:16 archie Exp $ - * $DragonFly: src/sys/sys/malloc.h,v 1.13 2003/11/03 17:11:22 dillon Exp $ + * $DragonFly: src/sys/sys/malloc.h,v 1.14 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_MALLOC_H_ @@ -54,6 +54,10 @@ #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) +#ifndef _MACHINE_TYPES_H_ +#include /* vm_paddr_t */ +#endif + /* * flags to malloc. */ diff --git a/sys/sys/queue.h b/sys/sys/queue.h index e59d86fb17..ec1fe8bf87 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -32,13 +32,15 @@ * * @(#)queue.h 8.5 (Berkeley) 8/20/94 * $FreeBSD: src/sys/sys/queue.h,v 1.32.2.7 2002/04/17 14:21:02 des Exp $ - * $DragonFly: src/sys/sys/queue.h,v 1.3 2003/08/20 07:31:21 rob Exp $ + * $DragonFly: src/sys/sys/queue.h,v 1.4 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ -#include /* for __offsetof */ +#ifndef _MACHINE_STDINT_H_ +#include /* for __offsetof */ +#endif /* * This file defines five types of data structures: singly-linked lists, diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h index 5e8a36fedc..133a1753b1 100644 --- a/sys/sys/sbuf.h +++ b/sys/sys/sbuf.h @@ -26,13 +26,18 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/sys/sbuf.h,v 1.7.2.2 2002/03/12 01:00:28 archie Exp $ - * $DragonFly: src/sys/sys/sbuf.h,v 1.2 2003/06/17 04:28:58 dillon Exp $ + * $DragonFly: src/sys/sys/sbuf.h,v 1.3 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_SBUF_H_ #define _SYS_SBUF_H_ -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif +#ifndef _MACHINE_STDARG_H_ +#include +#endif /* * Structure definition @@ -59,12 +64,12 @@ __BEGIN_DECLS struct sbuf *sbuf_new(struct sbuf *, char *, int, int); void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, int); -int sbuf_bcat(struct sbuf *, const char *, size_t); -int sbuf_bcpy(struct sbuf *, const char *, size_t); +int sbuf_bcat(struct sbuf *, const char *, __size_t); +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 *); @@ -76,8 +81,8 @@ void sbuf_delete(struct sbuf *); #ifdef _KERNEL struct uio; struct sbuf *sbuf_uionew(struct sbuf *, struct uio *, int *); -int sbuf_bcopyin(struct sbuf *, const void *, size_t); -int sbuf_copyin(struct sbuf *, const void *, size_t); +int sbuf_bcopyin(struct sbuf *, const void *, __size_t); +int sbuf_copyin(struct sbuf *, const void *, __size_t); #endif __END_DECLS diff --git a/sys/sys/signal.h b/sys/sys/signal.h index 1139553e10..ee68cabccd 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -37,12 +37,15 @@ * * @(#)signal.h 8.4 (Berkeley) 5/4/95 * $FreeBSD: src/sys/sys/signal.h,v 1.23.2.2 2001/04/19 01:38:35 alfred Exp $ - * $DragonFly: src/sys/sys/signal.h,v 1.4 2003/10/13 18:12:07 dillon Exp $ + * $DragonFly: src/sys/sys/signal.h,v 1.5 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_SIGNAL_H_ #define _SYS_SIGNAL_H_ +#ifndef _MACHINE_STDINT_H_ +#include /* for __ types */ +#endif #include #include @@ -235,17 +238,12 @@ 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_ -#endif - /* * Structure used in sigaltstack call. */ typedef struct sigaltstack { char *ss_sp; /* signal stack base */ - size_t ss_size; /* signal stack length */ + __size_t ss_size; /* signal stack length */ int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ } stack_t; diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 5cb1642344..a67334114b 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -32,13 +32,16 @@ * * @(#)socket.h 8.4 (Berkeley) 2/21/94 * $FreeBSD: src/sys/sys/socket.h,v 1.39.2.7 2001/07/03 11:02:01 ume Exp $ - * $DragonFly: src/sys/sys/socket.h,v 1.6 2003/10/03 00:04:04 daver Exp $ + * $DragonFly: src/sys/sys/socket.h,v 1.7 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_SOCKET_H_ #define _SYS_SOCKET_H_ -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif + #define _NO_NAMESPACE_POLLUTION #include #undef _NO_NAMESPACE_POLLUTION @@ -50,11 +53,13 @@ /* * Data types. */ -typedef u_char sa_family_t; -#ifdef _BSD_SOCKLEN_T_ -typedef _BSD_SOCKLEN_T_ socklen_t; -#undef _BSD_SOCKLEN_T_ +typedef __uint8_t sa_family_t; + +#ifndef _SOCKLEN_T_DECLARED_ +#define _SOCKLEN_T_DECLARED_ +typedef __socklen_t socklen_t; #endif + /* * Types @@ -161,7 +166,7 @@ struct accept_filter_arg { * addresses. */ struct sockaddr { - u_char sa_len; /* total length */ + __uint8_t sa_len; /* total length */ sa_family_t sa_family; /* address family */ char sa_data[14]; /* actually longer; address value */ }; @@ -172,8 +177,8 @@ struct sockaddr { * information in raw sockets. */ struct sockproto { - u_short sp_family; /* address family */ - u_short sp_protocol; /* protocol */ + __uint16_t sp_family; /* address family */ + __uint16_t sp_protocol; /* protocol */ }; /* @@ -186,10 +191,10 @@ struct sockproto { _SS_PAD1SIZE - _SS_ALIGNSIZE) struct sockaddr_storage { - u_char ss_len; /* address length */ + __uint8_t ss_len; /* address length */ sa_family_t ss_family; /* address family */ char __ss_pad1[_SS_PAD1SIZE]; - int64_t __ss_align; /* force desired structure storage alignment */ + __int64_t __ss_align; /* force desired structure storage alignment */ char __ss_pad2[_SS_PAD2SIZE]; }; diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h new file mode 100644 index 0000000000..26224fdff4 --- /dev/null +++ b/sys/sys/stdint.h @@ -0,0 +1,42 @@ +/* + * This file is in the public domain. + * $FreeBSD: src/sys/sys/inttypes.h,v 1.2 1999/08/28 00:51:47 peter Exp $ + * $DragonFly: src/sys/sys/stdint.h,v 1.1 2003/11/09 02:22:37 dillon Exp $ + * + * Note: since portions of these header files can be included with various + * other combinations of defines, we cannot surround the whole header file + * with an #ifndef sequence. Elements are individually protected. + */ + +#include + +#ifndef _SYS_STDINT_H_ +#define _SYS_STDINT_H_ + +typedef int __ct_rune_t; +typedef __ct_rune_t __rune_t; +#ifndef __cplusplus +typedef __ct_rune_t __wchar_t; +#endif +typedef __ct_rune_t __wint_t; +typedef __int64_t __off_t; +typedef __int32_t __pid_t; + +#endif /* SYS_STDINT_H */ + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef _SYS_STDINT_H_STDC_LIMIT_MACROS_ +#define _SYS_STDINT_H_STDC_LIMIT_MACROS_ + +#ifndef WCHAR_MIN /* Also possibly defined in */ +/* Limits of wchar_t. */ +#define WCHAR_MIN INT32_MIN +#define WCHAR_MAX INT32_MAX + +/* Limits of wint_t. */ +#define WINT_MIN INT32_MIN +#define WINT_MAX INT32_MAX +#endif + +#endif /* STDINT_H_STDC_LIMIT_MACROS */ +#endif /* STDC_LIMIT_MACROS */ diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h index 2733f5e0e9..0ddc6f3160 100644 --- a/sys/sys/syslog.h +++ b/sys/sys/syslog.h @@ -32,7 +32,7 @@ * * @(#)syslog.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/sys/sys/syslog.h,v 1.19.2.2 2001/05/29 13:15:08 dwmalone Exp $ - * $DragonFly: src/sys/sys/syslog.h,v 1.3 2003/08/20 07:31:21 rob Exp $ + * $DragonFly: src/sys/sys/syslog.h,v 1.4 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_SYSLOG_H_ @@ -187,17 +187,22 @@ CODE facilitynames[] = { * places ( and ), 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 and use it. + * __va_list from and use it. */ -#include #include +#ifndef _MACHINE_STDINT_H_ +#include +#endif +#ifndef _MACHINE_STDARG_H_ +#include +#endif __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 a32c7fa345..361540451a 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,12 +37,18 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.14 2003/11/07 18:28:53 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.15 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_SYSTM_H_ #define _SYS_SYSTM_H_ +#ifndef _MACHINE_TYPES_H_ +#include +#endif +#ifndef _MACHINE_STDARG_H_ +#include +#endif #include #include #include @@ -129,7 +135,7 @@ void init_param2 (int physpages); void tablefull (const char *); int addlog (const char *, ...) __printflike(1, 2); int kvprintf (char const *, void (*)(int, void*), void *, int, - _BSD_VA_LIST_) __printflike(1, 0); + __va_list) __printflike(1, 0); int log (int, const char *, ...) __printflike(2, 3); void logwakeup (void); void log_console (struct uio *); @@ -137,12 +143,12 @@ 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/time.h b/sys/sys/time.h index 386dc62e60..4a4a58015f 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -32,13 +32,15 @@ * * @(#)time.h 8.5 (Berkeley) 5/4/95 * $FreeBSD: src/sys/sys/time.h,v 1.42 1999/12/29 04:24:48 peter Exp $ - * $DragonFly: src/sys/sys/time.h,v 1.4 2003/08/20 07:31:21 rob Exp $ + * $DragonFly: src/sys/sys/time.h,v 1.5 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_TIME_H_ #define _SYS_TIME_H_ +#ifndef _SYS_TYPES_H_ #include +#endif /* * Structure returned by gettimeofday(2) system call, diff --git a/sys/sys/times.h b/sys/sys/times.h index 2e0c3f58f1..f0f30e7263 100644 --- a/sys/sys/times.h +++ b/sys/sys/times.h @@ -37,17 +37,19 @@ * * @(#)times.h 8.4 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/times.h,v 1.6 1999/12/29 04:24:48 peter Exp $ - * $DragonFly: src/sys/sys/times.h,v 1.3 2003/08/20 07:31:21 rob Exp $ + * $DragonFly: src/sys/sys/times.h,v 1.4 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_TIMES_H_ #define _SYS_TIMES_H_ -#include +#ifndef _MACHINE_STDINT_H_ +#include +#endif -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED_ +#define _CLOCK_T_DECLARED_ +typedef __clock_t clock_t; #endif struct tms { diff --git a/sys/sys/types.h b/sys/sys/types.h index 6c77a7d6eb..3ee85b80f8 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -37,17 +37,19 @@ * * @(#)types.h 8.6 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/types.h,v 1.40.2.2 2001/04/21 14:53:06 ume Exp $ - * $DragonFly: src/sys/sys/types.h,v 1.4 2003/08/20 07:31:22 rob Exp $ + * $DragonFly: src/sys/sys/types.h,v 1.5 2003/11/09 02:22:37 dillon Exp $ */ #ifndef _SYS_TYPES_H_ #define _SYS_TYPES_H_ #include - -/* Machine type dependent parameters. */ -#include /* includes */ +#include +#include +#include +#ifndef _MACHINE_TYPES_H_ #include +#endif #ifndef _POSIX_SOURCE typedef unsigned char u_char; @@ -62,35 +64,30 @@ typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; - -typedef u_int64_t u_quad_t; /* quads */ -typedef int64_t quad_t; +typedef __uint64_t u_quad_t; /* quads */ +typedef __int64_t quad_t; 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 int32_t daddr_t; /* disk address */ -typedef u_int32_t u_daddr_t; /* unsigned disk address */ -typedef u_int32_t fixpt_t; /* fixed point number */ -typedef u_int32_t gid_t; /* group id */ -typedef u_int32_t in_addr_t; /* base type for internet address */ -typedef u_int16_t in_port_t; -typedef u_int32_t ino_t; /* inode number */ +typedef __int32_t daddr_t; /* disk address */ +typedef __uint32_t u_daddr_t; /* unsigned disk address */ +typedef __uint32_t fixpt_t; /* fixed point number */ +typedef __uint32_t gid_t; /* group id */ +typedef __uint32_t in_addr_t; /* base type for internet address */ +typedef __uint16_t in_port_t; +typedef __uint32_t ino_t; /* inode number */ 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 __uint16_t mode_t; /* permissions */ +typedef __uint16_t nlink_t; /* link count */ +typedef __off_t off_t; /* file offset */ +typedef __pid_t pid_t; /* process id */ typedef quad_t rlim_t; /* resource limit */ -#ifdef __alpha__ /* XXX should be in */ -typedef int64_t segsz_t; /* segment size */ -#else -typedef int32_t segsz_t; /* segment size */ -#endif -typedef int32_t swblk_t; /* swap offset */ -typedef int32_t ufs_daddr_t; -typedef u_int32_t uid_t; /* user id */ +typedef __int32_t segsz_t; /* segment size */ +typedef __int32_t swblk_t; /* swap offset */ +typedef __int32_t ufs_daddr_t; +typedef __uint32_t uid_t; /* user id */ #ifdef _KERNEL typedef int boolean_t; @@ -124,36 +121,34 @@ typedef u_int32_t dev_t; /* device number */ #endif /* !_KERNEL */ -#include - -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED_ +#define _CLOCK_T_DECLARED_ +typedef __clock_t clock_t; #endif -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _CLOCKID_T_DECLARED_ +#define _CLOCKID_T_DECLARED_ +typedef __clockid_t clockid_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED_ +#define _SIZE_T_DECLARED_ +typedef __size_t size_t; #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SSIZE_T_DECLARED_ +#define _SSIZE_T_DECLARED_ +typedef __ssize_t ssize_t; #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED_ +#define _TIME_T_DECLARED_ +typedef __time_t time_t; #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DECLARED_ +#define _TIMER_T_DECLARED_ +typedef __timer_t timer_t; #endif #ifndef _POSIX_SOURCE -- 2.41.0