gem5 v24.0.0.0
|
FutexMap class holds a map of all futexes used in the system. More...
#include <futex_map.hh>
Public Member Functions | |
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. | |
void | suspend_bitset (Addr addr, uint64_t tgid, ThreadContext *tc, int bitmask) |
int | wakeup_bitset (Addr addr, uint64_t tgid, int bitmask) |
int | requeue (Addr addr1, uint64_t tgid, int count, int count2, Addr addr2) |
This operation wakes a given number (val) of waiters. | |
bool | is_waiting (ThreadContext *tc) |
Determine if the given thread context is currently waiting on a futex wait operation on any of the futexes tracked by this FutexMap. | |
Private Attributes | |
std::unordered_set< ThreadContext * > | waitingTcs |
FutexMap class holds a map of all futexes used in the system.
Definition at line 109 of file futex_map.hh.
bool gem5::FutexMap::is_waiting | ( | ThreadContext * | tc | ) |
Determine if the given thread context is currently waiting on a futex wait operation on any of the futexes tracked by this FutexMap.
Definition at line 185 of file futex_map.cc.
References waitingTcs.
Referenced by gem5::BaseCPU::postInterrupt().
This operation wakes a given number (val) of waiters.
If there are more threads waiting than woken, they are removed from the wait queue of the futex pointed to by addr1 and added to the wait queue of the futex pointed to by addr2. The number of waiter moved is capped by count2 (misused timeout parameter).
The return value is the number of waiters that are woken or requeued.
Definition at line 141 of file futex_map.cc.
References gem5::X86ISA::count, gem5::ArmISA::it1, gem5::ArmISA::it2, and gem5::MipsISA::w.
Referenced by gem5::futexFunc().
void gem5::FutexMap::suspend | ( | Addr | addr, |
uint64_t | tgid, | ||
ThreadContext * | tc ) |
Inserts a futex into the map with one waiting TC.
Definition at line 53 of file futex_map.cc.
References gem5::X86ISA::addr, and suspend_bitset().
Referenced by gem5::futexFunc().
void gem5::FutexMap::suspend_bitset | ( | Addr | addr, |
uint64_t | tgid, | ||
ThreadContext * | tc, | ||
int | bitmask ) |
Suspend the thread context
Definition at line 89 of file futex_map.cc.
References gem5::X86ISA::addr, gem5::ThreadContext::suspend(), and waitingTcs.
Referenced by gem5::futexFunc(), and suspend().
int gem5::FutexMap::wakeup | ( | Addr | addr, |
uint64_t | tgid, | ||
int | count ) |
Wakes up at most count waiting threads on a futex.
Definition at line 59 of file futex_map.cc.
References gem5::X86ISA::addr, gem5::X86ISA::count, and waitingTcs.
Referenced by gem5::exitFutexWake(), and gem5::futexFunc().
int gem5::FutexMap::wakeup_bitset | ( | Addr | addr, |
uint64_t | tgid, | ||
int | bitmask ) |
Definition at line 108 of file futex_map.cc.
References gem5::ThreadContext::activate(), gem5::X86ISA::addr, gem5::WaiterState::checkMask(), gem5::WaiterState::tc, and waitingTcs.
Referenced by gem5::futexFunc().
|
private |
Definition at line 143 of file futex_map.hh.
Referenced by is_waiting(), suspend_bitset(), wakeup(), and wakeup_bitset().