2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_DSP
|
|
|
|
#define _DOLPHIN_DSP
|
2022-04-30 08:32:00 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
2022-09-10 20:32:26 +00:00
|
|
|
#include <dolphin/os.h>
|
2022-04-30 08:32:00 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-12-20 23:19:11 +00:00
|
|
|
#define DSP_TASK_FLAG_CLEARALL 0x00000000
|
|
|
|
#define DSP_TASK_FLAG_ATTACHED 0x00000001
|
|
|
|
#define DSP_TASK_FLAG_CANCEL 0x00000002
|
|
|
|
|
|
|
|
#define DSP_TASK_STATE_INIT 0
|
|
|
|
#define DSP_TASK_STATE_RUN 1
|
|
|
|
#define DSP_TASK_STATE_YIELD 2
|
|
|
|
#define DSP_TASK_STATE_DONE 3
|
|
|
|
|
2022-09-18 06:05:46 +00:00
|
|
|
typedef void (*DSPCallback)(void* task);
|
2022-04-30 08:32:00 +00:00
|
|
|
|
|
|
|
typedef struct DSPTaskInfo DSPTaskInfo;
|
|
|
|
|
2022-09-18 06:05:46 +00:00
|
|
|
typedef struct DSPTaskInfo {
|
|
|
|
vu32 state;
|
|
|
|
vu32 priority;
|
|
|
|
vu32 flags;
|
|
|
|
u16* iram_mmem_addr;
|
|
|
|
u32 iram_length;
|
|
|
|
u32 iram_addr;
|
|
|
|
|
|
|
|
u16* dram_mmem_addr;
|
|
|
|
u32 dram_length;
|
|
|
|
u32 dram_addr;
|
|
|
|
|
|
|
|
u16 dsp_init_vector;
|
|
|
|
u16 dsp_resume_vector;
|
|
|
|
|
|
|
|
DSPCallback init_cb;
|
|
|
|
DSPCallback res_cb;
|
|
|
|
DSPCallback done_cb;
|
|
|
|
DSPCallback req_cb;
|
|
|
|
|
2022-12-20 23:19:11 +00:00
|
|
|
struct DSPTaskInfo* next;
|
|
|
|
struct DSPTaskInfo* prev;
|
2022-09-18 06:05:46 +00:00
|
|
|
|
|
|
|
OSTime t_context;
|
|
|
|
OSTime t_task;
|
2022-04-30 08:32:00 +00:00
|
|
|
|
|
|
|
} DSPTaskInfo;
|
|
|
|
|
|
|
|
void DSPInit();
|
|
|
|
void DSPReset();
|
|
|
|
void DSPHalt();
|
|
|
|
void DSPSendMailToDSP(u32 mail);
|
|
|
|
u32 DSPCheckMailToDSP();
|
|
|
|
u32 DSPCheckMailFromDSP();
|
|
|
|
u32 DSPGetDMAStatus();
|
|
|
|
|
|
|
|
DSPTaskInfo* DSPAddTask(DSPTaskInfo* task);
|
|
|
|
|
2022-12-20 23:19:11 +00:00
|
|
|
void __DSP_exec_task(DSPTaskInfo* curr, DSPTaskInfo* next);
|
|
|
|
void __DSP_boot_task(DSPTaskInfo* task);
|
|
|
|
void __DSP_remove_task(DSPTaskInfo* task);
|
|
|
|
void __DSP_add_task(DSPTaskInfo* task);
|
2022-04-30 08:32:00 +00:00
|
|
|
void __DSP_debug_printf(const char* fmt, ...);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_DSP
|