FreeNOS
|
API handlers contain the kernel side implementation of the Application Programming Interface (API). More...
Functions | |
API::Result | PrivExecHandler (const PrivOperation op, const Address param) |
Prototype for kernel handler. More... | |
API::Result | ProcessCtlHandler (const ProcessID proc, const ProcessOperation op, const Address addr, const Address output) |
Kernel handler prototype. More... | |
API::Result | SystemInfoHandler (SystemInformation *info) |
Kernel prototype. More... | |
API::Result | VMCopyHandler (const ProcessID proc, const API::Operation how, const Address ours, const Address theirs, const Size sz) |
Kernel handler prototype. More... | |
API::Result | VMCtlHandler (const ProcessID procID, const MemoryOperation op, Memory::Range *range) |
Kernel handler prototype. More... | |
API::Result | VMShareHandler (const ProcessID pid, const API::Operation op, ProcessShares::MemoryShare *share) |
Kernel handler prototype. More... | |
API handlers contain the kernel side implementation of the Application Programming Interface (API).
API::Result PrivExecHandler | ( | const PrivOperation | op, |
const Address | param | ||
) |
Prototype for kernel handler.
Performs various privileged operations.
op | The operation to perform. |
param | Optional parameter value for the given operation |
Definition at line 23 of file PrivExec.cpp.
References assert, cpu_reboot, cpu_shutdown, ProcessManager::current(), DEBUG, FATAL, Kernel::getProcessManager(), Idle, WeakSingleton< Kernel >::instance(), WeakSingleton< Log >::instance(), API::InvalidArgument, Panic, param(), RebootSystem, ProcessManager::setIdle(), ShutdownSystem, API::Success, WriteConsole, and ZERO.
Referenced by API::API().
API::Result ProcessCtlHandler | ( | const ProcessID | proc, |
const ProcessOperation | op, | ||
const Address | addr, | ||
const Address | output | ||
) |
Kernel handler prototype.
Process management related operations.
proc | Target Process' ID. |
op | The operation to perform. |
addr | Input argument address, used for program entry point for Spawn, ProcessInfo pointer for Info. |
output | Output argument address (optional). |
Definition at line 27 of file ProcessCtl.cpp.
References ProcessManager::create(), ProcessManager::current(), DEBUG, DisableIRQ, EnableIRQ, Kernel::enableIRQ(), EnterSleep, ERROR, ProcessManager::get(), Timer::getCurrent(), Process::getID(), GetParent, Process::getParent(), GetPID, Kernel::getProcessManager(), Process::getState(), Kernel::getTimer(), Process::getWaitResult(), ProcessInfo::id, InfoPID, InfoTimer, WeakSingleton< Kernel >::instance(), API::IOError, KillPID, API::NotFound, ProcessInfo::parent, ProcessManager::registerInterruptNotify(), ProcessManager::remove(), Reset, ProcessManager::reset(), Resume, ProcessManager::resume(), Schedule, ProcessManager::schedule(), SELF, SendIRQ, Kernel::sendIRQ(), ProcessManager::sleep(), Spawn, ProcessInfo::state, Stop, ProcessManager::stop(), ProcessManager::Success, API::Success, ProcessManager::wait(), WaitPID, WaitTimer, Wakeup, ProcessManager::wakeup(), WatchIRQ, and ZERO.
Referenced by API::API().
API::Result SystemInfoHandler | ( | SystemInformation * | info | ) |
Kernel prototype.
Retrieves system information.
info | Pointer to SystemInformation output buffer. |
Definition at line 24 of file SystemInfo.cpp.
References SplitAllocator::available(), CoreInfo::bootImageAddress, SystemInformation::bootImageAddress, CoreInfo::bootImageSize, SystemInformation::bootImageSize, SystemInformation::cmdline, MemoryBlock::copy(), CoreInfo::coreChannelAddress, SystemInformation::coreChannelAddress, CoreInfo::coreChannelSize, SystemInformation::coreChannelSize, CoreInfo::coreId, SystemInformation::coreId, coreInfo, DEBUG, Kernel::getAllocator(), Kernel::getCoreInfo(), WeakSingleton< Kernel >::instance(), CoreInfo::kernel, SystemInformation::kernelAddress, CoreInfo::kernelCommand, SystemInformation::kernelSize, SystemInformation::memoryAvail, SystemInformation::memorySize, Memory::Range::phys, Memory::Range::size, Allocator::size(), API::Success, CoreInfo::timerCounter, SystemInformation::timerCounter, and SystemInformation::version.
Referenced by API::API().
API::Result VMCopyHandler | ( | const ProcessID | proc, |
const API::Operation | how, | ||
const Address | ours, | ||
const Address | theirs, | ||
const Size | sz | ||
) |
Kernel handler prototype.
Copies virtual memory between two processes.
proc | Remote process. |
how | Read or Write. |
ours | Virtual address of the buffer of this process. |
theirs | Virtual address of the remote process' buffer. |
sz | Amount of memory to copy. |
Definition at line 24 of file VMCopy.cpp.
References API::AccessViolation, assert, MemoryBlock::copy(), ProcessManager::current(), DEBUG, ERROR, MemoryContext::findFree(), ProcessManager::get(), Process::getMemoryContext(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), API::IOError, MemoryMap::KernelPrivate, MemoryContext::lookup(), MemoryContext::map(), API::NotFound, PAGEMASK, PAGESIZE, API::RangeError, API::Read, Memory::Readable, API::ReadPhys, SELF, MemoryContext::Success, API::Success, MemoryContext::unmap(), Memory::Writable, and API::Write.
Referenced by API::API().
API::Result VMCtlHandler | ( | const ProcessID | procID, |
const MemoryOperation | op, | ||
Memory::Range * | range | ||
) |
Kernel handler prototype.
Examines and modifies virtual memory pages.
procID | Remote process. |
op | Determines which operation to perform. |
range | Describes the memory pages to operate on. |
Definition at line 24 of file VMCtl.cpp.
References Access, Memory::Range::access, MemoryContext::access(), API::AccessViolation, SplitAllocator::allocate(), assert, CacheClean, CacheCleanInvalidate, CacheInvalidate, Cache::cleanData(), ARMCacheV6::cleanInvalidate(), ProcessManager::current(), Cache::Data, DEBUG, ERROR, MemoryContext::findFree(), ProcessManager::get(), Kernel::getAllocator(), Process::getMemoryContext(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), API::InvalidArgument, ARMCacheV6::invalidateAddress(), API::IOError, SplitAllocator::isAllocated(), MemoryContext::lookup(), LookupVirtual, MapContiguous, MemoryContext::mapRangeContiguous(), MemoryContext::mapRangeSparse(), MapSparse, API::NotFound, PAGEMASK, PAGESIZE, Memory::Range::phys, Release, MemoryContext::releaseRange(), MemoryContext::releaseSection(), ReleaseSections, ReserveMem, SELF, Memory::Range::size, Cache::Success, MemoryContext::Success, Allocator::Success, API::Success, UnMap, MemoryContext::unmapRange(), MemoryMap::UserPrivate, Memory::Range::virt, and ZERO.
Referenced by API::API().
API::Result VMShareHandler | ( | const ProcessID | pid, |
const API::Operation | op, | ||
ProcessShares::MemoryShare * | share | ||
) |
Kernel handler prototype.
Creates and removes shared virtual memory mappings.
pid | Remote process. |
op | Determines which operation to perform. |
share | Pointer to the MemoryShare to use in the operation |
Definition at line 25 of file VMShare.cpp.
References ProcessShares::AlreadyExists, API::AlreadyExists, API::Create, ProcessShares::createShare(), ProcessManager::current(), DEBUG, API::Delete, ProcessShares::DetachInProgress, ProcessManager::get(), Kernel::getProcessManager(), Process::getShares(), WeakSingleton< Kernel >::instance(), API::InvalidArgument, API::IOError, API::NotFound, API::Read, ProcessShares::readShare(), ProcessShares::removeShares(), SELF, ProcessShares::Success, API::Success, API::TemporaryUnavailable, and ZERO.
Referenced by API::API().