Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 1999, 2000, 2003 Ralf Baechle
0007  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
0008  */
0009 #ifndef _ASM_SIM_H
0010 #define _ASM_SIM_H
0011 
0012 
0013 #include <asm/asm-offsets.h>
0014 
0015 #define __str2(x) #x
0016 #define __str(x) __str2(x)
0017 
0018 #ifdef CONFIG_32BIT
0019 
0020 #define save_static_function(symbol)                    \
0021 __asm__(                                \
0022     ".text\n\t"                         \
0023     ".globl\t__" #symbol "\n\t"                 \
0024     ".align\t2\n\t"                         \
0025     ".type\t__" #symbol ", @function\n\t"               \
0026     ".ent\t__" #symbol ", 0\n__"                    \
0027     #symbol":\n\t"                          \
0028     ".frame\t$29, 0, $31\n\t"                   \
0029     "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"  \
0030     "sw\t$17,"__str(PT_R17)"($29)\n\t"              \
0031     "sw\t$18,"__str(PT_R18)"($29)\n\t"              \
0032     "sw\t$19,"__str(PT_R19)"($29)\n\t"              \
0033     "sw\t$20,"__str(PT_R20)"($29)\n\t"              \
0034     "sw\t$21,"__str(PT_R21)"($29)\n\t"              \
0035     "sw\t$22,"__str(PT_R22)"($29)\n\t"              \
0036     "sw\t$23,"__str(PT_R23)"($29)\n\t"              \
0037     "sw\t$30,"__str(PT_R30)"($29)\n\t"              \
0038     "j\t" #symbol "\n\t"                        \
0039     ".end\t__" #symbol "\n\t"                   \
0040     ".size\t__" #symbol",. - __" #symbol)
0041 
0042 #endif /* CONFIG_32BIT */
0043 
0044 #ifdef CONFIG_64BIT
0045 
0046 #define save_static_function(symbol)                    \
0047 __asm__(                                \
0048     ".text\n\t"                         \
0049     ".globl\t__" #symbol "\n\t"                 \
0050     ".align\t2\n\t"                         \
0051     ".type\t__" #symbol ", @function\n\t"               \
0052     ".ent\t__" #symbol ", 0\n__"                    \
0053     #symbol":\n\t"                          \
0054     ".frame\t$29, 0, $31\n\t"                   \
0055     "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"  \
0056     "sd\t$17,"__str(PT_R17)"($29)\n\t"              \
0057     "sd\t$18,"__str(PT_R18)"($29)\n\t"              \
0058     "sd\t$19,"__str(PT_R19)"($29)\n\t"              \
0059     "sd\t$20,"__str(PT_R20)"($29)\n\t"              \
0060     "sd\t$21,"__str(PT_R21)"($29)\n\t"              \
0061     "sd\t$22,"__str(PT_R22)"($29)\n\t"              \
0062     "sd\t$23,"__str(PT_R23)"($29)\n\t"              \
0063     "sd\t$30,"__str(PT_R30)"($29)\n\t"              \
0064     "j\t" #symbol "\n\t"                        \
0065     ".end\t__" #symbol "\n\t"                   \
0066     ".size\t__" #symbol",. - __" #symbol)
0067 
0068 #endif /* CONFIG_64BIT */
0069 
0070 #endif /* _ASM_SIM_H */