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 * Authors: Nathan Binkert
29 *          Ali Saidi
30 */
31
32#define m5_op 0x2
33#define m5_op3 0x37
34
35#include <gem5/asm/generic/m5ops.h>
36
37#define INST(func, rs1, rs2, rd) \
38        .long (m5_op) << 30 | (rd) << 25 | (m5_op3) << 19 | (func) << 7 |  \
39              (rs1) << 14 | (rs2) << 0;
40
41
42#define LEAF(func)                \
43        .section ".text";         \
44        .align   4;               \
45        .global  func;            \
46        .type    func, #function; \
47func:
48
49#define END(func)         \
50        .size    func, (.-func)
51
52#define DEBUGBREAK INST(M5OP_DEBUG_BREAK, 0, 0, 0)
53#define M5EXIT INST(M5OP_EXIT, 0, 0, 0)
54#define PANIC INST(M5OP_PANIC, 0, 0, 0)
55#define READFILE INST(M5OP_READ_FILE, 0, 0, 0)
56
57LEAF(m5_exit)
58    retl
59    M5EXIT
60END(m5_exit)
61
62LEAF(m5_panic)
63    retl
64    PANIC
65END(m5_panic)
66
67LEAF(m5_read_file)
68    retl
69    READFILE
70END(m5_read_file)
71
72LEAF(m5_debug_break)
73    retl
74    DEBUGBREAK
75END(m5_debug_break)
76
77/* !!!!!! All code below here just panics !!!!!! */
78LEAF(m5_arm)
79    retl
80    PANIC
81END(m5_arm)
82
83LEAF(m5_quiesce)
84    retl
85    PANIC
86END(m5_quiesce)
87
88LEAF(m5_quiesce_ns)
89    retl
90    PANIC
91END(m5_quiesce_ns)
92
93LEAF(m5_quiesce_cycle)
94    retl
95    PANIC
96END(m5_quiesce_cycle)
97
98LEAF(m5_quiesce_time)
99    retl
100    PANIC
101END(m5_quiesce_time)
102
103LEAF(m5_init_param)
104    retl
105    PANIC
106END(m5_init_param)
107
108LEAF(m5_load_symbol)
109    retl
110    PANIC
111END(m5_load_symbol)
112
113LEAF(m5_reset_stats)
114    retl
115    PANIC
116END(m5_reset_stats)
117
118LEAF(m5_dump_stats)
119    retl
120    PANIC
121END(m5_dump_stats)
122
123LEAF(m5_dump_reset_stats)
124    retl
125    PANIC
126END(m5_dump_reset_stats)
127
128LEAF(m5_checkpoint)
129    retl
130    PANIC
131END(m5_checkpoint)
132
133LEAF(m5_switch_cpu)
134    retl
135    PANIC
136END(m5_switch_cpu)
137
138LEAF(m5_add_symbol)
139    retl
140    PANIC
141END(m5_add_symbol)
142
143LEAF(m5_anbegin)
144    retl
145    PANIC
146END(m5_anbegin)
147
148LEAF(m5_anwait)
149    retl
150    PANIC
151END(m5_anwait)
152
153
154