20 #ifndef KERNEL_UTILITIES_BUFFER_H 21 #define KERNEL_UTILITIES_BUFFER_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/types.h" 27 #include "pedigree/kernel/utilities/List.h" 28 #include "pedigree/kernel/utilities/new" 48 template <
class T,
bool allowShortOperation = false>
61 size_t write(
const T *buffer,
size_t count,
bool block =
true);
67 size_t read(T *buffer,
size_t count,
bool block =
true);
109 bool canWrite(
bool block);
114 bool canRead(
bool block);
149 WITHOUT_IMPLICIT_CONSTRUCTORS(
Buffer);
156 void notifyMonitors();
161 void addSegment(
const T *buffer,
size_t count);
166 static const size_t m_SegmentSize = 32768;
174 Segment() : data(), reader(0), size(0)
179 T data[m_SegmentSize];
198 : pThread(thread), pEvent(event), pSemaphore(0)
234 #endif // KERNEL_UTILITIES_BUFFER_H
void monitor(Thread *pThread, Event *pEvent)
void cullMonitorTargets(Thread *pThread)
virtual uint64_t read(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) final
virtual uint64_t write(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) final