4 #include "qemu/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
)
28 CPUState
*cs
= CPU(lm32_env_get_cpu(env
));
31 env
->exception_index
= EXCP_HLT
;
35 void HELPER(wcsr_im
)(CPULM32State
*env
, uint32_t im
)
37 lm32_pic_set_im(env
->pic_state
, im
);
40 void HELPER(wcsr_ip
)(CPULM32State
*env
, uint32_t im
)
42 lm32_pic_set_ip(env
->pic_state
, im
);
45 void HELPER(wcsr_jtx
)(CPULM32State
*env
, uint32_t jtx
)
47 lm32_juart_set_jtx(env
->juart_state
, jtx
);
50 void HELPER(wcsr_jrx
)(CPULM32State
*env
, uint32_t jrx
)
52 lm32_juart_set_jrx(env
->juart_state
, jrx
);
55 uint32_t HELPER(rcsr_im
)(CPULM32State
*env
)
57 return lm32_pic_get_im(env
->pic_state
);
60 uint32_t HELPER(rcsr_ip
)(CPULM32State
*env
)
62 return lm32_pic_get_ip(env
->pic_state
);
65 uint32_t HELPER(rcsr_jtx
)(CPULM32State
*env
)
67 return lm32_juart_get_jtx(env
->juart_state
);
70 uint32_t HELPER(rcsr_jrx
)(CPULM32State
*env
)
72 return lm32_juart_get_jrx(env
->juart_state
);
75 /* Try to fill the TLB and return an exception if error. If retaddr is
76 NULL, it means that the function was called in C code (i.e. not
77 from generated code or from helper.c) */
78 void tlb_fill(CPULM32State
*env
, target_ulong addr
, int is_write
, int mmu_idx
,
83 ret
= cpu_lm32_handle_mmu_fault(env
, addr
, is_write
, mmu_idx
);
86 /* now we have a real cpu fault */
87 cpu_restore_state(env
, retaddr
);