History log of /arch/sh/kernel/traps_32.c
Revision Date Author Comments
a3c195144e162097c42e4284323ed6d386de105d 03-Apr-2014 Bobby Bingham <koorogi@koorogi.info> sh: don't pass saved userspace state to exception handlers

The compiler is permitted to generate code which overwrites the
parameters to a function. If those parameters include the only saved
copy we have of userspace's registers, we're in trouble.

Signed-off-by: Bobby Bingham <koorogi@koorogi.info>
Cc: Paul Mundt <paul.mundt@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4603f53a1dc3c76dfba841d123db9fa6204934f5 18-Jun-2013 Paul Gortmaker <paul.gortmaker@windriver.com> sh: delete __cpuinit usage from all sh files

The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.

This removes all the arch/sh uses of the __cpuinit macros from
all C files. Currently sh does not have any __CPUINIT used in
assembly files.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
5f857bce21cfd0531dc7d4daac74d976caf6166b 14-Jun-2012 Paul Mundt <lethal@linux-sh.org> sh: Consolidate die definitions for trap handlers.

This kills off the _64 versions and consolidates on the more robust _32
versions instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
49453264997f232008efae457553d82381f9614f 24-May-2012 Paul Mundt <lethal@linux-sh.org> sh64: Convert to unwinder API.

This switches over to use the sh unwinder API which brings it all in line
with the general sh routines (which we shuffle around at the same time),
and lets us kill off more sh64-specific cruft.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e839ca528718e68cad32a307dc9aabf01ef3eb05 28-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for SH

Disintegrate asm/system.h for SH.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-sh@vger.kernel.org
34f7145a63211eb7ecfcafa6c2a8db5646baf953 24-Aug-2011 Phil Edworthy <Phil.Edworthy@renesas.com> sh: Add unaligned memory access for PC relative intructions

This adds unaligned memory access support for the following instructions:
mov.w @(disp,PC),Rn
mov.l @(disp,PC),Rn

These instructions are often used on SH2A toolchains.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
0710b91c516ffd448db6e80e9026f11778a80d45 22-Aug-2011 Phil Edworthy <Phil.Edworthy@renesas.com> sh: Fix unaligned memory access for branches without delay slots

This patch just clears the return code for those cases where an
unaligned memory access occurs on branch instructions without a
delay slot.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
a8b0ca17b80e92faab46ee7179ba9e99ccb61233 27-Jun-2011 Peter Zijlstra <a.p.zijlstra@chello.nl> perf: Remove the nmi parameter from the swevent and overflow interface

The nmi parameter indicated if we could do wakeups from the current
context, if not, we would set some state and self-IPI and let the
resulting interrupt do the wakeup.

For the various event classes:

- hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from
the PMI-tail (ARM etc.)
- tracepoint: nmi=0; since tracepoint could be from NMI context.
- software: nmi=[0,1]; some, like the schedule thing cannot
perform wakeups, and hence need 0.

