tree: drop last paragraph of GPL copyright header
[coreboot.git] / payloads / libpayload / include / mips / arch / byteorder.h
blob40412d232ca5144feed7638c034173c83673a3f2
1 /*
2 * This file is part of the libpayload project.
4 * Copyright (C) 2014 Imagination Technologies
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef __MIPS_ARCH_BYTEORDER_H__
17 #define __MIPS_ARCH_BYTEORDER_H__
19 #include <stdint.h>
20 #include <swab.h>
22 #ifndef __ORDER_LITTLE_ENDIAN__
23 #error "What endian are you!?"
24 #endif
26 #define cpu_to_le64(x) ((uint64_t)(x))
27 #define le64_to_cpu(x) ((uint64_t)(x))
28 #define cpu_to_le32(x) ((uint32_t)(x))
29 #define le32_to_cpu(x) ((uint32_t)(x))
30 #define cpu_to_le16(x) ((uint16_t)(x))
31 #define le16_to_cpu(x) ((uint16_t)(x))
32 #define cpu_to_be64(x) swab64(x)
33 #define be64_to_cpu(x) swab64(x)
34 #define cpu_to_be32(x) swab32((x))
35 #define be32_to_cpu(x) swab32((x))
36 #define cpu_to_be16(x) swab16((x))
37 #define be16_to_cpu(x) swab16((x))
39 #endif /* __MIPS_ARCH_BYTEORDER_H__ */