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