linux/arch
Maciej W. Rozycki 60b0d65541 [MIPS] SYNC emulation for MIPS I processors
Userland, including the C library and the dynamic linker, is keen to use
the SYNC instruction, even for "generic" MIPS I binaries these days.
Which makes it less than useful on MIPS I processors.

This change adds the emulation, but as our do_ri() infrastructure was not
really prepared to take yet another instruction, I have rewritten it and
its callees slightly as follows.

Now there is only a single place a possible signal is thrown from.  The
place is at the end of do_ri().  The instruction word is fetched in
do_ri() and passed down to handlers.  The handlers are called in sequence
and return a result that lets the caller decide upon further processing.
If the result is positive, then the handler has picked the instruction,
but a signal should be thrown and the result is the signal number.  If the
result is zero, then the handler has successfully simulated the
instruction.  If the result is negative, then the handler did not handle
the instruction; to make it more obvious the calls do not follow the usual
0/-Exxx result convention they now return -1 instead of -EFAULT.

The calculation of the return EPC is now at the beginning.  The reason is
it is easier to handle it there as emulation callees may modify a register
and an instruction may be located in delay slot of a branch whose result
depends on the register.  It has to be undone if a signal is to be raised,
but it is not a problem as this is the slow-path case, and both actions
are done in single places now rather than the former being scattered
through emulation handlers.

The part of do_cpu() being covered follows the changes to do_ri().

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
2007-10-17 18:28:47 +01:00
..
alpha Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-10-16 11:23:06 -07:00
arm Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup 2007-10-17 09:00:30 -07:00
avr32 Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
blackfin Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-10-16 11:23:06 -07:00
cris remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
frv remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
h8300 remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
i386 Update help text for CONFIG_CRASH_DUMP 2007-10-17 08:43:06 -07:00
ia64 Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block 2007-10-17 09:08:13 -07:00
m32r remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
m68k remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
m68knommu remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
mips [MIPS] SYNC emulation for MIPS I processors 2007-10-17 18:28:47 +01:00
parisc Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-10-16 11:23:06 -07:00
powerpc Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-10-17 09:05:55 -07:00
ppc Merge branch 'for-2.6.24' of git://git.secretlab.ca/git/linux-2.6-mpc52xx into merge 2007-10-17 22:31:13 +10:00
s390 remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
sh Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
sh64 Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
sparc remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
sparc64 Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block 2007-10-17 09:08:13 -07:00
um remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
v850 remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
x86 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup 2007-10-17 09:00:30 -07:00
x86_64 Update help text for CONFIG_CRASH_DUMP 2007-10-17 08:43:06 -07:00
xtensa Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild 2007-10-16 11:23:06 -07:00