summaryrefslogtreecommitdiff
path: root/apps/codecs/libspc/spc_codec.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libspc/spc_codec.h')
-rw-r--r--apps/codecs/libspc/spc_codec.h64
1 files changed, 42 insertions, 22 deletions
diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h
index f4f69dd758..391540cb19 100644
--- a/apps/codecs/libspc/spc_codec.h
+++ b/apps/codecs/libspc/spc_codec.h
@@ -89,20 +89,41 @@
89 #define SPC_NOECHO 1 89 #define SPC_NOECHO 1
90#endif 90#endif
91 91
92#ifdef CPU_ARM 92#if (CONFIG_CPU == MCF5250)
93#define IBSS_ATTR_SPC IBSS_ATTR
94#define ICODE_ATTR_SPC ICODE_ATTR
95#define ICONST_ATTR_SPC ICONST_ATTR
96/* Not enough IRAM available to move further data to it. */
97#define IBSS_ATTR_SPC_LARGE_IRAM
98
99#elif (CONFIG_CPU == PP5020)
100/* spc is slower on PP5020 when moving data to IRAM. */
101#define IBSS_ATTR_SPC
102#define ICODE_ATTR_SPC
103#define ICONST_ATTR_SPC
104/* Not enough IRAM available to move further data to it. */
105#define IBSS_ATTR_SPC_LARGE_IRAM
106
107#elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
108#define IBSS_ATTR_SPC IBSS_ATTR
109#define ICODE_ATTR_SPC ICODE_ATTR
110#define ICONST_ATTR_SPC ICONST_ATTR
111/* Not enough IRAM available to move further data to it. */
112#define IBSS_ATTR_SPC_LARGE_IRAM
113
114#elif defined(CPU_S5L870X)
115#define IBSS_ATTR_SPC IBSS_ATTR
116#define ICODE_ATTR_SPC ICODE_ATTR
117#define ICONST_ATTR_SPC ICONST_ATTR
118/* Very large IRAM. Move even more data to it. */
119#define IBSS_ATTR_SPC_LARGE_IRAM IBSS_ATTR
93 120
94#if CONFIG_CPU != PP5002 121#else
95 #undef ICODE_ATTR 122#define IBSS_ATTR_SPC IBSS_ATTR
96 #define ICODE_ATTR 123#define ICODE_ATTR_SPC ICODE_ATTR
97 124#define ICONST_ATTR_SPC ICONST_ATTR
98 #undef IDATA_ATTR 125/* Not enough IRAM available to move further data to it. */
99 #define IDATA_ATTR 126#define IBSS_ATTR_SPC_LARGE_IRAM
100
101 #undef ICONST_ATTR
102 #define ICONST_ATTR
103
104 #undef IBSS_ATTR
105 #define IBSS_ATTR
106#endif 127#endif
107 128
108#if SPC_DUAL_CORE 129#if SPC_DUAL_CORE
@@ -111,7 +132,6 @@
111 #undef SHAREDDATA_ATTR 132 #undef SHAREDDATA_ATTR
112 #define SHAREDDATA_ATTR __attribute__((section(".idata"))) 133 #define SHAREDDATA_ATTR __attribute__((section(".idata")))
113#endif 134#endif
114#endif
115 135
116/* Samples per channel per iteration */ 136/* Samples per channel per iteration */
117#if defined(CPU_PP) && NUM_CORES == 1 137#if defined(CPU_PP) && NUM_CORES == 1
@@ -192,7 +212,7 @@ struct cpu_ram_t
192#define RAM ram.ram 212#define RAM ram.ram
193extern struct cpu_ram_t ram; 213extern struct cpu_ram_t ram;
194 214
195long CPU_run( THIS, long start_time ) ICODE_ATTR; 215long CPU_run( THIS, long start_time ) ICODE_ATTR_SPC;
196void CPU_Init( THIS ); 216void CPU_Init( THIS );
197 217
198/* The DSP portion (awe!) */ 218/* The DSP portion (awe!) */
@@ -375,7 +395,7 @@ struct Spc_Dsp
375#endif 395#endif
376}; 396};
377 397
378void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR; 398void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR_SPC;
379void DSP_reset( struct Spc_Dsp* this ); 399void DSP_reset( struct Spc_Dsp* this );
380 400
381static inline void DSP_run( struct Spc_Dsp* this, long count, int32_t* out ) 401static inline void DSP_run( struct Spc_Dsp* this, long count, int32_t* out )
@@ -412,7 +432,7 @@ struct Timer
412 int counter; 432 int counter;
413}; 433};
414 434
415void Timer_run_( struct Timer* t, long time ) ICODE_ATTR; 435void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC;
416 436
417static inline void Timer_run( struct Timer* t, long time ) 437static inline void Timer_run( struct Timer* t, long time )
418{ 438{
@@ -461,7 +481,7 @@ void SPC_Init( THIS );
461int SPC_load_spc( THIS, const void* data, long size ); 481int SPC_load_spc( THIS, const void* data, long size );
462 482
463/**************** DSP interaction ****************/ 483/**************** DSP interaction ****************/
464void DSP_write( struct Spc_Dsp* this, int i, int data ) ICODE_ATTR; 484void DSP_write( struct Spc_Dsp* this, int i, int data ) ICODE_ATTR_SPC;
465 485
466static inline int DSP_read( struct Spc_Dsp* this, int i ) 486static inline int DSP_read( struct Spc_Dsp* this, int i )
467{ 487{
@@ -469,7 +489,7 @@ static inline int DSP_read( struct Spc_Dsp* this, int i )
469 return this->r.reg [i]; 489 return this->r.reg [i];
470} 490}
471 491
472void SPC_run_dsp_( THIS, long time ) ICODE_ATTR; 492void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC;
473 493
474static inline void SPC_run_dsp( THIS, long time ) 494static inline void SPC_run_dsp( THIS, long time )
475{ 495{
@@ -477,10 +497,10 @@ static inline void SPC_run_dsp( THIS, long time )
477 SPC_run_dsp_( this, time ); 497 SPC_run_dsp_( this, time );
478} 498}
479 499
480int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR; 500int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR_SPC;
481void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR; 501void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR_SPC;
482 502
483/**************** Sample generation ****************/ 503/**************** Sample generation ****************/
484int SPC_play( THIS, long count, int32_t* out ) ICODE_ATTR; 504int SPC_play( THIS, long count, int32_t* out ) ICODE_ATTR_SPC;
485 505
486#endif /* _SPC_CODEC_H_ */ 506#endif /* _SPC_CODEC_H_ */