The Pedigree Project 0.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SignalEvent Class Reference
+ Inheritance diagram for SignalEvent:
+ Collaboration diagram for SignalEvent:

Public Types

enum class  DeliveryDisposition { DefaultAction , CaughtHandler }
 
- Public Types inherited from Event
enum class  HandlerPrivilege { Kernel , User }
 
enum class  UserReturnDelivery { NotApplicable , Delivered , Failed }
 

Public Member Functions

 SignalEvent (uintptr_t handlerAddress, size_t signalNum, size_t specificNestingLevel=~0UL, uint64_t signalMask=0, bool deferSignal=true, bool isDeletable=false, HandlerPrivilege handlerPrivilege=HandlerPrivilege::Kernel, DeliveryDisposition disposition=DeliveryDisposition::CaughtHandler, bool useAlternateUserStack=false, size_t continuationEpoch=0)
 
 SignalEvent (const SignalEvent &other)
 
void setChildStatus (int32_t status, uint64_t userTime, uint64_t systemTime)
 
int32_t childStatus () const
 
uint64_t childUserTime () const
 
uint64_t childSystemTime () const
 
uint64_t rebindGeneration () const
 
void setRebindGeneration (uint64_t value)
 
uint64_t queueSequence () const
 
void setQueueSequence (uint64_t value)
 
bool deliveryActive () const
 
bool queuedIndividually () const
 
bool hasDeliveryState () const
 
void setDeliveryState (const SharedPointer< SignalEventState > &state)
 
void transferDeliveryStateTo (SignalEvent &event)
 
const void * deliverySource () const
 
void timerInfo (int32_t &timerId, int32_t &overrun) const
 
void rejectSignalDelivery () const
 
void completeSignalDelivery (int32_t overrun=0) const
 
void setTraceBypass (bool value=true)
 
bool consumeTraceBypass ()
 
virtual size_t serialize (uint8_t *pBuffer)
 
virtual bool isSignalEvent () const
 
virtual bool prefersAlternateUserStack () const
 
virtual bool isDeliverableWhileProcessSuspended () const
 
virtual Event * cloneForDelivery ()
 
virtual SignalEvent * cloneForDisposition ()
 
void setProcessDirected (bool processDirected)
 
bool isProcessDirected () const
 
void setSignalOrigin (int32_t signalCode, int32_t senderProcess, uint32_t senderUser)
 
int32_t getSignalCode () const
 
int32_t getSenderProcess () const
 
void setSignalValue (uint64_t value)
 
uint64_t getSignalValue () const
 
uint32_t getSenderUser () const
 
uint64_t getDeliverySignalMask () const
 
bool defersDeliveredSignal () const
 
void setContinuationEpoch (size_t continuationEpoch)
 
size_t getContinuationEpoch () const
 
virtual size_t getNumber ()
 
- Public Member Functions inherited from Event
 Event (uintptr_t handlerAddress, bool isDeletable, size_t specificNestingLevel=~0UL, HandlerPrivilege handlerPrivilege=HandlerPrivilege::Kernel)
 
virtual bool isDeletable ()
 
uintptr_t getHandlerAddress ()
 
HandlerPrivilege getHandlerPrivilege () const
 
bool isValidHandlerMapping (size_t mappingFlags) const
 
virtual bool requiresExactUserReturnState () const
 
virtual UserReturnDelivery deliverAtUserReturn (InterruptState &)
 
virtual UserReturnDelivery deliverAtUserReturn (SyscallState &)
 
size_t getSpecificNestingLevel ()
 
 Event (const Event &other)
 
Event & operator= (const Event &other)
 
size_t pendingCount ()
 
bool tryAcquireRegistration (SendLease &registration)
 
virtual void waitForDeliveries ()
 
void retire ()
 
void beginRetirement (Retirement &retirement)
 

Static Public Member Functions

static bool unserialize (uint8_t *pBuffer, Event &event)
 
- Static Public Member Functions inherited from Event
static uintptr_t getTrampoline ()
 
static uintptr_t getSecondaryTrampoline ()
 
static uintptr_t getHandlerBuffer ()
 
static size_t getHandlerBufferSize ()
 
static uintptr_t getLastHandlerBuffer ()
 
static bool unserialize (uint8_t *pBuffer, Event &event)
 
static size_t getEventType (uint8_t *pBuffer)
 

