m5ops.h revision 12157:c27b548bad70
1/*
2 * Copyright (c) 2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder.  You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 2003-2006 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Nathan Binkert
41 *          Ali Saidi
42 *          Andreas Sandberg
43 */
44
45#ifndef __GEM5_ASM_GENERIC_M5OPS_H__
46#define __GEM5_ASM_GENERIC_M5OPS_H__
47
48#define M5OP_ARM                0x00
49#define M5OP_QUIESCE            0x01
50#define M5OP_QUIESCE_NS         0x02
51#define M5OP_QUIESCE_CYCLE      0x03
52#define M5OP_QUIESCE_TIME       0x04
53#define M5OP_RPNS               0x07
54#define M5OP_WAKE_CPU           0x09
55#define M5OP_DEPRECATED1        0x10 // obsolete ivlb
56#define M5OP_DEPRECATED2        0x11 // obsolete ivle
57#define M5OP_DEPRECATED3        0x20 // deprecated exit function
58#define M5OP_EXIT               0x21
59#define M5OP_FAIL               0x22
60#define M5OP_INIT_PARAM         0x30
61#define M5OP_LOAD_SYMBOL        0x31
62#define M5OP_RESET_STATS        0x40
63#define M5OP_DUMP_STATS         0x41
64#define M5OP_DUMP_RESET_STATS   0x42
65#define M5OP_CHECKPOINT         0x43
66#define M5OP_WRITE_FILE         0x4F
67#define M5OP_READ_FILE          0x50
68#define M5OP_DEBUG_BREAK        0x51
69#define M5OP_SWITCH_CPU         0x52
70#define M5OP_ADD_SYMBOL         0x53
71#define M5OP_PANIC              0x54
72
73#define M5OP_RESERVED2          0x56 // Reserved for user
74#define M5OP_RESERVED3          0x57 // Reserved for user
75#define M5OP_RESERVED4          0x58 // Reserved for user
76#define M5OP_RESERVED5          0x59 // Reserved for user
77
78#define M5OP_WORK_BEGIN         0x5a
79#define M5OP_WORK_END           0x5b
80
81#define M5OP_SE_SYSCALL         0x60
82#define M5OP_SE_PAGE_FAULT      0x61
83#define M5OP_DIST_TOGGLE_SYNC   0x62
84
85// These operations are for critical path annotation
86#define M5OP_ANNOTATE           0x55
87#define M5OP_AN_BSM             0x1
88#define M5OP_AN_ESM             0x2
89#define M5OP_AN_BEGIN           0x3
90#define M5OP_AN_END             0x4
91#define M5OP_AN_Q               0x6
92#define M5OP_AN_DQ              0x7
93#define M5OP_AN_WF              0x8
94#define M5OP_AN_WE              0x9
95#define M5OP_AN_RQ              0xA
96#define M5OP_AN_WS              0xB
97#define M5OP_AN_SQ              0xC
98#define M5OP_AN_AQ              0xD
99#define M5OP_AN_PQ              0xE
100#define M5OP_AN_L               0xF
101#define M5OP_AN_IDENTIFY        0x10
102#define M5OP_AN_GETID           0x11
103
104
105#define M5OP_FOREACH                                          \
106    M5OP(arm, M5OP_ARM, 0);                                   \
107    M5OP(quiesce, M5OP_QUIESCE, 0);                           \
108    M5OP(quiesceNs, M5OP_QUIESCE_NS, 0);                      \
109    M5OP(quiesceCycle, M5OP_QUIESCE_CYCLE, 0);                \
110    M5OP(quiesceTime, M5OP_QUIESCE_TIME, 0);                  \
111    M5OP(rpns, M5OP_RPNS, 0);                                 \
112    M5OP(wakeCPU, M5OP_WAKE_CPU, 0);                          \
113    M5OP(m5_exit, M5OP_EXIT, 0);                              \
114    M5OP(m5_fail, M5OP_FAIL, 0);                              \
115    M5OP(m5_initparam, M5OP_INIT_PARAM, 0);                   \
116    M5OP(m5_loadsymbol, M5OP_LOAD_SYMBOL, 0);                 \
117    M5OP(m5_reset_stats, M5OP_RESET_STATS, 0);                \
118    M5OP(m5_dump_stats, M5OP_DUMP_STATS, 0);                  \
119    M5OP(m5_dumpreset_stats, M5OP_DUMP_RESET_STATS, 0);       \
120    M5OP(m5_checkpoint, M5OP_CHECKPOINT, 0);                  \
121    M5OP(m5_readfile, M5OP_READ_FILE, 0);                     \
122    M5OP(m5_writefile, M5OP_WRITE_FILE, 0);                   \
123    M5OP(m5_debugbreak, M5OP_DEBUG_BREAK, 0);                 \
124    M5OP(m5_switchcpu, M5OP_SWITCH_CPU, 0);                   \
125    M5OP(m5_addsymbol, M5OP_ADD_SYMBOL, 0);                   \
126    M5OP(m5_panic, M5OP_PANIC, 0);                            \
127    M5OP(m5_work_begin, M5OP_WORK_BEGIN, 0);                  \
128    M5OP(m5_work_end, M5OP_WORK_END, 0);                      \
129    M5OP(m5_togglesync, M5OP_DIST_TOGGLE_SYNC, 0);
130
131#define M5OP_FOREACH_ANNOTATION                      \
132    M5_ANNOTATION(m5a_bsm, M5OP_AN_BSM);             \
133    M5_ANNOTATION(m5a_esm, M5OP_AN_ESM);             \
134    M5_ANNOTATION(m5a_begin, M5OP_AN_BEGIN);         \
135    M5_ANNOTATION(m5a_end, M5OP_AN_END);             \
136    M5_ANNOTATION(m5a_q, M5OP_AN_Q);                 \
137    M5_ANNOTATION(m5a_dq, M5OP_AN_DQ);               \
138    M5_ANNOTATION(m5a_wf, M5OP_AN_WF);               \
139    M5_ANNOTATION(m5a_we, M5OP_AN_WE);               \
140    M5_ANNOTATION(m5a_rq, M5OP_AN_RQ);               \
141    M5_ANNOTATION(m5a_ws, M5OP_AN_WS);               \
142    M5_ANNOTATION(m5a_sq, M5OP_AN_SQ);               \
143    M5_ANNOTATION(m5a_aq, M5OP_AN_AQ);               \
144    M5_ANNOTATION(m5a_pq, M5OP_AN_PQ);               \
145    M5_ANNOTATION(m5a_l, M5OP_AN_L);                 \
146    M5_ANNOTATION(m5a_identify, M5OP_AN_IDENTIFY);   \
147    M5_ANNOTATION(m5a_getid, M5OP_AN_GETID);
148
149#endif //  __GEM5_ASM_GENERIC_M5OPS_H__
150