The Pedigree Project 0.1
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
VirtioInputDevice Class Referencefinal
+ Inheritance diagram for VirtioInputDevice:
+ Collaboration diagram for VirtioInputDevice:

Classes

struct  Event
 
struct  Slot
 

Public Member Functions

 VirtioInputDevice (Device *pci)
 
bool initialise ()
 
IrqDisposition irq (irq_id_t number) override
 
- Public Member Functions inherited from Device
 Device (Device *p)
 
Device * getParent () const
 
void setParent (Device *p)
 
virtual void getName (String &str)
 
virtual Type getType ()
 
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 void dump (String &str)
 
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 IrqHandler
virtual bool acceptsSpuriousInterrupts () const
 

Private Types

enum  DeviceType { Keyboard , Mouse , Tablet }
 

Private Member Functions

bool supportsEvent (uint8_t type, uint16_t code, bool &supported)
 
bool readAxis (uint8_t axis, int32_t &minimum, int32_t &maximum)
 
bool postReceive (Slot &slot)
 
void handle (const Event &event)
 
void reportPointer ()
 
uint32_t scaleAxis (int32_t value, unsigned axis) const
 
 VirtioInputDevice (const VirtioInputDevice &)=delete
 
VirtioInputDevice & operator= (const VirtioInputDevice &)=delete
 

Private Attributes

Device * m_Pci
 
Virtio::PciTransport m_Transport
 
Virtio::Queue m_EventQueue
 
Virtio::Queue m_StatusQueue
 
MemoryRegion m_Events
 
Mutex m_Lock
 
Slot m_Slots [MaxSlots]
 
size_t m_SlotCount
 
irq_id_t m_Irq
 
DeviceType m_Type
 
int32_t m_AbsMinimum [2]
 
int32_t m_AbsMaximum [2]
 
uint32_t m_AbsPosition [2]
 
ssize_t m_Relative [3]
 
uint32_t m_Buttons
 
bool m_KeyDown [256]
 
bool m_PointerChanged
 
bool m_Active
 
bool m_Stopping
 

Static Private Attributes

static constexpr size_t MaxSlots = 64
 
static constexpr uint32_t AbsoluteMaximum = 0x7fff
 

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)
 
- Protected Member Functions inherited from IrqHandler
virtual ~IrqHandler ()
 
- Protected Member Functions inherited from IrqHandlerBase
virtual ~IrqHandlerBase ()
 
- 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
 

Detailed Description

Definition at line 13 of file VirtioInput.h.

Member Enumeration Documentation

◆ DeviceType

enum VirtioInputDevice::DeviceType
private

Definition at line 25 of file VirtioInput.h.

Constructor & Destructor Documentation

◆ VirtioInputDevice()

VirtioInputDevice::VirtioInputDevice ( Device *  pci)
explicit

Definition at line 160 of file VirtioInput.cc.

◆ ~VirtioInputDevice()

VirtioInputDevice::~VirtioInputDevice ( )
override

Definition at line 183 of file VirtioInput.cc.

Member Function Documentation

◆ handle()

void VirtioInputDevice::handle ( const Event &  event)
private

Definition at line 351 of file VirtioInput.cc.

◆ initialise()

bool VirtioInputDevice::initialise ( )

Definition at line 256 of file VirtioInput.cc.

◆ irq()

IrqDisposition VirtioInputDevice::irq ( irq_id_t  number)
overridevirtual

Handles a pending IRQ in thread context.

Implements IrqHandler.

Definition at line 399 of file VirtioInput.cc.

References Quiesced.

◆ postReceive()

bool VirtioInputDevice::postReceive ( Slot &  slot)
private

Definition at line 251 of file VirtioInput.cc.

◆ readAxis()

bool VirtioInputDevice::readAxis ( uint8_t  axis,
int32_t &  minimum,
int32_t &  maximum 
)
private

Definition at line 233 of file VirtioInput.cc.

◆ reportPointer()

void VirtioInputDevice::reportPointer ( )
private

Definition at line 337 of file VirtioInput.cc.

◆ scaleAxis()

uint32_t VirtioInputDevice::scaleAxis ( int32_t  value,
unsigned  axis 
) const
private

Definition at line 325 of file VirtioInput.cc.

◆ supportsEvent()

bool VirtioInputDevice::supportsEvent ( uint8_t  type,
uint16_t  code,
bool &  supported 
)
private

Definition at line 213 of file VirtioInput.cc.

Member Data Documentation

◆ AbsoluteMaximum

constexpr uint32_t VirtioInputDevice::AbsoluteMaximum = 0x7fff
staticconstexprprivate

Definition at line 23 of file VirtioInput.h.

◆ m_AbsMaximum

int32_t VirtioInputDevice::m_AbsMaximum[2]
private

Definition at line 57 of file VirtioInput.h.

◆ m_AbsMinimum

int32_t VirtioInputDevice::m_AbsMinimum[2]
private

Definition at line 56 of file VirtioInput.h.

◆ m_AbsPosition

uint32_t VirtioInputDevice::m_AbsPosition[2]
private

Definition at line 58 of file VirtioInput.h.

◆ m_Active

bool VirtioInputDevice::m_Active
private

Definition at line 63 of file VirtioInput.h.

◆ m_Buttons

uint32_t VirtioInputDevice::m_Buttons
private

Definition at line 60 of file VirtioInput.h.

◆ m_EventQueue

Virtio::Queue VirtioInputDevice::m_EventQueue
private

Definition at line 48 of file VirtioInput.h.

◆ m_Events

MemoryRegion VirtioInputDevice::m_Events
private

Definition at line 50 of file VirtioInput.h.

◆ m_Irq

irq_id_t VirtioInputDevice::m_Irq
private

Definition at line 54 of file VirtioInput.h.

◆ m_KeyDown

bool VirtioInputDevice::m_KeyDown[256]
private

Definition at line 61 of file VirtioInput.h.

◆ m_Lock

Mutex VirtioInputDevice::m_Lock
private

Definition at line 51 of file VirtioInput.h.

◆ m_Pci

Device* VirtioInputDevice::m_Pci
private

Definition at line 46 of file VirtioInput.h.

◆ m_PointerChanged

bool VirtioInputDevice::m_PointerChanged
private

Definition at line 62 of file VirtioInput.h.

◆ m_Relative

ssize_t VirtioInputDevice::m_Relative[3]
private

Definition at line 59 of file VirtioInput.h.

◆ m_SlotCount

size_t VirtioInputDevice::m_SlotCount
private

Definition at line 53 of file VirtioInput.h.

◆ m_Slots

Slot VirtioInputDevice::m_Slots[MaxSlots]
private

Definition at line 52 of file VirtioInput.h.

◆ m_StatusQueue

Virtio::Queue VirtioInputDevice::m_StatusQueue
private

Definition at line 49 of file VirtioInput.h.

◆ m_Stopping

bool VirtioInputDevice::m_Stopping
private

Definition at line 64 of file VirtioInput.h.

◆ m_Transport

Virtio::PciTransport VirtioInputDevice::m_Transport
private

Definition at line 47 of file VirtioInput.h.

◆ m_Type

DeviceType VirtioInputDevice::m_Type
private

Definition at line 55 of file VirtioInput.h.

◆ MaxSlots

constexpr size_t VirtioInputDevice::MaxSlots = 64
staticconstexprprivate

Definition at line 22 of file VirtioInput.h.


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