[][src]Module sunrise_kernel::event

The core event handling primitives of Sunrise.

The Sunrise kernel supports a couple sources of events, such as IRQs, timers, userspace-triggered events, and other. It must be possible to await for one or multiple events at the same time.

In order to do this, we have the Event trait. It works by (in theory) registering an interest in an event, and putting the current process to sleep (deregistering it from the scheduler). When the event is triggered, the scheduler will wake the process up, allowing it work.

Structs

Event

The underlying shared object of a ReadableEvent/WritableEvent.

IRQEvent

An event waiting for an IRQ.

IRQState

Global state of an IRQ.

ReadableEvent

The readable part of an event. The user shall use this end to verify if the event is signaled, and wait for the signaling through wait_synchronization. The user can also use this handle to clear the signaled state through ReadableEvent::clear_signal().

WritableEvent

The writable part of an event. The user shall use this end to signal (and wake up threads waiting on the event).

Statics

IRQ_STATES

Global state for all the IRQ handled by the IOAPIC.

Traits

Waitable

A waitable item.

Functions

dispatch_event

Signal the scheduler and waiters that an IRQ has been triggered.

new_pair

Create a new pair of WritableEvent/ReadableEvent.

wait

Waits for an event to occur on one of the given Waitable objects.

wait_event

Creates an IRQEvent waiting for the given IRQ number.