nios2.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
  4. * Scott McNutt <smcnutt@psyent.com>
  5. */
  6. #ifndef __ASM_NIOS2_H__
  7. #define __ASM_NIOS2_H__
  8. /*------------------------------------------------------------------------
  9. * Control registers -- use with wrctl() & rdctl()
  10. *----------------------------------------------------------------------*/
  11. #define CTL_STATUS 0 /* Processor status reg */
  12. #define CTL_ESTATUS 1 /* Exception status reg */
  13. #define CTL_BSTATUS 2 /* Break status reg */
  14. #define CTL_IENABLE 3 /* Interrut enable reg */
  15. #define CTL_IPENDING 4 /* Interrut pending reg */
  16. /*------------------------------------------------------------------------
  17. * Access to control regs
  18. *----------------------------------------------------------------------*/
  19. #define rdctl(reg) __builtin_rdctl(reg)
  20. #define wrctl(reg, val) __builtin_wrctl(reg, val)
  21. /*------------------------------------------------------------------------
  22. * Control reg bit masks
  23. *----------------------------------------------------------------------*/
  24. #define STATUS_IE (1<<0) /* Interrupt enable */
  25. #define STATUS_U (1<<1) /* User-mode */
  26. /*------------------------------------------------------------------------
  27. * Bit-31 Cache bypass -- only valid for data access. When data cache
  28. * is not implemented, bit 31 is ignored for compatibility.
  29. *----------------------------------------------------------------------*/
  30. #define CACHE_BYPASS(a) ((a) | 0x80000000)
  31. #define CACHE_NO_BYPASS(a) ((a) & ~0x80000000)
  32. #endif /* __ASM_NIOS2_H__ */