20 #include "modules/subsys/posix/PsAuxFile.h" 21 #include "modules/drivers/x86/ps2mouse/Ps2Mouse.h" 23 bool PsAuxFile::initialise()
32 g_Ps2Mouse->subscribe(subscriber,
this);
37 uint64_t location, uint64_t size, uintptr_t buffer,
bool bCanBlock)
39 return m_Buffer.
read(reinterpret_cast<uint8_t *>(buffer), size, bCanBlock);
43 uint64_t location, uint64_t size, uintptr_t buffer,
bool bCanBlock)
45 g_Ps2Mouse->write(reinterpret_cast<const char *>(buffer), size);
53 return m_Buffer.
canWrite(timeout == 1) ? 1 : 0;
57 return m_Buffer.
canRead(timeout == 1) ? 1 : 0;
61 void PsAuxFile::subscriber(
void *param,
const void *buffer,
size_t len)
63 reinterpret_cast<PsAuxFile *
>(param)->handleIncoming(buffer, len);
66 void PsAuxFile::handleIncoming(
const void *buffer,
size_t len)
68 if (m_Buffer.
write(reinterpret_cast<const uint8_t *>(buffer), len,
false))
uint64_t writeBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)
bool canWrite(bool block)
size_t read(T *buffer, size_t count, bool block=true)
virtual int select(bool bWriting=false, int timeout=0)
uint64_t readBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)
size_t write(const T *buffer, size_t count, bool block=true)