FreeNOS
Public Types | Public Member Functions | Private Attributes
ARMException Class Reference

ARM exception handling functionality. More...

#include <ARMException.h>

Public Types

enum  ExceptionType {
  Reset = 0, UndefinedInstruction, SoftwareInterrupt, PrefetchAbort,
  DataAbort, Reserved, IRQ, FIQ
}
 ARM exception types. More...
 
enum  Result { Success, NotFound, IOError }
 Result codes. More...
 
typedef void Handler(struct CPUState state)
 Function which is called when the CPU is interrupted. More...
 

Public Member Functions

 ARMException (Address base)
 Constructor. More...
 
Result install (ExceptionType vector, Handler handler)
 Install an exception handler. More...
 

Private Attributes

Address m_vecTable
 ARM exception vector jump table. More...
 

Detailed Description

ARM exception handling functionality.

Definition at line 44 of file ARMException.h.

Member Typedef Documentation

◆ Handler

typedef void ARMException::Handler(struct CPUState state)

Function which is called when the CPU is interrupted.

Parameters
stateState of the CPU on the moment the interrupt occurred.

Definition at line 78 of file ARMException.h.

Member Enumeration Documentation

◆ ExceptionType

ARM exception types.

Enumerator
Reset 
UndefinedInstruction 
SoftwareInterrupt 
PrefetchAbort 
DataAbort 
Reserved 
IRQ 
FIQ 

Definition at line 51 of file ARMException.h.

◆ Result

Result codes.

Enumerator
Success 
NotFound 
IOError 

Definition at line 66 of file ARMException.h.

Constructor & Destructor Documentation

◆ ARMException()

ARMException::ARMException ( Address  base)

Constructor.

Parameters
baseBase address of the interrupt jump table. By default this is physical address 0x0 in RAM.

Definition at line 25 of file ARMException.cpp.

References ARM_EX_VECTAB_SIZE, MemoryBlock::copy(), m_vecTable, sysctrl_read, sysctrl_write, vbar_set, and vecTable.

Member Function Documentation

◆ install()

ARMException::Result ARMException::install ( ARMException::ExceptionType  vector,
ARMException::Handler  handler 
)

Install an exception handler.

Parameters
vectorException vector to install
handlerException handler function to install.
Returns
Result code

Definition at line 39 of file ARMException.cpp.

References handlerTable, and Success.

Referenced by ARMKernel::ARMKernel(), RaspberryKernel::RaspberryKernel(), and SunxiKernel::SunxiKernel().

Field Documentation

◆ m_vecTable

Address ARMException::m_vecTable
private

ARM exception vector jump table.

The ARM processor will start executing at the appropriate vector offset in the jump table and perform a jump to the exception handler address, which it retrieves from the exception handlers table.

See also
m_handlerTable;
ARMExceptionTable.S

Definition at line 113 of file ARMException.h.

Referenced by ARMException().


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