RetroArch
Classes | Macros | Functions | Variables
irq.c File Reference
#include <stdlib.h>
#include <string.h>
#include "asm.h"
#include "cache.h"
#include "context.h"
#include "processor.h"
#include "lwp_threads.h"
#include "irq.h"
#include "console.h"
Include dependency graph for irq.c:

Classes

struct  irq_handler_s
 

Macros

#define CPU_STACK_ALIGNMENT   8
 
#define CPU_MINIMUM_STACK_FRAME_SIZE   16
 
#define _SHIFTL(v, s, w)   ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
 
#define _SHIFTR(v, s, w)   ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
 

Functions

void __exception_load (u32, void *, u32, void *)
 
void c_irqdispatcher (frame_context *ctx)
 
static u32 __SetInterrupts (u32 iMask, u32 nMask)
 
void __UnmaskIrq (u32 nMask)
 
void __MaskIrq (u32 nMask)
 
void __irq_init ()
 
raw_irq_handler_t IRQ_Request (u32 nIrq, raw_irq_handler_t pHndl, void *pCtx)
 Register an interrupt handler. More...
 
raw_irq_handler_t IRQ_GetHandler (u32 nIrq)
 Get the handler from interrupt number. More...
 
raw_irq_handler_t IRQ_Free (u32 nIrq)
 Free an interrupt handler. More...
 
u32 IRQ_Disable ()
 Disable the complete IRQ subsystem. No interrupts will be served. Multithreading kernel fully disabled. More...
 
void IRQ_Restore (u32 level)
 Restore the IRQ subsystem with the given level. This is function should be used together with IRQ_Disable() More...
 

Variables

struct irq_handler_s __attribute__
 
static u64 spuriousIrq = 0
 
static u32 prevIrqMask = 0
 
static u32 currIrqMask = 0
 
static struct irq_handler_s g_IRQHandler [32]
 
static vu32 *const _piReg = (u32*)0xCC003000
 
static vu16 *const _memReg = (u16*)0xCC004000
 
static vu16 *const _dspReg = (u16*)0xCC005000
 
static u32 const _irqPrio []
 
s8 irqhandler_start []
 
s8 irqhandler_end []
 
u8 __intrstack_addr []
 
u8 __intrstack_end []
 
 return
 

Macro Definition Documentation

◆ _SHIFTL

#define _SHIFTL (   v,
  s,
  w 
)    ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))

◆ _SHIFTR

#define _SHIFTR (   v,
  s,
  w 
)    ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))

◆ CPU_MINIMUM_STACK_FRAME_SIZE

#define CPU_MINIMUM_STACK_FRAME_SIZE   16

◆ CPU_STACK_ALIGNMENT

#define CPU_STACK_ALIGNMENT   8

Function Documentation

◆ __exception_load()

void __exception_load ( u32  ,
void ,
u32  ,
void  
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __irq_init()

void __irq_init ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __MaskIrq()

void __MaskIrq ( u32  nMask)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __SetInterrupts()

static u32 __SetInterrupts ( u32  iMask,
u32  nMask 
)
static
Here is the caller graph for this function:

◆ __UnmaskIrq()

void __UnmaskIrq ( u32  nMask)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_irqdispatcher()

void c_irqdispatcher ( frame_context ctx)

◆ IRQ_Disable()

u32 IRQ_Disable ( void  )

Disable the complete IRQ subsystem. No interrupts will be served. Multithreading kernel fully disabled.

Returns
Old state of the IRQ subsystem

◆ IRQ_Free()

raw_irq_handler_t IRQ_Free ( u32  nIrq)

Free an interrupt handler.

Parameters
[in]nIrqinterrupt number for which to free the handler
Returns
Old interrupt handler, else NULL

◆ IRQ_GetHandler()

raw_irq_handler_t IRQ_GetHandler ( u32  nIrq)

Get the handler from interrupt number.

Parameters
[in]nIrqinterrupt number for which to retrieve the handler
Returns
interrupt handler, else NULL
Here is the caller graph for this function:

◆ IRQ_Request()

raw_irq_handler_t IRQ_Request ( u32  nIrq,
raw_irq_handler_t  pHndl,
void pCtx 
)

Register an interrupt handler.

Parameters
[in]nIrqinterrupt number to which to register the handler
[in]pHndlpointer to the handler callback function which to call when interrupt has triggered
[in]pCtxpointer to user data to pass with, when handler is called
Returns
Old interrupt handler, else NULL
Here is the caller graph for this function:

◆ IRQ_Restore()

void IRQ_Restore ( u32  level)

Restore the IRQ subsystem with the given level. This is function should be used together with IRQ_Disable()

Parameters
[in]levelIRQ level to restore to.
Returns
none

Variable Documentation

◆ __attribute__

struct irq_handler_s __attribute__

◆ __intrstack_addr

u8 __intrstack_addr[]

◆ __intrstack_end

u8 __intrstack_end[]

◆ _dspReg

vu16* const _dspReg = (u16*)0xCC005000
static

◆ _irqPrio

u32 const _irqPrio[]
static
Initial value:
0xffffffff}
#define IM_PI_PEFINISH
Definition: irq.h:109
#define IM_PI_VI
Definition: irq.h:114
#define IM_AI
Definition: irq.h:90
#define IM_MEM
Definition: irq.h:83
#define IM_PI_DI
Definition: irq.h:111
#define IM_DSP_DSP
Definition: irq.h:87
#define IM_DSP_ARAM
Definition: irq.h:86
#define IM_PI_ERROR
Definition: irq.h:113
#define IM_EXI
Definition: irq.h:105
#define IM_DSP_AI
Definition: irq.h:85
#define IM_PI_HSP
Definition: irq.h:116
#define IM_PI_DEBUG
Definition: irq.h:115
#define IM_PI_SI
Definition: irq.h:110
#define IM_PI_CP
Definition: irq.h:107
#define IM_PI_PETOKEN
Definition: irq.h:108
#define IM_PI_RSW
Definition: irq.h:112

◆ _memReg

vu16* const _memReg = (u16*)0xCC004000
static

◆ _piReg

vu32* const _piReg = (u32*)0xCC003000
static

◆ currIrqMask

u32 currIrqMask = 0
static

◆ g_IRQHandler

struct irq_handler_s g_IRQHandler[32]
static

◆ irqhandler_end

s8 irqhandler_end[]

◆ irqhandler_start

s8 irqhandler_start[]

◆ prevIrqMask

u32 prevIrqMask = 0
static

◆ return

return

◆ spuriousIrq

u64 spuriousIrq = 0
static