types.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #ifndef __ASM_RISCV_TYPES_H
  12. #define __ASM_RISCV_TYPES_H
  13. typedef unsigned short umode_t;
  14. /*
  15. * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
  16. * header files exported to user space
  17. */
  18. typedef __signed__ char __s8;
  19. typedef unsigned char __u8;
  20. typedef __signed__ short __s16;
  21. typedef unsigned short __u16;
  22. typedef __signed__ int __s32;
  23. typedef unsigned int __u32;
  24. #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
  25. typedef __signed__ long long __s64;
  26. typedef unsigned long long __u64;
  27. #endif
  28. /*
  29. * These aren't exported outside the kernel to avoid name space clashes
  30. */
  31. #ifdef __KERNEL__
  32. typedef signed char s8;
  33. typedef unsigned char u8;
  34. typedef signed short s16;
  35. typedef unsigned short u16;
  36. typedef signed int s32;
  37. typedef unsigned int u32;
  38. typedef signed long long s64;
  39. typedef unsigned long long u64;
  40. #define BITS_PER_LONG 32
  41. #include <stddef.h>
  42. typedef u32 dma_addr_t;
  43. typedef unsigned long phys_addr_t;
  44. typedef unsigned long phys_size_t;
  45. #endif /* __KERNEL__ */
  46. #endif