m5op_alpha.S revision 2188
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 0x01
30
31#define arm_func 0x00
32#define quiesce_func 0x01
33#define quiescens_func 0x02
34#define quiescecycle_func 0x03
35#define quiescetime_func 0x04
36#define ivlb_func 0x10
37#define ivle_func 0x11
38#define exit_old_func 0x20 // deprectated!
39#define exit_func 0x21
40#define initparam_func 0x30
41#define resetstats_func 0x40
42#define dumpstats_func 0x41
43#define dumprststats_func 0x42
44#define ckpt_func 0x43
45#define readfile_func 0x50
46#define debugbreak_func 0x51
47#define switchcpu_func 0x52
48#define addsymbol_func 0x53
49#define panic_func     0x54
50
51#define INST(op, ra, rb, func) \
52        .long (((op) << 26) | ((ra) << 21) | ((rb) << 16) | (func))
53
54#define LEAF(func)    \
55        .align 3;     \
56        .globl  func; \
57        .ent    func; \
58func:
59
60#define RET           \
61        ret     ($26)
62
63#define END(func)     \
64        .end func
65
66#define	ARM(reg) INST(m5_op, reg, 0, arm_func)
67#define QUIESCE INST(m5_op, 0, 0, quiesce_func)
68#define QUIESCENS(r1) INST(m5_op, r1, 0, quiescens_func)
69#define QUIESCECYC(r1) INST(m5_op, r1, 0, quiescecycle_func)
70#define QUIESCETIME INST(m5_op, 0, 0, quiescetime_func)
71#define IVLB(reg) INST(m5_op, reg, 0, ivlb_func)
72#define IVLE(reg) INST(m5_op, reg, 0, ivle_func)
73#define M5EXIT(reg) INST(m5_op, reg, 0, exit_func)
74#define INITPARAM(reg) INST(m5_op, reg, 0, initparam_func)
75#define RESET_STATS(r1, r2) INST(m5_op, r1, r2, resetstats_func)
76#define DUMP_STATS(r1, r2) INST(m5_op, r1, r2, dumpstats_func)
77#define DUMPRST_STATS(r1, r2) INST(m5_op, r1, r2, dumprststats_func)
78#define CHECKPOINT(r1, r2) INST(m5_op, r1, r2, ckpt_func)
79#define READFILE INST(m5_op, 0, 0, readfile_func)
80#define DEBUGBREAK INST(m5_op, 0, 0, debugbreak_func)
81#define SWITCHCPU INST(m5_op, 0, 0, switchcpu_func)
82#define ADDSYMBOL(r1,r2) INST(m5_op, r1, r2, addsymbol_func)
83#define PANIC INST(m5_op, 0, 0, panic_func)
84
85        .set noreorder
86
87        .align 4
88LEAF(arm)
89        ARM(16)
90        RET
91END(arm)
92
93        .align 4
94LEAF(quiesce)
95        QUIESCE
96        RET
97END(quiesce)
98
99        .align 4
100LEAF(quiesceNs)
101        QUIESCENS(16)
102        RET
103END(quiesceNs)
104
105        .align 4
106LEAF(quiesceCycle)
107        QUIESCECYC(16)
108        RET
109END(quiesceCycle)
110
111        .align 4
112LEAF(quiesceTime)
113        QUIESCETIME
114        RET
115END(quiesceTime)
116
117
118        .align 4
119LEAF(m5_ivlb)
120        IVLB(16)
121        RET
122END(m5_ivlb)
123
124        .align 4
125LEAF(m5_ivle)
126        IVLE(16)
127        RET
128END(m5_ivle)
129
130        .align 4
131LEAF(m5_exit)
132        M5EXIT(16)
133        RET
134END(m5_exit)
135
136        .align 4
137LEAF(m5_initparam)
138        INITPARAM(0)
139        RET
140END(m5_initparam)
141
142        .align 4
143LEAF(m5_reset_stats)
144        RESET_STATS(16, 17)
145        RET
146END(m5_reset_stats)
147
148        .align 4
149LEAF(m5_dump_stats)
150        DUMP_STATS(16, 17)
151        RET
152END(m5_dump_stats)
153
154        .align 4
155LEAF(m5_dumpreset_stats)
156        DUMPRST_STATS(16, 17)
157        RET
158END(m5_dumpreset_stats)
159
160        .align 4
161LEAF(m5_checkpoint)
162        CHECKPOINT(16, 17)
163        RET
164END(m5_checkpoint)
165
166        .align 4
167LEAF(m5_readfile)
168        READFILE
169        RET
170END(m5_readfile)
171
172        .align 4
173LEAF(m5_debugbreak)
174        DEBUGBREAK
175        RET
176END(m5_debugbreak)
177
178        .align 4
179LEAF(m5_switchcpu)
180        SWITCHCPU
181        RET
182END(m5_switchcpu)
183
184        .align 4
185LEAF(m5_addsymbol)
186        ADDSYMBOL(16, 17)
187        RET
188END(m5_addsymbol)
189
190        .align 4
191LEAF(m5_panic)
192        PANIC
193        RET
194END(m5_panic)
195
196
197