byteorder.h (302408) | byteorder.h (331756) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * |
29 * $FreeBSD: stable/11/sys/compat/linuxkpi/common/include/asm/byteorder.h 299363 2016-05-10 11:39:36Z hselasky $ | 29 * $FreeBSD: stable/11/sys/compat/linuxkpi/common/include/asm/byteorder.h 331756 2018-03-30 02:04:46Z emaste $ |
30 */ 31#ifndef _ASM_BYTEORDER_H_ 32#define _ASM_BYTEORDER_H_ 33 34#include <sys/types.h> 35#include <sys/endian.h> 36#include <asm/types.h> 37 --- 44 unchanged lines hidden (view full) --- 82#define be16_to_cpus(x) do { *((uint16_t *)(x)) = be16_to_cpup((x)); } while (0) 83 84#define swab16(x) bswap16(x) 85#define swab32(x) bswap32(x) 86#define swab64(x) bswap64(x) 87 88static inline void 89be16_add_cpu(uint16_t *var, uint16_t val) | 30 */ 31#ifndef _ASM_BYTEORDER_H_ 32#define _ASM_BYTEORDER_H_ 33 34#include <sys/types.h> 35#include <sys/endian.h> 36#include <asm/types.h> 37 --- 44 unchanged lines hidden (view full) --- 82#define be16_to_cpus(x) do { *((uint16_t *)(x)) = be16_to_cpup((x)); } while (0) 83 84#define swab16(x) bswap16(x) 85#define swab32(x) bswap32(x) 86#define swab64(x) bswap64(x) 87 88static inline void 89be16_add_cpu(uint16_t *var, uint16_t val) |
90{ | 90{ |
91 *var = cpu_to_be16(be16_to_cpu(*var) + val); 92} 93 94#endif /* _ASM_BYTEORDER_H_ */ | 91 *var = cpu_to_be16(be16_to_cpu(*var) + val); 92} 93 94#endif /* _ASM_BYTEORDER_H_ */ |