Go to the documentation of this file.
18 #include <FreeNOS/User.h>
26 , m_directMapped(false)
35 , m_directMapped(false)
52 ERROR(
"failed to unmap remote buffer using VMCtl: result = " << (
int) r);
75 ERROR(
"failed to lookup remote buffer using VMCtl: result = " << (
int) lookResult);
86 ERROR(
"failed to map remote buffer using VMCtl: result = " << (
int) mapResult);
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
FileSystem::Result flushWrite()
Flush write buffers.
Result
Enumeration of generic kernel API result codes.
unsigned long ulong
Unsigned long number.
Memory::Range m_directMapRange
Contains the memory address range of the direct memory mapping.
Size getCount() const
Get byte count.
void addCount(const Size bytes)
Increment byte counter.
char * buffer
Points to a buffer for I/O.
const FileSystemMessage * getMessage() const
Get filesystem message.
#define PAGEMASK
Mask to find the page.
FileSystem::Result bufferedWrite(const void *buffer, const Size size)
Buffered write bytes to the I/O buffer.
C uint isKernel
Non-zero if this executable is linked as the kernel.
bool m_directMapped
True if using directly memory-mapped memory (unbuffered)
unsigned long Address
A memory address.
virtual ~IOBuffer()
Destructor.
API::Result VMCtl(const ProcessID procID, const MemoryOperation op, Memory::Range *range=ZERO)
Prototype for user applications.
IOBuffer()
Default empty constructor.
void setMessage(const FileSystemMessage *msg)
Set filesystem message.
const FileSystemMessage * m_message
Current request being processed.
u8 * m_buffer
Buffer for storing temporary data.
#define NULL
NULL means zero.
unsigned int Size
Any sane size indicator cannot go negative.
u8 * getBuffer()
Get raw buffer.
#define assert(exp)
Insert program diagnostics.
#define ERROR(msg)
Output an error message.
Result
Result code for filesystem Actions.
unsigned char u8
Unsigned 8-bit number.
Size m_count
Bytes written to the buffer.
ProcessID from
Source process of the message.
u8 operator[](Size index) const
Byte index operator.
FileSystem::Result bufferedRead()
Buffered read bytes from the I/O buffer.
FileSystem::Action action
Action to perform.
Address virt
Virtual address.
FileSystem::Result read(void *buffer, const Size size, const Size offset=ZERO)
Read bytes from the I/O buffer.
FileSystem::Result write(const void *buffer, const Size size, const Size offset=ZERO)
Write bytes to the I/O buffer.
API::Result VMCopy(const ProcessID proc, const API::Operation how, const Address ours, const Address theirs, const Size sz)
Prototype for user applications.
Size size
Size in number of bytes.
Access access
Page access flags.
Size size
Size of the buffer.