system.cc (12005:f4b9607db0af) system.cc (12317:23c9252a5459)
1/*
1/*
2 * Copyright (c) 2010, 2012-2013, 2015 ARM Limited
2 * Copyright (c) 2010, 2012-2013, 2015,2017 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

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

164 } else {
165 // Set the initial PC to be at start of the kernel code
166 if (!_highestELIs64)
167 threadContexts[0]->pcState((kernelEntry & loadAddrMask) +
168 loadAddrOffset);
169 }
170}
171
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

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

164 } else {
165 // Set the initial PC to be at start of the kernel code
166 if (!_highestELIs64)
167 threadContexts[0]->pcState((kernelEntry & loadAddrMask) +
168 loadAddrOffset);
169 }
170}
171
172bool
173ArmSystem::haveSecurity(ThreadContext *tc)
172ArmSystem*
173ArmSystem::getArmSystem(ThreadContext *tc)
174{
174{
175 if (!FullSystem)
176 return false;
177
178 ArmSystem *a_sys = dynamic_cast<ArmSystem *>(tc->getSystemPtr());
179 assert(a_sys);
175 ArmSystem *a_sys = dynamic_cast<ArmSystem *>(tc->getSystemPtr());
176 assert(a_sys);
180 return a_sys->haveSecurity();
177 return a_sys;
181}
182
178}
179
180bool
181ArmSystem::haveSecurity(ThreadContext *tc)
182{
183 return FullSystem? getArmSystem(tc)->haveSecurity() : false;
184}
183
185
186
184ArmSystem::~ArmSystem()
185{
186 if (debugPrintkEvent)
187 delete debugPrintkEvent;
188}
189
190ObjectFile *
191ArmSystem::getBootLoader(ObjectFile *const obj)

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

196 }
197
198 return nullptr;
199}
200
201bool
202ArmSystem::haveLPAE(ThreadContext *tc)
203{
187ArmSystem::~ArmSystem()
188{
189 if (debugPrintkEvent)
190 delete debugPrintkEvent;
191}
192
193ObjectFile *
194ArmSystem::getBootLoader(ObjectFile *const obj)

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

199 }
200
201 return nullptr;
202}
203
204bool
205ArmSystem::haveLPAE(ThreadContext *tc)
206{
204 if (!FullSystem)
205 return false;
206
207 ArmSystem *a_sys = dynamic_cast<ArmSystem *>(tc->getSystemPtr());
208 assert(a_sys);
209 return a_sys->haveLPAE();
207 return FullSystem? getArmSystem(tc)->haveLPAE() : false;
210}
211
212bool
213ArmSystem::haveVirtualization(ThreadContext *tc)
214{
208}
209
210bool
211ArmSystem::haveVirtualization(ThreadContext *tc)
212{
215 if (!FullSystem)
216 return false;
217
218 ArmSystem *a_sys = dynamic_cast<ArmSystem *>(tc->getSystemPtr());
219 assert(a_sys);
220 return a_sys->haveVirtualization();
213 return FullSystem? getArmSystem(tc)->haveVirtualization() : false;
221}
222
223bool
224ArmSystem::highestELIs64(ThreadContext *tc)
225{
214}
215
216bool
217ArmSystem::highestELIs64(ThreadContext *tc)
218{
226 return FullSystem ?
227 dynamic_cast<ArmSystem *>(tc->getSystemPtr())->highestELIs64() :
228 true;
219 return FullSystem? getArmSystem(tc)->highestELIs64() : true;
229}
230
231ExceptionLevel
232ArmSystem::highestEL(ThreadContext *tc)
233{
220}
221
222ExceptionLevel
223ArmSystem::highestEL(ThreadContext *tc)
224{
234 return FullSystem ?
235 dynamic_cast<ArmSystem *>(tc->getSystemPtr())->highestEL() :
236 EL1;
225 return FullSystem? getArmSystem(tc)->highestEL() : EL1;
237}
238
239Addr
240ArmSystem::resetAddr64(ThreadContext *tc)
241{
226}
227
228Addr
229ArmSystem::resetAddr64(ThreadContext *tc)
230{
242 return dynamic_cast<ArmSystem *>(tc->getSystemPtr())->resetAddr64();
231 return getArmSystem(tc)->resetAddr64();
243}
244
245uint8_t
246ArmSystem::physAddrRange(ThreadContext *tc)
247{
232}
233
234uint8_t
235ArmSystem::physAddrRange(ThreadContext *tc)
236{
248 return dynamic_cast<ArmSystem *>(tc->getSystemPtr())->physAddrRange();
237 return getArmSystem(tc)->physAddrRange();
249}
250
251Addr
252ArmSystem::physAddrMask(ThreadContext *tc)
253{
238}
239
240Addr
241ArmSystem::physAddrMask(ThreadContext *tc)
242{
254 return dynamic_cast<ArmSystem *>(tc->getSystemPtr())->physAddrMask();
243 return getArmSystem(tc)->physAddrMask();
255}
256
257bool
258ArmSystem::haveLargeAsid64(ThreadContext *tc)
259{
244}
245
246bool
247ArmSystem::haveLargeAsid64(ThreadContext *tc)
248{
260 return dynamic_cast<ArmSystem *>(tc->getSystemPtr())->haveLargeAsid64();
249 return getArmSystem(tc)->haveLargeAsid64();
261}
262
263ArmSystem *
264ArmSystemParams::create()
265{
266 return new ArmSystem(this);
267}
268

--- 16 unchanged lines hidden ---
250}
251
252ArmSystem *
253ArmSystemParams::create()
254{
255 return new ArmSystem(this);
256}
257

--- 16 unchanged lines hidden ---