1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #include <stdint.h> 22 23 typedef unsigned char uint8; /* unsigned 8 bit quantity */ 24 typedef unsigned char uint8; /* unsigned 8 bit quantity */ 25 typedef signed char int8; /* signed 8 bit quantity */ 26 typedef unsigned short uint16; /* unsigned 16 bit quantity */ 27 typedef signed short int16; /* signed 16 bit quantity */ 28 typedef unsigned int uint32; /* unsigned 32 bit quantity */ 29 typedef signed int int32; /* signed 32 bit quantity */ 30 typedef unsigned long long uint64; /* unsigned 32 bit quantity */ 31 typedef signed long long int64; /* signed 32 bit quantity */ 32 33 typedef unsigned char UINT8; /* Unsigned 8 bit quantity */ 34 typedef signed char INT8; /* Signed 8 bit quantity */ 35 typedef unsigned short UINT16; /* Unsigned 16 bit quantity */ 36 typedef signed short INT16; /* Signed 16 bit quantity */ 37 typedef unsigned int UINT32; /* Unsigned 32 bit quantity */ 38 typedef signed int INT32; /* Signed 32 bit quantity */ 39 typedef unsigned long long UINT64; /* Unsigned 32 bit quantity */ 40 typedef signed long long INT64; /* Signed 32 bit quantity */ 41 typedef float FP32; /* Single precision floating point */ 42 typedef double FP64; /* Double precision floating point */ 43 typedef unsigned int size_t; 44 typedef unsigned char BOOLEAN; 45 typedef unsigned int BOOL; 46 47 typedef uint16_t __uint16_t; /* unsigned 16 bit quantity */ 48 typedef uint32_t __uint32_t; /* unsigned 32 bit quantity */ 49 typedef uint64_t __uint64_t; /* unsigned 32 bit quantity */ 50 51 #define BK_TRUE 1 52 #define BK_FALSE 0 53 54 #define LPVOID void* 55 #define VOID void 56 57 typedef volatile signed long VS32; 58 typedef volatile signed short VS16; 59 typedef volatile signed char VS8; 60 61 typedef volatile signed long const VSC32; 62 typedef volatile signed short const VSC16; 63 typedef volatile signed char const VSC8; 64 65 typedef volatile unsigned long VU32; 66 typedef volatile unsigned short VU16; 67 typedef volatile unsigned char VU8; 68 69 typedef volatile unsigned long const VUC32; 70 typedef volatile unsigned short const VUC16; 71 typedef volatile unsigned char const VUC8; 72 73 #ifndef HAVE_UTYPES 74 typedef unsigned char u8; 75 typedef signed char s8; 76 typedef unsigned short u16; 77 typedef signed short s16; 78 typedef unsigned int u32; 79 typedef signed int s32; 80 #endif /* HAVE_UTYPES */ 81 82 typedef unsigned long long u64; 83 typedef long long s64; 84 85 typedef unsigned int __u32; 86 typedef int __s32; 87 typedef unsigned short __u16; 88 typedef signed short __s16; 89 typedef unsigned char __u8; 90 typedef unsigned long long __u64; 91 92 #ifdef __CHECKER__ 93 #define __bitwise__ __attribute__((bitwise)) 94 #else 95 #define __bitwise__ 96 #endif 97 #define __bitwise __bitwise__ 98 99 typedef __u16 __bitwise __le16; 100 typedef __u16 __bitwise __be16; 101 typedef __u32 __bitwise __le32; 102 typedef __u32 __bitwise __be32; 103 typedef __u64 __bitwise __le64; 104 typedef __u64 __bitwise __be64; 105 typedef __u16 __bitwise __sum16; 106 typedef __u32 __bitwise __wsum; 107 108 #ifdef __cplusplus 109 } 110 #endif 111