Protected Member Functions

 SignalEvent (const SignalEvent &other, bool isDeletable)
 

Private Attributes

size_t m_SignalNumber
 
uint64_t m_SignalMask
 
bool m_DeferSignal
 
bool m_ProcessDirected
 
DeliveryDisposition m_Disposition
 
bool m_UseAlternateUserStack
 
size_t m_ContinuationEpoch
 
int32_t m_SignalCode
 
int32_t m_SenderProcess
 
uint32_t m_SenderUser
 
uint64_t m_SignalValue
 
SharedPointer< SignalEventState > m_DeliveryState
 
bool m_TraceBypass = false
 
uint64_t m_RebindGeneration = 0
 
uint64_t m_QueueSequence = 0
 
int32_t m_ChildStatus = 0
 
uint64_t m_ChildUserTime = 0
 
uint64_t m_ChildSystemTime = 0
 

Additional Inherited Members

- Protected Attributes inherited from Event
uintptr_t m_HandlerAddress
 
HandlerPrivilege m_HandlerPrivilege
 
bool m_bIsDeletable
 
size_t m_NestingLevel
 
uint64_t m_Magic
 
List< Thread * > m_Threads
 
Spinlock m_Lock
 

Detailed Description

Definition at line 40 of file SignalEvent.h.

Member Enumeration Documentation

◆ DeliveryDisposition

enum class SignalEvent::DeliveryDisposition
strong

Definition at line 42 of file SignalEvent.h.

Constructor & Destructor Documentation

◆ SignalEvent() [1/3]

SignalEvent::SignalEvent ( uintptr_t  handlerAddress,
size_t  signalNum,
size_t  specificNestingLevel = ~0UL,
uint64_t  signalMask = 0,
bool  deferSignal = true,
bool  isDeletable = false,
HandlerPrivilege  handlerPrivilege = HandlerPrivilege::Kernel,
DeliveryDisposition  disposition = DeliveryDisposition::CaughtHandler,
bool  useAlternateUserStack = false,
size_t  continuationEpoch = 0 
)

Definition at line 27 of file SignalEvent.cc.

◆ SignalEvent() [2/3]

SignalEvent::SignalEvent ( const SignalEvent &  other)

Definition at line 44 of file SignalEvent.cc.

◆ ~SignalEvent()

SignalEvent::~SignalEvent ( )
override

Definition at line 64 of file SignalEvent.cc.

◆ SignalEvent() [3/3]

SignalEvent::SignalEvent ( const SignalEvent &  other,
bool  isDeletable 
)
protected

Definition at line 46 of file SignalEvent.cc.

Member Function Documentation

◆ childStatus()

int32_t SignalEvent::childStatus ( ) const
inline

Definition at line 61 of file SignalEvent.h.

◆ childSystemTime()

uint64_t SignalEvent::childSystemTime ( ) const
inline

Definition at line 67 of file SignalEvent.h.

◆ childUserTime()

uint64_t SignalEvent::childUserTime ( ) const
inline

Definition at line 64 of file SignalEvent.h.

◆ cloneForDelivery()

Event * SignalEvent::cloneForDelivery ( )
virtual

Returns the instance to enqueue for one delivery. Most events enqueue themselves; signal dispositions return an independently owned snapshot.

Reimplemented from Event.

Reimplemented in LinuxAmd64Signal::AsyncEvent.

Definition at line 70 of file SignalEvent.cc.

References Event::isDeletable().

Referenced by PosixSubsystem::queueSignalDelivery().

+ Here is the caller graph for this function:

◆ cloneForDisposition()

SignalEvent * SignalEvent::cloneForDisposition ( )
virtual

Copies a stable signal-disposition event without slicing subclasses.

Reimplemented in LinuxAmd64Signal::AsyncEvent.

Definition at line 78 of file SignalEvent.cc.

◆ completeSignalDelivery()

void SignalEvent::completeSignalDelivery ( int32_t  overrun = 0) const
inline

Definition at line 112 of file SignalEvent.h.

◆ consumeTraceBypass()

bool SignalEvent::consumeTraceBypass ( )
inline

Definition at line 121 of file SignalEvent.h.

◆ defersDeliveredSignal()

bool SignalEvent::defersDeliveredSignal ( ) const
inline

Definition at line 185 of file SignalEvent.h.

◆ deliveryActive()