As one can see, there is very little nmi=1 usage, and the down-side of
not using it is that on some platforms some software events can have a
jiffy delay in wakeup (when arch_irq_work_raise isn't implemented).

The up-side however is that we can remove the nmi parameter and save a
bunch of conditionals in fast paths.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Michael Cree <mcree@orcon.net.nz>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Eric B Munson <emunson@mgebm.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Don Zickus <dzickus@redhat.com>
Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
82a3242e11d9e63c8195be46c954efaefee35e22 13-May-2011 Greg Kroah-Hartman <gregkh@suse.de> sysfs: remove "last sysfs file:" line from the oops messages

On some arches (x86, sh, arm, unicore, powerpc) the oops message would
print out the last sysfs file accessed.

This was very useful in finding a number of sysfs and driver core bugs
in the 2.5 and early 2.6 development days, but it has been a number of
years since this file has actually helped in debugging anything that
couldn't also be trivially determined from the stack traceback.

So it's time to delete the line. This is good as we need all the space
we can get for oops messages at times on consoles.

Acked-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ace2dc7d12693545b67f15ab8cdb3d255c937713 12-Oct-2010 Paul Mundt <lethal@linux-sh.org> sh: wire up perf alignment and emulation faults.

This plugs in the alignment and emulation fault reporting for perf sw
events.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
68a1aed7039e5a94a8e60e23fdf676738c36086a 24-Sep-2010 Magnus Damm <damm@opensource.se> sh: boot kernel with SR.BL set

Update the SH kernel to keep SR.BL set until the VBR
register has been initialized. Useful to allow boot
of the kernel even though exceptions are pending.

Without this patch there is a window of time when
exceptions such as NMI are enabled but no exception
handlers are installed.

This patch modifies both the zImage loader and the
actual kernel to boot with BL=1, but the zImage
loader is modfied in such a way that the init_sr
value is unchanged to not break the zImage loader
provided by kexec.

Tested on sh7724 Ecovec and on the SH4AL-DSP core
included in sh7372.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
49f3bfe9334a4cf86079d2ee1d08e674b58862a9 16-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Setup boot CPU VBR early to enable early page faults.

vmemmap and the vmsplit code amongst others need to be able to take page
faults much earlier than trap_init() time, so move this in to the early
CPU initialization. VBR setup for secondary CPUs is already handled
through start_secondary(), so we only need to do this for the boot CPU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
a99eae5417a09e0be66bf574a9a79a2a7388c967 12-Jan-2010 Paul Mundt <lethal@linux-sh.org> sh: Split out the unaligned counters and user bits.

This splits out the unaligned access counters and userspace bits in to
their own generic interface, which will allow them to be wired up on sh64
too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
191d0d24b632eb69767705acded5cbf7449ad457 12-Jan-2010 Paul Mundt <lethal@linux-sh.org> sh: Tidy up the sh bios VBR handling.

This moves the VBR handling out of the main trap handling code and in to
the sh-bios helper code. A couple of accessors are added in order to
permit other kernel code to get at the VBR value for state save/restore
paths.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
c4761815ab49feca904776dec464046bc7138d3a 04-Jan-2010 Paul Mundt <lethal@linux-sh.org> sh: Fix up breakpoint trap handler patching on SH-2A.

SH-2A was referencing the old handler that no longer exists, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1232d88a47626cad13ba82f3a9ea814820bc1c65 14-Dec-2009 Paul Mundt <lethal@linux-sh.org> sh: Make the unaligned trap handler always obey notification levels.

Presently there are a couple of paths in to the alignment handler, where
only the address error path presently quiets the notificiation messages
based on the configuration settings. We carry over the notification level
tests to the default alignment handler itself incase so that they behave
uniformly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
9a1607071c293e48b08bd703733480b1d55c7b93 27-Nov-2009 Alexey Dobriyan <adobriyan@gmail.com> sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15dfdddbf0c2be680d5d2fe2bbe3aad3dba3cf0e 18-Oct-2009 Paul Mundt <lethal@linux-sh.org> sh: Disable SCIF2 on the SH-X3 proto CPU.

SCIF2 and the FPU exceptions happen to share vector numbers, one in
EXPEVT and the other in INTEVT. This is a violation of the interface and
should have never made it in to silicon. On top of that, the demux hack
that was added for special dispatch is rather error prone, and introduces
more problems than it solves. Kill all of it off, and just refuse to deal
with SCIF2 outright.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
af67c3a9e68ee0a9e30ee8582577408adba0e299 13-Oct-2009 Paul Mundt <lethal@linux-sh.org> sh: update die() output.

This follows the ARM change, as SH had all of the same issues:

Make die() better match x86:
- add printing of the last accessed sysfs file
- ensure console_verbose() is called under the lock
- ensure we panic outside of oops_exit()

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
8406638ab041b3f1ab3d49d6fe1989e25f3ffcad 30-Sep-2009 Paul Mundt <lethal@linux-sh.org> sh: Disable unaligned kernel access printks by default.

Certain networking and USB workloads generate floods of these accesses,
so just disable it by default (thereby restoring the old behaviour). The
option remains configurable from userspace, and can still be used as a
debugging aid.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
40258ee97d0d5e5c30a3d4b7acaf294fe82cd23f 24-Sep-2009 Paul Mundt <lethal@linux-sh.org> sh: Fix up uninitialized variable use caught by gcc 4.4.

In the unaligned kernel exception fixup case the printk() was ordered
before the copy_from_user(), resulting in a nonsensical instruction
value. This fixes up the ordering properly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
23c4c82171008c8b18d8627c9741cdd577631cea 24-Sep-2009 Paul Mundt <lethal@linux-sh.org> sh: Handle unaligned 16-bit instructions on SH-2A.

This adds some sanity checking in the unaligned instruction handler to
verify the instruction size, which enables basic support for 16-bit
fixups on SH-2A parts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
480c646c32f368dfa2a076f7a120a7795e786e62 16-Sep-2009 Paul Mundt <lethal@linux-sh.org> sh: Kill off unused se_skipped in alignment trap notification code.

Nothing is using this, resulting in a build error with certain
configurations. Just kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
4aa5ac4ef44dd8c986241c54298abd7910b78b3f 28-Aug-2009 Matt Fleming <matt@console-pimps.org> sh: Only shout about fixing up unexpected unaligned accesses

Some unaligned accesses are completely expected. For example, the
trapped_io code uses the unaligned access fixup code path so there's no
need to warn about having to fixup the unaligned access.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
5a0ab35e43a6e3c69893c0091fe6a78ea8b3e443 24-Aug-2009 Andre Draszik <andre.draszik@st.com> sh: cleanup of do_address_error()

This patch fixes a few problems with the existing code in do_address_error().

a) the variable used to printk()d the offending instruction wasn't
initialized correctly. This is a fix to bug 5727

