remarkable-linux/arch/sh/kernel
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
..
cpu sh: provide unified syscall trap compatible with all SH models 2016-03-17 19:46:06 +00:00
vsyscall arm64,ia64,ppc,s390,sh,tile,um,x86,mm: remove default gate area 2014-08-08 15:57:27 -07:00
.gitignore
asm-offsets.c sh: Remove signal translation and exec_domain 2015-04-12 20:58:25 +02:00
crash_dump.c
debugtraps.S
disassemble.c
dma-nommu.c
dumpstack.c sh: fix format string bug in stack tracer 2014-04-03 16:20:49 -07:00
dwarf.c arch/sh/kernel/dwarf.c: use mempool_create_slab_pool() 2015-04-14 16:48:56 -07:00
entry-common.S sh: provide unified syscall trap compatible with all SH models 2016-03-17 19:46:06 +00:00
ftrace.c sh: ftrace: Fix the comments for ftrace_modify_code() 2015-12-23 14:27:24 -05:00
head_32.S
head_64.S
hw_breakpoint.c sh: Replace __get_cpu_var uses 2014-06-04 16:53:52 -07:00
idle.c sched/idle, SH: Remove redundant cpuidle_idle_call() 2014-02-11 09:58:26 +01:00
io.c
io_trapped.c Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP 2014-04-07 16:36:11 -07:00
iomap.c
ioport.c
irq.c sh/irq: Use access helper irq_data_get_affinity_mask() 2015-07-29 10:08:08 +02:00
irq_32.c
irq_64.c
kdebugfs.c
kgdb.c arch/sh/kernel/kgdb.c: add missing #include <linux/sched.h> 2014-01-21 16:19:42 -08:00
kprobes.c sh: Replace __get_cpu_var uses 2014-06-04 16:53:52 -07:00
localtimer.c sh/localtimer: Migrate to new 'set-state' interface 2015-08-10 11:41:04 +02:00
machine_kexec.c
machvec.c
Makefile Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP 2014-04-07 16:36:11 -07:00
module.c
nmi_debug.c
perf_callchain.c
perf_event.c treewide: Remove old email address 2015-11-23 09:44:58 +01:00
process.c sh: delete __cpuinit usage from all sh files 2013-07-14 19:36:53 -04:00
process_32.c sh: move fpu_counter into ARCH specific thread_struct 2013-11-13 12:09:13 +09:00
process_64.c sh64: kernel: remove useless variable 'regs' 2013-11-13 12:08:59 +09:00
ptrace.c
ptrace_32.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
ptrace_64.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
reboot.c
relocate_kernel.S
return_address.c
setup.c memblock: make memblock_set_node() support different memblock_type 2014-01-21 16:19:44 -08:00
sh_bios.c
sh_ksyms_32.c sh: New gcc support 2016-03-17 19:45:44 +00:00
sh_ksyms_64.c
signal_32.c Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc 2015-04-15 13:53:55 -07:00
signal_64.c Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc 2015-04-15 13:53:55 -07:00
smp.c Fix weird uses of num_online_cpus(). 2015-03-10 13:54:42 +10:30
stacktrace.c
swsusp.c
sys_sh.c
sys_sh32.c sh: push extra copy of r0-r2 for syscall parameters 2014-04-03 16:20:52 -07:00
syscalls_32.S
syscalls_64.S
time.c arch/sh/kernel/time.c: use PTR_ERR_OR_ZERO 2014-08-06 18:01:12 -07:00
topology.c
traps.c
traps_32.c sh: don't pass saved userspace state to exception handlers 2014-04-03 16:20:52 -07:00
traps_64.c arch/sh/kernel/traps_64.c: use sign_extend64() for sign extension 2015-11-06 17:50:42 -08:00
unwinder.c
vmlinux.lds.S