|
The Pedigree Project 0.1
|
#include <EhciHandoff.h>
Collaboration diagram for EhciHandoff::State:Public Member Functions | |
| template<typename Config > | |
| AcquireResult | acquire (uint16_t offset, Config &config, size_t pollLimit=DefaultPollLimit) |
| template<typename Config > | |
| ReleaseResult | withdrawRequest (Config &config, size_t pollLimit=DefaultPollLimit) |
| template<typename Config > | |
| ReleaseResult | release (Config &config, bool callerQuiescedOrNeverTouched, size_t pollLimit=DefaultPollLimit) |
| uint16_t | offset () const |
| uint32_t | savedSmiEnables () const |
| bool | wasBiosOwned () const |
| bool | requested () const |
| bool | acquired () const |
| bool | disabled () const |
Static Public Attributes | |
| static constexpr uint32_t | BiosOwned = 1U << 16 |
| static constexpr uint32_t | OsOwned = 1U << 24 |
| static constexpr uint8_t | LegacyCapabilityId = 1 |
| static constexpr size_t | DefaultPollLimit = 1000 |
Private Member Functions | |
| void | reset () |
| template<typename Config > | |
| bool | restoreSmis (Config &config) |
| template<typename Config > | |
| ReleaseResult | releaseInternal (Config &config, bool allowUnacquired, size_t pollLimit) |
Static Private Member Functions | |
| static bool | validOffset (uint16_t offset) |
| static uint16_t | controlOffset (uint16_t offset) |
Private Attributes | |
| uint16_t | m_Offset |
| uint32_t | m_SavedSmiEnables |
| bool | m_WasBiosOwned |
| bool | m_RequestWritten |
| bool | m_Acquired |
| bool | m_Disabled |
| bool | m_SmiMutationAttempted |
| bool | m_SnapshotValid |
Static Private Attributes | |
| static constexpr uint16_t | ControlOffset = 4 |
Tracks one EHCI legacy ownership exchange.
Config must provide:
bool read32(uint16_t offset, uint32_t& value); bool write32(uint16_t offset, uint32_t value); bool write8(uint16_t offset, uint8_t value); void delay();
The caller owns all controller quiescence ordering. In particular, release may only be called after schedules, callbacks, DMA, and the PCI interrupt source have been detached. The helper never touches controller schedules.
Definition at line 47 of file EhciHandoff.h.
|
inline |
Definition at line 54 of file EhciHandoff.h.
|
inline |
Request OS ownership, or use the existing BIOS-unowned shortcut.
The semaphore request is a byte write at offset +3. A dword read-modify-write is deliberately not used: the other USBLEGSUP fields are semaphores, capability metadata, or reserved bits.
Definition at line 72 of file EhciHandoff.h.
|
inline |
Definition at line 181 of file EhciHandoff.h.
|
inlinestaticprivate |
Definition at line 196 of file EhciHandoff.h.
|
inline |
Definition at line 185 of file EhciHandoff.h.
|
inline |
Definition at line 165 of file EhciHandoff.h.
|
inline |
Return ownership after the caller has quiesced all controller activity.
If the controller started BIOS-unowned, this is a no-op: it never writes either ownership semaphore or re-enables firmware SMIs for a controller that never granted the OS an ownership lease.
Definition at line 158 of file EhciHandoff.h.
|
inlineprivate |
Definition at line 224 of file EhciHandoff.h.
|
inline |
Definition at line 177 of file EhciHandoff.h.
|
inlineprivate |
Definition at line 200 of file EhciHandoff.h.
|
inlineprivate |
Definition at line 212 of file EhciHandoff.h.
|
inline |
Definition at line 169 of file EhciHandoff.h.
|
inlinestaticprivate |
Definition at line 192 of file EhciHandoff.h.
|
inline |
Definition at line 173 of file EhciHandoff.h.
|
inline |
Withdraw an ownership request which did not reach acquired state.
This path is intentionally separate from release: no controller schedule or callback has been published yet. It restores the saved SMI enables, clears only the OS-owned byte when a request was written, and does not invent a BIOS-owned semaphore. A successful return means that the OS semaphore was cleared; firmware confirmation is reported separately.
Definition at line 143 of file EhciHandoff.h.
|
staticconstexpr |
Definition at line 49 of file EhciHandoff.h.
|
staticconstexprprivate |
Definition at line 190 of file EhciHandoff.h.
|
staticconstexpr |
Definition at line 52 of file EhciHandoff.h.
|
staticconstexpr |
Definition at line 51 of file EhciHandoff.h.
|
private |
Definition at line 284 of file EhciHandoff.h.
|
private |
Definition at line 285 of file EhciHandoff.h.
|
private |
Definition at line 280 of file EhciHandoff.h.
|
private |
Definition at line 283 of file EhciHandoff.h.
|
private |
Definition at line 281 of file EhciHandoff.h.
|
private |
Definition at line 286 of file EhciHandoff.h.
|
private |
Definition at line 287 of file EhciHandoff.h.
|
private |
Definition at line 282 of file EhciHandoff.h.
|
staticconstexpr |
Definition at line 50 of file EhciHandoff.h.