WSL2-Linux-Kernel/arch/sh/kernel/cpu
Rich Felker 3623d13821 sh: provide unified syscall trap compatible with all SH models
Historically SH-2 Linux (and originally uClinux) used a syscall
calling convention incompatible with the established SH-3/4 Linux ABI.
This choice was made because the trap range used by the existing ABI,
0x10-0x17, overlaps with the hardware exception/interrupt trap range
reserved by SH-2, and in particular, with the SH-2A divide-by-zero and
division-overflow exceptions.

Despite the documented syscall convention using the low bits of the
trap number to signal the number of arguments the kernel should
expect, no version of the kernel has ever used this information, nor
is it useful; all of the registers need to be saved anyway. Therefore,
it is possible to pick a new trap number, 0x1f, that is both supported
by all existing SH-3/4 kernels and unassigned as a hardware trap in
the SH-2 range. This makes it possible to produce SH-2 application
binaries that are forwards-compatible with running on SH-3/4 kernels
and to treat SH as a unified platform with varying ISA support levels
rather than multiple gratuitously-incompatible platforms.

This patch adjusts the range checking SH-2 and SH-2A kernels make for
the syscall trap to accept the range 0x1f-0x2f rather than just
0x20-0x2f. As a result, trap 0x1f now acts as a syscall for all SH
models.

Signed-off-by: Rich Felker <dalias@libc.org>
2016-03-17 19:46:06 +00:00
..
irq Disintegrate asm/system.h for SH 2012-03-28 18:30:03 +01:00
sh2 sh: provide unified syscall trap compatible with all SH models 2016-03-17 19:46:06 +00:00
sh2a sh: provide unified syscall trap compatible with all SH models 2016-03-17 19:46:06 +00:00
sh3 sh: fix sh770x SCIF memory regions 2014-10-29 16:33:15 -07:00
sh4 bus: subsys: update return type of ->remove_dev() to void 2015-08-05 17:08:14 -07:00
sh4a sh: sh7734: Correct SCIF type for BRG 2015-12-17 11:19:08 +01:00
sh5 arch/sh/kernel/traps_64.c: use sign_extend64() for sign extension 2015-11-06 17:50:42 -08:00
shmobile cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
Makefile sh: Add PFC platform device registration helper function 2013-01-25 09:24:23 +09:00
adc.c
clock-cpg.c sh: Remove sci_ick clock alias 2015-12-17 11:19:05 +01:00
clock.c ARM: 6483/1: arm & sh: factorised duplicated clkdev.c 2010-11-26 10:51:04 +00:00
fpu.c sh: move fpu_counter into ARCH specific thread_struct 2013-11-13 12:09:13 +09:00
init.c sh: prefix sh-specific "CCR" and "CCR2" by "SH_" 2014-03-04 07:55:49 -08:00
pfc.c sh: Remove unused sh_pfc_register_info() function 2013-01-25 09:24:30 +09:00
proc.c Merge branches 'sh/wdt' and 'sh/rsk-updates' into sh-latest 2012-05-10 17:20:56 +09:00