FreeNOS
Static Public Member Functions
MemoryBlock Class Reference

Memory block operations class. More...

#include <MemoryBlock.h>

Static Public Member Functions

static void * set (void *dest, int ch, unsigned count)
 Fill memory with a constant byte. More...
 
static Size copy (void *dest, const void *src, Size count)
 Copy memory from one place to another. More...
 
static Size copy (char *dest, char *src, Size count)
 Copy a character string. More...
 
static bool compare (const void *p1, const void *p2, const Size count)
 Compare memory. More...
 
static bool compare (const char *p1, const char *p2, const Size count=0)
 Compare memory. More...
 

Detailed Description

Memory block operations class.

Todo:
Add architecture specific implementations for extra speed. The alternative implementations should be placed in libarch without creating a new dependency in libstd, for example using weak symbols.

Definition at line 38 of file MemoryBlock.h.

Member Function Documentation

◆ compare() [1/2]

bool MemoryBlock::compare ( const char *  p1,
const char *  p2,
const Size  count = 0 
)
static

Compare memory.

Parameters
p1Memory pointer one.
p2Memory pointer two.
countNumber of bytes to compare or zero to continue until a ZERO byte.
Returns
True if equal, false otherwise.

Definition at line 88 of file MemoryBlock.cpp.

References ZERO.

◆ compare() [2/2]

bool MemoryBlock::compare ( const void *  p1,
const void *  p2,
const Size  count 
)
static

Compare memory.

Parameters
p1Memory pointer one.
p2Memory pointer two.
countNumber of bytes to compare
Returns
True if equal, false otherwise

Definition at line 72 of file MemoryBlock.cpp.

Referenced by MpiTarget::initialize(), MpiTarget::initializeMaster(), and DhcpClient::receiveBootResponse().

◆ copy() [1/2]

Size MemoryBlock::copy ( char *  dest,
char *  src,
Size  count 
)
static

Copy a character string.

Parameters
destDestination string.
srcSource string.
countNumber of bytes to copy.
Returns
Number of bytes copied

Definition at line 47 of file MemoryBlock.cpp.

◆ copy() [2/2]

Size MemoryBlock::copy ( void *  dest,
const void *  src,
Size  count 
)
static

Copy memory from one place to another.

Parameters
destDestination address.
srcSource address.
countNumber of bytes to copy.
Returns
Number of bytes copied.

Definition at line 36 of file MemoryBlock.cpp.

References sp.

Referenced by ARMException::ARMException(), IOBuffer::bufferedWrite(), ProcessShares::createShare(), Lz4Decompressor::decompress(), ARMProcess::execute(), FileSystemRequest::FileSystemRequest(), FileSystemClient::findMount(), Loopback::getAddress(), Ethernet::getAddress(), Ethernet::getTransmitPacket(), DhcpClient::initialize(), Directory::insert(), SunxiKernel::interrupt(), RaspberryKernel::interrupt(), kernel_main(), Mount::listMounts(), Kernel::loadBootProgram(), ARP::lookupAddress(), FileSystemServer::mountHandler(), multibootToCoreInfo(), String::operator<<(), String::operator=(), UDPSocket::process(), ICMP::process(), MpiProxy::processExec(), PseudoFile::PseudoFile(), BootImageStorage::read(), LinnDirectory::read(), IOBuffer::read(), Lz4Decompressor::read(), read16(), read32(), read64(), read8(), readBe16(), readBe32(), readBe64(), readLe16(), readLe32(), readLe64(), ProcessShares::readShare(), MpiHost::receivePacket(), DatastoreClient::registerBuffer(), FileSystemClient::request(), String::resize(), RecoveryServer::rewriteProgram(), MpiHost::send(), DhcpClient::sendBootRequest(), ICMP::sendPacket(), ARP::sendReply(), ChannelClient::sendRequest(), ARP::sendRequest(), Loopback::setAddress(), Ethernet::setAddress(), ARMProcess::setCpuState(), ICMPSocket::setReply(), Process::sleep(), spawn(), MpiHost::startProcesses(), String::String(), SystemInfoHandler(), ARMKernel::trap(), String::trim(), TestChar< T >::unique(), ARP::updateCacheEntry(), VMCopyHandler(), IPV4Address::write(), PseudoFile::write(), UDPSocket::write(), IOBuffer::write(), VGA::write(), write16(), write32(), write64(), write8(), writeBe16(), writeBe32(), writeBe64(), writeLe16(), writeLe32(), and writeLe64().

◆ set()

void * MemoryBlock::set ( void *  dest,
int  ch,
unsigned  count 
)
static

The documentation for this class was generated from the following files: