-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.h
50 lines (40 loc) · 1.49 KB
/
type.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*****************************************************************************/
/* File: type.h */
/* */
/* Description: Data types */
/* */
/* Author: Shoily O Rahman <[email protected]> */
/* */
/* Date: Mar 24, 2020 */
/* */
/*****************************************************************************/
#ifndef _TYPE_H
#define _TYPE_H
typedef int bool;
#define true 1
#define false 0
typedef char byte;
#define NULL (void*)0
typedef unsigned char u8;
typedef char s8;
typedef unsigned short u16;
typedef short s16;
typedef unsigned int u32;
typedef int s32;
typedef long long s64;
typedef unsigned long long u64;
typedef u32 size_t;
typedef u64 addr64_t;
#define ALIGN_LONG(size) ((size + sizeof(long) - 1) & ~(sizeof(long) - 1))
#define ADDPTRS(x, y) ((long)(x) + (long)(y))
typedef unsigned long addr_t;
#ifdef CONFIG_64
#define ADDPTRS64 ADDPTRS
#define PTR64(x) (x)
#define PTR(x) ((u64)x)
#else
#define ADDPTRS64(x, y) ((u64)(x) + (u64)(y))
#define PTR64(x) ((u64)(u32)(x))
#define PTR(x) ((u32)x)
#endif
#endif