linux/arch/mips
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
..
alchemy MIPS: Alchemy: fix build with SERIAL_8250=n 2010-12-16 18:11:01 +00:00
ar7 MIPS: AR7: Fix loops per jiffies on TNETD7200 devices 2010-12-16 18:10:56 +00:00
bcm47xx MIPS: BCM47xx: Swap serial console if ttyS1 was specified. 2010-12-16 18:11:00 +00:00
bcm63xx MIPS: Decouple BMIPS CPU support from bcm47xx/bcm63xx SoC code 2010-10-29 19:08:50 +01:00
boot Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus 2010-10-18 13:10:36 -07:00
cavium-octeon MIPS: Add platform device and Kconfig for Octeon USB EHCI / OHCI 2010-10-29 19:08:45 +01:00
cobalt MIPS: Move Cobalt Makefile parts to their own Platform file 2010-08-05 13:25:47 +01:00
configs defconfig reduction 2010-08-14 22:26:53 +02:00
dec Merge git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-irqflags 2010-10-21 14:37:27 -07:00
emma MIPS: Ritually kill stupid printk. 2010-08-05 13:26:27 +01:00
fw MIPS: IP22: Remove an unused function 2009-12-17 01:56:56 +00:00
include/asm MIPS: LD/SD o32 macro GAS fix update 2010-12-16 18:11:01 +00:00
jazz MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
jz4740 MIPS: JZ4740: Fix pcm device name 2010-12-16 18:10:57 +00:00
kernel MIPS: MT: Fix typo in comment. 2010-12-16 18:11:00 +00:00
lasat MIPS: Lasat: Migrate to new platform makefile style. 2010-08-05 13:25:53 +01:00
lib MIPS: Separate two consecutive loads in memset.S 2010-12-16 18:10:57 +00:00
loongson MIPS: Loongson: Add return value check for strict_strtoul() 2010-12-16 18:10:55 +00:00
math-emu MIPS: Send proper signal and siginfo on FP emulator faults. 2010-12-16 18:10:57 +00:00
mipssim MIPS: MIPSsim: Migrate to new Platform file 2010-08-05 13:25:45 +01:00
mm MIPS: Rename mips_dma_cache_sync back to dma_cache_sync 2010-12-16 18:11:01 +00:00
mti-malta MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
nxp/pnx8550/common MIPS: PNX8550: Move code one directory level up. 2010-08-05 13:25:56 +01:00
oprofile MIPS: Oprofile: Fixup of loongson2_exit() 2010-07-05 17:17:31 +01:00
pci MIPS: Octeon: Rewrite DMA mapping functions. 2010-10-29 19:08:32 +01:00
pmc-sierra MIPS: LD/SD o32 macro GAS fix update 2010-12-16 18:11:01 +00:00
pnx833x MIPS: Fix gen_nand probe structures contents 2010-08-12 12:22:49 +01:00
pnx8550 MIPS: PNX8550: Sort out machine halt, restart and powerdown functions. 2010-10-04 18:33:57 +01:00
power MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
powertv MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
rb532 MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
sgi-ip22 MIPS: IP22, IP28: Migrate to new platform makefile style. 2010-08-05 13:25:49 +01:00
sgi-ip27 MIPS: IP27: Migrate to new Platform file 2010-08-05 13:25:47 +01:00
sgi-ip32 MIPS: IP32: Migrate to new platform makefile style. 2010-08-05 13:25:50 +01:00
sibyte MIPS: Swarm: Fix typo in symbol name: RTC_M4LT81 -> RTC_M41T81 2010-12-16 18:10:52 +00:00
sni MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
txx9 MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
vr41xx MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
wrppmc MIPS: WRPPMC: Migrate to new platform makefile style. 2010-08-05 13:25:51 +01:00
Kbuild MIPS: Repair Kbuild make clean breakage. 2010-10-19 18:32:39 +01:00
Kbuild.platforms MIPS: JZ4740: Add Kbuild files 2010-08-05 13:26:17 +01:00
Kconfig MIPS: Rework GENERIC_HARDIRQS Kconfig. 2010-12-16 18:10:56 +00:00
Kconfig.debug MIPS: IRQ: Add stackoverflow detection 2010-10-29 19:08:27 +01:00
Makefile MIPS: Octeon: Apply CN63XXP1 errata workarounds. 2010-10-29 19:08:43 +01:00