coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
byteorder.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _BYTEORDER_H
4 #define _BYTEORDER_H
5 
6 #define __BIG_ENDIAN 4321
7 
8 #define PPC_BIT(bit) (0x8000000000000000UL >> (bit))
9 #define PPC_BITMASK(bs, be) ((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs))
10 
11 #ifndef __ASSEMBLER__
12 
13 #include <types.h>
14 #define PPC_SHIFT(val, lsb) (((uint64_t)(val)) << (63 - (lsb)))
15 
16 #else
17 #define PPC_SHIFT(val, lsb) ((val) << (63 - (lsb)))
18 #endif
19 
20 #endif /* _BYTEORDER_H */