mirror of https://gitee.com/openkylin/linux.git
b0984c4370
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> |
||
---|---|---|
.. | ||
cvmx-address.h | ||
cvmx-agl-defs.h | ||
cvmx-asm.h | ||
cvmx-asxx-defs.h | ||
cvmx-bootinfo.h | ||
cvmx-bootmem.h | ||
cvmx-ciu-defs.h | ||
cvmx-ciu2-defs.h | ||
cvmx-cmd-queue.h | ||
cvmx-config.h | ||
cvmx-dbg-defs.h | ||
cvmx-dpi-defs.h | ||
cvmx-fau.h | ||
cvmx-fpa-defs.h | ||
cvmx-fpa.h | ||
cvmx-gmxx-defs.h | ||
cvmx-gpio-defs.h | ||
cvmx-helper-board.h | ||
cvmx-helper-errata.h | ||
cvmx-helper-jtag.h | ||
cvmx-helper-loop.h | ||
cvmx-helper-npi.h | ||
cvmx-helper-rgmii.h | ||
cvmx-helper-sgmii.h | ||
cvmx-helper-spi.h | ||
cvmx-helper-util.h | ||
cvmx-helper-xaui.h | ||
cvmx-helper.h | ||
cvmx-iob-defs.h | ||
cvmx-ipd-defs.h | ||
cvmx-ipd.h | ||
cvmx-l2c-defs.h | ||
cvmx-l2c.h | ||
cvmx-l2d-defs.h | ||
cvmx-l2t-defs.h | ||
cvmx-led-defs.h | ||
cvmx-lmcx-defs.h | ||
cvmx-mdio.h | ||
cvmx-mio-defs.h | ||
cvmx-mixx-defs.h | ||
cvmx-mpi-defs.h | ||
cvmx-npei-defs.h | ||
cvmx-npi-defs.h | ||
cvmx-packet.h | ||
cvmx-pci-defs.h | ||
cvmx-pciercx-defs.h | ||
cvmx-pcsx-defs.h | ||
cvmx-pcsxx-defs.h | ||
cvmx-pemx-defs.h | ||
cvmx-pescx-defs.h | ||
cvmx-pexp-defs.h | ||
cvmx-pip-defs.h | ||
cvmx-pip.h | ||
cvmx-pko-defs.h | ||
cvmx-pko.h | ||
cvmx-pow-defs.h | ||
cvmx-pow.h | ||
cvmx-rnm-defs.h | ||
cvmx-scratch.h | ||
cvmx-sli-defs.h | ||
cvmx-smix-defs.h | ||
cvmx-spi.h | ||
cvmx-spinlock.h | ||
cvmx-spxx-defs.h | ||
cvmx-sriox-defs.h | ||
cvmx-srxx-defs.h | ||
cvmx-stxx-defs.h | ||
cvmx-sysinfo.h | ||
cvmx-uctlx-defs.h | ||
cvmx-wqe.h | ||
cvmx.h | ||
octeon-feature.h | ||
octeon-model.h | ||
octeon.h | ||
pci-octeon.h |