diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/linux/linux_system.cc | 10 | ||||
-rw-r--r-- | kern/tru64/tru64_system.cc | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index 4ac03143e..b6aa9c6f2 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -68,7 +68,8 @@ LinuxSystem::LinuxSystem(Params *p) physmem->dma_addr(paddr, sizeof(uint64_t)); if (est_cycle_frequency) - *(uint64_t *)est_cycle_frequency = htoa(ticksPerSecond); + *(uint64_t *)est_cycle_frequency = + Clock::Frequency / p->boot_cpu_frequency; } @@ -206,8 +207,8 @@ LinuxSystem::setDelayLoop(ExecContext *xc) uint8_t *loops_per_jiffy = physmem->dma_addr(paddr, sizeof(uint32_t)); - Tick cpuFreq = xc->cpu->getFreq(); - Tick intrFreq = platform->interrupt_frequency; + Tick cpuFreq = xc->cpu->frequency(); + Tick intrFreq = platform->intrFrequency(); *(uint32_t *)loops_per_jiffy = (uint32_t)((cpuFreq / intrFreq) * 0.9988); } @@ -215,6 +216,7 @@ LinuxSystem::setDelayLoop(ExecContext *xc) BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) + Param<Tick> boot_cpu_frequency; SimObjectParam<MemoryController *> memctrl; SimObjectParam<PhysicalMemory *> physmem; @@ -237,6 +239,7 @@ END_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxSystem) + INIT_PARAM(boot_cpu_frequency, "Frequency of the boot CPU"), INIT_PARAM(memctrl, "memory controller"), INIT_PARAM(physmem, "phsyical memory"), INIT_PARAM(kernel, "file that contains the kernel code"), @@ -258,6 +261,7 @@ CREATE_SIM_OBJECT(LinuxSystem) { System::Params *p = new System::Params; p->name = getInstanceName(); + p->boot_cpu_frequency = boot_cpu_frequency; p->memctrl = memctrl; p->physmem = physmem; p->kernel_path = kernel; diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index 7a2e033d8..e0ec31a43 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -28,6 +28,7 @@ #include "base/loader/symtab.hh" #include "base/trace.hh" +#include "cpu/base_cpu.hh" #include "cpu/exec_context.hh" #include "kern/tru64/tru64_events.hh" #include "kern/tru64/tru64_system.hh" @@ -116,6 +117,7 @@ Tru64System::~Tru64System() BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System) + Param<Tick> boot_cpu_frequency; SimObjectParam<MemoryController *> memctrl; SimObjectParam<PhysicalMemory *> physmem; @@ -137,6 +139,7 @@ END_DECLARE_SIM_OBJECT_PARAMS(Tru64System) BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64System) + INIT_PARAM(boot_cpu_frequency, "frequency of the boot cpu"), INIT_PARAM(memctrl, "memory controller"), INIT_PARAM(physmem, "phsyical memory"), INIT_PARAM(kernel, "file that contains the kernel code"), @@ -157,6 +160,7 @@ CREATE_SIM_OBJECT(Tru64System) { System::Params *p = new System::Params; p->name = getInstanceName(); + p->boot_cpu_frequency = boot_cpu_frequency; p->memctrl = memctrl; p->physmem = physmem; p->kernel_path = kernel; |