utility.hh (7638:21db0b3ab1fe) utility.hh (7640:5286a8a469c5)
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

--- 132 unchanged lines hidden (view full) ---

141 }
142
143 static inline bool
144 inPrivilegedMode(ThreadContext *tc)
145 {
146 return !inUserMode(tc);
147 }
148
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

--- 132 unchanged lines hidden (view full) ---

141 }
142
143 static inline bool
144 inPrivilegedMode(ThreadContext *tc)
145 {
146 return !inUserMode(tc);
147 }
148
149 static inline bool
150 vfpEnabled(CPACR cpacr, CPSR cpsr)
151 {
152 return cpacr.cp10 == 0x3 ||
153 (cpacr.cp10 == 0x2 && inPrivilegedMode(cpsr));
154 }
155
156 static inline bool
157 vfpEnabled(CPACR cpacr, CPSR cpsr, FPEXC fpexc)
158 {
159 return fpexc.en && vfpEnabled(cpacr, cpsr);
160 }
161
162 static inline bool
163 neonEnabled(CPACR cpacr, CPSR cpsr, FPEXC fpexc)
164 {
165 return !cpacr.asedis && vfpEnabled(cpacr, cpsr, fpexc);
166 }
167
149uint64_t getArgument(ThreadContext *tc, int number, bool fp);
150
151Fault setCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
152Fault readCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
153
154};
155
156
157#endif
168uint64_t getArgument(ThreadContext *tc, int number, bool fp);
169
170Fault setCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
171Fault readCp15Register(uint32_t &Rd, int CRn, int opc1, int CRm, int opc2);
172
173};
174
175
176#endif