b) behaviour for CONFIG_CPU_SH2A wasn't correct

c) the 'ignore address error' behaviour didn't update the PC, causing an
infinite loop.

Signed-off-by: Andre Draszik <andre.draszik@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
7436cde6b2ca71049051620c68c26522bb3403bf 24-Aug-2009 Andre Draszik <andre.draszik@st.com> sh: Allow user control over misaligned fixup handling

This patch brings the SH4 misaligned trap handler in line with what
happens on ARM:
Add a /proc/cpu/alignment which can be read from to get alignment
trap statistics and written to to influence the behaviour of the
alignment trap handling. The value to write is a bitfield, which
has the following meaning: 1 warn, 2 fixup, 4 signal
In addition, we add a /proc/cpu/kernel_alignment, to enable or
disable warnings in case of kernel code causing alignment errors.

Signed-off by: Andre Draszik <andre.draszik@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
9a4af027a03e10e97f56081cd7dd1fda5282bd9c 24-Aug-2009 Andre Draszik <andre.draszik@st.com> sh: ratelimit unaligned fixups

This patch makes sure we see messages about unaligned access fixups
every now and then. Else especially userspace apps suffering from
bad programming won't ever be noticed...

Signed-off by: Andre Draszik <andre.draszik@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b344e24a8e8ceda83d1285d22e3e5baf4f5e42d3 16-Aug-2009 Matt Fleming <matt@console-pimps.org> sh: unwinder: Introduce UNWINDER_BUG() and UNWINDER_BUG_ON()

We can't assume that if we execute the unwinder code and the unwinder
was already running that it has faulted. Clearly two kernel threads can
invoke the unwinder at the same time and may be running simultaneously.

The previous approach used BUG() and BUG_ON() in the unwinder code to
detect whether the unwinder was incapable of unwinding the stack, and
that the next available unwinder should be used instead. A better
approach is to explicitly invoke a trap handler to switch unwinders when
the current unwinder cannot continue.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
4e14dfc722b8e9e07a355f97aa60a3d9f0739071 07-Aug-2009 Matt Fleming <matt@console-pimps.org> sh: Use the generalized stacktrace ops

Copy the stacktrace ops code from x86 and provide a central function for
use by functions that need to dump a callstack.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2bcfffa42309b6f73042c62459bf5207762a271d 09-May-2009 Paul Mundt <lethal@linux-sh.org> sh: Rename opcode_t to insn_size_t.

