mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 11:24:42 +00:00
mips: sync asm/asm.h with Linux 5.7
Sync asm/asm.h with Linux 5.7. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
dd1bb42305
commit
eac800043f
1 changed files with 10 additions and 120 deletions
|
@ -16,37 +16,12 @@
|
||||||
|
|
||||||
#include <asm/sgidefs.h>
|
#include <asm/sgidefs.h>
|
||||||
|
|
||||||
#ifndef CAT
|
|
||||||
#ifdef __STDC__
|
|
||||||
#define __CAT(str1, str2) str1##str2
|
|
||||||
#else
|
|
||||||
#define __CAT(str1, str2) str1/**/str2
|
|
||||||
#endif
|
|
||||||
#define CAT(str1, str2) __CAT(str1, str2)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* PIC specific declarations
|
|
||||||
* Not used for the kernel but here seems to be the right place.
|
|
||||||
*/
|
|
||||||
#ifdef __PIC__
|
|
||||||
#define CPRESTORE(register) \
|
|
||||||
.cprestore register
|
|
||||||
#define CPADD(register) \
|
|
||||||
.cpadd register
|
|
||||||
#define CPLOAD(register) \
|
|
||||||
.cpload register
|
|
||||||
#else
|
|
||||||
#define CPRESTORE(register)
|
|
||||||
#define CPADD(register)
|
|
||||||
#define CPLOAD(register)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ENTRY(symbol) \
|
#define ENTRY(symbol) \
|
||||||
.globl symbol; \
|
.globl symbol; \
|
||||||
.type symbol, @function; \
|
.type symbol, @function; \
|
||||||
.ent symbol, 0; \
|
.ent symbol, 0; \
|
||||||
symbol:
|
symbol: .cfi_startproc; \
|
||||||
|
.insn
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LEAF - declare leaf routine
|
* LEAF - declare leaf routine
|
||||||
|
@ -57,7 +32,9 @@ symbol:
|
||||||
.type symbol, @function; \
|
.type symbol, @function; \
|
||||||
.ent symbol, 0; \
|
.ent symbol, 0; \
|
||||||
.section .text.symbol, "x"; \
|
.section .text.symbol, "x"; \
|
||||||
symbol: .frame sp, 0, ra
|
symbol: .frame sp, 0, ra; \
|
||||||
|
.cfi_startproc; \
|
||||||
|
.insn
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NESTED - declare nested routine entry point
|
* NESTED - declare nested routine entry point
|
||||||
|
@ -68,12 +45,15 @@ symbol: .frame sp, 0, ra
|
||||||
.type symbol, @function; \
|
.type symbol, @function; \
|
||||||
.ent symbol, 0; \
|
.ent symbol, 0; \
|
||||||
.section .text.symbol, "x"; \
|
.section .text.symbol, "x"; \
|
||||||
symbol: .frame sp, framesize, rpc
|
symbol: .frame sp, framesize, rpc; \
|
||||||
|
.cfi_startproc; \
|
||||||
|
.insn
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* END - mark end of function
|
* END - mark end of function
|
||||||
*/
|
*/
|
||||||
#define END(function) \
|
#define END(function) \
|
||||||
|
.cfi_endproc; \
|
||||||
.end function; \
|
.end function; \
|
||||||
.size function, .-function
|
.size function, .-function
|
||||||
|
|
||||||
|
@ -90,7 +70,7 @@ symbol:
|
||||||
#define FEXPORT(symbol) \
|
#define FEXPORT(symbol) \
|
||||||
.globl symbol; \
|
.globl symbol; \
|
||||||
.type symbol, @function; \
|
.type symbol, @function; \
|
||||||
symbol:
|
symbol: .insn
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ABS - export absolute symbol
|
* ABS - export absolute symbol
|
||||||
|
@ -128,96 +108,6 @@ symbol = value
|
||||||
8: .asciiz msg; \
|
8: .asciiz msg; \
|
||||||
.popsection;
|
.popsection;
|
||||||
|
|
||||||
/*
|
|
||||||
* Build text tables
|
|
||||||
*/
|
|
||||||
#define TTABLE(string) \
|
|
||||||
.pushsection .text; \
|
|
||||||
.word 1f; \
|
|
||||||
.popsection \
|
|
||||||
.pushsection .data; \
|
|
||||||
1: .asciiz string; \
|
|
||||||
.popsection
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MIPS IV pref instruction.
|
|
||||||
* Use with .set noreorder only!
|
|
||||||
*
|
|
||||||
* MIPS IV implementations are free to treat this as a nop. The R5000
|
|
||||||
* is one of them. So we should have an option not to use this instruction.
|
|
||||||
*/
|
|
||||||
#ifdef CONFIG_CPU_HAS_PREFETCH
|
|
||||||
|
|
||||||
#define PREF(hint, addr) \
|
|
||||||
.set push; \
|
|
||||||
.set arch=r5000; \
|
|
||||||
pref hint, addr; \
|
|
||||||
.set pop
|
|
||||||
|
|
||||||
#define PREFE(hint, addr) \
|
|
||||||
.set push; \
|
|
||||||
.set mips0; \
|
|
||||||
.set eva; \
|
|
||||||
prefe hint, addr; \
|
|
||||||
.set pop
|
|
||||||
|
|
||||||
#define PREFX(hint, addr) \
|
|
||||||
.set push; \
|
|
||||||
.set arch=r5000; \
|
|
||||||
prefx hint, addr; \
|
|
||||||
.set pop
|
|
||||||
|
|
||||||
#else /* !CONFIG_CPU_HAS_PREFETCH */
|
|
||||||
|
|
||||||
#define PREF(hint, addr)
|
|
||||||
#define PREFE(hint, addr)
|
|
||||||
#define PREFX(hint, addr)
|
|
||||||
|
|
||||||
#endif /* !CONFIG_CPU_HAS_PREFETCH */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs.
|
|
||||||
*/
|
|
||||||
#if (_MIPS_ISA == _MIPS_ISA_MIPS1)
|
|
||||||
#define MOVN(rd, rs, rt) \
|
|
||||||
.set push; \
|
|
||||||
.set reorder; \
|
|
||||||
beqz rt, 9f; \
|
|
||||||
move rd, rs; \
|
|
||||||
.set pop; \
|
|
||||||
9:
|
|
||||||
#define MOVZ(rd, rs, rt) \
|
|
||||||
.set push; \
|
|
||||||
.set reorder; \
|
|
||||||
bnez rt, 9f; \
|
|
||||||
move rd, rs; \
|
|
||||||
.set pop; \
|
|
||||||
9:
|
|
||||||
#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */
|
|
||||||
#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3)
|
|
||||||
#define MOVN(rd, rs, rt) \
|
|
||||||
.set push; \
|
|
||||||
.set noreorder; \
|
|
||||||
bnezl rt, 9f; \
|
|
||||||
move rd, rs; \
|
|
||||||
.set pop; \
|
|
||||||
9:
|
|
||||||
#define MOVZ(rd, rs, rt) \
|
|
||||||
.set push; \
|
|
||||||
.set noreorder; \
|
|
||||||
beqzl rt, 9f; \
|
|
||||||
move rd, rs; \
|
|
||||||
.set pop; \
|
|
||||||
9:
|
|
||||||
#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
|
|
||||||
#if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
|
|
||||||
(_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
|
|
||||||
#define MOVN(rd, rs, rt) \
|
|
||||||
movn rd, rs, rt
|
|
||||||
#define MOVZ(rd, rs, rt) \
|
|
||||||
movz rd, rs, rt
|
|
||||||
#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stack alignment
|
* Stack alignment
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue