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