return tlb;
}
-////////////////////////////////////////////////////////////////////////
-//
-// Machine dependent functions
-//
-void
-initCPU(ThreadContext *tc, int cpuId)
-{
- initIPRs(tc, cpuId);
-
- tc->setIntReg(16, cpuId);
- tc->setIntReg(0, cpuId);
-
- Addr base = tc->readMiscRegNoEffect(IPR_PAL_BASE);
- Addr offset = ResetFault().vect();
-
- tc->pcState(base + offset);
-
- tc->activate();
-}
-
////////////////////////////////////////////////////////////////////////
//
//
#include <sys/signal.h>
#include "arch/alpha/ev5.hh"
+#include "arch/alpha/faults.hh"
#include "arch/vtophys.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
// Call the initialisation of the super class
System::initState();
+ for (auto *tc: threadContexts) {
+ int cpuId = tc->contextId();
+ initIPRs(tc, cpuId);
+
+ tc->setIntReg(16, cpuId);
+ tc->setIntReg(0, cpuId);
+
+ Addr base = tc->readMiscRegNoEffect(IPR_PAL_BASE);
+ Addr offset = ResetFault().vect();
+
+ tc->pcState(base + offset);
+
+ tc->activate();
+ }
+
// Load program sections into memory
pal->buildImage().mask(loadAddrMask).write(physProxy);
console->buildImage().mask(loadAddrMask).write(physProxy);
{ return (addr + PageBytes - 1) & ~(PageBytes - 1); }
void initIPRs(ThreadContext *tc, int cpuId);
-void initCPU(ThreadContext *tc, int cpuId);
void copyRegs(ThreadContext *src, ThreadContext *dest);
#include <iostream>
+#include "arch/arm/faults.hh"
#include "arch/arm/semihosting.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
// Call the initialisation of the super class
System::initState();
+ // Reset CP15?? What does that mean -- ali
+
+ // FPEXC.EN = 0
+
+ for (auto *tc: threadContexts) {
+ Reset().invoke(tc);
+ tc->activate();
+ }
+
const Params* p = params();
if (bootldr) {
#include "mem/fs_translating_port_proxy.hh"
#include "sim/full_system.hh"
-namespace ArmISA {
-
-void
-initCPU(ThreadContext *tc, int cpuId)
+namespace ArmISA
{
- // Reset CP15?? What does that mean -- ali
-
- // FPEXC.EN = 0
-
- Reset().invoke(tc);
- tc->activate();
-}
uint64_t
getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
panic("Copy Misc. Regs Not Implemented Yet\n");
}
-void initCPU(ThreadContext *tc, int cpuId);
-
/** Send an event (SEV) to a specific PE if there isn't
* already a pending event */
void sendEvent(ThreadContext *tc);
}
}
-void
-initCPU(ThreadContext *tc, int cpuId)
-{
- tc->activate();
-}
-
void
copyRegs(ThreadContext *src, ThreadContext *dest)
{
//
inline Addr
TruncPage(Addr addr)
-{ return addr & ~(PageBytes - 1); }
+{
+ return addr & ~(PageBytes - 1);
+}
inline Addr
RoundPage(Addr addr)
-{ return (addr + PageBytes - 1) & ~(PageBytes - 1); }
-
-////////////////////////////////////////////////////////////////////////
-//
-// CPU Utility
-//
-void initCPU(ThreadContext *tc, int cpuId);
+{
+ return (addr + PageBytes - 1) & ~(PageBytes - 1);
+}
void copyRegs(ThreadContext *src, ThreadContext *dest);
void copyMiscRegs(ThreadContext *src, ThreadContext *dest);
return 0;
}
-inline void initCPU(ThreadContext *tc, int cpuId) {}
-
}
#endif // __ARCH_NULL_UTILITY_HH__
panic("Not Implemented for POWER");
}
-void
-initCPU(ThreadContext *tc, int cpuId)
-{
- panic("initCPU not implemented for POWER.\n");
-}
-
-
} // namespace PowerISA
return 0;
}
-void initCPU(ThreadContext *, int cpuId);
-
} // namespace PowerISA
Source('stacktrace.cc')
Source('tlb.cc')
Source('system.cc')
- Source('utility.cc')
Source('linux/process.cc')
Source('linux/linux.cc')
#include "arch/riscv/bare_metal/system.hh"
+#include "arch/riscv/faults.hh"
#include "base/loader/object_file.hh"
BareMetalRiscvSystem::BareMetalRiscvSystem(Params *p)
// Call the initialisation of the super class
RiscvSystem::initState();
+ for (auto *tc: threadContexts) {
+ RiscvISA::Reset().invoke(tc);
+ tc->activate();
+ }
+
// load program sections into memory
if (!bootloader->buildImage().write(physProxy)) {
warn("could not load sections to memory");
+++ /dev/null
-/*
- * Copyright (c) 2018 TU Dresden
- * All rights reserved
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Robert Scheffel
- */
-
-#include "arch/riscv/utility.hh"
-
-#include "arch/riscv/faults.hh"
-
-namespace RiscvISA
-{
-
-void initCPU(ThreadContext *tc, int cpuId)
-{
- Reset().invoke(tc);
- tc->activate();
-}
-
-}
return 0;
}
-/**
- * init Cpu function
- */
-void initCPU(ThreadContext *tc, int cpuId);
-
} // namespace RiscvISA
#endif // __ARCH_RISCV_UTILITY_HH__
#include "arch/sparc/system.hh"
+#include "arch/sparc/faults.hh"
#include "arch/vtophys.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
// @todo any fixup code over writing data in binaries on setting break
// events on functions should happen here.
+
+ if (threadContexts.empty())
+ return;
+
+ // Other CPUs will get activated by IPIs.
+ auto *tc = threadContexts[0];
+ SparcISA::PowerOnReset().invoke(tc);
+ tc->activate();
}
SparcSystem::~SparcSystem()
tc->pcState(newPC);
}
-
-void
-initCPU(ThreadContext *tc, int cpuId)
-{
- // Other CPUs will get activated by IPIs.
- if (cpuId != 0)
- return;
-
- PowerOnReset().invoke(tc);
- tc->activate();
-}
-
} // namespace SPARC_ISA
return !(pstate.priv || hpstate.hpriv);
}
-void initCPU(ThreadContext *tc, int cpuId);
-
void copyRegs(ThreadContext *src, ThreadContext *dest);
void copyMiscRegs(ThreadContext *src, ThreadContext *dest);
#include "arch/x86/bios/intelmp.hh"
#include "arch/x86/bios/smbios.hh"
+#include "arch/x86/faults.hh"
#include "arch/x86/isa_traits.hh"
#include "base/loader/object_file.hh"
#include "cpu/thread_context.hh"
{
System::initState();
+ for (auto *tc: threadContexts) {
+ X86ISA::InitInterrupt(0).invoke(tc);
+
+ if (tc->contextId() == 0) {
+ tc->activate();
+ } else {
+ // This is an application processor (AP). It should be initialized
+ // to look like only the BIOS POST has run on it and put then put
+ // it into a halted state.
+ tc->suspend();
+ }
+ }
+
if (!kernel)
fatal("No kernel to load.\n");
}
}
-void
-initCPU(ThreadContext *tc, int cpuId)
-{
- InitInterrupt(0).invoke(tc);
-
- if (cpuId == 0) {
- tc->activate();
- } else {
- // This is an application processor (AP). It should be initialized to
- // look like only the BIOS POST has run on it and put then put it into
- // a halted state.
- tc->suspend();
- }
-}
-
void
copyMiscRegs(ThreadContext *src, ThreadContext *dest)
{
}
}
- void initCPU(ThreadContext *tc, int cpuId);
-
void copyRegs(ThreadContext *src, ThreadContext *dest);
void copyMiscRegs(ThreadContext *src, ThreadContext *dest);
System::initState()
{
if (FullSystem) {
- for (auto *tc: threadContexts)
- TheISA::initCPU(tc, tc->contextId());
// Moved from the constructor to here since it relies on the
// address map being resolved in the interconnect
/**