diff options
author | James Hogan <james.hogan@imgtec.com> | 2015-01-30 10:40:19 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-01-30 17:04:59 -0500 |
commit | 5e32033e14ca9c7f7341cb383f5a05699b0b5382 (patch) | |
tree | 1c80f121b1d7aed3fd23dbcbb687b8ef526f86dc | |
parent | c7754e75100ed5e3068ac5085747f2bfc386c8d6 (diff) |
MIPS: mipsregs.h: Add write_32bit_cp1_register()
Add a write_32bit_cp1_register() macro to compliment the
read_32bit_cp1_register() macro. This is to abstract whether .set
hardfloat needs to be used based on GAS_HAS_SET_HARDFLOAT.
The implementation of _read_32bit_cp1_register() .sets mips1 due to
failure of gas v2.19 to assemble cfc1 for Octeon (see commit
25c300030016 ("MIPS: Override assembler target architecture for
octeon.")). I haven't copied this over to _write_32bit_cp1_register() as
I'm uncertain whether it applies to ctc1 too, or whether anybody cares
about that version of binutils any longer.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9172/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 5e4aef304b02..5b720d8c2745 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -1386,12 +1386,27 @@ do { \ | |||
1386 | __res; \ | 1386 | __res; \ |
1387 | }) | 1387 | }) |
1388 | 1388 | ||
1389 | #define _write_32bit_cp1_register(dest, val, gas_hardfloat) \ | ||
1390 | do { \ | ||
1391 | __asm__ __volatile__( \ | ||
1392 | " .set push \n" \ | ||
1393 | " .set reorder \n" \ | ||
1394 | " "STR(gas_hardfloat)" \n" \ | ||
1395 | " ctc1 %0,"STR(dest)" \n" \ | ||
1396 | " .set pop \n" \ | ||
1397 | : : "r" (val)); \ | ||
1398 | } while (0) | ||
1399 | |||
1389 | #ifdef GAS_HAS_SET_HARDFLOAT | 1400 | #ifdef GAS_HAS_SET_HARDFLOAT |
1390 | #define read_32bit_cp1_register(source) \ | 1401 | #define read_32bit_cp1_register(source) \ |
1391 | _read_32bit_cp1_register(source, .set hardfloat) | 1402 | _read_32bit_cp1_register(source, .set hardfloat) |
1403 | #define write_32bit_cp1_register(dest, val) \ | ||
1404 | _write_32bit_cp1_register(dest, val, .set hardfloat) | ||
1392 | #else | 1405 | #else |
1393 | #define read_32bit_cp1_register(source) \ | 1406 | #define read_32bit_cp1_register(source) \ |
1394 | _read_32bit_cp1_register(source, ) | 1407 | _read_32bit_cp1_register(source, ) |
1408 | #define write_32bit_cp1_register(dest, val) \ | ||
1409 | _write_32bit_cp1_register(dest, val, ) | ||
1395 | #endif | 1410 | #endif |
1396 | 1411 | ||
1397 | #ifdef HAVE_AS_DSP | 1412 | #ifdef HAVE_AS_DSP |