Ciro Santilli has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/29776 )

Change subject: sim-se: factor out FutexMap::suspend and FutexMap::suspend_bitset
......................................................................

sim-se: factor out FutexMap::suspend and FutexMap::suspend_bitset

Both methods do basically the same, especially since they don't handle the
timeout which is basically the only difference between both modes of the
syscall (one uses absolute and the other relative time).

Remove the WaiterState::WaiterState(ThreadContext* _tc) constructor,
since the only calls were from FutexMap::suspend which does not use them
anymore. Instead, set the magic 0xffffffff constant as a parameter to
suspend_bitset.

Change-Id: I69d86bad31d63604657a3c71cf07e5623f0ea639
---
M src/sim/futex_map.cc
1 file changed, 1 insertion(+), 16 deletions(-)



diff --git a/src/sim/futex_map.cc b/src/sim/futex_map.cc
index e2880aa..f7dde9c 100644
--- a/src/sim/futex_map.cc
+++ b/src/sim/futex_map.cc
@@ -26,7 +26,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

-#include <debug/Thread.hh>
 #include <sim/futex_map.hh>

 FutexKey::FutexKey(uint64_t addr_in, uint64_t tgid_in)
@@ -53,9 +52,6 @@
 WaiterState::WaiterState(ThreadContext* _tc, int _bitmask)
       : tc(_tc), bitmask(_bitmask) { }

-WaiterState::WaiterState(ThreadContext* _tc)
-      : tc(_tc), bitmask(0xffffffff) { }
-
 bool
 WaiterState::checkMask(int wakeup_bitmask) const
 {
@@ -65,18 +61,7 @@
 void
 FutexMap::suspend(Addr addr, uint64_t tgid, ThreadContext *tc)
 {
-    FutexKey key(addr, tgid);
-    auto it = find(key);
-
-    if (it == end()) {
-        WaiterList waiterList {WaiterState(tc)};
-        insert({key, waiterList});
-    } else {
-        it->second.push_back(WaiterState(tc));
-    }
-
-    /** Suspend the thread context */
-    tc->suspend();
+    suspend_bitset(addr, tgid, tc, 0xffffffff);
 }

 int

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29776
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I69d86bad31d63604657a3c71cf07e5623f0ea639
Gerrit-Change-Number: 29776
Gerrit-PatchSet: 1
Gerrit-Owner: Ciro Santilli <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to