endian.h (127977) | endian.h (143063) |
---|---|
1/*- 2 * Copyright (c) 1987, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)endian.h 8.1 (Berkeley) 6/10/93 | 1/*- 2 * Copyright (c) 1987, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)endian.h 8.1 (Berkeley) 6/10/93 |
30 * $FreeBSD: head/sys/sparc64/include/endian.h 127977 2004-04-07 05:00:01Z imp $ | 30 * $FreeBSD: head/sys/sparc64/include/endian.h 143063 2005-03-02 21:33:29Z joerg $ |
31 */ 32 33#ifndef _MACHINE_ENDIAN_H_ 34#define _MACHINE_ENDIAN_H_ 35 36#include <sys/cdefs.h> 37#include <sys/_types.h> 38 --- 19 unchanged lines hidden (view full) --- 58 */ 59#if __BSD_VISIBLE 60#define LITTLE_ENDIAN _LITTLE_ENDIAN 61#define BIG_ENDIAN _BIG_ENDIAN 62#define PDP_ENDIAN _PDP_ENDIAN 63#define BYTE_ORDER _BYTE_ORDER 64#endif 65 | 31 */ 32 33#ifndef _MACHINE_ENDIAN_H_ 34#define _MACHINE_ENDIAN_H_ 35 36#include <sys/cdefs.h> 37#include <sys/_types.h> 38 --- 19 unchanged lines hidden (view full) --- 58 */ 59#if __BSD_VISIBLE 60#define LITTLE_ENDIAN _LITTLE_ENDIAN 61#define BIG_ENDIAN _BIG_ENDIAN 62#define PDP_ENDIAN _PDP_ENDIAN 63#define BYTE_ORDER _BYTE_ORDER 64#endif 65 |
66#if defined(__GNUC__) && defined(__OPTIMIZE__) | 66#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__) |
67#define __is_constant(x) __builtin_constant_p(x) 68#else 69#define __is_constant(x) 0 70#endif 71 72#define __bswap16_const(x) ((x >> 8) | ((x << 8) & 0xff00)) 73#define __bswap32_const(x) ((x >> 24) | ((x >> 8) & 0xff00) | \ 74 ((x << 8) & 0xff0000) | ((x << 24) & 0xff000000)) --- 44 unchanged lines hidden --- | 67#define __is_constant(x) __builtin_constant_p(x) 68#else 69#define __is_constant(x) 0 70#endif 71 72#define __bswap16_const(x) ((x >> 8) | ((x << 8) & 0xff00)) 73#define __bswap32_const(x) ((x >> 24) | ((x >> 8) & 0xff00) | \ 74 ((x << 8) & 0xff0000) | ((x << 24) & 0xff000000)) --- 44 unchanged lines hidden --- |