WSL2-Linux-Kernel/arch/mips/include/asm/octeon
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
..
cvmx-address.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-agl-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-asm.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
cvmx-asxx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-bootinfo.h MIPS: OCTEON: cvmx-bootinfo: add D-Link DSR-1000N 2014-08-02 00:06:42 +02:00
cvmx-bootmem.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-ciu-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-ciu2-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-cmd-queue.h MIPS: Fix microMIPS LL/SC immediate offsets 2014-11-24 07:45:36 +01:00
cvmx-config.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-dbg-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-dpi-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-fau.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-fpa-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-fpa.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-gmxx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-gpio-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-helper-board.h MIPS: OCTEON: Supply OCTEON+ USB nodes in internal device trees. 2014-01-23 13:02:35 +01:00
cvmx-helper-errata.h MIPS: Add Cavium OCTEON PCI support. 2009-06-17 11:06:25 +01:00
cvmx-helper-jtag.h MIPS: Add Cavium OCTEON PCI support. 2009-06-17 11:06:25 +01:00
cvmx-helper-loop.h MIPS: Octeon: Rearrange CVMX files in preperation for device tree 2011-12-07 22:03:29 +00:00
cvmx-helper-npi.h MIPS: Octeon: Rearrange CVMX files in preperation for device tree 2011-12-07 22:03:29 +00:00
cvmx-helper-rgmii.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-helper-sgmii.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-helper-spi.h MIPS: Octeon: Rearrange CVMX files in preperation for device tree 2011-12-07 22:03:29 +00:00
cvmx-helper-util.h Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-03-02 07:44:16 -08:00
cvmx-helper-xaui.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-helper.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-iob-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-ipd-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-ipd.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-l2c-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-l2c.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-l2d-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-l2t-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-led-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-lmcx-defs.h MIPS: OCTEON: Add definitions for OCTEON memory contoller registers. 2012-12-13 18:15:25 +01:00
cvmx-mdio.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-mio-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-mixx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-mpi-defs.h MIPS: OCTEON: Add register definitions for SPI host hardware. 2012-08-22 23:46:38 +02:00
cvmx-npei-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-npi-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-packet.h MIPS: Add Cavium OCTEON processor support files to arch/mips/cavium-octeon/executive and asm/octeon. 2009-01-11 09:57:20 +00:00
cvmx-pci-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pciercx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pcsx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pcsxx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pemx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pescx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pexp-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pip-defs.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-pip.h treewide: Fix common typo in "identify" 2013-10-14 15:31:06 +02:00
cvmx-pko-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pko.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-pow-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-pow.h mips: Convert pr_warning to pr_warn 2014-11-24 07:44:51 +01:00
cvmx-rnm-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-scratch.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-sli-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-smix-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-spi.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-spinlock.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-spxx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-sriox-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-srxx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-stxx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-sysinfo.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx-uctlx-defs.h MIPS: OCTEON: Update register definitions. 2012-08-31 10:46:53 -07:00
cvmx-wqe.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cvmx.h MIPS: Octeon: Mark octeon_model_get_string() with __init 2014-11-24 07:45:32 +01:00
octeon-feature.h MIPS: Octeon: Delete potentially dangerous feature checks 2014-11-24 07:45:32 +01:00
octeon-model.h MIPS: Octeon: Mark octeon_model_get_string() with __init 2014-11-24 07:45:32 +01:00
octeon.h MIPS: Octeon: Remove checks for CONFIG_CAVIUM_GDB 2014-05-23 15:12:39 +02:00
pci-octeon.h MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00