This is now clashing with a driver, so just rename it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
cd89436e54b29a07a383ee82f2f718d8c9d24cc4 08-May-2009 Peter Griffin <pgriffin@mpc-data.co.uk> sh: Add UBC trap vector for SH2A

Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
01ab10393c510342ec4ce85df11ccfa3df06bbb2 03-Apr-2009 Michael Trimarchi <trimarchi@gandalf.sssup.it> sh: Fix up DSP context save/restore.

There were a number of issues with the DSP context save/restore code,
mostly left-over relics from when it was introduced on SH3-DSP with
little follow-up testing, resulting in things like task_pt_dspregs()
referencing incorrect state on the stack.

This follows the MIPS convention of tracking the DSP state in the
thread_struct and handling the state save/restore in switch_to() and
finish_arch_switch() respectively. The regset interface is also updated,
which allows us to finally be rid of task_pt_dspregs() and the special
cased task_pt_regs().

Signed-off-by: Michael Trimarchi <michael@evidence.eu.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2afb447f33c29cb000a494396559f8005d3e33c1 21-Jan-2009 SUGIOKA Toshinobu <sugioka@itonet.co.jp> sh: fix unaligned and nonexistent address handling

unaligned and nonexistent address causes wrong exception
handling in traps_32.c(handle_unaligned_access).

'handle_unalinged_ins' should return -EFAULT if address error
is fixed up with kernel exception table, otherwise
'handle_unaligned_access' increases already fixed program counter
and then crash.

for example
ioctl(fd, TCGETA, (struct termio *)-1)
never return and stay in TASK_UNINTERRUPTIBLE state forever
in my kernel.

Signed-off-by: SUGIOKA Toshinobu <sugioka@itonet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
ba84be2338d3a2b6020d39279335bb06fcd332e1 06-Jan-2009 Russell King <rmk+kernel@arm.linux.org.uk> remove linux/hardirq.h from asm-generic/local.h

While looking at reducing the amount of architecture namespace pollution
in the generic kernel, I found that asm/irq.h is included in the vast
majority of compilations on ARM (around 650 files.)

Since asm/irq.h includes a sub-architecture include file on ARM, this
causes a negative impact on the ccache's ability to re-use the build
results from other sub-architectures, so we have a desire to reduce the
dependencies on asm/irq.h.

It turns out that a major cause of this is the needless include of
linux/hardirq.h into asm-generic/local.h. The patch below removes this
include, resulting in some 250 to 300 files (around half) of the kernel
then omitting asm/irq.h.

