diff options
Diffstat (limited to 'apps/codecs/libspc/spc_codec.h')
-rw-r--r-- | apps/codecs/libspc/spc_codec.h | 64 |
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 |
193 | extern struct cpu_ram_t ram; | 213 | extern struct cpu_ram_t ram; |
194 | 214 | ||
195 | long CPU_run( THIS, long start_time ) ICODE_ATTR; | 215 | long CPU_run( THIS, long start_time ) ICODE_ATTR_SPC; |
196 | void CPU_Init( THIS ); | 216 | void 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 | ||
378 | void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR; | 398 | void DSP_run_( struct Spc_Dsp* this, long count, int32_t* out_buf ) ICODE_ATTR_SPC; |
379 | void DSP_reset( struct Spc_Dsp* this ); | 399 | void DSP_reset( struct Spc_Dsp* this ); |
380 | 400 | ||
381 | static inline void DSP_run( struct Spc_Dsp* this, long count, int32_t* out ) | 401 | static 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 | ||
415 | void Timer_run_( struct Timer* t, long time ) ICODE_ATTR; | 435 | void Timer_run_( struct Timer* t, long time ) ICODE_ATTR_SPC; |
416 | 436 | ||
417 | static inline void Timer_run( struct Timer* t, long time ) | 437 | static inline void Timer_run( struct Timer* t, long time ) |
418 | { | 438 | { |
@@ -461,7 +481,7 @@ void SPC_Init( THIS ); | |||
461 | int SPC_load_spc( THIS, const void* data, long size ); | 481 | int SPC_load_spc( THIS, const void* data, long size ); |
462 | 482 | ||
463 | /**************** DSP interaction ****************/ | 483 | /**************** DSP interaction ****************/ |
464 | void DSP_write( struct Spc_Dsp* this, int i, int data ) ICODE_ATTR; | 484 | void DSP_write( struct Spc_Dsp* this, int i, int data ) ICODE_ATTR_SPC; |
465 | 485 | ||
466 | static inline int DSP_read( struct Spc_Dsp* this, int i ) | 486 | static 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 | ||
472 | void SPC_run_dsp_( THIS, long time ) ICODE_ATTR; | 492 | void SPC_run_dsp_( THIS, long time ) ICODE_ATTR_SPC; |
473 | 493 | ||
474 | static inline void SPC_run_dsp( THIS, long time ) | 494 | static 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 | ||
480 | int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR; | 500 | int SPC_read( THIS, unsigned addr, long const time ) ICODE_ATTR_SPC; |
481 | void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR; | 501 | void SPC_write( THIS, unsigned addr, int data, long const time ) ICODE_ATTR_SPC; |
482 | 502 | ||
483 | /**************** Sample generation ****************/ | 503 | /**************** Sample generation ****************/ |
484 | int SPC_play( THIS, long count, int32_t* out ) ICODE_ATTR; | 504 | int SPC_play( THIS, long count, int32_t* out ) ICODE_ATTR_SPC; |
485 | 505 | ||
486 | #endif /* _SPC_CODEC_H_ */ | 506 | #endif /* _SPC_CODEC_H_ */ |