Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * asmmacro.h: Assembler macros to make things easier to read.
0004  *
0005  * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
0006  * Copyright (C) 1998, 1999, 2003 Ralf Baechle
0007  */
0008 #ifndef _ASM_ASMMACRO_32_H
0009 #define _ASM_ASMMACRO_32_H
0010 
0011 #include <asm/asm-offsets.h>
0012 #include <asm/regdef.h>
0013 #include <asm/fpregdef.h>
0014 #include <asm/mipsregs.h>
0015 
0016     .macro  fpu_save_single thread tmp=t0
0017     .set push
0018     SET_HARDFLOAT
0019     cfc1    \tmp,  fcr31
0020     s.d $f0,  THREAD_FPR0(\thread)
0021     s.d $f2,  THREAD_FPR2(\thread)
0022     s.d $f4,  THREAD_FPR4(\thread)
0023     s.d $f6,  THREAD_FPR6(\thread)
0024     s.d $f8,  THREAD_FPR8(\thread)
0025     s.d $f10, THREAD_FPR10(\thread)
0026     s.d $f12, THREAD_FPR12(\thread)
0027     s.d $f14, THREAD_FPR14(\thread)
0028     s.d $f16, THREAD_FPR16(\thread)
0029     s.d $f18, THREAD_FPR18(\thread)
0030     s.d $f20, THREAD_FPR20(\thread)
0031     s.d $f22, THREAD_FPR22(\thread)
0032     s.d $f24, THREAD_FPR24(\thread)
0033     s.d $f26, THREAD_FPR26(\thread)
0034     s.d $f28, THREAD_FPR28(\thread)
0035     s.d $f30, THREAD_FPR30(\thread)
0036     sw  \tmp, THREAD_FCR31(\thread)
0037     .set pop
0038     .endm
0039 
0040     .macro  fpu_restore_single thread tmp=t0
0041     .set push
0042     SET_HARDFLOAT
0043     lw  \tmp, THREAD_FCR31(\thread)
0044     l.d $f0,  THREAD_FPR0(\thread)
0045     l.d $f2,  THREAD_FPR2(\thread)
0046     l.d $f4,  THREAD_FPR4(\thread)
0047     l.d $f6,  THREAD_FPR6(\thread)
0048     l.d $f8,  THREAD_FPR8(\thread)
0049     l.d $f10, THREAD_FPR10(\thread)
0050     l.d $f12, THREAD_FPR12(\thread)
0051     l.d $f14, THREAD_FPR14(\thread)
0052     l.d $f16, THREAD_FPR16(\thread)
0053     l.d $f18, THREAD_FPR18(\thread)
0054     l.d $f20, THREAD_FPR20(\thread)
0055     l.d $f22, THREAD_FPR22(\thread)
0056     l.d $f24, THREAD_FPR24(\thread)
0057     l.d $f26, THREAD_FPR26(\thread)
0058     l.d $f28, THREAD_FPR28(\thread)
0059     l.d $f30, THREAD_FPR30(\thread)
0060     ctc1    \tmp, fcr31
0061     .set pop
0062     .endm
0063 
0064     .macro  cpu_save_nonscratch thread
0065     LONG_S  s0, THREAD_REG16(\thread)
0066     LONG_S  s1, THREAD_REG17(\thread)
0067     LONG_S  s2, THREAD_REG18(\thread)
0068     LONG_S  s3, THREAD_REG19(\thread)
0069     LONG_S  s4, THREAD_REG20(\thread)
0070     LONG_S  s5, THREAD_REG21(\thread)
0071     LONG_S  s6, THREAD_REG22(\thread)
0072     LONG_S  s7, THREAD_REG23(\thread)
0073     LONG_S  sp, THREAD_REG29(\thread)
0074     LONG_S  fp, THREAD_REG30(\thread)
0075     .endm
0076 
0077     .macro  cpu_restore_nonscratch thread
0078     LONG_L  s0, THREAD_REG16(\thread)
0079     LONG_L  s1, THREAD_REG17(\thread)
0080     LONG_L  s2, THREAD_REG18(\thread)
0081     LONG_L  s3, THREAD_REG19(\thread)
0082     LONG_L  s4, THREAD_REG20(\thread)
0083     LONG_L  s5, THREAD_REG21(\thread)
0084     LONG_L  s6, THREAD_REG22(\thread)
0085     LONG_L  s7, THREAD_REG23(\thread)
0086     LONG_L  sp, THREAD_REG29(\thread)
0087     LONG_L  fp, THREAD_REG30(\thread)
0088     LONG_L  ra, THREAD_REG31(\thread)
0089     .endm
0090 
0091 #endif /* _ASM_ASMMACRO_32_H */