vmm.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * VMM startup file.
  3. *
  4. * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd
  5. * All rights reserved
  6. *
  7. * SPDX-License-Identifier: Apache-2.0
  8. *
  9. * Change Logs:
  10. * Date Author Notes
  11. * 2013-06-15 Bernard the first verion
  12. */
  13. #ifndef __VMM_H__
  14. #define __VMM_H__
  15. #ifndef __ASSEMBLY__
  16. #include <stddef.h> // for size_t
  17. #endif
  18. #define VMM_VERIFY_GUEST
  19. #include <rtt_api.h>
  20. #ifndef __ASSEMBLY__
  21. void vmm_iomap_init(struct vmm_iomap *iomap);
  22. unsigned long vmm_find_iomap(const char *name);
  23. unsigned long vmm_find_iomap_by_pa(unsigned long pa);
  24. void vmm_vector_init(void);
  25. #ifndef RT_USING_LOGTRACE
  26. /* If the rshell is run, we could not rt_kprintf in some situation because
  27. * write to a vbus channel *Would BLOCK*. So we cannot use it in interrupt
  28. * context, we cannot use it within the context of idle(vmm). */
  29. #define vmm_debug(fmt, ...)
  30. #define vmm_verbose(fmt, ...)
  31. #define vmm_info(fmt, ...)
  32. #else // have RT_USING_LOGTRACE
  33. #define vmm_debug(fmt, ...) log_trace(LOG_TRACE_DEBUG "[vmm]"fmt, ##__VA_ARGS__)
  34. #define vmm_verbose(fmt, ...) log_trace(LOG_TRACE_VERBOSE"[vmm]"fmt, ##__VA_ARGS__)
  35. #define vmm_info(fmt, ...) log_trace(LOG_TRACE_INFO "[vmm]"fmt, ##__VA_ARGS__)
  36. #endif // RT_USING_LOGTRACE
  37. #endif
  38. #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
  39. #endif