166458Sdfr/* $FreeBSD: releng/10.3/sys/ia64/include/_limits.h 217145 2011-01-08 11:13:34Z tijl $ */
266458Sdfr/* From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp */
366458Sdfr
4139790Simp/*-
566458Sdfr * Copyright (c) 1988, 1993
666458Sdfr *	The Regents of the University of California.  All rights reserved.
766458Sdfr *
866458Sdfr * Redistribution and use in source and binary forms, with or without
966458Sdfr * modification, are permitted provided that the following conditions
1066458Sdfr * are met:
1166458Sdfr * 1. Redistributions of source code must retain the above copyright
1266458Sdfr *    notice, this list of conditions and the following disclaimer.
1366458Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1466458Sdfr *    notice, this list of conditions and the following disclaimer in the
1566458Sdfr *    documentation and/or other materials provided with the distribution.
1666458Sdfr * 4. Neither the name of the University nor the names of its contributors
1766458Sdfr *    may be used to endorse or promote products derived from this software
1866458Sdfr *    without specific prior written permission.
1966458Sdfr *
2066458Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2166458Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2266458Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2366458Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2466458Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2566458Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2666458Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2766458Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2866458Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2966458Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3066458Sdfr * SUCH DAMAGE.
3166458Sdfr *
3266458Sdfr *	@(#)limits.h	8.3 (Berkeley) 1/4/94
3366458Sdfr */
3466458Sdfr
35113941Skan#ifndef _MACHINE__LIMITS_H_
36113941Skan#define	_MACHINE__LIMITS_H_
3766458Sdfr
38114678Skan/*
39114678Skan * According to ANSI (section 2.2.4.2), the values below must be usable by
40114678Skan * #if preprocessing directives.  Additionally, the expression must have the
41114678Skan * same type as would an expression that is an object of the corresponding
42114678Skan * type converted according to the integral promotions.  The subtraction for
43114678Skan * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
44114678Skan * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
45114678Skan */
46114678Skan
47115164Skan#define	__CHAR_BIT	8		/* number of bits in a char */
48115164Skan
49113941Skan#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
50113941Skan#define	__SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
5166458Sdfr
52217145Stijl#define	__UCHAR_MAX	0xff		/* max value for an unsigned char */
5366458Sdfr
54217145Stijl#define	__USHRT_MAX	0xffff		/* max value for an unsigned short */
55113941Skan#define	__SHRT_MAX	0x7fff		/* max value for a short */
56113941Skan#define	__SHRT_MIN	(-0x7fff-1)	/* min value for a short */
5766458Sdfr
58217145Stijl#define	__UINT_MAX	0xffffffff	/* max value for an unsigned int */
59113941Skan#define	__INT_MAX	0x7fffffff	/* max value for an int */
60113941Skan#define	__INT_MIN	(-0x7fffffff-1)	/* min value for an int */
6166458Sdfr
62217145Stijl#define	__ULONG_MAX	0xffffffffffffffff	/* max for an unsigned long */
63217145Stijl#define	__LONG_MAX	0x7fffffffffffffff	/* max for a long */
64217145Stijl#define	__LONG_MIN	(-0x7fffffffffffffff-1) /* min for a long */
65113941Skan
66217145Stijl/* Long longs have the same size but not the same type as longs. */
6767488Sobrien					/* max for an unsigned long long */
68113941Skan#define	__ULLONG_MAX	0xffffffffffffffffULL
69113941Skan#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
70113941Skan#define	__LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
7167488Sobrien
72113941Skan#define	__SSIZE_MAX	__LONG_MAX	/* max value for a ssize_t */
7366458Sdfr
74113941Skan#define	__SIZE_T_MAX	__ULONG_MAX	/* max value for a size_t */
7566458Sdfr
76113941Skan#define	__OFF_MAX	__LONG_MAX	/* max value for an off_t */
77113941Skan#define	__OFF_MIN	__LONG_MIN	/* min value for an off_t */
7881720Sache
7967488Sobrien/* Quads and longs are the same.  Ensure they stay in sync. */
80113941Skan#define	__UQUAD_MAX	(__ULONG_MAX)	/* max value for a uquad_t */
81113941Skan#define	__QUAD_MAX	(__LONG_MAX)	/* max value for a quad_t */
82113941Skan#define	__QUAD_MIN	(__LONG_MIN)	/* min value for a quad_t */
8366458Sdfr
84113941Skan#define	__LONG_BIT	64
85113941Skan#define	__WORD_BIT	32
8666458Sdfr
87149337Sstefanf/* Minimum signal stack size. */
88149337Sstefanf#define	__MINSIGSTKSZ	(3072 * 4)
89149337Sstefanf
90113941Skan#endif /* !_MACHINE__LIMITS_H_ */
91