1*2c2f96dcSApple OSS Distributions // vim:noexpandtab 2*2c2f96dcSApple OSS Distributions #ifndef __TYPES_H__ 3*2c2f96dcSApple OSS Distributions #define __TYPES_H__ 4*2c2f96dcSApple OSS Distributions 5*2c2f96dcSApple OSS Distributions #include <stdint.h> 6*2c2f96dcSApple OSS Distributions #include <stdbool.h> 7*2c2f96dcSApple OSS Distributions 8*2c2f96dcSApple OSS Distributions typedef signed char s8; 9*2c2f96dcSApple OSS Distributions typedef unsigned char u8; 10*2c2f96dcSApple OSS Distributions typedef uint16_t u16; 11*2c2f96dcSApple OSS Distributions typedef int16_t s16; 12*2c2f96dcSApple OSS Distributions typedef uint32_t u32; 13*2c2f96dcSApple OSS Distributions typedef uint64_t u64; 14*2c2f96dcSApple OSS Distributions typedef int32_t s32; 15*2c2f96dcSApple OSS Distributions typedef int64_t s64; 16*2c2f96dcSApple OSS Distributions 17*2c2f96dcSApple OSS Distributions #if defined(__arm64__) || defined(__x86_64__) 18*2c2f96dcSApple OSS Distributions typedef u64 un; 19*2c2f96dcSApple OSS Distributions typedef s64 sn; 20*2c2f96dcSApple OSS Distributions #else 21*2c2f96dcSApple OSS Distributions typedef u32 un; 22*2c2f96dcSApple OSS Distributions typedef s32 sn; 23*2c2f96dcSApple OSS Distributions #endif 24*2c2f96dcSApple OSS Distributions 25*2c2f96dcSApple OSS Distributions #ifndef __DRT_H__ 26*2c2f96dcSApple OSS Distributions typedef u32 uint; 27*2c2f96dcSApple OSS Distributions #endif 28*2c2f96dcSApple OSS Distributions 29*2c2f96dcSApple OSS Distributions #define volatile_read(atom) (*((volatile typeof(*(atom)) *)(atom))) 30*2c2f96dcSApple OSS Distributions #define volatile_write(atom, value) (*((volatile typeof(*(atom)) *)(atom)) = value) 31*2c2f96dcSApple OSS Distributions 32*2c2f96dcSApple OSS Distributions #endif 33