21 #include "pedigree/kernel/processor/types.h" 22 #include "pedigree/kernel/utilities/Buffer.h" 23 #include "pedigree/kernel/utilities/String.h" 27 ConsoleMasterFile::ConsoleMasterFile(
29 :
ConsoleFile(consoleNumber, consoleName, pFs), bLocked(false), pLocker(0)
34 uint64_t location, uint64_t size, uintptr_t buffer,
bool bCanBlock)
37 size_t slaveFlags =
m_pOther->m_Flags;
38 if (!(slaveFlags & ConsoleManager::OMapNLToCRNL))
43 m_Buffer.
read(reinterpret_cast<char *>(buffer), size, bCanBlock);
50 reinterpret_cast<char *>(buffer), nBytes, size,
m_pOther->m_Flags);
53 uint64_t totalBytes = 0;
54 while (totalBytes < size)
68 uint64_t nBytes = m_Buffer.
read(
69 reinterpret_cast<char *>(buffer + totalBytes), size / 2, bCanBlock);
78 reinterpret_cast<char *>(buffer + totalBytes), nBytes, size,
80 totalBytes += disciplineSize;
81 size -= disciplineSize;
92 uint64_t location, uint64_t size, uintptr_t buffer,
bool bCanBlock)
static size_t outputLineDiscipline(char *buf, size_t len, size_t maxSz, size_t flags=0)
Output line discipline.
bool canWrite(bool block)
size_t read(T *buffer, size_t count, bool block=true)
ConsoleFile * m_pOther
Other side of the console.
void inputLineDiscipline(char *buf, size_t len, size_t flags=~0U, const char *controlChars=0)
Input line discipline.
virtual uint64_t writeBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)
virtual uint64_t readBytewise(uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true)