diff options
Diffstat (limited to 'sys')
62 files changed, 86 insertions, 521 deletions
diff --git a/sys/alpha/include/limits.h b/sys/alpha/include/limits.h index d45e08a..cbbcf59 100644 --- a/sys/alpha/include/limits.h +++ b/sys/alpha/include/limits.h @@ -38,70 +38,10 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the alpha. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for a off_t */ -#define OFF_MIN LONG_MIN /* min value for a off_t */ - -/* Quads and longs are the same on the alpha. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif +#include <sys/limits.h> + #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/amd64/include/limits.h b/sys/amd64/include/limits.h index e740acf..8a36831 100644 --- a/sys/amd64/include/limits.h +++ b/sys/amd64/include/limits.h @@ -39,70 +39,10 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the alpha. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for an off_t */ -#define OFF_MIN LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same on the alpha. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif +#include <sys/limits.h> + #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index df1b2e9..9e6c489 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -61,6 +61,7 @@ #include <sys/time.h> #include <sys/timetc.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/sysctl.h> #include <sys/cons.h> #include <sys/power.h> @@ -68,7 +69,6 @@ #include <machine/clock.h> #include <machine/cputypes.h> #include <machine/frame.h> -#include <machine/limits.h> #include <machine/md_var.h> #include <machine/psl.h> #ifdef APIC_IO diff --git a/sys/arm/include/limits.h b/sys/arm/include/limits.h index b5e3bd1..58dac20 100644 --- a/sys/arm/include/limits.h +++ b/sys/arm/include/limits.h @@ -34,72 +34,13 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define UCHAR_MAX 0xff /* max value for an unsigned char */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MAX UCHAR_MAX /* max value for a char */ -#define CHAR_MIN 0 /* min value for a char */ -#else -#define CHAR_MAX SCHAR_MAX /* max value for a char */ -#define CHAR_MIN SCHAR_MIN /* min value for a char */ +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif -#define USHRT_MAX 0xffff /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -/* Bad hack for gcc configured to give 64-bit longs. */ -#ifdef _LARGE_LONG -#define ULONG_MAX 0xffffffffffffffffUL -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#else -#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define LONG_MAX 0x7fffffffL /* max value for a long */ -#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ -#endif - - /* max value for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) -#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ - -#define OFF_MAX LLONG_MAX /* max value for a off_t */ -#define OFF_MIN LLONG_MIN /* min value for a off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ -#define QUAD_MAX LLONG_MAX /* max value for a quad_t */ -#define QUAD_MIN LLONG_MIN /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#include <sys/limits.h> #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 431fbb3..706bbf9 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #include <sys/time.h> #ifdef CAM_NEW_TRAN_CODE -#include <machine/limits.h> +#include <sys/limits.h> #endif /* CAM_NEW_TRAN_CODE */ #ifndef _KERNEL #include <sys/callout.h> diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index e81b110..a7e40b6 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -38,13 +38,13 @@ #include <sys/types.h> #include <sys/time.h> #include <sys/bio.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/mtio.h> #ifdef _KERNEL #include <sys/conf.h> #endif #include <sys/devicestat.h> -#include <machine/limits.h> #ifndef _KERNEL #include <stdio.h> diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 64a496c..92fa13d 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -32,12 +32,11 @@ #include <sys/systm.h> #include <sys/sysproto.h> #include <sys/proc.h> +#include <sys/limits.h> #include <sys/msg.h> #include <sys/sem.h> #include <sys/shm.h> -#include <machine/limits.h> - #include <machine/../linux/linux.h> #include <machine/../linux/linux_proto.h> #include <machine/../linux/linux_ipc64.h> diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 28ab2b3..ab0abec 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -36,6 +36,7 @@ #include <sys/imgact_aout.h> #include <sys/jail.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mac.h> #include <sys/malloc.h> @@ -65,8 +66,6 @@ #include <vm/vm_object.h> #include <vm/swap_pager.h> -#include <machine/limits.h> - #include <posix4/sched.h> #include <machine/../linux/linux.h> diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index e9dcb4b..a521048 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -42,6 +42,7 @@ #include <sys/sysproto.h> #include <sys/fcntl.h> #include <sys/file.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/socket.h> #include <sys/socketvar.h> @@ -62,8 +63,6 @@ #include <compat/linux/linux_socket.h> #include <compat/linux/linux_util.h> -#include <machine/limits.h> - static int do_sa_get(struct sockaddr **, const struct osockaddr *, int *, struct malloc_type *); static int linux_to_bsd_domain(int); diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index e4414c59..46cd642 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -34,6 +34,7 @@ #include <sys/kernel.h> #include <sys/bus.h> #include <sys/proc.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <machine/bus.h> @@ -167,8 +168,6 @@ atkbd_timeout(void *arg) /* LOW-LEVEL */ -#include <machine/limits.h> - #define ATKBD_DEFAULT 0 typedef struct atkbd_state { diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 968491d..afb66ba 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -77,7 +77,7 @@ #include <sys/time.h> #include <sys/uio.h> -#include <machine/limits.h> +#include <sys/limits.h> #include <sys/mouse.h> #include <machine/resource.h> diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index 2b306eb..0f8f8f2 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -36,12 +36,12 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/queue.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/bus.h> -#include <machine/limits.h> #include <machine/bus.h> #include <machine/resource.h> #include <sys/rman.h> diff --git a/sys/dev/kbd/atkbd.c b/sys/dev/kbd/atkbd.c index e4414c59..46cd642 100644 --- a/sys/dev/kbd/atkbd.c +++ b/sys/dev/kbd/atkbd.c @@ -34,6 +34,7 @@ #include <sys/kernel.h> #include <sys/bus.h> #include <sys/proc.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <machine/bus.h> @@ -167,8 +168,6 @@ atkbd_timeout(void *arg) /* LOW-LEVEL */ -#include <machine/limits.h> - #define ATKBD_DEFAULT 0 typedef struct atkbd_state { diff --git a/sys/dev/mca/mca_bus.c b/sys/dev/mca/mca_bus.c index 2550dc1..13bdc08 100644 --- a/sys/dev/mca/mca_bus.c +++ b/sys/dev/mca/mca_bus.c @@ -38,10 +38,10 @@ #include <sys/queue.h> #include <sys/malloc.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/module.h> #include <sys/bus.h> -#include <machine/limits.h> #include <machine/bus.h> #include <machine/resource.h> #include <sys/rman.h> diff --git a/sys/dev/raidframe/rf_types.h b/sys/dev/raidframe/rf_types.h index 3f388fc..25630ef 100644 --- a/sys/dev/raidframe/rf_types.h +++ b/sys/dev/raidframe/rf_types.h @@ -64,8 +64,8 @@ */ #include <sys/types.h> +#include <sys/limits.h> #include <machine/endian.h> -#include <machine/limits.h> #if BYTE_ORDER == BIG_ENDIAN #define RF_IS_BIG_ENDIAN 1 diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index daf8970..3ca2b5f 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -243,6 +243,7 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/kernel.h> @@ -263,8 +264,6 @@ #include <net/if_ieee80211.h> #include <net/if_llc.h> -#include <machine/limits.h> - #include <dev/pccard/pccardvar.h> #include "card_if.h" diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 2a3d8ac..c448716 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -56,6 +56,7 @@ #include <sys/fcntl.h> #include <sys/interrupt.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> @@ -73,7 +74,6 @@ #include <isa/isavar.h> -#include <machine/limits.h> #include <machine/resource.h> #include <dev/sio/sioreg.h> diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index 0867654..9ba9c95 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -62,7 +62,7 @@ #include <machine/bus_pio.h> #include <machine/bus.h> #include <machine/clock.h> /* for DELAY */ -#include <machine/limits.h> +#include <sys/limits.h> #include <sys/soundcard.h> #include <sys/rman.h> #include <sys/mman.h> diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c index 0c4ba2c..2b3a77b 100644 --- a/sys/dev/syscons/scmouse.c +++ b/sys/dev/syscons/scmouse.c @@ -33,6 +33,7 @@ #include <sys/conf.h> #include <sys/consio.h> #include <sys/fbio.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mouse.h> @@ -41,7 +42,6 @@ #include <sys/random.h> #include <sys/signalvar.h> #include <sys/tty.h> -#include <machine/limits.h> #include <dev/syscons/syscons.h> diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 775a04d..a16d799 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -51,6 +51,7 @@ #include <sys/module.h> #include <sys/bus.h> #include <sys/file.h> +#include <sys/limits.h> #if __FreeBSD_version >= 500014 #include <sys/selinfo.h> #else @@ -235,7 +236,6 @@ ukbd_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, ukbd_driver_load, 0); -#include <machine/limits.h> #define UKBD_DEFAULT 0 diff --git a/sys/fs/pseudofs/pseudofs_fileno.c b/sys/fs/pseudofs/pseudofs_fileno.c index 4341e23..24848b3 100644 --- a/sys/fs/pseudofs/pseudofs_fileno.c +++ b/sys/fs/pseudofs/pseudofs_fileno.c @@ -31,13 +31,12 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mutex.h> #include <sys/sysctl.h> -#include <machine/limits.h> - #include <fs/pseudofs/pseudofs.h> #include <fs/pseudofs/pseudofs_internal.h> diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 19b099a..20bd9c6 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -42,10 +42,9 @@ #include <sys/mount.h> #include <sys/unistd.h> #include <sys/vnode.h> +#include <sys/limits.h> #include <sys/lockf.h> -#include <machine/limits.h> - #include <vm/vm.h> #include <vm/vm_extern.h> diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index cb4e377..b090d75 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -47,9 +47,9 @@ #include <sys/time.h> #include <sys/disk.h> #include <sys/fcntl.h> +#include <sys/limits.h> #include <geom/geom.h> #include <geom/geom_int.h> -#include <machine/limits.h> static d_open_t g_dev_open; static d_close_t g_dev_close; diff --git a/sys/i386/include/limits.h b/sys/i386/include/limits.h index 13ea139..58dac20 100644 --- a/sys/i386/include/limits.h +++ b/sys/i386/include/limits.h @@ -34,72 +34,13 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define UCHAR_MAX 0xff /* max value for an unsigned char */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MAX UCHAR_MAX /* max value for a char */ -#define CHAR_MIN 0 /* min value for a char */ -#else -#define CHAR_MAX SCHAR_MAX /* max value for a char */ -#define CHAR_MIN SCHAR_MIN /* min value for a char */ +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif -#define USHRT_MAX 0xffff /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -/* Bad hack for gcc configured to give 64-bit longs. */ -#ifdef _LARGE_LONG -#define ULONG_MAX 0xffffffffffffffffUL -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#else -#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define LONG_MAX 0x7fffffffL /* max value for a long */ -#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ -#endif - - /* max value for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) -#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ - -#define OFF_MAX LLONG_MAX /* max value for an off_t */ -#define OFF_MIN LLONG_MIN /* min value for an off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ -#define QUAD_MAX LLONG_MAX /* max value for a quad_t */ -#define QUAD_MIN LLONG_MIN /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#include <sys/limits.h> #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index df1b2e9..9e6c489 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -61,6 +61,7 @@ #include <sys/time.h> #include <sys/timetc.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/sysctl.h> #include <sys/cons.h> #include <sys/power.h> @@ -68,7 +69,6 @@ #include <machine/clock.h> #include <machine/cputypes.h> #include <machine/frame.h> -#include <machine/limits.h> #include <machine/md_var.h> #include <machine/psl.h> #ifdef APIC_IO diff --git a/sys/ia64/include/limits.h b/sys/ia64/include/limits.h index b694386..7dc0de7 100644 --- a/sys/ia64/include/limits.h +++ b/sys/ia64/include/limits.h @@ -36,68 +36,13 @@ * @(#)limits.h 8.3 (Berkeley) 1/4/94 */ -#define CHAR_BIT 8 /* number of bits in a char */ +#ifndef _MACHINE_LIMITS_H_ +#define _MACHINE_LIMITS_H_ -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the IA-64. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for an off_t */ -#define OFF_MIN LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." +#endif -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 +#include <sys/limits.h> -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F -#endif +#endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index df1b2e9..9e6c489 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -61,6 +61,7 @@ #include <sys/time.h> #include <sys/timetc.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/sysctl.h> #include <sys/cons.h> #include <sys/power.h> @@ -68,7 +69,6 @@ #include <machine/clock.h> #include <machine/cputypes.h> #include <machine/frame.h> -#include <machine/limits.h> #include <machine/md_var.h> #include <machine/psl.h> #ifdef APIC_IO diff --git a/sys/isa/psm.c b/sys/isa/psm.c index 968491d..afb66ba 100644 --- a/sys/isa/psm.c +++ b/sys/isa/psm.c @@ -77,7 +77,7 @@ #include <sys/time.h> #include <sys/uio.h> -#include <machine/limits.h> +#include <sys/limits.h> #include <sys/mouse.h> #include <machine/resource.h> diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 3d04cf0..0482d53 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -60,10 +60,10 @@ #include <sys/sysctl.h> #include <sys/bus.h> #include <sys/interrupt.h> +#include <sys/limits.h> #include <sys/timetc.h> #include <machine/cpu.h> -#include <machine/limits.h> #ifdef GPROF #include <sys/gmon.h> diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 0d02974..6975d0e 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -49,6 +49,7 @@ #include <sys/filedesc.h> #include <sys/lock.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/mutex.h> #include <sys/sysctl.h> @@ -67,8 +68,6 @@ #include <sys/socketvar.h> #include <sys/signalvar.h> -#include <machine/limits.h> - #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/uma.h> diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index 7a7379b..ca2ba30 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -42,6 +42,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mount.h> #include <sys/mutex.h> @@ -52,8 +53,6 @@ #include <sys/fcntl.h> #include <sys/lockf.h> -#include <machine/limits.h> - /* * This variable controls the maximum number of processes that will * be checked in doing deadlock detection. diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c index f204f19..675f145 100644 --- a/sys/kern/subr_scanf.c +++ b/sys/kern/subr_scanf.c @@ -42,7 +42,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/ctype.h> -#include <machine/limits.h> +#include <sys/limits.h> /* * Note that stdarg.h and the ANSI style va_start macro is used for both diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index c26cf47..98506f3 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -53,6 +53,7 @@ #include <sys/socketvar.h> #include <sys/uio.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/poll.h> #include <sys/resourcevar.h> @@ -69,8 +70,6 @@ #include <vm/vm.h> #include <vm/vm_page.h> -#include <machine/limits.h> - static MALLOC_DEFINE(M_IOCTLOPS, "ioctlops", "ioctl data buffer"); static MALLOC_DEFINE(M_SELECT, "select", "select() buffer"); MALLOC_DEFINE(M_IOV, "iov", "large iov's"); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7c13722..f50f59f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -41,6 +41,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/fcntl.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mac.h> #include <sys/malloc.h> @@ -63,7 +64,6 @@ #include <vm/uma.h> -#include <machine/limits.h> #ifdef INET static int do_setopt_accept_filter(struct socket *so, struct sockopt *sopt); diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index ddfda94..f9a3fbe 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -32,6 +32,7 @@ #include <sys/kthread.h> #include <sys/fcntl.h> #include <sys/file.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/unistd.h> @@ -56,8 +57,6 @@ #include <vm/uma.h> #include <sys/aio.h> -#include <machine/limits.h> - #include "opt_vfs_aio.h" /* diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 556c37e..7e3f295 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -45,6 +45,7 @@ #include <sys/buf.h> #include <sys/conf.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mount.h> @@ -53,8 +54,6 @@ #include <sys/vnode.h> #include <sys/poll.h> -#include <machine/limits.h> - #include <vm/vm.h> #include <vm/vm_object.h> #include <vm/vm_extern.h> diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 21b2046..5d41208 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -58,6 +58,7 @@ #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/file.h> +#include <sys/limits.h> #include <sys/linker.h> #include <sys/stat.h> #include <sys/sx.h> @@ -70,7 +71,6 @@ #include <sys/syscallsubr.h> #include <sys/sysctl.h> -#include <machine/limits.h> #include <machine/stdarg.h> #include <vm/vm.h> diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 21b2046..5d41208 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -58,6 +58,7 @@ #include <sys/kernel.h> #include <sys/fcntl.h> #include <sys/file.h> +#include <sys/limits.h> #include <sys/linker.h> #include <sys/stat.h> #include <sys/sx.h> @@ -70,7 +71,6 @@ #include <sys/syscallsubr.h> #include <sys/sysctl.h> -#include <machine/limits.h> #include <machine/stdarg.h> #include <vm/vm.h> diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a01733f..589a372 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -47,6 +47,7 @@ #include <sys/file.h> #include <sys/stat.h> #include <sys/proc.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mac.h> #include <sys/mount.h> @@ -61,8 +62,6 @@ #include <sys/conf.h> #include <sys/syslog.h> -#include <machine/limits.h> - static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_ioctl_t vn_ioctl; diff --git a/sys/libkern/quad.h b/sys/libkern/quad.h index a2566e2..0e48e12 100644 --- a/sys/libkern/quad.h +++ b/sys/libkern/quad.h @@ -59,8 +59,8 @@ #include <sys/cdefs.h> #include <sys/types.h> +#include <sys/limits.h> #include <sys/syslimits.h> -#include <machine/limits.h> /* * Depending on the desired operation, we view a `long long' (aka quad_t) in diff --git a/sys/libkern/strtol.c b/sys/libkern/strtol.c index f645cb5..9fb5e36 100644 --- a/sys/libkern/strtol.c +++ b/sys/libkern/strtol.c @@ -41,7 +41,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/ctype.h> -#include <machine/limits.h> +#include <sys/limits.h> /* * Convert a string to a long integer. diff --git a/sys/libkern/strtoq.c b/sys/libkern/strtoq.c index a1bb4ff..fa07081 100644 --- a/sys/libkern/strtoq.c +++ b/sys/libkern/strtoq.c @@ -39,7 +39,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/ctype.h> -#include <machine/limits.h> +#include <sys/limits.h> /* * Convert a string to a quad integer. diff --git a/sys/libkern/strtoul.c b/sys/libkern/strtoul.c index b5973ef..c9ca8e4 100644 --- a/sys/libkern/strtoul.c +++ b/sys/libkern/strtoul.c @@ -41,7 +41,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/ctype.h> -#include <machine/limits.h> +#include <sys/limits.h> /* * Convert a string to an unsigned long integer. diff --git a/sys/libkern/strtouq.c b/sys/libkern/strtouq.c index 7b6ca1a..f80f2b4 100644 --- a/sys/libkern/strtouq.c +++ b/sys/libkern/strtouq.c @@ -39,7 +39,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/ctype.h> -#include <machine/limits.h> +#include <sys/limits.h> /* * Convert a string to an unsigned quad integer. diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 786eecd..8135c6e 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -48,6 +48,7 @@ #include <sys/systm.h> #include <sys/errno.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/sysctl.h> @@ -56,7 +57,6 @@ #include <sys/mbuf.h> #include <sys/ctype.h> #include <sys/sysctl.h> -#include <machine/limits.h> #include <net/netisr.h> diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c index 6dfa4a4..a11335f 100644 --- a/sys/netgraph/ng_ppp.c +++ b/sys/netgraph/ng_ppp.c @@ -47,14 +47,13 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/time.h> #include <sys/mbuf.h> #include <sys/malloc.h> #include <sys/errno.h> #include <sys/ctype.h> -#include <machine/limits.h> - #include <netgraph/ng_message.h> #include <netgraph/netgraph.h> #include <netgraph/ng_parse.h> diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 316977c..4f46ca6 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -39,6 +39,7 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/domain.h> @@ -50,8 +51,6 @@ #include <sys/kernel.h> #include <sys/sysctl.h> -#include <machine/limits.h> - #include <vm/uma.h> #include <net/if.h> diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c index 550a133..ac0f381 100644 --- a/sys/nfsclient/nfs_lock.c +++ b/sys/nfsclient/nfs_lock.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/fcntl.h> #include <sys/kernel.h> /* for hz */ +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/lockf.h> /* for hz */ /* Must come after sys/malloc.h */ @@ -48,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include <sys/unistd.h> #include <sys/vnode.h> -#include <machine/limits.h> - #include <net/if.h> #include <nfs/rpcv2.h> diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index acef9ea..8764b2b 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mbuf.h> @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include <nfsclient/nfsm_subs.h> #include <nfsclient/nfsdiskless.h> -#include <machine/limits.h> - MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header"); MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle"); MALLOC_DEFINE(M_NFSDIROFF, "NFSV3 diroff", "NFS directory offset data"); diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 29cee68..bc03ea6 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -59,6 +59,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/proc.h> @@ -72,7 +73,6 @@ #include <machine/clock.h> #include <machine/cputypes.h> #include <machine/frame.h> -#include <machine/limits.h> #include <machine/md_var.h> #include <machine/psl.h> #ifdef APIC_IO diff --git a/sys/pc98/cbus/pckbd.c b/sys/pc98/cbus/pckbd.c index 60e01a4..37fe6d2 100644 --- a/sys/pc98/cbus/pckbd.c +++ b/sys/pc98/cbus/pckbd.c @@ -263,7 +263,7 @@ pckbd_timeout(void *arg) /* LOW-LEVEL */ -#include <machine/limits.h> +#include <sys/limits.h> #define PC98KBD_DEFAULT 0 diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 29cee68..bc03ea6 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -59,6 +59,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/proc.h> @@ -72,7 +73,6 @@ #include <machine/clock.h> #include <machine/cputypes.h> #include <machine/frame.h> -#include <machine/limits.h> #include <machine/md_var.h> #include <machine/psl.h> #ifdef APIC_IO diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index a9213ee..b571fef 100644 --- a/sys/pc98/cbus/sio.c +++ b/sys/pc98/cbus/sio.c @@ -119,6 +119,7 @@ #include <sys/fcntl.h> #include <sys/interrupt.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> @@ -135,7 +136,6 @@ #include <isa/isavar.h> -#include <machine/limits.h> #include <machine/resource.h> #include <dev/sio/sioreg.h> diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c index 29cee68..bc03ea6 100644 --- a/sys/pc98/pc98/clock.c +++ b/sys/pc98/pc98/clock.c @@ -59,6 +59,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/proc.h> @@ -72,7 +73,6 @@ #include <machine/clock.h> #include <machine/cputypes.h> #include <machine/frame.h> -#include <machine/limits.h> #include <machine/md_var.h> #include <machine/psl.h> #ifdef APIC_IO diff --git a/sys/pc98/pc98/pc98kbd.c b/sys/pc98/pc98/pc98kbd.c index 60e01a4..37fe6d2 100644 --- a/sys/pc98/pc98/pc98kbd.c +++ b/sys/pc98/pc98/pc98kbd.c @@ -263,7 +263,7 @@ pckbd_timeout(void *arg) /* LOW-LEVEL */ -#include <machine/limits.h> +#include <sys/limits.h> #define PC98KBD_DEFAULT 0 diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index a9213ee..b571fef 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/sio.c @@ -119,6 +119,7 @@ #include <sys/fcntl.h> #include <sys/interrupt.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> @@ -135,7 +136,6 @@ #include <isa/isavar.h> -#include <machine/limits.h> #include <machine/resource.h> #include <dev/sio/sioreg.h> diff --git a/sys/powerpc/include/limits.h b/sys/powerpc/include/limits.h index 1b06efd..58dac20 100644 --- a/sys/powerpc/include/limits.h +++ b/sys/powerpc/include/limits.h @@ -34,75 +34,13 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define UCHAR_MAX 0xff /* max value for an unsigned char */ - -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MAX UCHAR_MAX /* max value for a char */ -#define CHAR_MIN 0 /* min value for a char */ -#else -#define CHAR_MAX SCHAR_MAX /* max value for a char */ -#define CHAR_MIN SCHAR_MIN /* min value for a char */ +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif -#define USHRT_MAX 0xffff /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -/* Bad hack for gcc configured to give 64-bit longs. */ -#ifdef _LARGE_LONG -#define ULONG_MAX 0xffffffffffffffffUL -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#else -#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define LONG_MAX 0x7fffffffL /* max value for a long */ -#define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ -#endif - - /* max value for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) -#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ - -#define OFF_MAX LLONG_MAX /* max value for an off_t */ -#define OFF_MIN LLONG_MIN /* min value for an off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ -#define QUAD_MAX LLONG_MAX /* max value for a quad_t */ -#define QUAD_MIN LLONG_MIN /* min value for a quad_t */ - -#define LONG_BIT 32 - -#endif /* !_POSIX_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#include <sys/limits.h> #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/sparc64/include/limits.h b/sys/sparc64/include/limits.h index be8cf0d..60ebf8f 100644 --- a/sys/sparc64/include/limits.h +++ b/sys/sparc64/include/limits.h @@ -30,70 +30,10 @@ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ -#define CHAR_BIT 8 /* number of bits in a char */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers are for the default configuration of gcc. They work for - * some other compilers as well, but this should not be depended on. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -/* Long longs and longs are the same size on the alpha. */ - /* max for an unsigned long long */ -#define ULLONG_MAX 0xffffffffffffffffULL -#define LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ -#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -#define OFF_MAX LONG_MAX /* max value for an off_t */ -#define OFF_MIN LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same on the alpha. Ensure they stay in sync. */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F +#if __GNUC__ +#warning "machine/limits.h is deprecated. Include sys/limits.h instead." #endif +#include <sys/limits.h> + #endif /* !_MACHINE_LIMITS_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 78464bd..dffea10 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -104,7 +104,7 @@ /* Machine type dependent parameters. */ #include <machine/param.h> #ifndef _KERNEL -#include <machine/limits.h> +#include <sys/limits.h> #endif #ifndef _NO_NAMESPACE_POLLUTION diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c index 3b89129..7e87293f 100644 --- a/sys/ufs/ffs/ffs_rawread.c +++ b/sys/ufs/ffs/ffs_rawread.c @@ -32,6 +32,7 @@ #include <sys/file.h> #include <sys/stat.h> #include <sys/proc.h> +#include <sys/limits.h> #include <sys/mount.h> #include <sys/namei.h> #include <sys/vnode.h> @@ -44,7 +45,6 @@ #include <ufs/ufs/inode.h> #include <ufs/ffs/fs.h> -#include <machine/limits.h> #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/vm_object.h> diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 8742a5b..eda8b0b 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -50,6 +50,7 @@ #include <sys/conf.h> #include <sys/extattr.h> #include <sys/kernel.h> +#include <sys/limits.h> #include <sys/malloc.h> #include <sys/mount.h> #include <sys/proc.h> @@ -59,8 +60,6 @@ #include <sys/vmmeter.h> #include <sys/vnode.h> -#include <machine/limits.h> - #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/vm_object.h> diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 765f23c..cd00c33 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -66,6 +66,7 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/proc.h> @@ -79,8 +80,6 @@ #include <sys/ktr.h> #include <sys/unistd.h> -#include <machine/limits.h> - #include <vm/vm.h> #include <vm/vm_param.h> #include <vm/pmap.h> |