linux/arch/mips/kernel
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
..
8250-platform.c [MIPS] Put an end to <asm/serial.h>'s long and annyoing existence 2007-07-10 17:33:01 +01:00
asm-offsets.c [MIPS] Extract {PGD,PMD,PTE}_ORDER into asm-offset.h 2007-08-27 02:16:49 +01:00
binfmt_elfn32.c [PATCH] elf: Always define elf_addr_t in linux/elf.h 2006-12-07 08:39:38 -08:00
binfmt_elfo32.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
branch.c [MIPS] Add some __user tags 2007-07-13 17:40:01 +01:00
cpu-bugs64.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
cpu-probe.c [MIPS] Add BUG_ON assertion for attempt to run kernel on the wrong CPU type. 2007-10-11 23:46:18 +01:00
early_printk.c [MIPS] early_printk: allow the early console to run earlier 2007-05-11 14:28:30 +01:00
entry.S [MIPS] SMTC: Interrupt mask backstop hack 2007-07-12 17:41:17 +01:00
gdb-low.S [MIPS] TRACE_IRQFLAGS_SUPPORT support. 2006-07-13 21:26:09 +01:00
gdb-stub.c [MIPS] Kill num_online_cpus() loops. 2007-10-11 23:46:18 +01:00
genex.S [MIPS] SMTC: Interrupt mask backstop hack 2007-07-12 17:41:17 +01:00
head.S [MIPS] Fix modpost warning in raw binary builds. 2007-10-17 18:28:46 +01:00
i8253.c [MIPS] i8253 PIT clocksource and clockevent drivers 2007-10-11 23:46:10 +01:00
i8259.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
init_task.c [PATCH] nsproxy: move init_nsproxy into kernel/nsproxy.c 2006-10-02 07:57:20 -07:00
irix5sys.S
irixelf.c core_pattern: ignore RLIMIT_CORE if core_pattern is a pipe 2007-10-17 08:42:50 -07:00
irixinv.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
irixioctl.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
irixsig.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
irq-gt641xx.c [MIPS] Add GT641xx IRQ routines. 2007-10-11 23:46:04 +01:00
irq-msc01.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
irq-rm7000.c [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
irq-rm9000.c [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
irq.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
irq_cpu.c [MIPS] use name instead of typename for each irq_chip 2007-02-06 16:53:14 +00:00
irq_txx9.c [MIPS] Remove dead code from irq_txx9.c 2007-08-27 02:16:54 +01:00
kspd.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
linux32.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
machine_kexec.c [MIPS] Unconditionally writeback and invalidate caches on kexec. 2007-08-27 02:16:59 +01:00
Makefile kbuild: enable 'make CFLAGS=...' to add additional options to CC 2007-10-14 22:21:35 +02:00
mips-mt-fpaff.c [MIPS] Fixup secure computing stuff. 2007-07-31 21:35:21 +01:00
mips-mt.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
mips_ksyms.c [MIPS] Export __copy_user_inatomic. 2007-03-07 00:07:17 +00:00
module.c [MIPS] Load modules to CKSEG0 if CONFIG_BUILD_ELF64=n 2006-11-30 01:14:44 +00:00
pcspeaker.c [MIPS] Rename PC speaker code 2007-07-12 17:41:23 +01:00
proc.c [MIPS] Make facility to convert CPU types to strings generally available. 2007-10-11 23:46:17 +01:00
process.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
ptrace.c Consolidate PTRACE_DETACH 2007-10-16 09:42:49 -07:00
ptrace32.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
r4k_fpu.S [MIPS] Check FCSR for pending interrupts, alternative version 2007-03-17 01:03:25 +00:00
r4k_switch.S [MIPS] Fix resume for 64K page size on R4000 class processors. 2007-07-12 17:41:05 +01:00
r2300_fpu.S kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
r2300_switch.S [MIPS] Disallow CpU exception in kernel again. 2007-04-20 14:58:37 +01:00
r6000_fpu.S kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
relocate_kernel.S [MIPS] Kexec: Fix several 64-bit bugs. 2007-07-31 21:35:36 +01:00
reset.c [MIPS] Export pm_power_off 2006-12-10 21:52:11 +00:00
rtlx.c [MIPS] rtlx: Fix build error. 2007-09-14 19:08:42 +01:00
scall32-o32.S [MIPS] Wire up the fallocate syscall. 2007-07-31 21:35:22 +01:00
scall64-64.S [MIPS] Wire up the fallocate syscall. 2007-07-31 21:35:22 +01:00
scall64-n32.S [MIPS] N32 needs to use compat_sys_futimesat 2007-09-14 19:08:42 +01:00
scall64-o32.S [MIPS] Fix fallocate on o32 binary compat ABI 2007-09-28 19:27:20 +01:00
semaphore.c Always use ".set mips3" rather than select between "mips2" or "mips3" 2005-10-29 19:31:31 +01:00
setup.c [MIPS] ARC: Get rid of mips_machgroup 2007-10-11 23:46:08 +01:00
signal-common.h [MIPS] Retry {save,restore}_fp_context if failed in atomic context. 2007-04-20 14:58:37 +01:00
signal.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
signal32.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
signal_n32.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
smp-mt.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
smp.c [MIPS] SMP: Fix use of cpumasks. 2007-10-13 00:53:01 +01:00
smtc-asm.S [MIPS] SMTC: Don't set and restore irqregs ptr from self_ipi. 2007-06-11 18:20:53 +01:00
smtc-proc.c [MIPS] MT: Improved multithreading support. 2006-04-19 04:14:28 +02:00
smtc.c [MIPS] Kill num_online_cpus() loops. 2007-10-11 23:46:18 +01:00
stacktrace.c simplify the stacktrace code 2007-05-08 11:14:58 -07:00
syscall.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
sysirix.c [MIPS] checkfiles: Fix "need space after that ','" errors. 2007-10-11 23:46:15 +01:00
time.c [MIPS] Increase cp0 compare clockevent min_delta_ns from 0x30 to 0x300. 2007-10-16 18:23:50 +01:00
topology.c [MIPS] Do topology_init even on uniprocessor kernels. 2006-11-29 16:21:34 +00:00
traps.c [MIPS] SYNC emulation for MIPS I processors 2007-10-17 18:28:47 +01:00
unaligned.c [MIPS] Fix "no space between function name and open parenthesis" warnings. 2007-10-11 23:46:15 +01:00
vmlinux.lds.S [MIPS] vmlinux.lds.S: Handle KPROBES_TEXT. 2007-10-16 18:23:46 +01:00
vpe.c [MIPS] VPE loader: convert from struct class_ device to struct device 2007-10-16 18:23:49 +01:00