commented early_printk patch because of rejects.
[linux-flexiantxendom0-3.2.10.git] / include / asm-mips / sim.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 1999, 2000, 2003 Ralf Baechle
7  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8  */
9 #ifndef _ASM_SIM_H
10 #define _ASM_SIM_H
11
12 #include <linux/config.h>
13
14 #include <asm/offset.h>
15
16 #ifdef CONFIG_MIPS32
17
18 /* Used in declaration of save_static functions.  */
19 #define static_unused static __attribute__((unused))
20
21 #define __str2(x) #x
22 #define __str(x) __str2(x)
23
24 #define save_static_function(symbol)                                    \
25 __asm__ (                                                               \
26         ".text\n\t"                                                     \
27         ".globl\t" #symbol "\n\t"                                       \
28         ".align\t2\n\t"                                                 \
29         ".type\t" #symbol ", @function\n\t"                             \
30         ".ent\t" #symbol ", 0\n"                                        \
31         #symbol":\n\t"                                                  \
32         ".frame\t$29, 0, $31\n\t"                                       \
33         "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t"  \
34         "sw\t$17,"__str(PT_R17)"($29)\n\t"                              \
35         "sw\t$18,"__str(PT_R18)"($29)\n\t"                              \
36         "sw\t$19,"__str(PT_R19)"($29)\n\t"                              \
37         "sw\t$20,"__str(PT_R20)"($29)\n\t"                              \
38         "sw\t$21,"__str(PT_R21)"($29)\n\t"                              \
39         "sw\t$22,"__str(PT_R22)"($29)\n\t"                              \
40         "sw\t$23,"__str(PT_R23)"($29)\n\t"                              \
41         "sw\t$30,"__str(PT_R30)"($29)\n\t"                              \
42         ".end\t" #symbol "\n\t"                                         \
43         ".size\t" #symbol",. - " #symbol)
44
45 #define save_static(frame)      do { } while (0)
46
47 #define nabi_no_regargs
48
49 #endif /* CONFIG_MIPS32 */
50
51 #ifdef CONFIG_MIPS64
52
53 /* Used in declaration of save_static functions.  */
54 #define static_unused static __attribute__((unused))
55
56 #define __str2(x) #x
57 #define __str(x) __str2(x)
58
59 #define save_static_function(symbol)                                    \
60 __asm__ (                                                               \
61         ".text\n\t"                                                     \
62         ".globl\t" #symbol "\n\t"                                       \
63         ".align\t2\n\t"                                                 \
64         ".type\t" #symbol ", @function\n\t"                             \
65         ".ent\t" #symbol ", 0\n"                                        \
66         #symbol":\n\t"                                                  \
67         ".frame\t$29, 0, $31\n\t"                                       \
68         ".end\t" #symbol "\n\t"                                         \
69         ".size\t" #symbol",. - " #symbol)
70
71 #define save_static(frame)                                              \
72         __asm__ __volatile__(                                           \
73                 "sd\t$16,"__str(PT_R16)"(%0)\n\t"                       \
74                 "sd\t$17,"__str(PT_R17)"(%0)\n\t"                       \
75                 "sd\t$18,"__str(PT_R18)"(%0)\n\t"                       \
76                 "sd\t$19,"__str(PT_R19)"(%0)\n\t"                       \
77                 "sd\t$20,"__str(PT_R20)"(%0)\n\t"                       \
78                 "sd\t$21,"__str(PT_R21)"(%0)\n\t"                       \
79                 "sd\t$22,"__str(PT_R22)"(%0)\n\t"                       \
80                 "sd\t$23,"__str(PT_R23)"(%0)\n\t"                       \
81                 "sd\t$30,"__str(PT_R30)"(%0)\n\t"                       \
82                 : /* No outputs */                                      \
83                 : "r" (frame))
84
85 #define nabi_no_regargs                                                 \
86         unsigned long __dummy0,                                         \
87         unsigned long __dummy1,                                         \
88         unsigned long __dummy2,                                         \
89         unsigned long __dummy3,                                         \
90         unsigned long __dummy4,                                         \
91         unsigned long __dummy5,                                         \
92         unsigned long __dummy6,                                         \
93         unsigned long __dummy7,
94
95 #endif /* CONFIG_MIPS64 */
96
97 #endif /* _ASM_SIM_H */