4 #include "qemu/host-utils.h"
6 #include "hw/lm32/lm32_pic.h"
7 #include "hw/char/lm32_juart.h"
9 #include "exec/softmmu_exec.h"
11 #if !defined(CONFIG_USER_ONLY)
12 #define MMUSUFFIX _mmu
14 #include "exec/softmmu_template.h"
16 #include "exec/softmmu_template.h"
18 #include "exec/softmmu_template.h"
20 #include "exec/softmmu_template.h"
22 void HELPER(raise_exception
)(CPULM32State
*env
, uint32_t index
)
24 env
->exception_index
= index
;
28 void HELPER(hlt
)(CPULM32State
*env
)
30 CPUState
*cs
= CPU(lm32_env_get_cpu(env
));
33 env
->exception_index
= EXCP_HLT
;
37 void HELPER(wcsr_im
)(CPULM32State
*env
, uint32_t im
)
39 lm32_pic_set_im(env
->pic_state
, im
);
42 void HELPER(wcsr_ip
)(CPULM32State
*env
, uint32_t im
)
44 lm32_pic_set_ip(env
->pic_state
, im
);
47 void HELPER(wcsr_jtx
)(CPULM32State
*env
, uint32_t jtx
)
49 lm32_juart_set_jtx(env
->juart_state
, jtx
);
52 void HELPER(wcsr_jrx
)(CPULM32State
*env
, uint32_t jrx
)
54 lm32_juart_set_jrx(env
->juart_state
, jrx
);
57 uint32_t HELPER(rcsr_im
)(CPULM32State
*env
)
59 return lm32_pic_get_im(env
->pic_state
);
62 uint32_t HELPER(rcsr_ip
)(CPULM32State
*env
)
64 return lm32_pic_get_ip(env
->pic_state
);
67 uint32_t HELPER(rcsr_jtx
)(CPULM32State
*env
)
69 return lm32_juart_get_jtx(env
->juart_state
);
72 uint32_t HELPER(rcsr_jrx
)(CPULM32State
*env
)
74 return lm32_juart_get_jrx(env
->juart_state
);
77 /* Try to fill the TLB and return an exception if error. If retaddr is
78 NULL, it means that the function was called in C code (i.e. not
79 from generated code or from helper.c) */
80 void tlb_fill(CPULM32State
*env
, target_ulong addr
, int is_write
, int mmu_idx
,
85 ret
= cpu_lm32_handle_mmu_fault(env
, addr
, is_write
, mmu_idx
);
88 /* now we have a real cpu fault */
89 cpu_restore_state(env
, retaddr
);