[PATCH v3] riscv: entry: set a0 = -ENOSYS only when syscall != -1

Andreas Schwab schwab at suse.de
Wed Jul 19 00:21:43 PDT 2023


On Jul 19 2023, Celeste Liu wrote:

> @@ -308,7 +312,7 @@ asmlinkage __visible __trap_section void do_trap_ecall_u(struct pt_regs *regs)
>  
>  		if (syscall < NR_syscalls)
>  			syscall_handler(regs, syscall);
> -		else
> +		else if ((long)syscall != -1L)

You can also use syscall != -1UL or even syscall != -1.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



More information about the linux-riscv mailing list