Go to the documentation of this file.
25 , m_maximumMessages((
PAGESIZE / messageSize) - 1U)
61 return reset(hardReset);
85 ERROR(
"failed to map data physical address " << (
void*)data <<
": " << (
int)result);
92 ERROR(
"failed to map feedback physical address " << (
void*)feedback <<
": " << (
int)result);
96 return reset(hardReset);
182 ERROR(
"failed to clean data cache at " << (
void *) page <<
183 ": result = " << (
int) result);
Unidirectional point-to-point messaging channel.
Result unmap()
Unmap I/O address space.
const Size m_maximumMessages
Maximum number of messages that can be stored.
Size index
Index where the ring buffer starts.
Result
Enumeration of generic kernel API result codes.
Result setVirtual(const Address data, const Address feedback, const bool hardReset=true)
Set memory pages by virtual address.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
Result setPhysical(const Address data, const Address feedback, const bool hardReset=true)
Set memory pages by physical address.
Result map(Address phys, Size size=4096, Memory::Access access=Memory::Readable|Memory::Writable|Memory::User)
Map I/O address space.
void write(u32 reg, u32 data)
write to memory mapped I/O register
#define PAGESIZE
ARM uses 4K pages.
MemoryChannel(const Mode mode, const Size messageSize)
Constructor.
const Size m_messageSize
Message size.
C uint isKernel
Non-zero if this executable is linked as the kernel.
const Mode m_mode
Channel mode.
unsigned long Address
A memory address.
API::Result VMCtl(const ProcessID procID, const MemoryOperation op, Memory::Range *range=ZERO)
Prototype for user applications.
Arch::IO m_data
The data page.
Defines in-memory ring header.
void setBase(const Address base)
Set memory I/O base offset.
virtual ~MemoryChannel()
Destructor.
ARMv6 cache management implementation.
unsigned int Size
Any sane size indicator cannot go negative.
virtual Result write(const void *buffer)
Write a message.
virtual Result cleanData(Address addr)
Clean one data page.
Access
Memory access flags.
u32 read(u32 reg) const
read from memory mapped I/O register
virtual Result flush()
Flush message buffers.
virtual Result read(void *buffer)
Read a message.
Result reset(const bool hardReset)
Reset to initial state.
#define assert(exp)
Insert program diagnostics.
#define ERROR(msg)
Output an error message.
Arch::IO m_feedback
The feedback page.
Result unmap()
Unmap memory pages from virtual address space.
Address getBase() const
Get memory I/O base offset.
Address virt
Virtual address.
Result flushPage(const Address page) const
Flush memory page.
RingHead m_head
Local RingHead.