20 #ifndef REQUEST_QUEUE_H 21 #define REQUEST_QUEUE_H 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/process/ConditionVariable.h" 25 #include "pedigree/kernel/process/Mutex.h" 26 #include "pedigree/kernel/processor/state_forward.h" 27 #include "pedigree/kernel/processor/types.h" 28 #include "pedigree/kernel/utilities/String.h" 30 #include "pedigree/kernel/machine/TimerHandler.h" 35 #define REQUEST_QUEUE_NUM_PRIORITIES 4 55 virtual void timer(uint64_t delta, InterruptState &state);
57 size_t m_LastQueueSize;
70 enum ActionOnDuplicate
90 size_t priority, uint64_t p1 = 0, uint64_t p2 = 0, uint64_t p3 = 0,
91 uint64_t p4 = 0, uint64_t p5 = 0, uint64_t p6 = 0, uint64_t p7 = 0,
97 size_t priority, ActionOnDuplicate action, uint64_t p1 = 0,
98 uint64_t p2 = 0, uint64_t p3 = 0, uint64_t p4 = 0, uint64_t p5 = 0,
99 uint64_t p6 = 0, uint64_t p7 = 0, uint64_t p8 = 0);
103 size_t priority, uint64_t p1 = 0, uint64_t p2 = 0, uint64_t p3 = 0,
104 uint64_t p4 = 0, uint64_t p5 = 0, uint64_t p6 = 0, uint64_t p7 = 0,
122 uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5,
123 uint64_t p6, uint64_t p7, uint64_t p8) = 0;
133 : p1(0), p2(0), p3(0), p4(0), p5(0), p6(0), p7(0), p8(0), ret(0),
135 mutex(
true), pThread(0),
137 bReject(
false), bCompleted(
false), next(0), refcnt(0), owner(0),
144 uint64_t p1, p2, p3, p4, p5, p6, p7, p8;
159 void operator=(
const Request &);
175 bool isRequestValid(
const Request *r);
178 static int trampoline(
void *p);
181 static int doAsync(
void *p);
190 Request *m_pRequestQueue[REQUEST_QUEUE_NUM_PRIORITIES];
208 Mutex m_HaltAcknowledged;
213 size_t m_nMaxAsyncRequests;
214 size_t m_nAsyncRequests;
216 size_t m_nTotalRequests;
virtual bool compareRequests(const Request &a, const Request &b)
uint64_t addAsyncRequest(size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0)
Mutex m_RequestQueueMutex
virtual uint64_t executeRequest(uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5, uint64_t p6, uint64_t p7, uint64_t p8)=0
ConditionVariable m_RequestQueueCondition
ConditionVariable m_AsyncRequestQueueCondition
virtual void initialise()
MUST_USE_RESULT uint64_t addRequest(size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0)
RequestQueue(const String &name)