types.h 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #include <asm-generic/int-ll64.h>
  14. typedef unsigned short umode_t;
  15. /*
  16. * These aren't exported outside the kernel to avoid name space clashes
  17. */
  18. #ifdef __KERNEL__
  19. #ifdef CONFIG_ARCH_RV64I
  20. #define BITS_PER_LONG 64
  21. #else
  22. #define BITS_PER_LONG 32
  23. #endif
  24. #include <stddef.h>
  25. #ifdef CONFIG_DMA_ADDR_T_64BIT
  26. typedef u64 dma_addr_t;
  27. #else
  28. typedef u32 dma_addr_t;
  29. #endif
  30. typedef unsigned long long phys_addr_t;
  31. typedef unsigned long long phys_size_t;
  32. #endif /* __KERNEL__ */
  33. #endif