bool SignalEvent::deliveryActive ( ) const
inline

Definition at line 82 of file SignalEvent.h.

◆ deliverySource()

const void * SignalEvent::deliverySource ( ) const
inline

Definition at line 98 of file SignalEvent.h.

◆ getContinuationEpoch()

size_t SignalEvent::getContinuationEpoch ( ) const
inline

Definition at line 194 of file SignalEvent.h.

◆ getDeliverySignalMask()

uint64_t SignalEvent::getDeliverySignalMask ( ) const
inline

Definition at line 181 of file SignalEvent.h.

◆ getNumber()

virtual size_t SignalEvent::getNumber ( )
inlinevirtual

Returns the event number / ID.

Implements Event.

Definition at line 198 of file SignalEvent.h.

◆ getSenderProcess()

int32_t SignalEvent::getSenderProcess ( ) const
inline

Definition at line 166 of file SignalEvent.h.

◆ getSenderUser()

uint32_t SignalEvent::getSenderUser ( ) const
inline

Definition at line 177 of file SignalEvent.h.

◆ getSignalCode()

int32_t SignalEvent::getSignalCode ( ) const
inline

Definition at line 162 of file SignalEvent.h.

◆ getSignalValue()

uint64_t SignalEvent::getSignalValue ( ) const
inline

Definition at line 173 of file SignalEvent.h.

◆ hasDeliveryState()

bool SignalEvent::hasDeliveryState ( ) const
inline

Definition at line 88 of file SignalEvent.h.

◆ isDeliverableWhileProcessSuspended()

virtual bool SignalEvent::isDeliverableWhileProcessSuspended ( ) const
inlinevirtual

Returns whether this event can run before a suspended process resumes.

Reimplemented from Event.

Definition at line 137 of file SignalEvent.h.

◆ isProcessDirected()

bool SignalEvent::isProcessDirected ( ) const
inline

Definition at line 151 of file SignalEvent.h.

◆ isSignalEvent()

virtual bool SignalEvent::isSignalEvent ( ) const
inlinevirtual

Returns true if this event is subject to the thread's signal mask.

Reimplemented from Event.

Definition at line 129 of file SignalEvent.h.

◆ prefersAlternateUserStack()

virtual bool SignalEvent::prefersAlternateUserStack ( ) const
inlinevirtual

Returns whether a userspace handler prefers the thread's signal stack.

Reimplemented from Event.

Definition at line 133 of file SignalEvent.h.

◆ queuedIndividually()

bool SignalEvent::queuedIndividually ( ) const
inline

Definition at line 85 of file SignalEvent.h.

◆ queueSequence()

uint64_t SignalEvent::queueSequence ( ) const
inline

Definition at line 76 of file SignalEvent.h.

◆ rebindGeneration()

uint64_t SignalEvent::rebindGeneration ( ) const
inline

Definition at line 70 of file SignalEvent.h.

◆ rejectSignalDelivery()

void SignalEvent::rejectSignalDelivery ( ) const
inline

Definition at line 108 of file SignalEvent.h.

◆ serialize()

size_t SignalEvent::serialize ( uint8_t *  pBuffer)
virtual

◆ setChildStatus()

void SignalEvent::setChildStatus ( int32_t  status,
uint64_t  userTime,
uint64_t  systemTime 
)
inline

Definition at line 56 of file SignalEvent.h.

◆ setContinuationEpoch()

void SignalEvent::setContinuationEpoch ( size_t  continuationEpoch)
inline

Stamps the process continuation generation captured for this delivery.

Definition at line 190 of file SignalEvent.h.

Referenced by Thread::replaceSignalEvent().

+ Here is the caller graph for this function:

◆ setDeliveryState()

void SignalEvent::setDeliveryState ( const SharedPointer< SignalEventState > &  state)
inline

Definition at line 91 of file SignalEvent.h.

◆ setProcessDirected()

void SignalEvent::setProcessDirected ( bool  processDirected)
inline

Definition at line 147 of file SignalEvent.h.

◆ setQueueSequence()

void SignalEvent::setQueueSequence ( uint64_t  value)
inline

Definition at line 79 of file SignalEvent.h.

◆ setRebindGeneration()

void SignalEvent::setRebindGeneration ( uint64_t  value)
inline

Definition at line 73 of file SignalEvent.h.

◆ setSignalOrigin()

