fe70e0a8a64d9f26a0b7771531bc41902bf329fd
[gem5.git] / util / m5 / m5op_sparc.S
1 /*
2 * Copyright (c) 2003-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #define m5_op 0x2
30 #define m5_op3 0x37
31
32 #include <gem5/asm/generic/m5ops.h>
33
34 #define INST(func, rs1, rs2, rd) \
35 .long (m5_op) << 30 | (rd) << 25 | (m5_op3) << 19 | (func) << 7 | \
36 (rs1) << 14 | (rs2) << 0;
37
38
39 #define LEAF(func) \
40 .section ".text"; \
41 .align 4; \
42 .global func; \
43 .type func, #function; \
44 func:
45
46 #define END(func) \
47 .size func, (.-func)
48
49 #define DEBUGBREAK INST(M5OP_DEBUG_BREAK, 0, 0, 0)
50 #define M5EXIT INST(M5OP_EXIT, 0, 0, 0)
51 #define PANIC INST(M5OP_PANIC, 0, 0, 0)
52 #define READFILE INST(M5OP_READ_FILE, 0, 0, 0)
53
54 LEAF(m5_exit)
55 retl
56 M5EXIT
57 END(m5_exit)
58
59 LEAF(m5_panic)
60 retl
61 PANIC
62 END(m5_panic)
63
64 LEAF(m5_read_file)
65 retl
66 READFILE
67 END(m5_read_file)
68
69 LEAF(m5_debug_break)
70 retl
71 DEBUGBREAK
72 END(m5_debug_break)
73
74 /* !!!!!! All code below here just panics !!!!!! */
75 LEAF(m5_arm)
76 retl
77 PANIC
78 END(m5_arm)
79
80 LEAF(m5_quiesce)
81 retl
82 PANIC
83 END(m5_quiesce)
84
85 LEAF(m5_quiesce_ns)
86 retl
87 PANIC
88 END(m5_quiesce_ns)
89
90 LEAF(m5_quiesce_cycle)
91 retl
92 PANIC
93 END(m5_quiesce_cycle)
94
95 LEAF(m5_quiesce_time)
96 retl
97 PANIC
98 END(m5_quiesce_time)
99
100 LEAF(m5_init_param)
101 retl
102 PANIC
103 END(m5_init_param)
104
105 LEAF(m5_load_symbol)
106 retl
107 PANIC
108 END(m5_load_symbol)
109
110 LEAF(m5_reset_stats)
111 retl
112 PANIC
113 END(m5_reset_stats)
114
115 LEAF(m5_dump_stats)
116 retl
117 PANIC
118 END(m5_dump_stats)
119
120 LEAF(m5_dump_reset_stats)
121 retl
122 PANIC
123 END(m5_dump_reset_stats)
124
125 LEAF(m5_checkpoint)
126 retl
127 PANIC
128 END(m5_checkpoint)
129
130 LEAF(m5_switch_cpu)
131 retl
132 PANIC
133 END(m5_switch_cpu)
134
135 LEAF(m5_add_symbol)
136 retl
137 PANIC
138 END(m5_add_symbol)
139
140 LEAF(m5_anbegin)
141 retl
142 PANIC
143 END(m5_anbegin)
144
145 LEAF(m5_anwait)
146 retl
147 PANIC
148 END(m5_anwait)
149
150