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

Public Types

typedef void(* MouseHandlerFunction) (void *, const void *, size_t)
 
- 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 Member Functions

 Ps2Mouse (Device *pDev)
 
virtual bool initialise (Ps2Controller *pController)
 
virtual void getName (String &str)
 
EXPORTED_PUBLIC void write (const char *bytes, size_t len)
 
EXPORTED_PUBLIC void subscribe (MouseHandlerFunction handler, void *param)
 
- Public Member Functions inherited from Device
 Device (Device *p)
 
DevicegetParent () const
 
void setParent (Device *p)
 
virtual Type getType ()
 
virtual 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 ()
 
virtual void dump (String &str)
 
virtual Vector< Address * > & addresses ()
 
virtual uintptr_t getInterruptNumber ()
 
virtual void setInterruptNumber (uintptr_t n)
 
void addChild (Device *pDevice)
 
DevicegetChild (size_t n)
 
size_t getNumChildren ()
 
void removeChild (size_t n)
 
void removeChild (Device *d)
 
void replaceChild (Device *src, Device *dest)
 

Private Types

enum  WaitType { Data, Signal }
 
enum  Ps2Ports { KbdStat = 0x64, KbdCommand = 0x60 }
 
enum  Ps2Commands {
  EnablePS2 = 0xA8, DisableKbd = 0xAD, EnableKbd = 0xAE, Mouse = 0xD4,
  MouseStream = 0xF4, MouseDisable = 0xF5, SetDefaults = 0xF6, MouseAck = 0xFA
}
 

Private Member Functions

void readerThread () NORETURN
 
void updateSubscribers (const void *buffer, size_t len)
 
 Ps2Mouse (const Ps2Mouse &)
 
void operator= (const Ps2Mouse &)
 

Static Private Member Functions

static int readerThreadTrampoline (void *) NORETURN
 

Private Attributes

Ps2Controllerm_pController
 
uint8_t m_Buffer [3]
 Mouse data buffer.
 
size_t m_BufferIndex
 Index into the data buffer.
 
Spinlock m_BufferLock
 Lock for the mouse data buffer.
 
Semaphore m_IrqWait
 IRQ wait semaphore.
 
MouseHandlerFunction m_Handlers [m_nHandlers]
 
void * m_HandlerParams [m_nHandlers]
 

Static Private Attributes

static const size_t m_nHandlers = 32
 

Additional Inherited Members

- Static Public Member Functions inherited from Device
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 Deviceroot ()
 
- Protected Attributes inherited from Device
Vector< Address * > m_Addresses
 
Vector< Device * > m_Children
 
Devicem_pParent
 
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 34 of file Ps2Mouse.h.

Member Function Documentation

virtual void Ps2Mouse::getName ( String str)
inlinevirtual

Stores the device's name in str.

Reimplemented from Device.

Definition at line 44 of file Ps2Mouse.h.

References EXPORTED_PUBLIC, and NORETURN.

bool Ps2Mouse::initialise ( Ps2Controller pController)
virtual

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