using namespace std;
using namespace ArmISA;
-Addr
-ArmISA::vtophys(Addr vaddr)
-{
- fatal("VTOPHYS: Can't convert vaddr to paddr on ARM without a thread context");
-}
-
static std::pair<bool, Addr>
try_translate(ThreadContext *tc, Addr addr)
{
if (translation.first)
return translation.second;
else
- panic("Table walkers support functional accesses. We should never get here\n");
+ panic("Table walkers support functional accesses. "
+ "We should never get here.");
}
bool
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __ARCH_ARM_VTOPHYS_H__
-#define __ARCH_ARM_VTOPHYS_H__
+#ifndef __ARCH_ARM_VTOPHYS_HH__
+#define __ARCH_ARM_VTOPHYS_HH__
#include "arch/arm/isa_traits.hh"
#include "arch/arm/utility.hh"
class ThreadContext;
-namespace ArmISA {
- inline Addr PteAddr(Addr a) { return (a & PteMask) << PteShift; }
+namespace ArmISA
+{
- Addr vtophys(Addr vaddr);
- Addr vtophys(ThreadContext *tc, Addr vaddr);
- bool virtvalid(ThreadContext *tc, Addr vaddr);
-}
+inline Addr PteAddr(Addr a) { return (a & PteMask) << PteShift; }
-#endif // __ARCH_ARM_VTOPHYS_H__
+Addr vtophys(ThreadContext *tc, Addr vaddr);
+bool virtvalid(ThreadContext *tc, Addr vaddr);
+
+} // namespace ArmISA
+
+#endif // __ARCH_ARM_VTOPHYS_HH__
#include "arch/mips/vtophys.hh"
-#include <string>
-
-#include "base/chunk_generator.hh"
-#include "base/trace.hh"
-#include "cpu/thread_context.hh"
-#include "debug/VtoPhys.hh"
-
-using namespace std;
-using namespace MipsISA;
-
-Addr
-MipsISA::vtophys(Addr vaddr)
-{
- fatal("VTOPHYS: Unimplemented on MIPS\n");
- return 0;
-}
+#include "base/logging.hh"
Addr
MipsISA::vtophys(ThreadContext *tc, Addr addr)
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __ARCH_MIPS_VTOPHYS_H__
-#define __ARCH_MIPS_VTOPHYS_H__
+#ifndef __ARCH_MIPS_VTOPHYS_HH__
+#define __ARCH_MIPS_VTOPHYS_HH__
#include "arch/mips/isa_traits.hh"
#include "arch/mips/utility.hh"
class ThreadContext;
-namespace MipsISA {
- Addr vtophys(Addr vaddr);
- Addr vtophys(ThreadContext *tc, Addr vaddr);
+namespace MipsISA
+{
-};
-#endif // __ARCH_MIPS_VTOPHYS_H__
+Addr vtophys(ThreadContext *tc, Addr vaddr);
+
+} // namespace MipsISA
+
+#endif // __ARCH_MIPS_VTOPHYS_HH__
using namespace std;
-Addr
-PowerISA::vtophys(Addr vaddr)
-{
- fatal("vtophys: Unimplemented on POWER\n");
-}
-
Addr
PowerISA::vtophys(ThreadContext *tc, Addr addr)
{
class ThreadContext;
-namespace PowerISA {
+namespace PowerISA
+{
-Addr vtophys(Addr vaddr);
Addr vtophys(ThreadContext *tc, Addr vaddr);
inline Addr
class ThreadContext;
-namespace RiscvISA {
-
-inline Addr
-vtophys(Addr vaddr)
+namespace RiscvISA
{
- fatal("VTOPHYS: Unimplemented on RISC-V\n");
- return vaddr;
-}
-inline Addr
+static inline Addr
vtophys(ThreadContext *tc, Addr vaddr)
{
fatal("VTOPHYS: Unimplemented on RISC-V\n");
- return vtophys(vaddr);
}
} // namespace RiscvISA
#include <string>
+#include "arch/sparc/pagetable.hh"
#include "arch/sparc/tlb.hh"
#include "base/chunk_generator.hh"
#include "base/compiler.hh"
using namespace std;
-namespace SparcISA {
-
-Addr
-vtophys(Addr vaddr)
+namespace SparcISA
{
- // In SPARC it's almost always impossible to turn a VA->PA w/o a
- // context The only times we can kinda do it are if we have a
- // SegKPM mapping and can find the real address in the tlb or we
- // have a physical adddress already (beacuse we are looking at the
- // hypervisor) Either case is rare, so we'll just panic.
-
- panic("vtophys() without context on SPARC largly worthless\n");
- M5_DUMMY_RETURN;
-}
Addr
vtophys(ThreadContext *tc, Addr addr)
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef __ARCH_SPARC_VTOPHYS_H__
-#define __ARCH_SPARC_VTOPHYS_H__
+#ifndef __ARCH_SPARC_VTOPHYS_HH__
+#define __ARCH_SPARC_VTOPHYS_HH__
#include "arch/sparc/isa_traits.hh"
-#include "arch/sparc/pagetable.hh"
class ThreadContext;
-namespace SparcISA {
+namespace SparcISA
+{
-Addr vtophys(Addr vaddr);
Addr vtophys(ThreadContext *tc, Addr vaddr);
-};
-#endif // __ARCH_SPARC_VTOPHYS_H__
+}; // namespace SparcISA
+
+#endif // __ARCH_SPARC_VTOPHYS_HH__
using namespace std;
-namespace X86ISA
+Addr
+X86ISA::vtophys(ThreadContext *tc, Addr vaddr)
{
- Addr
- vtophys(Addr vaddr)
- {
- panic("Need access to page tables\n");
- }
-
- Addr
- vtophys(ThreadContext *tc, Addr vaddr)
- {
- Walker *walker = dynamic_cast<TLB *>(tc->getDTBPtr())->getWalker();
- unsigned logBytes;
- Addr addr = vaddr;
- Fault fault = walker->startFunctional(
- tc, addr, logBytes, BaseTLB::Read);
- if (fault != NoFault)
- panic("vtophys page walk returned fault\n");
- Addr masked_addr = vaddr & mask(logBytes);
- Addr paddr = addr | masked_addr;
- DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr);
- return paddr;
- }
+ Walker *walker = dynamic_cast<TLB *>(tc->getDTBPtr())->getWalker();
+ unsigned logBytes;
+ Addr addr = vaddr;
+ Fault fault = walker->startFunctional(
+ tc, addr, logBytes, BaseTLB::Read);
+ if (fault != NoFault)
+ panic("vtophys page walk returned fault\n");
+ Addr masked_addr = vaddr & mask(logBytes);
+ Addr paddr = addr | masked_addr;
+ DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr);
+ return paddr;
}
namespace X86ISA
{
-Addr vtophys(Addr vaddr);
Addr vtophys(ThreadContext *tc, Addr vaddr);
}
return fault;
}
-Addr
-CheckerCPU::dbg_vtophys(Addr addr)
-{
- return vtophys(tc, addr);
-}
-
/**
* Checks if the flags set by the Checker and Checkee match.
*/
BaseTLB *itb;
BaseTLB *dtb;
- Addr dbg_vtophys(Addr addr);
-
// ISAs like ARM can have multiple destination registers to check,
// keep them all in a std::queue
std::queue<InstResult> result;
BaseCPU::unserialize(cp);
}
-Addr
-MinorCPU::dbg_vtophys(Addr addr)
-{
- /* Note that this gives you the translation for thread 0 */
- panic("No implementation for vtophy\n");
-
- return 0;
-}
-
void
MinorCPU::wakeup(ThreadID tid)
{
void startup() override;
void wakeup(ThreadID tid) override;
- Addr dbg_vtophys(Addr addr);
-
/** Processor-specific statistics */
Minor::MinorStats stats;
{
}
-Addr
-BaseSimpleCPU::dbg_vtophys(Addr addr)
-{
- return vtophys(threadContexts[curThread], addr);
-}
-
void
BaseSimpleCPU::wakeup(ThreadID tid)
{
Status _status;
public:
- Addr dbg_vtophys(Addr addr);
-
-
void checkForInterrupts();
void setupFetchRequest(const RequestPtr &req);
void preExecute();