https://github.com/torvalds/linux
Revision ba00376b0b13f234d839541a7b36a5bf5c2a4036 authored by Chris Metcalf on 13 August 2010, 20:37:00 UTC, committed by Chris Metcalf on 13 August 2010, 20:37:00 UTC
Until now, the tile architecture ABI for syscall return has just been
that r0 holds the return value, and an error is only signalled like it is
for kernel code, with a negative small number.

However, this means that in multiple places in userspace we end up writing
the same three-cycle idiom that tests for a small negative number for
error.  It seems cleaner to instead move that code into the kernel, and
set r1 to hold zero on success or errno on failure; previously, r1 was
just zeroed on return from the kernel (to avoid leaking kernel state).
This way a single conditional branch after the syscall is sufficient
to test for the failure case.  The number of cycles taken is the same,
but the error-checking code is in just one place, so total code size is
smaller, and random userspace syscall code is easier to understand.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
1 parent c745a8a
History
Tip revision: ba00376b0b13f234d839541a7b36a5bf5c2a4036 authored by Chris Metcalf on 13 August 2010, 20:37:00 UTC
arch/tile: extend syscall ABI to set r1 on return as well.
Tip revision: ba00376
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore -rw-r--r-- 936 bytes
.mailmap -rw-r--r-- 3.9 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 91.8 KB
Kbuild -rw-r--r-- 2.4 KB
MAINTAINERS -rw-r--r-- 171.7 KB
Makefile -rw-r--r-- 50.5 KB
README -rw-r--r-- 17.0 KB
REPORTING-BUGS -rw-r--r-- 3.3 KB

README

back to top