vmm.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * VMM startup file.
  3. *
  4. * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd
  5. *
  6. * This file is part of RT-Thread (http://www.rt-thread.org)
  7. * Maintainer: bernard.xiong <bernard.xiong at gmail.com>
  8. *
  9. * All rights reserved.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License along
  22. * with this program; if not, write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  24. *
  25. * Change Logs:
  26. * Date Author Notes
  27. * 2013-06-15 Bernard the first verion
  28. */
  29. #ifndef __VMM_H__
  30. #define __VMM_H__
  31. #ifndef __ASSEMBLY__
  32. #include <stddef.h> // for size_t
  33. #endif
  34. #define VMM_VERIFY_GUEST
  35. #include <rtt_api.h>
  36. #ifndef __ASSEMBLY__
  37. void vmm_iomap_init(struct vmm_iomap *iomap);
  38. unsigned long vmm_find_iomap(const char *name);
  39. unsigned long vmm_find_iomap_by_pa(unsigned long pa);
  40. void vmm_vector_init(void);
  41. #ifndef RT_USING_LOGTRACE
  42. /* If the rshell is run, we could not rt_kprintf in some situation because
  43. * write to a vbus channel *Would BLOCK*. So we cannot use it in interrupt
  44. * context, we cannot use it within the context of idle(vmm). */
  45. #define vmm_debug(fmt, ...)
  46. #define vmm_verbose(fmt, ...)
  47. #define vmm_info(fmt, ...)
  48. #else // have RT_USING_LOGTRACE
  49. #define vmm_debug(fmt, ...) log_trace(LOG_TRACE_DEBUG "[vmm]"fmt, ##__VA_ARGS__)
  50. #define vmm_verbose(fmt, ...) log_trace(LOG_TRACE_VERBOSE"[vmm]"fmt, ##__VA_ARGS__)
  51. #define vmm_info(fmt, ...) log_trace(LOG_TRACE_INFO "[vmm]"fmt, ##__VA_ARGS__)
  52. #endif // RT_USING_LOGTRACE
  53. #endif
  54. #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
  55. #endif