1292407Sbr/*- 2292407Sbr * Copyright (c) 1988, 1993 3292407Sbr * The Regents of the University of California. All rights reserved. 4292407Sbr * 5292407Sbr * Redistribution and use in source and binary forms, with or without 6292407Sbr * modification, are permitted provided that the following conditions 7292407Sbr * are met: 8292407Sbr * 1. Redistributions of source code must retain the above copyright 9292407Sbr * notice, this list of conditions and the following disclaimer. 10292407Sbr * 2. Redistributions in binary form must reproduce the above copyright 11292407Sbr * notice, this list of conditions and the following disclaimer in the 12292407Sbr * documentation and/or other materials provided with the distribution. 13292407Sbr * 14292407Sbr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 15292407Sbr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16292407Sbr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17292407Sbr * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 18292407Sbr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19292407Sbr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20292407Sbr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21292407Sbr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22292407Sbr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23292407Sbr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24292407Sbr * SUCH DAMAGE. 25292407Sbr * 26292407Sbr * @(#)limits.h 8.3 (Berkeley) 1/4/94 27292407Sbr * $FreeBSD: releng/11.0/sys/riscv/include/_limits.h 292407 2015-12-17 18:44:30Z br $ 28292407Sbr */ 29292407Sbr 30292407Sbr#ifndef _MACHINE__LIMITS_H_ 31292407Sbr#define _MACHINE__LIMITS_H_ 32292407Sbr 33292407Sbr/* 34292407Sbr * According to ANSI (section 2.2.4.2), the values below must be usable by 35292407Sbr * #if preprocessing directives. Additionally, the expression must have the 36292407Sbr * same type as would an expression that is an object of the corresponding 37292407Sbr * type converted according to the integral promotions. The subtraction for 38292407Sbr * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an 39292407Sbr * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). 40292407Sbr */ 41292407Sbr 42292407Sbr#define __CHAR_BIT 8 /* number of bits in a char */ 43292407Sbr 44292407Sbr#define __SCHAR_MAX 0x7f /* max value for a signed char */ 45292407Sbr#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ 46292407Sbr 47292407Sbr#define __UCHAR_MAX 0xff /* max value for an unsigned char */ 48292407Sbr 49292407Sbr#define __USHRT_MAX 0xffff /* max value for an unsigned short */ 50292407Sbr#define __SHRT_MAX 0x7fff /* max value for a short */ 51292407Sbr#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */ 52292407Sbr 53292407Sbr#define __UINT_MAX 0xffffffff /* max value for an unsigned int */ 54292407Sbr#define __INT_MAX 0x7fffffff /* max value for an int */ 55292407Sbr#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ 56292407Sbr 57292407Sbr#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ 58292407Sbr#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */ 59292407Sbr#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */ 60292407Sbr 61292407Sbr/* Long longs have the same size but not the same type as longs. */ 62292407Sbr /* max for an unsigned long long */ 63292407Sbr#define __ULLONG_MAX 0xffffffffffffffffULL 64292407Sbr#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */ 65292407Sbr#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ 66292407Sbr 67292407Sbr#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ 68292407Sbr 69292407Sbr#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ 70292407Sbr 71292407Sbr#define __OFF_MAX __LONG_MAX /* max value for an off_t */ 72292407Sbr#define __OFF_MIN __LONG_MIN /* min value for an off_t */ 73292407Sbr 74292407Sbr/* Quads and longs are the same size. Ensure they stay in sync. */ 75292407Sbr#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */ 76292407Sbr#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */ 77292407Sbr#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */ 78292407Sbr 79292407Sbr#define __LONG_BIT 64 80292407Sbr#define __WORD_BIT 32 81292407Sbr 82292407Sbr/* Minimum signal stack size. */ 83292407Sbr#define __MINSIGSTKSZ (1024 * 4) 84292407Sbr 85292407Sbr#endif /* !_MACHINE__LIMITS_H_ */ 86