My test builds still succeed, provided two ARM files are fixed
(arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
negative impacts for this on other architectures.

Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
asm/local.h, so this patch can be viewed as bringing the generic version
into line with the x86 version.

[kosaki.motohiro@jp.fujitsu.com: add #include <linux/irqflags.h> to acpi/processor_idle.c]
[adobriyan@gmail.com: fix sparc64]
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ab6e570ba33dbee18c2520d386e0f367a9b573c3 11-Dec-2008 Paul Mundt <lethal@linux-sh.org> sh: Generic kgdb stub support.

This migrates from the old bitrotted kgdb stub implementation and moves
to the generic stub. In the process support for SH-2/SH-2A is also added,
which the old stub never provided.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
75fd24c1073adcd1e8ea43048d946bbfa34dfc64 26-Nov-2008 Paul Mundt <lethal@linux-sh.org> sh: Tidy up backtrace formatting with kallsyms disabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
edfd6da0405520b147ab1473ad183a5b32be7082 26-Nov-2008 Paul Mundt <lethal@linux-sh.org> sh: Add a few more branch types to the branch emulator.

This plugs in some extra encodings for matching more bsr/bsrf/jsr
branches.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
c9306f0efbfbe65a6e9212082f1d1fc19fdc3094 21-Oct-2008 Paul Mundt <lethal@linux-sh.org> sh: Wire up oops reporting in the die notifier chain.

Commit 3f5a54e371ca20b119b73704f6c01b71295c1714 ("ftrace: dump out ftrace
buffers to console on panic") added an ftrace buffer dumper that hooks
in to the die notifier chain and dumps out data in the oops path.

Unfortunately SH supported ftrace but didn't support DIE_OOPS, so add
that in and get it building again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
4c59e2942e92d2d776bcd038604a5c3c1d56d3ac 20-Sep-2008 Paul Mundt <lethal@linux-sh.org> sh: Move lookup_exception_vector() out to asm/system_32.h.

There are other places where we want to have access to the trap/exception
number, so move out the lookup_exception_vector() helper. While we're at
it, refactor it slightly to return the vector instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b3d765f5df5707e2b3676768b6877db5d8db76a2 17-Sep-2008 Paul Mundt <lethal@linux-sh.org> sh: Fix up fpu emu build.

The addition of the kprobes code pushed down a variable declaration,
clean it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
d39f5450146ff39f66cfde9d5184420627d0ac51 05-Sep-2008 Chris Smith <chris.smith@st.com> sh: Add kprobes support.

Initial support for kprobes/kretprobes for 32-bit SH platforms.

[ General cleanup and some rework for the kretprobe hash lock. -- PFM ]

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
fa43972fab24a3c050e880a7831f9378c6cebc0b 04-Sep-2008 Paul Mundt <lethal@linux-sh.org> sh: fixup many sparse errors.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
6e80f5e8c4c685eb7bc34c3916e3d986b03f9981 09-Jul-2008 Yoshinori Sato <ysato@users.sourceforge.jp> sh2(A) exception handler update

This patch is

By sh2
- Remove duplicate code
- Reduce stack usage
- Cleanup and little optimize

By sh2a
- Add missing handler(256 to 511)
- Use sh2a instructions handler

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
fad0f90134197259b5a935c69d7556ee847f242c 15-Apr-2008 Andrew Morton <akpm@linux-foundation.org> sh: arch/sh/kernel/traps_32.c needs asm/fpu.h

arch/sh/kernel/traps_32.c: In function `do_reserved_inst':
arch/sh/kernel/traps_32.c:667: error: implicit declaration of function `do_fpu_inst'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e7cc9a7340b8ec018caa9eb1d035fdaef1f2fc51 07-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: trapped io support V2

The idea is that we want to get rid of the in/out/readb/writeb callbacks from
the machvec and replace that with simple inline read and write operations to
memory. Fast and simple for most hardware devices (think pci).

Some devices require special treatment though - like 16-bit only CF devices -
so we need to have some method to hook in callbacks.

This patch makes it possible to add a per-device trap generating filter. This
way we can get maximum performance of sane hardware - which doesn't need this
filter - and crappy hardware works but gets punished by a performance hit.

V2 changes things around a bit and replaces io access callbacks with a
simple minimum_bus_width value. In the future we can add stride as well.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
4b5a9ef5279aed2c34d92fee62cf6d0c6ffacbaa 07-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: use opcode_t and enable unaligned code for sh2a

This patch converts the unaligned access handling code to use opcode_t
instead of u16. While at it, enable unaligned access handling for sh2a.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
4252c659a4e7f4260e4bdc87538578236c51ab2d 07-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: add byte support to the sign extension code

This patch adds byte support to the sign extension code. Unaligned access
traps should never be generated on 8-bit io operations, but we will use this
code for trapped io and we do need byte support there.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
86c0179c9307bd600a96a44d623814c33bdbe0f0 06-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: break out unaligned sign extension code

Break out the sign extension code since it's used in multiple places.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
74d99a5e262229ee865f6f68528d10b82471ead6 26-Nov-2007 Paul Mundt <lethal@linux-sh.org> sh: SH-2A FPU support.

Signed-off-by: Kieran Bingham <kbingham@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
5a4f7c66be981c6b5f44a4d66a14ea6ac9b7b6b0 20-Nov-2007 Paul Mundt <lethal@linux-sh.org> sh: Share bug/debug traps across _32 and _64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2f75fbf16bd87f36f3e72396b603bc6689e04be4 10-Nov-2007 Paul Mundt <lethal@linux-sh.org> sh: Move in the SH-5 traps.c impl.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>