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 14 #ifndef __VMM_H__ 15 #define __VMM_H__ 16 17 #ifndef __ASSEMBLY__ 18 #include <stddef.h> // for size_t 19 #endif 20 21 #define VMM_VERIFY_GUEST 22 23 #include <rtt_api.h> 24 25 #ifndef __ASSEMBLY__ 26 27 void vmm_iomap_init(struct vmm_iomap *iomap); 28 unsigned long vmm_find_iomap(const char *name); 29 unsigned long vmm_find_iomap_by_pa(unsigned long pa); 30 31 void vmm_vector_init(void); 32 33 #ifndef RT_USING_LOGTRACE 34 /* If the rshell is run, we could not rt_kprintf in some situation because 35 * write to a vbus channel *Would BLOCK*. So we cannot use it in interrupt 36 * context, we cannot use it within the context of idle(vmm). */ 37 #define vmm_debug(fmt, ...) 38 #define vmm_verbose(fmt, ...) 39 #define vmm_info(fmt, ...) 40 #else // have RT_USING_LOGTRACE 41 #define vmm_debug(fmt, ...) log_trace(LOG_TRACE_DEBUG "[vmm]"fmt, ##__VA_ARGS__) 42 #define vmm_verbose(fmt, ...) log_trace(LOG_TRACE_VERBOSE"[vmm]"fmt, ##__VA_ARGS__) 43 #define vmm_info(fmt, ...) log_trace(LOG_TRACE_INFO "[vmm]"fmt, ##__VA_ARGS__) 44 #endif // RT_USING_LOGTRACE 45 #endif 46 47 #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0])) 48 49 #endif 50