1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle 4 * Copyright (C) 1999 Silicon Graphics, Inc. 5 */ 6 #ifndef _ASM_TYPES_H 7 #define _ASM_TYPES_H 8 9 #ifndef __ASSEMBLY__ 10 11 typedef unsigned short umode_t; 12 13 /* 14 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the 15 * header files exported to user space 16 */ 17 18 typedef __signed__ char __s8; 19 typedef unsigned char __u8; 20 21 typedef __signed__ short __s16; 22 typedef unsigned short __u16; 23 24 typedef __signed__ int __s32; 25 typedef unsigned int __u32; 26 27 #if defined(__GNUC__) 28 __extension__ typedef __signed__ long long __s64; 29 __extension__ typedef unsigned long long __u64; 30 #else 31 typedef __signed__ long long __s64; 32 typedef unsigned long long __u64; 33 #endif 34 35 #endif /* __ASSEMBLY__ */ 36 37 /* 38 * These aren't exported outside the kernel to avoid name space clashes 39 */ 40 #ifdef __KERNEL__ 41 42 #define BITS_PER_LONG _MIPS_SZLONG 43 44 #ifndef __ASSEMBLY__ 45 46 typedef __signed char s8; 47 typedef unsigned char u8; 48 49 typedef __signed short s16; 50 typedef unsigned short u16; 51 52 typedef __signed int s32; 53 typedef unsigned int u32; 54 55 typedef __signed__ long long s64; 56 typedef unsigned long long u64; 57 58 #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ 59 || defined(CONFIG_64BIT) 60 typedef u64 dma_addr_t; 61 62 typedef u64 phys_addr_t; 63 typedef u64 phys_size_t; 64 65 #else 66 typedef u32 dma_addr_t; 67 68 typedef u32 phys_addr_t; 69 typedef u32 phys_size_t; 70 71 #endif 72 typedef u64 dma64_addr_t; 73 74 /* 75 * Don't use phys_t. You've been warned. 76 */ 77 #ifdef CONFIG_64BIT_PHYS_ADDR 78 typedef unsigned long long phys_t; 79 #else 80 typedef unsigned long phys_t; 81 #endif 82 83 #endif /* __ASSEMBLY__ */ 84 85 #endif /* __KERNEL__ */ 86 87 #endif /* _ASM_TYPES_H */ 88