Go to the documentation of this file.
29 #ifndef __FUTEX_MAP_HH__
30 #define __FUTEX_MAP_HH__
32 #include <unordered_map>
33 #include <unordered_set>
46 FutexKey(uint64_t addr_in, uint64_t tgid_in);
60 size_t operator()(
const FutexKey& in)
const;
90 class FutexMap :
public std::unordered_map<FutexKey, WaiterList>
127 #endif // __FUTEX_MAP_HH__
void suspend(Addr addr, uint64_t tgid, ThreadContext *tc)
Inserts a futex into the map with one waiting TC.
int wakeup(Addr addr, uint64_t tgid, int count)
Wakes up at most count waiting threads on a futex.
std::unordered_set< ThreadContext * > waitingTcs
bool operator==(const FutexKey &in) const
void suspend_bitset(Addr addr, uint64_t tgid, ThreadContext *tc, int bitmask)
bool checkMask(int wakeup_bitmask) const
return true if the bit-wise AND of the wakeup_bitmask given by a waking thread and this thread's inte...
FutexMap class holds a map of all futexes used in the system.
bool is_waiting(ThreadContext *tc)
Determine if the given thread context is currently waiting on a futex wait operation on any of the fu...
FutexKey class defines an unique identifier for a particular futex in the system.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
WaiterState(ThreadContext *_tc, int _bitmask)
this constructor is used if futex ops with bitset are used
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
FutexKey(uint64_t addr_in, uint64_t tgid_in)
int requeue(Addr addr1, uint64_t tgid, int count, int count2, Addr addr2)
This operation wakes a given number (val) of waiters.
WaiterState defines internal state of a waiter thread.
Overload hash function for BasicBlockRange type.
int wakeup_bitset(Addr addr, uint64_t tgid, int bitmask)
std::list< WaiterState > WaiterList
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17