void SignalEvent::setSignalOrigin ( int32_t  signalCode,
int32_t  senderProcess,
uint32_t  senderUser 
)
inline

Records the origin fields exposed through Linux siginfo_t.

Definition at line 156 of file SignalEvent.h.

Referenced by PosixSubsystem::queueSignalDelivery(), and Thread::replaceSignalEvent().

+ Here is the caller graph for this function:

◆ setSignalValue()

void SignalEvent::setSignalValue ( uint64_t  value)
inline

Definition at line 170 of file SignalEvent.h.

◆ setTraceBypass()

void SignalEvent::setTraceBypass ( bool  value = true)
inline

Definition at line 118 of file SignalEvent.h.

◆ timerInfo()

void SignalEvent::timerInfo ( int32_t &  timerId,
int32_t &  overrun 
) const
inline

Definition at line 101 of file SignalEvent.h.

◆ transferDeliveryStateTo()

void SignalEvent::transferDeliveryStateTo ( SignalEvent &  event)
inline

Definition at line 94 of file SignalEvent.h.

◆ unserialize()

bool SignalEvent::unserialize ( uint8_t *  pBuffer,
Event &  event 
)
static

Definition at line 108 of file SignalEvent.cc.

Member Data Documentation

◆ m_ChildStatus

int32_t SignalEvent::m_ChildStatus = 0
private

Definition at line 236 of file SignalEvent.h.

◆ m_ChildSystemTime

uint64_t SignalEvent::m_ChildSystemTime = 0
private

Definition at line 237 of file SignalEvent.h.

◆ m_ChildUserTime

uint64_t SignalEvent::m_ChildUserTime = 0
private

Definition at line 237 of file SignalEvent.h.

◆ m_ContinuationEpoch

size_t SignalEvent::m_ContinuationEpoch
private

Process continuation generation captured when this signal was queued.

Definition at line 225 of file SignalEvent.h.

Referenced by serialize().

◆ m_DeferSignal

bool SignalEvent::m_DeferSignal
private

Whether the delivered signal itself is blocked while the handler runs.

Definition at line 213 of file SignalEvent.h.

Referenced by serialize().

◆ m_DeliveryState

SharedPointer<SignalEventState> SignalEvent::m_DeliveryState
private

Definition at line 232 of file SignalEvent.h.

◆ m_Disposition

DeliveryDisposition SignalEvent::m_Disposition
private

Whether this delivery represents a caught signal handler.

Definition at line 219 of file SignalEvent.h.

Referenced by serialize().

◆ m_ProcessDirected

bool SignalEvent::m_ProcessDirected
private

Process-pending signals survive removal of their selected recipient.

Definition at line 216 of file SignalEvent.h.

◆ m_QueueSequence

uint64_t SignalEvent::m_QueueSequence = 0
private

Definition at line 235 of file SignalEvent.h.

◆ m_RebindGeneration

uint64_t SignalEvent::m_RebindGeneration = 0
private

Definition at line 234 of file SignalEvent.h.

◆ m_SenderProcess

int32_t SignalEvent::m_SenderProcess
private

Definition at line 229 of file SignalEvent.h.

◆ m_SenderUser

uint32_t SignalEvent::m_SenderUser
private

Definition at line 230 of file SignalEvent.h.

◆ m_SignalCode

int32_t SignalEvent::m_SignalCode
private

Linux-compatible signal origin metadata.

Definition at line 228 of file SignalEvent.h.

◆ m_SignalMask

uint64_t SignalEvent::m_SignalMask
private

Signals additionally blocked while the handler runs.

Definition at line 210 of file SignalEvent.h.

Referenced by serialize().

◆ m_SignalNumber

size_t SignalEvent::m_SignalNumber
private

This keeps track of the actual signal this SignalEvent is linked to

Definition at line 207 of file SignalEvent.h.

Referenced by serialize().

◆ m_SignalValue

uint64_t SignalEvent::m_SignalValue
private

Definition at line 231 of file SignalEvent.h.

◆ m_TraceBypass

bool SignalEvent::m_TraceBypass = false
private

Definition at line 233 of file SignalEvent.h.

◆ m_UseAlternateUserStack

bool SignalEvent::m_UseAlternateUserStack
private

Whether this delivery should enter an available alternate signal stack.

Definition at line 222 of file SignalEvent.h.


The documentation for this class was generated from the following files: