|
The Pedigree Project 0.1
|
#include <AtaController.h>
Inheritance diagram for AtaController:
Collaboration diagram for AtaController:Public Member Functions | |
| AtaController (Controller *pDev, int nController=0, bool startWorker=true) | |
| virtual void | shutdown ()=0 |
| virtual void | getName (String &str)=0 |
| virtual bool | compareRequests (const RequestQueue::Request &a, const RequestQueue::Request &b) |
| virtual IrqDisposition | irq (irq_id_t number) |
Public Member Functions inherited from ScsiController | |
| ScsiController (Controller *pDev, bool startWorker=true) | |
| bool | prepareDiskRemoval () |
| void | cancelDiskRemoval () |
| virtual bool | supportsConcurrentReads () const |
| virtual bool | sendCommand (size_t nUnit, uintptr_t pCommand, uint8_t nCommandSize, uintptr_t pRespBuffer, uint16_t nRespBytes, bool bWrite)=0 |
| virtual uint64_t | executeRequest (uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5, uint64_t p6, uint64_t p7, uint64_t p8) |
Public Member Functions inherited from Controller | |
| Controller (Device *pDev) | |
| virtual Type | getType () |
| virtual void | dump (String &str) |
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) |
Public Member Functions inherited from RequestQueue | |
| RequestQueue (const String &name) | |
| virtual void | initialise () |
| virtual void | destroy () |
| MUST_USE_RESULT uint64_t | addRequest (size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0) |
| MUST_USE_RESULT uint64_t | addRequest (size_t priority, ActionOnDuplicate action, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0) |
| uint64_t | addAsyncRequest (size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0) |
| MUST_USE_RESULT bool | publishAsyncRequest (size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0) |
| bool | canWaitForCompletion () |
| MUST_USE_RESULT bool | waitForPreallocated (PreallocatedRequest &request) |
| MUST_USE_RESULT PreallocatedPublishResult | publishPreallocated (PreallocatedRequest &request, size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0) |
| MUST_USE_RESULT PreallocatedPublishResult | republishPreallocatedWhileReleasing (PreallocatedRequest &request, size_t priority, uint64_t p1=0, uint64_t p2=0, uint64_t p3=0, uint64_t p4=0, uint64_t p5=0, uint64_t p6=0, uint64_t p7=0, uint64_t p8=0) |
| MUST_USE_RESULT bool | halt () |
| MUST_USE_RESULT bool | resume () |
| LifecycleState | getLifecycleState () |
| bool | drain () |
Public Member Functions inherited from IrqHandler | |
| virtual bool | acceptsSpuriousInterrupts () const |
Public Attributes | |
| IoBase * | m_pCommandRegs |
| IoBase * | m_pControlRegs |
Protected Member Functions | |
| bool | beginShutdown () |
| void | maskDiskInterrupts () |
| void | stopDiskDma () |
| virtual size_t | getNumUnits () |
Protected Member Functions inherited from ScsiController | |
| virtual void | cancelRequest (const Request &request) |
| void | shutdownDiskCaches (bool deviceAvailable=true) |
| void | searchDisks () |
Protected Member Functions inherited from Device | |
| NOT_COPYABLE_OR_ASSIGNABLE (Device) | |
Protected Member Functions inherited from RequestQueue | |
| virtual bool | workerPlacement (ThreadPlacement &) const |
| RequestQueue (const RequestQueue &) | |
| void | operator= (const RequestQueue &) |
| int | work () |
| NextRequestResult | getNextRequest (Request *&request) |
| bool | drainIntakeLocked (size_t priority) |
| void | publishRequest (Request *request) |
| Request * | findDuplicate (const Request &request) |
| void | discardRequest (Request *request) |
| uint64_t | addAsyncRequestInternal (size_t priority, uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5, uint64_t p6, uint64_t p7, uint64_t p8) |
| PreallocatedPublishResult | publishPreallocatedRequest (PreallocatedRequest &request, PreallocatedRequest::State availableState, size_t priority, uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5, uint64_t p6, uint64_t p7, uint64_t p8) |
| void | releasePreallocatedRequest (Request *request) |
| void | invokeCancelRequest (const Request &request) |
| bool | callbackActiveOnCurrentThread () const |
| void | releaseRequest (Request *request) |
| uint64_t | waitForRequest (Request *request) |
| bool | startWorker () |
| bool | stopWorker () |
| void | closePreallocatedAdmission () |
| void | waitForPreallocatedPublishers () |
Protected Member Functions inherited from IrqHandler | |
| virtual | ~IrqHandler () |
Protected Member Functions inherited from IrqHandlerBase | |
| virtual | ~IrqHandlerBase () |
Static Protected Member Functions | |
| static bool | canCoalesceCanonicalRequests (uint64_t aType, uint64_t aDisk, uint64_t aLocation, uint64_t bType, uint64_t bDisk, uint64_t bLocation) |
Static Protected Member Functions inherited from Device | |
| static Device & | root () |
Static Protected Member Functions inherited from RequestQueue | |
| static int | trampoline (void *p) |
| static void | completeRequest (Request *request, uint64_t returnValue, bool rejected) |
| static void | retainRequest (Request *request) |
Private Member Functions | |
| AtaController (const AtaController &) | |
| void | operator= (const AtaController &) |
Private Attributes | |
| bool | m_bShutdown = false |
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 *) |
Public Types inherited from RequestQueue | |
| enum class | OverrunStatus { Clear , Armed , Stalled , Overloaded } |
| enum class | PreallocatedPublishResult { Accepted , TokenBusy , QueueStopped , QueueFull , InvalidPriority } |
| enum | ActionOnDuplicate { Block , NewRequest , ReturnImmediately } |
| enum class | LifecycleState { Stopped , Accepting , Stopping , Destroyed } |
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 Types inherited from RequestQueue | |
| enum class | NextRequestResult { Item , Empty , Retry } |
Static Protected Attributes inherited from Device | |
| static Device | m_Root |
| static Mutex | m_TreeLock |
Static Protected Attributes inherited from RequestQueue | |
| static constexpr size_t | PublicationClosed = static_cast<size_t>(1) << ((sizeof(size_t) * 8) - 1) |
| static constexpr size_t | PublicationCountMask = ~PublicationClosed |
Base class for an ATA controller.
Definition at line 37 of file AtaController.h.
|
inline |
Definition at line 39 of file AtaController.h.
|
inlinevirtual |
Definition at line 46 of file AtaController.h.
|
inlineprotected |
Definition at line 77 of file AtaController.h.
|
inlinestaticprotected |
ScsiDisk publishes canonical p3 keys. Reads are immutable fill work, while active writes consume a mutable cache page and must stay distinct.
Definition at line 71 of file AtaController.h.
Referenced by compareRequests().
Here is the caller graph for this function:
|
virtual |
Defaults to never comparing as equal. Used to determine duplicates among allocation-backed synchronous and asynchronous requests. Preallocated tokens use identity instead and are never passed here. This runs under the queue's non-sleeping guard and therefore must not block.
Reimplemented from RequestQueue.
Definition at line 36 of file AtaController.cc.
References canCoalesceCanonicalRequests().
|
pure virtual |
Stores the device's name in str.
Reimplemented from Controller.
Implemented in IsaAtaController, and PciAtaController.
|
inlineprotectedvirtual |
Implements ScsiController.
Definition at line 93 of file AtaController.h.
|
inlinevirtual |
Handles a pending IRQ in thread context.
Implements IrqHandler.
Reimplemented in IsaAtaController, and PciAtaController.
Definition at line 56 of file AtaController.h.
|
protected |
Masks fresh device IRQ generation on every child channel.
Definition at line 24 of file AtaController.cc.
References Device::getChild(), and Device::getNumChildren().
Referenced by IsaAtaController::shutdown(), and PciAtaController::shutdown().
Here is the caller graph for this function:
|
pure virtual |
Retires disk work and every hardware callback before device transfer.
Implemented in IsaAtaController, and PciAtaController.
|
protected |
Stops and acknowledges bus-master state after IRQ callbacks drain.
Definition at line 30 of file AtaController.cc.
References Device::getChild(), and Device::getNumChildren().
Referenced by IsaAtaController::shutdown(), and PciAtaController::shutdown().
Here is the caller graph for this function:
|
private |
Definition at line 98 of file AtaController.h.
|
protected |
Definition at line 85 of file AtaController.h.
| IoBase* AtaController::m_pCommandRegs |
Definition at line 61 of file AtaController.h.
| IoBase* AtaController::m_pControlRegs |
Definition at line 62 of file AtaController.h.