linux/arch
Maciej W. Rozycki 82b89152f0 MIPS: LD/SD o32 macro GAS fix update
I am about to commit:

http://sourceware.org/ml/binutils/2010-10/msg00033.html

that fixes a problem with the LD/SD macro currently implemented by GAS for
the o32 ABI in an inconsistent way.  This is best illustrated with a
simple program, which I'm copying here from the message above for easier
reference:

$ cat ld.s
	ld	$5,32767($4)
	ld	$5,32768($4)

This gets assebled into the following output:

$ mips-linux-as -32 -mips3 -o ld.o ld.s
$ mips-linux-objdump -d ld.o

ld.o:     file format elf32-tradbigmips

Disassembly of section .text:

00000000 <.text>:
   0:	dc857fff 	ld	a1,32767(a0)
   4:	3c010001 	lui	at,0x1
   8:	00810821 	addu	at,a0,at
   c:	8c258000 	lw	a1,-32768(at)
  10:	8c268004 	lw	a2,-32764(at)
	...

Oops!

 The GAS fix makes the macro behave in a consistent way and pairs of LW/SW
instructions to be output as appropriate regardless of the size of the
offset associated with the address used.  The machine instruction is still
available, but to reach it macros have to be disabled first.  This has a
side effect of requiring the use of a machine-addressable memory operand.

 As some platforms require 64-bit operations for accesses to some I/O
registers LD/SD instructions are used in a couple of places in Linux
regardless of the ABI selected.  Here's a fix for some pieces of code
affected I've been able to track down.  The fix should be backwards
compatible with all supported binutils releases in existence and can be
used as a reference for any other places or off-tree code.  The use of the
"R" constraint guarantees a machine-addressable operand.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1680/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-12-16 18:11:01 +00:00
..
alpha Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
arm Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-12-14 17:36:35 -08:00
avr32 Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
blackfin BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
cris Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
frv BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
h8300 BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
ia64 SCSI host lock push-down 2010-11-16 13:33:23 -08:00
m32r Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
m68k BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
m68knommu BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
microblaze Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
mips MIPS: LD/SD o32 macro GAS fix update 2010-12-16 18:11:01 +00:00
mn10300 MN10300: Fix interrupt mask alteration function call name in gdbstub 2010-12-07 11:29:14 -08:00
parisc parisc: convert the rest of the irq handlers to simple/percpu 2010-12-04 11:15:19 -05:00
powerpc powerpc: Use call_rcu_sched() for pagetables 2010-11-30 10:42:20 +11:00
s390 [S390] nohz/s390: fix arch_needs_cpu() return value on offline cpus 2010-12-01 10:08:17 +01:00
score Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
sh sh: wire up accept4 syscall (non-multiplexed path) 2010-12-14 17:58:10 +09:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2010-12-14 17:34:00 -08:00
tile Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2010-11-25 07:42:32 +09:00
um uml: disable winch irq before freeing handler data 2010-11-25 06:50:39 +09:00
x86 Merge branches 'x86-fixes-for-linus', 'perf-fixes-for-linus' and 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-12-08 06:40:59 -08:00
xtensa Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2010-10-28 16:16:39 -07:00
.gitignore
Kconfig jump label: Add work around to i386 gcc asm goto bug 2010-10-29 14:45:29 -04:00