diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2017-01-16 00:31:34 +0100 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2017-01-16 06:15:53 +0100 |
commit | c5ebb1d005e1a176b94be136aa21734c03d34d08 (patch) | |
tree | e993aded5e50f5e109c4750e6f33c3b67d92dcc3 /src/arch/riscv/trap_handler.c | |
parent | f676aa4afdadac5dce93ca10a9fe2c4d9ca4edfb (diff) |
riscv: Move mcall numbers to mcall.h, adjust their names
The new name and location make more sense:
- The instruction used to call into machine mode isn't called "ecall"
anymore; it's mcall now.
- Having SBI_ in the name is slightly wrong, too: these numbers are not
part of the Supervisor Binary Interface, they are just used to
forward SBI calls (they could be renumbered arbitrarily without
breaking an OS that's run under coreboot).
Also remove mcall_dev_{req,resp} and the corresponding mcall numbers,
which are no longer used.
Change-Id: I76a8cb04e4ace51964b1cb4f67d49cfee9850da7
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/18146
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch/riscv/trap_handler.c')
-rw-r--r-- | src/arch/riscv/trap_handler.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c index 9a8947c990..4dd3d5bed2 100644 --- a/src/arch/riscv/trap_handler.c +++ b/src/arch/riscv/trap_handler.c @@ -31,42 +31,34 @@ void handle_supervisor_call(trapframe *tf) { uintptr_t arg1 = tf->gpr[11]; /* a1 */ uintptr_t returnValue; switch(call) { - case SBI_ECALL_HART_ID: + case MCALL_HART_ID: printk(BIOS_DEBUG, "Getting hart id...\n"); returnValue = read_csr(0xf14);//mhartid); break; - case SBI_ECALL_NUM_HARTS: + case MCALL_NUM_HARTS: /* TODO: parse the hardware-supplied config string and return the correct value */ returnValue = 1; break; - case SBI_ECALL_CONSOLE_PUT: + case MCALL_CONSOLE_PUTCHAR: returnValue = mcall_console_putchar(arg0); break; - case SBI_ECALL_SEND_DEVICE_REQUEST: - printk(BIOS_DEBUG, "Sending device request...\n"); - returnValue = mcall_dev_req((sbi_device_message*) arg0); - break; - case SBI_ECALL_RECEIVE_DEVICE_RESPONSE: - printk(BIOS_DEBUG, "Getting device response...\n"); - returnValue = mcall_dev_resp(); - break; - case SBI_ECALL_SEND_IPI: + case MCALL_SEND_IPI: printk(BIOS_DEBUG, "Sending IPI...\n"); returnValue = mcall_send_ipi(arg0); break; - case SBI_ECALL_CLEAR_IPI: + case MCALL_CLEAR_IPI: printk(BIOS_DEBUG, "Clearing IPI...\n"); returnValue = mcall_clear_ipi(); break; - case SBI_ECALL_SHUTDOWN: + case MCALL_SHUTDOWN: printk(BIOS_DEBUG, "Shutting down...\n"); returnValue = mcall_shutdown(); break; - case SBI_ECALL_SET_TIMER: + case MCALL_SET_TIMER: returnValue = mcall_set_timer(arg0); break; - case SBI_ECALL_QUERY_MEMORY: + case MCALL_QUERY_MEMORY: printk(BIOS_DEBUG, "Querying memory, CPU #%lld...\n", arg0); returnValue = mcall_query_memory(arg0, (memory_block_info*) arg1); break; |