summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-03-07 03:02:35 -0800
committerGabe Black <gabeblack@google.com>2019-03-19 10:22:50 +0000
commitd3d24835bcc03ecf312ac6ba7df114656770730f (patch)
tree43bb564a7bc3e22ffd7b1b906f6f96742ecb619a /src/arch
parent378d9ccbeb4053aeeab002159b26625854af54f7 (diff)
downloadgem5-d3d24835bcc03ecf312ac6ba7df114656770730f.tar.xz
arch, cpu, dev, gpu, mem, sim, python: start using getPort.
Replace the getMasterPort, getSlavePort, and getEthPort functions with getPort, and remove extraneous mechanisms that are no longer necessary. Change-Id: Iab7e3c02d2f3a0cf33e7e824e18c28646b5bc318 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17040 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/table_walker.cc6
-rw-r--r--src/arch/arm/table_walker.hh4
-rw-r--r--src/arch/arm/tlb.cc4
-rw-r--r--src/arch/arm/tlb.hh4
-rw-r--r--src/arch/generic/tlb.hh6
-rw-r--r--src/arch/x86/interrupts.hh15
-rw-r--r--src/arch/x86/pagetable_walker.cc6
-rw-r--r--src/arch/x86/pagetable_walker.hh4
-rw-r--r--src/arch/x86/tlb.cc6
-rw-r--r--src/arch/x86/tlb.hh6
10 files changed, 27 insertions, 34 deletions
diff --git a/src/arch/arm/table_walker.cc b/src/arch/arm/table_walker.cc
index 1a7b5d375..21257de59 100644
--- a/src/arch/arm/table_walker.cc
+++ b/src/arch/arm/table_walker.cc
@@ -114,8 +114,8 @@ TableWalker::init()
fatal_if(!tlb, "Table walker must have a valid TLB\n");
}
-BaseMasterPort&
-TableWalker::getMasterPort(const std::string &if_name, PortID idx)
+Port &
+TableWalker::getPort(const std::string &if_name, PortID idx)
{
if (if_name == "port") {
if (!isStage2) {
@@ -124,7 +124,7 @@ TableWalker::getMasterPort(const std::string &if_name, PortID idx)
fatal("Cannot access table walker port through stage-two walker\n");
}
}
- return MemObject::getMasterPort(if_name, idx);
+ return MemObject::getPort(if_name, idx);
}
TableWalker::WalkerState::WalkerState() :
diff --git a/src/arch/arm/table_walker.hh b/src/arch/arm/table_walker.hh
index 57e3aed06..8176fc7f5 100644
--- a/src/arch/arm/table_walker.hh
+++ b/src/arch/arm/table_walker.hh
@@ -889,8 +889,8 @@ class TableWalker : public MemObject
DrainState drain() override;
void drainResume() override;
- BaseMasterPort& getMasterPort(const std::string &if_name,
- PortID idx = InvalidPortID) override;
+ Port &getPort(const std::string &if_name,
+ PortID idx=InvalidPortID) override;
void regStats() override;
diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc
index ed7e68039..dc3c35bab 100644
--- a/src/arch/arm/tlb.cc
+++ b/src/arch/arm/tlb.cc
@@ -1243,8 +1243,8 @@ TLB::translateComplete(const RequestPtr &req, ThreadContext *tc,
return fault;
}
-BaseMasterPort*
-TLB::getTableWalkerMasterPort()
+Port *
+TLB::getTableWalkerPort()
{
return &stage2Mmu->getPort();
}
diff --git a/src/arch/arm/tlb.hh b/src/arch/arm/tlb.hh
index 8ca176a82..fa1b04069 100644
--- a/src/arch/arm/tlb.hh
+++ b/src/arch/arm/tlb.hh
@@ -392,7 +392,7 @@ class TLB : public BaseTLB
void regProbePoints() override;
/**
- * Get the table walker master port. This is used for migrating
+ * Get the table walker port. This is used for migrating
* port connections during a CPU takeOverFrom() call. For
* architectures that do not have a table walker, NULL is
* returned, hence the use of a pointer rather than a
@@ -401,7 +401,7 @@ class TLB : public BaseTLB
*
* @return A pointer to the walker master port
*/
- BaseMasterPort* getTableWalkerMasterPort() override;
+ Port *getTableWalkerPort() override;
// Caching misc register values here.
// Writing to misc registers needs to invalidate them.
diff --git a/src/arch/generic/tlb.hh b/src/arch/generic/tlb.hh
index 7865d8abe..ba07b1057 100644
--- a/src/arch/generic/tlb.hh
+++ b/src/arch/generic/tlb.hh
@@ -131,15 +131,15 @@ class BaseTLB : public MemObject
virtual void takeOverFrom(BaseTLB *otlb) = 0;
/**
- * Get the table walker master port if present. This is used for
+ * Get the table walker port if present. This is used for
* migrating port connections during a CPU takeOverFrom()
* call. For architectures that do not have a table walker, NULL
* is returned, hence the use of a pointer rather than a
* reference.
*
- * @return A pointer to the walker master port or NULL if not present
+ * @return A pointer to the walker port or NULL if not present
*/
- virtual BaseMasterPort* getTableWalkerMasterPort() { return NULL; }
+ virtual Port* getTableWalkerPort() { return NULL; }
void memInvalidate() { flushAll(); }
};
diff --git a/src/arch/x86/interrupts.hh b/src/arch/x86/interrupts.hh
index bfd188961..dfdff2b3f 100644
--- a/src/arch/x86/interrupts.hh
+++ b/src/arch/x86/interrupts.hh
@@ -215,22 +215,15 @@ class Interrupts : public BasicPioDevice, IntDevice
AddrRangeList getIntAddrRange() const override;
- BaseMasterPort &getMasterPort(const std::string &if_name,
- PortID idx = InvalidPortID) override
+ Port &getPort(const std::string &if_name,
+ PortID idx=InvalidPortID) override
{
if (if_name == "int_master") {
return intMasterPort;
- }
- return BasicPioDevice::getMasterPort(if_name, idx);
- }
-
- BaseSlavePort &getSlavePort(const std::string &if_name,
- PortID idx = InvalidPortID) override
- {
- if (if_name == "int_slave") {
+ } else if (if_name == "int_slave") {
return intSlavePort;
}
- return BasicPioDevice::getSlavePort(if_name, idx);
+ return BasicPioDevice::getPort(if_name, idx);
}
/*
diff --git a/src/arch/x86/pagetable_walker.cc b/src/arch/x86/pagetable_walker.cc
index 4a405f25f..0741dc2ed 100644
--- a/src/arch/x86/pagetable_walker.cc
+++ b/src/arch/x86/pagetable_walker.cc
@@ -167,13 +167,13 @@ bool Walker::sendTiming(WalkerState* sendingState, PacketPtr pkt)
}
-BaseMasterPort &
-Walker::getMasterPort(const std::string &if_name, PortID idx)
+Port &
+Walker::getPort(const std::string &if_name, PortID idx)
{
if (if_name == "port")
return port;
else
- return MemObject::getMasterPort(if_name, idx);
+ return MemObject::getPort(if_name, idx);
}
void
diff --git a/src/arch/x86/pagetable_walker.hh b/src/arch/x86/pagetable_walker.hh
index edca24795..c1f4ed2c4 100644
--- a/src/arch/x86/pagetable_walker.hh
+++ b/src/arch/x86/pagetable_walker.hh
@@ -160,8 +160,8 @@ namespace X86ISA
const RequestPtr &req, BaseTLB::Mode mode);
Fault startFunctional(ThreadContext * _tc, Addr &addr,
unsigned &logBytes, BaseTLB::Mode mode);
- BaseMasterPort &getMasterPort(const std::string &if_name,
- PortID idx = InvalidPortID);
+ Port &getPort(const std::string &if_name,
+ PortID idx=InvalidPortID) override;
protected:
// The TLB we're supposed to load.
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index 59fd3f00a..33de0583e 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -511,10 +511,10 @@ TLB::unserialize(CheckpointIn &cp)
}
}
-BaseMasterPort *
-TLB::getTableWalkerMasterPort()
+Port *
+TLB::getTableWalkerPort()
{
- return &walker->getMasterPort("port");
+ return &walker->getPort("port");
}
} // namespace X86ISA
diff --git a/src/arch/x86/tlb.hh b/src/arch/x86/tlb.hh
index 8894a1e4a..b969bca9d 100644
--- a/src/arch/x86/tlb.hh
+++ b/src/arch/x86/tlb.hh
@@ -156,16 +156,16 @@ namespace X86ISA
void unserialize(CheckpointIn &cp) override;
/**
- * Get the table walker master port. This is used for
+ * Get the table walker port. This is used for
* migrating port connections during a CPU takeOverFrom()
* call. For architectures that do not have a table walker,
* NULL is returned, hence the use of a pointer rather than a
* reference. For X86 this method will always return a valid
* port pointer.
*
- * @return A pointer to the walker master port
+ * @return A pointer to the walker port
*/
- BaseMasterPort *getTableWalkerMasterPort() override;
+ Port *getTableWalkerPort() override;
};
}