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