generic_timer.cc (11668:380375085863) generic_timer.cc (11933:e57d4ed7be23)
1/*
1/*
2 * Copyright (c) 2013, 2015 ARM Limited
2 * Copyright (c) 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

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

302 new CoreTimers(*this, i, irqPhys, irqVirt));
303 }
304}
305
306
307void
308GenericTimer::setMiscReg(int reg, unsigned cpu, MiscReg val)
309{
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

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

302 new CoreTimers(*this, i, irqPhys, irqVirt));
303 }
304}
305
306
307void
308GenericTimer::setMiscReg(int reg, unsigned cpu, MiscReg val)
309{
310 // This method might have been called from another context if we
311 // are running in multi-core KVM. Migrate to the SimObject's event
312 // queue to prevent surprising race conditions.
313 EventQueue::ScopedMigration migrate(eventQueue());
314
310 CoreTimers &core(getTimers(cpu));
311
312 switch (reg) {
313 case MISCREG_CNTFRQ:
314 case MISCREG_CNTFRQ_EL0:
315 systemCounter.setFreq(val);
316 return;
317

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

394 return;
395 }
396}
397
398
399MiscReg
400GenericTimer::readMiscReg(int reg, unsigned cpu)
401{
315 CoreTimers &core(getTimers(cpu));
316
317 switch (reg) {
318 case MISCREG_CNTFRQ:
319 case MISCREG_CNTFRQ_EL0:
320 systemCounter.setFreq(val);
321 return;
322

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

399 return;
400 }
401}
402
403
404MiscReg
405GenericTimer::readMiscReg(int reg, unsigned cpu)
406{
407 // This method might have been called from another context if we
408 // are running in multi-core KVM. Migrate to the SimObject's event
409 // queue to prevent surprising race conditions.
410 EventQueue::ScopedMigration migrate(eventQueue());
411
402 CoreTimers &core(getTimers(cpu));
403
404 switch (reg) {
405 case MISCREG_CNTFRQ:
406 case MISCREG_CNTFRQ_EL0:
407 return systemCounter.freq();
408
409 case MISCREG_CNTKCTL:

--- 411 unchanged lines hidden ---
412 CoreTimers &core(getTimers(cpu));
413
414 switch (reg) {
415 case MISCREG_CNTFRQ:
416 case MISCREG_CNTFRQ_EL0:
417 return systemCounter.freq();
418
419 case MISCREG_CNTKCTL:

--- 411 unchanged lines hidden ---