android_kernel_xiaomi_sm8350/arch/m68knommu/kernel
Greg Ungerer 01829e7212 [PATCH] m68knommu: fix a5 reg corruption in signal handlers
This is a patch adapted from a posting by Andrea Tarani which was
pointed out to me by Bernardo Innocenti.  Thanks to both of them for
their help and patience.

The original posting is here:
  http://mailman.uclinux.org/pipermail/uclinux-dev/2005-July/033543.html

The problem first manifest itself as busybox ping terminating with an
"Illegal instruction".  I reduced this to a test case and found that
variable size arrays allocated on the stack could lead to stacks not
aligned on 32 bit boundaries.  For the Coldfire this proved fatal.

Having been pointed out this patch by Bernardo, I applied it and it
fixed the first test case.  I then went back to busybox's ping.  This
still failed with "Illegal instruction", but in a different way.  Before
it depended on the size allocated for the ping buffer, now it happened
every time.  I also found it depended on optimisation level (gcc-3.4.0)
-Os was okay but not -O2.

After a lot of looking, it turned out that register a5 was being
corrupted by the signal handler (after applying the patch).  I re-worked
the patch a bit to save/restore a5 and now all seems well.

Patch submitted by Stuart Hughs <stuarth@freescale.com>

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-10 09:31:26 -08:00
..
asm-offsets.c [PATCH] m68knommu: move some platform irq support out of irq.h 2005-11-07 08:00:47 -08:00
comempci.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dma.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
entry.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
init_task.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
m68k_ksyms.c [PATCH] dump_thread() cleanup 2006-01-10 08:01:25 -08:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
module.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
process.c [PATCH] dump_thread() cleanup 2006-01-10 08:01:25 -08:00
ptrace.c [PATCH] m68knommu: fix mangled 'truct' in ptrace.c 2006-01-10 09:31:26 -08:00
semaphore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
setup.c [PATCH] m68knommu: enable_irq/disable_irq 2006-01-06 08:33:44 -08:00
signal.c [PATCH] m68knommu: fix a5 reg corruption in signal handlers 2006-01-10 09:31:26 -08:00
sys_m68k.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
syscalltable.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
time.c [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
traps.c [PATCH] m68knommu: cleanup showstack() 2005-09-02 00:57:30 -07:00
vmlinux.lds.S [PATCH] m68knommu: align param section and add 5208EVB linker support 2005-11-07 08:00:46 -08:00