|
The Pedigree Project 0.1
|
Inheritance diagram for Ps2Controller:
Collaboration diagram for Ps2Controller:Public Member Functions | |
| Ps2Controller (Controller *pDev) | |
| virtual void | getName (String &str) |
| virtual void | dump (String &str) |
| void | initialise () |
| bool | initialise3 () |
| void | uninitialise () |
| void | sendCommand (uint8_t command) |
| Send a command with no response or data. A timed-out command is dropped. | |
| void | sendCommand (uint8_t command, uint8_t data) |
| uint8_t | sendCommandWithResponse (uint8_t command) |
| Send a command and report its response, or zero if the operation fails. | |
| uint8_t | sendCommandWithResponse (uint8_t command, uint8_t data) |
| void | writeFirstPort (uint8_t byte) |
| Send a byte to the first port, dropping it if the controller times out. | |
| EXPORTED_PUBLIC void | writeSecondPort (uint8_t byte) |
| Send a byte to the second port, dropping it on timeout. | |
| EXPORTED_PUBLIC bool | hasSecondPort () const |
| Reports whether this PS/2 controller has two ports. | |
| EXPORTED_PUBLIC void | setIrqEnable (bool firstEnabled, bool secondEnabled) |
| Enables/disables IRQs for the first or second ports. | |
| uint8_t | readByte () |
| Reads a single byte from the PS/2 controller by polling. | |
| uint8_t | readByteNonBlock () |
| bool | readFirstPort (uint8_t &byte, bool block=true) |
| Reads a single byte from the first port. | |
| EXPORTED_PUBLIC bool | readSecondPort (uint8_t &byte, bool block=true) |
| Reads a single byte from the second port. | |
| EXPORTED_PUBLIC bool | readsStopping () const |
| Reports that buffered readers must leave their long-lived loops. | |
| void | setDebugState (bool debugState) |
| Selects trap-safe polling without changing controller IRQ state. | |
| bool | getDebugState () const |
| Gets the debug state. | |
Public Member Functions inherited from Controller | |
| Controller (Device *pDev) | |
| virtual Type | getType () |
Public Member Functions inherited from Device | |
| Device (Device *p) | |
| Device * | getParent () const |
| void | setParent (Device *p) |
| virtual const String & | getSpecificType () |
| virtual void | setSpecificType (String str) |
| void | setPciPosition (uint32_t bus, uint32_t device, uint32_t func) |
| void | setPciIdentifiers (uint8_t classCode, uint8_t subclassCode, uint16_t vendorId, uint16_t deviceId, uint8_t progIf) |
| void | setPciConfigHeader (const PciBus::ConfigSpace &space) |
| PciBus::ConfigSpace | getPciConfigHeader () const |
| uint8_t | getPciClassCode () |
| uint8_t | getPciSubclassCode () |
| uint16_t | getPciVendorId () |
| uint16_t | getPciDeviceId () |
| uint8_t | getPciProgInterface () |
| uint32_t | getPciBusPosition () |
| uint32_t | getPciDevicePosition () |
| uint32_t | getPciFunctionNumber () |
| Device * | getPhysicalFunction () const |
| size_t | getVirtualFunctionIndex () const |
| void | setVirtualFunction (Device *physicalFunction, size_t index) |
| virtual Vector< Address * > & | addresses () |
| virtual uintptr_t | getInterruptNumber () |
| virtual void | setInterruptNumber (uintptr_t n) |
| void | addChild (Device *pDevice) |
| Device * | getChild (size_t n) |
| size_t | getNumChildren () |
| void | removeChild (size_t n) |
| void | removeChild (Device *d) |
| void | replaceChild (Device *src, Device *dest) |
Private Member Functions | |
| IrqDisposition | irq (irq_id_t number) override |
| bool | acquireIoForThread () |
| void | releaseIo () |
| bool | sendCommandLocked (uint8_t command) |
| bool | sendCommandLocked (uint8_t command, uint8_t data) |
| bool | sendCommandWithResponseLocked (uint8_t command, uint8_t &response) |
| bool | sendCommandWithResponseLocked (uint8_t command, uint8_t data, uint8_t &response) |
| bool | writeFirstPortLocked (uint8_t byte) |
| bool | configureIrqEnable (bool firstEnabled, bool secondEnabled) |
| bool | waitForReadingLocked () |
| bool | waitForWritingLocked () |
Private Member Functions inherited from IrqHandler | |
| virtual bool | acceptsSpuriousInterrupts () const |
| virtual | ~IrqHandler () |
Private Member Functions inherited from IrqHandlerBase | |
| virtual | ~IrqHandlerBase () |
Private Attributes | |
| IoBase * | m_pBase |
| bool | m_bHasSecondPort |
| Buffer< uint8_t > | m_FirstPortBuffer |
| Buffer< uint8_t > | m_SecondPortBuffer |
| irq_id_t | m_FirstIrqId |
| irq_id_t | m_SecondIrqId |
| Ps2DebuggerPollingState | m_DebugState |
| uint8_t | m_ConfigByte |
| Ps2IoAdmissionGate | m_IoGate |
| Mutex | m_DrainLock |
| Atomic< size_t > | m_ReadMode |
| Atomic< size_t > | m_RejectedThreadIo |
| Atomic< size_t > | m_FirstPortDrops |
| Atomic< size_t > | m_SecondPortDrops |
| Atomic< size_t > | m_EmptyIrqs |
Static Private Attributes | |
| static constexpr size_t | PollingReadMode = 0 |
| static constexpr size_t | BufferedReadMode = 1 |
| static constexpr size_t | StoppingReadMode = 2 |
| static constexpr uint8_t | OutputBufferFull = 1 |
| static constexpr uint8_t | InputBufferFull = 1 << 1 |
| static constexpr uint8_t | SecondPortData = 1 << 5 |
Additional Inherited Members | |
Public Types inherited from Device | |
| enum | Type { Generic , Root , Disk , Bus , Display , Network , Sound , Console , Mouse , Controller , UsbController , UsbGeneric , UsbContainer } |
| typedef Device *(* | Callback) (Device *) |
Static Public Member Functions inherited from Device | |
| static bool | treeLockHeldByCurrentThread () |
| static void | foreach (Callback callback, Device *root=0) |
| template<class F , class... Args> | |
| static void | foreach (pedigree_std::Callable< F > &callback, Device *root, Args... args) |
| static void | addToRoot (Device *device) |
| static void | searchByVendorId (uint16_t vendorId, void(*callback)(Device *), Device *root=0) |
| static void | searchByVendorIdAndDeviceId (uint16_t vendorId, uint16_t deviceId, void(*callback)(Device *), Device *root=0) |
| static void | searchByClass (uint16_t classCode, void(*callback)(Device *), Device *root=0) |
| static void | searchByClassAndSubclass (uint16_t classCode, uint16_t subclassCode, void(*callback)(Device *), Device *root=0) |
| static void | searchByClassSubclassAndProgInterface (uint16_t classCode, uint16_t subclassCode, uint8_t progInterface, void(*callback)(Device *), Device *root=0) |
Protected Member Functions inherited from Device | |
| NOT_COPYABLE_OR_ASSIGNABLE (Device) | |
Static Protected Member Functions inherited from Device | |
| static Device & | root () |
Protected Attributes inherited from Device | |
| Vector< Address * > | m_Addresses |
| Vector< Device * > | m_Children |
| Device * | m_pParent |
| Device * | m_PhysicalFunction |
| size_t | m_VirtualFunctionIndex |
| uintptr_t | m_InterruptNumber |
| String | m_SpecificType |
| PciBus::ConfigSpace | m_ConfigHeader |
| uint8_t | m_ClassCode |
| uint8_t | m_SubclassCode |
| uint16_t | m_VendorId |
| uint16_t | m_DeviceId |
| uint8_t | m_ProgInterface |
| uint32_t | m_PciBusPos |
| uint32_t | m_PciDevicePos |
| uint32_t | m_PciFunctionNum |
Static Protected Attributes inherited from Device | |
| static Device | m_Root |
| static Mutex | m_TreeLock |
Definition at line 37 of file Ps2Controller.h.
| Ps2Controller::Ps2Controller | ( | Controller * | pDev | ) |
Definition at line 38 of file Ps2Controller.cc.
| Ps2Controller::Ps2Controller | ( | ) |
Definition at line 57 of file Ps2Controller.cc.
|
virtual |
Definition at line 76 of file Ps2Controller.cc.
|
private |
Definition at line 197 of file Ps2Controller.cc.
|
private |
Definition at line 331 of file Ps2Controller.cc.
|
inlinevirtual |
Dumps a textual representation of the device into the given string.
Reimplemented from Controller.
Definition at line 48 of file Ps2Controller.h.
|
inline |
Gets the debug state.
Definition at line 94 of file Ps2Controller.h.
Referenced by X86Keyboard::getChar(), and X86Keyboard::getCharNonBlock().
Here is the caller graph for this function:
|
inlinevirtual |
Stores the device's name in str.
Reimplemented from Controller.
Definition at line 44 of file Ps2Controller.h.
| bool Ps2Controller::hasSecondPort | ( | ) | const |
Reports whether this PS/2 controller has two ports.
Definition at line 319 of file Ps2Controller.cc.
| void Ps2Controller::initialise | ( | ) |
Definition at line 82 of file Ps2Controller.cc.
| bool Ps2Controller::initialise3 | ( | ) |
Registers threaded IRQ delivery after scheduler initialisation.
Definition at line 138 of file Ps2Controller.cc.
References Buffer< T, allowShortOperation >::enableWrites(), IrqManager::registerIsaIrqHandler(), uninitialise(), and Buffer< T, allowShortOperation >::wipe().
Referenced by Pc::initialise3().
Here is the caller graph for this function:
|
overrideprivatevirtual |
Handles a pending IRQ in thread context.
Implements IrqHandler.
Definition at line 447 of file Ps2Controller.cc.
References Scheduler::instance(), Quiesced, IoBase::read8(), Buffer< T, allowShortOperation >::writeAvailable(), and Scheduler::yield().
| uint8_t Ps2Controller::readByte | ( | ) |
Reads a single byte from the PS/2 controller by polling.
Definition at line 373 of file Ps2Controller.cc.
References IoBase::read8().
Referenced by X86Keyboard::getChar(), readFirstPort(), and readSecondPort().
Here is the caller graph for this function:| uint8_t Ps2Controller::readByteNonBlock | ( | ) |
Definition at line 392 of file Ps2Controller.cc.
| bool Ps2Controller::readFirstPort | ( | uint8_t & | byte, |
| bool | block = true |
||
| ) |
Reads a single byte from the first port.
Definition at line 405 of file Ps2Controller.cc.
References Buffer< T, allowShortOperation >::read(), and readByte().
Referenced by X86Keyboard::initialise().
Here is the caller graph for this function:| bool Ps2Controller::readSecondPort | ( | uint8_t & | byte, |
| bool | block = true |
||
| ) |
Reads a single byte from the second port.
Definition at line 424 of file Ps2Controller.cc.
References Buffer< T, allowShortOperation >::read(), and readByte().
|
inline |
Reports that buffered readers must leave their long-lived loops.
Definition at line 86 of file Ps2Controller.h.
|
private |
Definition at line 227 of file Ps2Controller.cc.
| void Ps2Controller::sendCommand | ( | uint8_t | command | ) |
Send a command with no response or data. A timed-out command is dropped.
Definition at line 267 of file Ps2Controller.cc.
| void Ps2Controller::sendCommand | ( | uint8_t | command, |
| uint8_t | data | ||
| ) |
Definition at line 275 of file Ps2Controller.cc.
|
private |
Definition at line 231 of file Ps2Controller.cc.
|
private |
Definition at line 238 of file Ps2Controller.cc.
| uint8_t Ps2Controller::sendCommandWithResponse | ( | uint8_t | command | ) |
Send a command and report its response, or zero if the operation fails.
Definition at line 283 of file Ps2Controller.cc.
| uint8_t Ps2Controller::sendCommandWithResponse | ( | uint8_t | command, |
| uint8_t | data | ||
| ) |
Definition at line 293 of file Ps2Controller.cc.
|
private |
Definition at line 245 of file Ps2Controller.cc.
|
private |
Definition at line 252 of file Ps2Controller.cc.
| void Ps2Controller::setDebugState | ( | bool | debugState | ) |
Selects trap-safe polling without changing controller IRQ state.
Definition at line 443 of file Ps2Controller.cc.
Referenced by X86Keyboard::setDebugState().
Here is the caller graph for this function:| void Ps2Controller::setIrqEnable | ( | bool | firstEnabled, |
| bool | secondEnabled | ||
| ) |
Enables/disables IRQs for the first or second ports.
Definition at line 323 of file Ps2Controller.cc.
| void Ps2Controller::uninitialise | ( | ) |
Quiesces both ports and drains their IRQ callbacks.
Definition at line 166 of file Ps2Controller.cc.
References Buffer< T, allowShortOperation >::disableWrites(), and IrqManager::unregisterHandler().
Referenced by Pc::deinitialise(), and initialise3().
Here is the caller graph for this function:
|
private |
Definition at line 493 of file Ps2Controller.cc.
|
private |
Definition at line 506 of file Ps2Controller.cc.
| void Ps2Controller::writeFirstPort | ( | uint8_t | byte | ) |
Send a byte to the first port, dropping it if the controller times out.
Definition at line 303 of file Ps2Controller.cc.
Referenced by X86Keyboard::initialise().
Here is the caller graph for this function:
|
private |
Definition at line 260 of file Ps2Controller.cc.
| void Ps2Controller::writeSecondPort | ( | uint8_t | byte | ) |
Send a byte to the second port, dropping it on timeout.
Definition at line 311 of file Ps2Controller.cc.
|
staticconstexprprivate |
Definition at line 100 of file Ps2Controller.h.
|
staticconstexprprivate |
Definition at line 103 of file Ps2Controller.h.
|
private |
Definition at line 122 of file Ps2Controller.h.
|
private |
Definition at line 132 of file Ps2Controller.h.
|
private |
Definition at line 130 of file Ps2Controller.h.
|
private |
Definition at line 135 of file Ps2Controller.h.
|
private |
Definition at line 140 of file Ps2Controller.h.
|
private |
Definition at line 127 of file Ps2Controller.h.
|
private |
Definition at line 124 of file Ps2Controller.h.
|
private |
Definition at line 138 of file Ps2Controller.h.
|
private |
Definition at line 134 of file Ps2Controller.h.
|
private |
Definition at line 121 of file Ps2Controller.h.
|
private |
Definition at line 136 of file Ps2Controller.h.
|
private |
Definition at line 137 of file Ps2Controller.h.
|
private |
Definition at line 128 of file Ps2Controller.h.
|
private |
Definition at line 125 of file Ps2Controller.h.
|
private |
Definition at line 139 of file Ps2Controller.h.
|
staticconstexprprivate |
Definition at line 102 of file Ps2Controller.h.
|
staticconstexprprivate |
Definition at line 99 of file Ps2Controller.h.
|
staticconstexprprivate |
Definition at line 104 of file Ps2Controller.h.
|
staticconstexprprivate |
Definition at line 101 of file Ps2Controller.h.