4 #include "host-utils.h"
6 #include "hw/lm32_pic.h"
7 #include "hw/lm32_juart.h"
9 #if !defined(CONFIG_USER_ONLY)
10 #define MMUSUFFIX _mmu
12 #include "exec/softmmu_template.h"
14 #include "exec/softmmu_template.h"
16 #include "exec/softmmu_template.h"
18 #include "exec/softmmu_template.h"
20 void helper_raise_exception(CPULM32State *env, uint32_t index)
22 env->exception_index = index;
26 void helper_hlt(CPULM32State *env)
29 env->exception_index = EXCP_HLT;
33 void helper_wcsr_im(CPULM32State *env, uint32_t im)
35 lm32_pic_set_im(env->pic_state, im);
38 void helper_wcsr_ip(CPULM32State *env, uint32_t im)
40 lm32_pic_set_ip(env->pic_state, im);
43 void helper_wcsr_jtx(CPULM32State *env, uint32_t jtx)
45 lm32_juart_set_jtx(env->juart_state, jtx);
48 void helper_wcsr_jrx(CPULM32State *env, uint32_t jrx)
50 lm32_juart_set_jrx(env->juart_state, jrx);
53 uint32_t helper_rcsr_im(CPULM32State *env)
55 return lm32_pic_get_im(env->pic_state);
58 uint32_t helper_rcsr_ip(CPULM32State *env)
60 return lm32_pic_get_ip(env->pic_state);
63 uint32_t helper_rcsr_jtx(CPULM32State *env)
65 return lm32_juart_get_jtx(env->juart_state);
68 uint32_t helper_rcsr_jrx(CPULM32State *env)
70 return lm32_juart_get_jrx(env->juart_state);
73 /* Try to fill the TLB and return an exception if error. If retaddr is
74 NULL, it means that the function was called in C code (i.e. not
75 from generated code or from helper.c) */
76 void tlb_fill(CPULM32State *env, target_ulong addr, int is_write, int mmu_idx,
81 ret = cpu_lm32_handle_mmu_fault(env, addr, is_write, mmu_idx);
84 /* now we have a real cpu fault */
85 cpu_restore_state(env, retaddr);