mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/riscv: introduce trap_init()
Note that trap_init() isn't declared with the __init attribute to avoid removing __init when multi-CPU support for Xen is added. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
38e7670105
commit
f2dc25686b
3 files changed
+16
No files matched your search
@@ -9,6 +9,7 @@
|
||||
|
||||
void do_trap(struct cpu_user_regs *cpu_regs);
|
||||
void handle_trap(void);
|
||||
void trap_init(void);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <public/version.h>
|
||||
|
||||
#include <asm/early_printk.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
void arch_get_xen_caps(xen_capabilities_info_t *info)
|
||||
{
|
||||
@@ -23,6 +24,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
|
||||
{
|
||||
remove_identity_mapping();
|
||||
|
||||
trap_init();
|
||||
|
||||
printk("All set up\n");
|
||||
|
||||
for ( ;; )
|
||||
|
||||
@@ -12,6 +12,18 @@
|
||||
#include <asm/riscv_encoding.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
/*
|
||||
* Initialize the trap handling.
|
||||
*
|
||||
* The function is called after MMU is enabled.
|
||||
*/
|
||||
void trap_init(void)
|
||||
{
|
||||
unsigned long addr = (unsigned long)&handle_trap;
|
||||
|
||||
csr_write(CSR_STVEC, addr);
|
||||
}
|
||||
|
||||
static const char *decode_trap_cause(unsigned long cause)
|
||||
{
|
||||
static const char *const trap_causes[] = {
|
||||
|
||||