1 /*
2  * Copyright (C) 2011 Andes Technology Corporation
3  * Copyright (C) 2010 Shawn Lin (nobuhiro@andestech.com)
4  * Copyright (C) 2011 Macpaul Lin (macpaul@andestech.com)
5  * Copyright (C) 2017 Rick Chen (rick@andestech.com)
6  *
7  * This file is subject to the terms and conditions of the GNU General Public
8  * License.  See the file "COPYING" in the main directory of this archive
9  * for more details.
10  */
11 
12 #ifndef __ASM_RISCV_TYPES_H
13 #define __ASM_RISCV_TYPES_H
14 
15 #include <asm-generic/int-ll64.h>
16 
17 typedef unsigned short umode_t;
18 
19 /*
20  * These aren't exported outside the kernel to avoid name space clashes
21  */
22 #ifdef __KERNEL__
23 
24 #ifdef CONFIG_ARCH_RV64I
25 #define BITS_PER_LONG 64
26 #else
27 #define BITS_PER_LONG 32
28 #endif
29 
30 #include <stddef.h>
31 
32 #ifdef CONFIG_DMA_ADDR_T_64BIT
33 typedef u64 dma_addr_t;
34 #else
35 typedef u32 dma_addr_t;
36 #endif
37 
38 typedef unsigned long long phys_addr_t;
39 typedef unsigned long long phys_size_t;
40 
41 #endif /* __KERNEL__ */
42 
43 #endif
44