change rustsbi and sbi call code
This commit is contained in:
parent
2aea4e5555
commit
b066e30130
|
@ -371,6 +371,7 @@ extern "C" fn start_trap_rust(trap_frame: &mut TrapFrame) {
|
|||
match cause {
|
||||
Trap::Exception(Exception::SupervisorEnvCall) => {
|
||||
if trap_frame.a7 == 0x0A000004 && trap_frame.a6 == 0x210 {
|
||||
println!("[rustsbi] set S-level external interrupt handler");
|
||||
// We use implementation specific sbi_rustsbi_k210_sext function (extension
|
||||
// id: 0x0A000004, function id: 0x210) to register S-level interrupt handler
|
||||
// for K210 chip only. This chip uses 1.9.1 version of privileged spec,
|
||||
|
|
Binary file not shown.
|
@ -91,6 +91,7 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
|
|||
}
|
||||
|
||||
static inline void sbi_set_extern_interrupt(unsigned long func_pointer) {
|
||||
SBI_CALL_1(0x09, func_pointer);
|
||||
asm volatile("mv a6, %0" : : "r" (0x210));
|
||||
SBI_CALL_1(0x0A000004, func_pointer);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue