linux/arch/mips
Maciej W. Rozycki b0984c4370 MIPS: Fix microMIPS LL/SC immediate offsets
In the microMIPS encoding some memory access instructions have their
immediate offset reduced to 12 bits only.  That does not match the GCC
`R' constraint we use in some places to satisfy the requirement,
resulting in build failures like this:

{standard input}: Assembler messages:
{standard input}:720: Error: macro used $at after ".set noat"
{standard input}:720: Warning: macro instruction expanded into multiple instructions

Fix the problem by defining a macro, `GCC_OFF12_ASM', that expands to
the right constraint depending on whether microMIPS or standard MIPS
code is produced.  Also apply the fix to where `m' is used as in the
worst case this change does nothing, e.g. where the pointer was already
in a register such as a function argument and no further offset was
requested, and in the best case it avoids an extraneous sequence of up
to two instructions to load the high 20 bits of the address in the LL/SC
loop.  This reduces the risk of lock contention that is the higher the
more instructions there are in the critical section between LL and SC.

Strictly speaking we could just bulk-replace `R' with `ZC' as the latter
constraint adjusts automatically depending on the ISA selected.
However it was only introduced with GCC 4.9 and we keep supporing older
compilers for the standard MIPS configuration, hence the slightly more
complicated approach I chose.

The choice of a zero-argument function-like rather than an object-like
macro was made so that it does not look like a function call taking the
C expression used for the constraint as an argument.  This is so as not
to confuse the reader or formatting checkers like `checkpatch.pl' and
follows previous practice.

Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8482/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-11-24 07:45:36 +01:00
..
alchemy MIPS: Alchemy: Remove direct access to prepare_count field of struct clk 2014-11-24 07:45:17 +01:00
ar7 mips: Convert pr_warning to pr_warn 2014-11-24 07:44:51 +01:00
ath25 MIPS: ath25: add Wireless device support 2014-11-24 07:45:29 +01:00
ath79 MIPS: ath79: Read the initrd address from the firmware environment 2014-11-24 07:45:30 +01:00
bcm47xx MIPS: BCM47XX: Clean up nvram header 2014-11-24 07:45:08 +01:00
bcm63xx MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
bcm3384 MIPS: bcm3384: Initial commit of bcm3384 platform support 2014-11-24 07:45:13 +01:00
boot MIPS: bcm3384: Initial commit of bcm3384 platform support 2014-11-24 07:45:13 +01:00
cavium-octeon MIPS: Octeon: Mark octeon_model_get_string() with __init 2014-11-24 07:45:32 +01:00
cobalt
configs MIPS: bcm3384: Initial commit of bcm3384 platform support 2014-11-24 07:45:13 +01:00
dec
emma
fw MIPS: FW: Use kstrtoul() to parse unsigned long from the fw environment 2014-11-24 07:45:26 +01:00
include MIPS: Fix microMIPS LL/SC immediate offsets 2014-11-24 07:45:36 +01:00
jazz
jz4740 This is the bulk of GPIO changes for the v3.17 development 2014-08-08 18:00:35 -07:00
kernel MIPS: signal.c: Fix an invalid cast in ISA mode bit handling 2014-11-24 07:45:36 +01:00
kvm KVM: remove garbage arg to *hardware_{en,dis}able 2014-08-29 16:35:55 +02:00
lantiq MIPS: lantiq: add missing spi clock on falcon SoC 2014-11-24 07:45:18 +01:00
lasat MIPS: Lasat: Add missing CONFIG_PROC_FS dependency to PICVUE_PROC 2014-10-21 17:35:44 +02:00
lib MIPS: lib: mips-atomic.c: Remove obsolete ifdefery 2014-11-24 07:45:33 +01:00
loongson MIPS: loongson: common: rtc: make loongson_rtc_resources static 2014-11-24 07:45:35 +01:00
loongson1 MIPS: Loongson1B: Add a clockevent/clocksource using PWM Timer 2014-11-24 07:45:09 +01:00
math-emu MIPS: Support for hybrid FPRs 2014-11-24 07:45:07 +01:00
mm MIPS: mm: Only build one microassembler that is suitable 2014-11-24 07:45:36 +01:00
mti-malta clocksource: mips-gic: Move gic_frequency to clocksource driver 2014-11-24 07:45:15 +01:00
mti-sead3 MIPS: Move gic.h to include/linux/irqchip/mips-gic.h 2014-11-24 07:44:59 +01:00
net Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-10-18 14:24:36 -07:00
netlogic MIPS: Netlogic: Move device-trees to arch/mips/boot/dts/ 2014-09-22 13:35:50 +02:00
oprofile MIPS: oprofile: Backtrace: don't fail on leaf functions 2014-11-24 07:45:31 +01:00
paravirt
pci MIPS: ath25: add AR2315 PCI host controller driver 2014-11-24 07:45:28 +01:00
pmcs-msp71xx MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
pnx833x
power nosave: consolidate __nosave_{begin,end} in <asm/sections.h> 2014-10-09 22:26:04 -04:00
ralink MIPS: ralink: add rt2880 pci driver 2014-11-24 07:45:25 +01:00
rb532 MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sgi-ip22 MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sgi-ip27 MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sgi-ip32
sibyte MIPS: Remove useless parentheses 2014-11-24 07:44:49 +01:00
sni
txx9 mips: Convert pr_warning to pr_warn 2014-11-24 07:44:51 +01:00
vr41xx
Kbuild
Kbuild.platforms MIPS: ath25: add common parts 2014-11-24 07:45:26 +01:00
Kconfig MIPS: Kconfig: Only allow 32-bit microMIPS builds 2014-11-24 07:45:36 +01:00
Kconfig.debug MIPS: Kconfig option to better exercise/debug hybrid FPRs 2014-11-24 07:45:08 +01:00
Makefile MIPS: IP22/IP32: Add line to arch/mips/Makefile archhelp about vmlinux.32 2014-11-24 07:45:33 +01:00