platform.h 801 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef PLATFORM_H_
  2. #define PLATFORM_H_
  3. #ifdef __ASSEMBLER__
  4. #define _AC(X,Y) X
  5. #define _AT(T,X) X
  6. #else
  7. #define _AC(X,Y) (X##Y)
  8. #define _AT(T,X) ((T)(X))
  9. #endif /* !__ASSEMBLER__*/
  10. /****************************************************************************
  11. * Platform definitions
  12. *****************************************************************************/
  13. // CPU info
  14. #define NUM_CORES 2
  15. #define MAX_HART_ID 1
  16. // The hart that non-SMP tests should run on
  17. #ifndef NONSMP_HART
  18. #define NONSMP_HART 0
  19. #endif
  20. // Memory map
  21. #define CLINT_CTRL_ADDR _AC(0x2000000,UL)
  22. #define CLINT_CTRL_SIZE _AC(0x10000,UL)
  23. #define CLINT_CTRL_MTIME _AC(0x200BFF8,UL)
  24. #define CLINT_CTRL_HART0_MTIMECMP _AC(0x2004000,UL)
  25. #define CLINT_CTRL_HART1_MTIMECMP _AC(0x2004008,UL)
  26. #endif