20 #include "pedigree/kernel/process/Event.h" 21 #include "pedigree/kernel/LockGuard.h" 22 #include "pedigree/kernel/Log.h" 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/process/Process.h" 25 #include "pedigree/kernel/process/Scheduler.h" 26 #include "pedigree/kernel/process/Thread.h" 27 #include "pedigree/kernel/processor/VirtualAddressSpace.h" 28 #include "pedigree/kernel/utilities/Iterator.h" 29 #include "pedigree/kernel/utilities/utility.h" 32 uintptr_t handlerAddress,
bool isDeletable,
size_t specificNestingLevel)
33 : m_HandlerAddress(handlerAddress), m_bIsDeletable(isDeletable),
34 m_NestingLevel(specificNestingLevel), m_Magic(EVENT_MAGIC)
37 m_Threads(), m_Lock(false)
49 ERROR(
"UNSAFE EVENT DELETION");
53 " => Pending delivery to thread " 54 << it <<
" (" << it->getParent()->getId() <<
":" << it->getId()
58 "Unsafe event deletion: " << m_Threads.count()
59 <<
" threads reference it!");
85 ((EVENT_TID_MAX * MAX_NESTED_EVENTS) * EVENT_LIMIT);
95 ERROR(
"Event::unserialize is abstract, should never be called.");
101 void *alignedBuffer = ASSUME_ALIGNMENT(pBuffer,
sizeof(
size_t));
102 size_t *pBufferSize_t =
reinterpret_cast<size_t *
>(alignedBuffer);
103 return pBufferSize_t[0];
void pushBack(const T &value)
virtual void waitForDeliveries()
Iterator erase(Iterator &Iter)
static uintptr_t getTrampoline()
virtual uintptr_t getKernelEventBlockStart() const =0
static EXPORTED_PUBLIC VirtualAddressSpace & getKernelAddressSpace()
static bool unserialize(uint8_t *pBuffer, Event &event)
uintptr_t m_HandlerAddress
static Scheduler & instance()
List< Thread * > m_Threads
static uintptr_t getHandlerBuffer()
static size_t getEventType(uint8_t *pBuffer)
virtual bool isDeletable()
static uintptr_t getLastHandlerBuffer()
void registerThread(Thread *thread)
static uintptr_t getSecondaryTrampoline()
Event(uintptr_t handlerAddress, bool isDeletable, size_t specificNestingLevel=~0UL)
void deregisterThread(Thread *thread)