1/* 2 * Copyright (c) 2010 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 --- 82 unchanged lines hidden (view full) --- 91 default: 92 panic("Unrecognized mode setting in CPSR.\n"); 93 } 94 } 95 96 public: 97 void clear(); 98 |
99 MiscReg readMiscRegNoEffect(int misc_reg) const; |
100 MiscReg readMiscReg(int misc_reg, ThreadContext *tc); 101 void setMiscRegNoEffect(int misc_reg, const MiscReg &val); 102 void setMiscReg(int misc_reg, const MiscReg &val, ThreadContext *tc); 103 104 int |
105 flattenIntIndex(int reg) const |
106 { 107 assert(reg >= 0); 108 if (reg < NUM_ARCH_INTREGS) { 109 return intRegMap[reg]; 110 } else if (reg < NUM_INTREGS) { 111 return reg; 112 } else { 113 int mode = reg / intRegsPerMode; --- 16 unchanged lines hidden (view full) --- 130 return INTREG_UND(reg); 131 default: 132 panic("Flattening into an unknown mode.\n"); 133 } 134 } 135 } 136 137 int |
138 flattenFloatIndex(int reg) const |
139 { 140 return reg; 141 } 142 143 // dummy 144 int |
145 flattenCCIndex(int reg) const |
146 { 147 return reg; 148 } 149 150 int |
151 flattenMiscIndex(int reg) const |
152 { 153 if (reg == MISCREG_SPSR) { 154 int spsr_idx = NUM_MISCREGS; 155 CPSR cpsr = miscRegs[MISCREG_CPSR]; 156 switch (cpsr.mode) { 157 case MODE_USER: 158 warn("User mode does not have SPSR\n"); 159 spsr_idx = MISCREG_SPSR; --- 57 unchanged lines hidden --- |