diff options
author | Kevin Lim <ktlim@umich.edu> | 2005-04-14 16:06:34 -0400 |
---|---|---|
committer | Kevin Lim <ktlim@umich.edu> | 2005-04-14 16:06:34 -0400 |
commit | 26d6d97f5d46bfe2cc5734eb632bec0bc67aed19 (patch) | |
tree | ed8a33f234ee4d85bc79f6179ea8907976ee3e70 /kern | |
parent | dcedd7866e35adc1e0fbc081188b259ffc7bbdf5 (diff) | |
parent | 5e67b78af7f74d7223ced5b54978ca9fa29606c5 (diff) | |
download | gem5-26d6d97f5d46bfe2cc5734eb632bec0bc67aed19.tar.xz |
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5
--HG--
extra : convert_revision : 0baadd8d68bfa6f8e96307eb2d4426b0d9e0b8b4
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; |