RetroArch
Macros | Functions | Variables
dsp.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "asm.h"
#include "processor.h"
#include "irq.h"
#include "dsp.h"
Include dependency graph for dsp.c:

Macros

#define DSPCR_DSPRESET   0x0800
 
#define DSPCR_DSPDMA   0x0200
 
#define DSPCR_DSPINTMSK   0x0100
 
#define DSPCR_DSPINT   0x0080
 
#define DSPCR_ARINTMSK   0x0040
 
#define DSPCR_ARINT   0x0020
 
#define DSPCR_AIINTMSK   0x0010
 
#define DSPCR_AIINT   0x0008
 
#define DSPCR_HALT   0x0004
 
#define DSPCR_PIINT   0x0002
 
#define DSPCR_RES   0x0001
 
#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

static void __dsp_inserttask (dsptask_t *task)
 
static void __dsp_removetask (dsptask_t *task)
 
static void __dsp_boottask (dsptask_t *task)
 
static void __dsp_exectask (dsptask_t *exec, dsptask_t *hire)
 
static void __dsp_def_taskcb ()
 
static void __dsp_inthandler (u32 nIrq, void *pCtx)
 
void DSP_Init ()
 Initialize DSP subsystem. More...
 
DSPCallback DSP_RegisterCallback (DSPCallback usr_cb)
 Register an user's interrupt callback. This may be used to handle DSP interrupts on its own. By default a system default callback is installed on DSP_Init(). More...
 
u32 DSP_CheckMailTo ()
 Check if mail was sent to DSP. More...
 
u32 DSP_CheckMailFrom ()
 Check for mail from DSP. More...
 
u32 DSP_ReadMailFrom ()
 Read mail from DSP. More...
 
void DSP_SendMailTo (u32 mail)
 Send mail to DSP. More...
 
u32 DSP_ReadCPUtoDSP ()
 Read back CPU->DSP mailbox. More...
 
void DSP_AssertInt ()
 Asserts the processor interface interrupt. More...
 
void DSP_Reset ()
 
void DSP_Halt ()
 
void DSP_Unhalt ()
 
u32 DSP_GetDMAStatus ()
 
dsptask_tDSP_AddTask (dsptask_t *task)
 Add a DSP task to the tasklist and start executing if necessary. More...
 
void DSP_CancelTask (dsptask_t *task)
 
dsptask_tDSP_AssertTask (dsptask_t *task)
 

Variables

static u32 __dsp_inited = FALSE
 
static u32 __dsp_rudetask_pend = FALSE
 
static DSPCallback __dsp_intcb = NULL
 
static dsptask_t__dsp_currtask
 
static dsptask_t__dsp_lasttask
 
static dsptask_t__dsp_firsttask
 
static dsptask_t__dsp_rudetask
 
static dsptask_ttmp_task
 
static vu16 *const _dspReg = (u16*)0xCC005000
 

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)))

◆ DSPCR_AIINT

#define DSPCR_AIINT   0x0008

◆ DSPCR_AIINTMSK

#define DSPCR_AIINTMSK   0x0010

◆ DSPCR_ARINT

#define DSPCR_ARINT   0x0020

◆ DSPCR_ARINTMSK

#define DSPCR_ARINTMSK   0x0040

◆ DSPCR_DSPDMA

#define DSPCR_DSPDMA   0x0200

◆ DSPCR_DSPINT

#define DSPCR_DSPINT   0x0080

◆ DSPCR_DSPINTMSK

#define DSPCR_DSPINTMSK   0x0100

◆ DSPCR_DSPRESET

#define DSPCR_DSPRESET   0x0800

◆ DSPCR_HALT

#define DSPCR_HALT   0x0004

◆ DSPCR_PIINT

#define DSPCR_PIINT   0x0002

◆ DSPCR_RES

#define DSPCR_RES   0x0001

Function Documentation

◆ __dsp_boottask()

static void __dsp_boottask ( dsptask_t task)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __dsp_def_taskcb()

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

◆ __dsp_exectask()

static void __dsp_exectask ( dsptask_t exec,
dsptask_t hire 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __dsp_inserttask()

static void __dsp_inserttask ( dsptask_t task)
static
Here is the caller graph for this function:

◆ __dsp_inthandler()

static void __dsp_inthandler ( u32  nIrq,
void pCtx 
)
static
Here is the caller graph for this function:

◆ __dsp_removetask()

static void __dsp_removetask ( dsptask_t task)
static
Here is the caller graph for this function:

◆ DSP_AddTask()

dsptask_t* DSP_AddTask ( dsptask_t task)

Add a DSP task to the tasklist and start executing if necessary.

Parameters
[in]taskpointer to a dsptask_t structure which holds all necessary values for DSP task execution.
Returns
current task
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DSP_AssertInt()

void DSP_AssertInt ( )

Asserts the processor interface interrupt.

Returns
none

◆ DSP_AssertTask()

dsptask_t* DSP_AssertTask ( dsptask_t task)

◆ DSP_CancelTask()

void DSP_CancelTask ( dsptask_t task)

◆ DSP_CheckMailFrom()

u32 DSP_CheckMailFrom ( )

Check for mail from DSP.

Returns
1: has mail, 0: no mail
Here is the caller graph for this function:

◆ DSP_CheckMailTo()

u32 DSP_CheckMailTo ( )

Check if mail was sent to DSP.

Returns
1: mail sent, 0: mail on route
Here is the caller graph for this function:

◆ DSP_GetDMAStatus()

u32 DSP_GetDMAStatus ( )

◆ DSP_Halt()

void DSP_Halt ( )

◆ DSP_Init()

void DSP_Init ( )

Initialize DSP subsystem.

Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DSP_ReadCPUtoDSP()

u32 DSP_ReadCPUtoDSP ( )

Read back CPU->DSP mailbox.

Returns
mail value received

◆ DSP_ReadMailFrom()

u32 DSP_ReadMailFrom ( )

Read mail from DSP.

Returns
mail value received
Here is the caller graph for this function:

◆ DSP_RegisterCallback()

DSPCallback DSP_RegisterCallback ( DSPCallback  usr_cb)

Register an user's interrupt callback. This may be used to handle DSP interrupts on its own. By default a system default callback is installed on DSP_Init().

Parameters
[in]user_cbpointer to the user's interrupt callback function. \
Returns
pointer to old interrupt callback function.
Here is the call graph for this function:

◆ DSP_Reset()

void DSP_Reset ( )

◆ DSP_SendMailTo()

void DSP_SendMailTo ( u32  mail)

Send mail to DSP.

Parameters
[in]mailvalue to send
Returns
none
Here is the caller graph for this function:

◆ DSP_Unhalt()

void DSP_Unhalt ( )

Variable Documentation

◆ __dsp_currtask

dsptask_t* __dsp_currtask
static

◆ __dsp_firsttask

dsptask_t * __dsp_firsttask
static

◆ __dsp_inited

u32 __dsp_inited = FALSE
static

◆ __dsp_intcb

DSPCallback __dsp_intcb = NULL
static

◆ __dsp_lasttask

dsptask_t * __dsp_lasttask
static

◆ __dsp_rudetask

dsptask_t * __dsp_rudetask
static

◆ __dsp_rudetask_pend

u32 __dsp_rudetask_pend = FALSE
static

◆ _dspReg

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

◆ tmp_task

dsptask_t * tmp_task
static