FreeNOS
|
Represents the ARM kernel implementation. More...
#include <ARMKernel.h>
Public Member Functions | |
ARMKernel (CoreInfo *info) | |
Constructor function. More... | |
Public Member Functions inherited from Kernel | |
Kernel (CoreInfo *info) | |
Constructor function. More... | |
SplitAllocator * | getAllocator () |
Get physical memory allocator. More... | |
ProcessManager * | getProcessManager () |
Get process manager. More... | |
API * | getAPI () |
Get API. More... | |
MemoryContext * | getMemoryContext () |
Get the current MMU context. More... | |
CoreInfo * | getCoreInfo () |
Get CoreInfo. More... | |
Timer * | getTimer () |
Get Timer. More... | |
int | run () |
Execute the kernel. More... | |
virtual void | enableIRQ (u32 irq, bool enabled) |
Enable or disable an hardware interrupt (IRQ). More... | |
virtual Result | sendIRQ (const uint coreId, const uint irq) |
Send a inter-processor-interrupt (IPI) to another core. More... | |
virtual void | hookIntVector (u32 vec, InterruptHandler h, ulong p) |
Hooks a function to an hardware interrupt. More... | |
virtual void | executeIntVector (u32 vec, CPUState *state) |
Execute an interrupt handler. More... | |
virtual Result | loadBootImage () |
Loads the boot image. More... | |
Public Member Functions inherited from WeakSingleton< Kernel > | |
WeakSingleton (Kernel *obj) | |
Constructor. More... | |
Protected Attributes | |
ARMException | m_exception |
ARM exception handling subsystem. More... | |
Protected Attributes inherited from Kernel | |
SplitAllocator * | m_alloc |
Physical memory allocator. More... | |
ProcessManager * | m_procs |
Process Manager. More... | |
API * | m_api |
API handlers object. More... | |
CoreInfo * | m_coreInfo |
CoreInfo object for this core. More... | |
Vector< List< InterruptHook * > * > | m_interrupts |
Interrupt handlers. More... | |
IntController * | m_intControl |
Interrupt Controller. More... | |
Timer * | m_timer |
Timer device. More... | |
Static Private Member Functions | |
static void | interrupt (CPUState state) |
Interrupt handler routine. More... | |
static void | trap (CPUState state) |
Software trap routine. More... | |
static void | undefinedInstruction (CPUState state) |
Undefined instruction routine. More... | |
static void | prefetchAbort (CPUState state) |
Prefetch abort routine. More... | |
static void | dataAbort (CPUState state) |
Data abort routine. More... | |
static void | reserved (CPUState state) |
Reserved routine. More... | |
Additional Inherited Members | |
Public Types inherited from Kernel | |
enum | Result { Success, InvalidBootImage, ProcessError, IOError } |
Result codes. More... | |
Static Public Member Functions inherited from Kernel | |
static Error | initializeHeap () |
Initialize heap. More... | |
Static Public Member Functions inherited from WeakSingleton< Kernel > | |
static Kernel * | instance () |
Retrieve the instance. More... | |
Represents the ARM kernel implementation.
Definition at line 40 of file ARMKernel.h.
ARMKernel::ARMKernel | ( | CoreInfo * | info | ) |
Constructor function.
info | Contains processor core specific information |
Definition at line 28 of file ARMKernel.cpp.
References ARMControl::AlignmentCorrect, ARMControl::AlignmentFaults, SplitAllocator::allocate(), ARMControl::BigEndian, CoreInfo::coreId, ARMException::DataAbort, dataAbort(), ARMException::FIQ, ARMException::install(), interrupt(), ARMException::IRQ, Kernel::m_alloc, Kernel::m_coreInfo, m_exception, MegaByte, CoreInfo::memory, NOTICE, PAGESIZE, Memory::Range::phys, ARMException::PrefetchAbort, prefetchAbort(), ARMException::Reserved, reserved(), ARMControl::set(), ARMException::SoftwareInterrupt, trap(), ARMException::UndefinedInstruction, undefinedInstruction(), and ARMControl::unset().
|
staticprivate |
Data abort routine.
state | Saved CPU register state |
Definition at line 101 of file ARMKernel.cpp.
References CoreInfo::coreId, coreInfo, ProcessManager::current(), FATAL, Process::getID(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), and ARMCore::logException().
Referenced by ARMKernel().
|
staticprivate |
Interrupt handler routine.
state | Saved CPU register state |
Definition at line 74 of file ARMKernel.cpp.
References CoreInfo::coreId, coreInfo, ProcessManager::current(), FATAL, Process::getID(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), and ARMCore::logException().
Referenced by ARMKernel().
|
staticprivate |
Prefetch abort routine.
state | Saved CPU register state |
Definition at line 92 of file ARMKernel.cpp.
References CoreInfo::coreId, coreInfo, ProcessManager::current(), FATAL, Process::getID(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), and ARMCore::logException().
Referenced by ARMKernel().
|
staticprivate |
Reserved routine.
state | Saved CPU register state |
Definition at line 111 of file ARMKernel.cpp.
References CoreInfo::coreId, coreInfo, ProcessManager::current(), FATAL, Process::getID(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), and ARMCore::logException().
Referenced by ARMKernel().
|
staticprivate |
Software trap routine.
state | Saved CPU register state |
Definition at line 120 of file ARMKernel.cpp.
References MemoryBlock::copy(), CoreInfo::coreId, coreInfo, ProcessManager::current(), DEBUG, ProcessManager::get(), Kernel::getAPI(), Process::getID(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), API::invoke(), NULL, CPUState::r0, CPUState::r1, CPUState::r2, CPUState::r3, CPUState::r4, CPUState::r5, and ARMProcess::setCpuState().
Referenced by ARMKernel().
|
staticprivate |
Undefined instruction routine.
state | Saved CPU register state |
Definition at line 83 of file ARMKernel.cpp.
References CoreInfo::coreId, coreInfo, ProcessManager::current(), FATAL, Process::getID(), Kernel::getProcessManager(), WeakSingleton< Kernel >::instance(), and ARMCore::logException().
Referenced by ARMKernel().
|
protected |
ARM exception handling subsystem.
Definition at line 98 of file ARMKernel.h.
Referenced by ARMKernel(), RaspberryKernel::RaspberryKernel(), and SunxiKernel::SunxiKernel().