endian.h (d846855da8c8142a2f647f7a4c6949b341261297) endian.h (7f0f1cfd575a7fa1b47211947f3ab05ba28452b2)
1/*-
2 * Copyright (c) 1987, 1991 Regents of the University of California.
3 * 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

--- 32 unchanged lines hidden (view full) ---

41#include <machine/ansi.h>
42
43/*
44 * Define the order of 32-bit words in 64-bit words.
45 */
46#define _QUAD_HIGHWORD 1
47#define _QUAD_LOWWORD 0
48
1/*-
2 * Copyright (c) 1987, 1991 Regents of the University of California.
3 * 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

--- 32 unchanged lines hidden (view full) ---

41#include <machine/ansi.h>
42
43/*
44 * Define the order of 32-bit words in 64-bit words.
45 */
46#define _QUAD_HIGHWORD 1
47#define _QUAD_LOWWORD 0
48
49#ifndef _POSIX_SOURCE
50/*
51 * Definitions for byte order, according to byte significance from low
52 * address to high.
53 */
49/*
50 * Definitions for byte order, according to byte significance from low
51 * address to high.
52 */
54#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
55#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
56#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
53#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
54#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
55#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
57
56
58#define BYTE_ORDER LITTLE_ENDIAN
59#endif /* ! _POSIX_SOURCE */
57#define _BYTE_ORDER _LITTLE_ENDIAN
60
58
59/*
60 * Deprecated variants that don't have enough underscores to be useful in more
61 * strict namespaces.
62 */
63#if __BSD_VISIBLE
64#define LITTLE_ENDIAN _LITTLE_ENDIAN
65#define BIG_ENDIAN _BIG_ENDIAN
66#define PDP_ENDIAN _PDP_ENDIAN
67#define BYTE_ORDER _BYTE_ORDER
68#endif
69
61#ifdef __GNUC__
62
63#define __word_swap_int(x) \
64__extension__ ({ register __uint32_t __X = (x); \
65 __asm ("rorl $16, %0" : "+r" (__X)); \
66 __X; })
67
68#if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)

--- 50 unchanged lines hidden ---
70#ifdef __GNUC__
71
72#define __word_swap_int(x) \
73__extension__ ({ register __uint32_t __X = (x); \
74 __asm ("rorl $16, %0" : "+r" (__X)); \
75 __X; })
76
77#if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)

--- 50 unchanged lines hidden ---