summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-06-29 09:39:13 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-06-29 09:39:13 +0000
commit5ff641fb8153e0a935317cca4330ca5ea4826c5a (patch)
tree29c66631e6bfa3b4b837c623556a57ef0227159d
parent40ff07140de0afa86ff3e0c29ee24e0e012f0c42 (diff)
downloadrockbox-5ff641fb8153e0a935317cca4330ca5ea4826c5a.tar.gz
rockbox-5ff641fb8153e0a935317cca4330ca5ea4826c5a.zip
Do some adjustments to alleviate IRAM congestion on some targets from r30097. Include removing pointless IRAM declarations in pcmbuf.c because that callback code runs at a fairly relaxed pace. M5 is still the biggest problem.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30100 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/beep.c2
-rw-r--r--apps/pcmbuf.c41
-rw-r--r--firmware/export/pcm_mixer.h8
-rw-r--r--firmware/pcm_mixer.c2
4 files changed, 29 insertions, 24 deletions
diff --git a/apps/beep.c b/apps/beep.c
index 716847263e..a6244d932c 100644
--- a/apps/beep.c
+++ b/apps/beep.c
@@ -94,7 +94,7 @@ static FORCE_INLINE void beep_generate(int count)
94 94
95/* Callback to generate the beep frames - also don't want inlining of 95/* Callback to generate the beep frames - also don't want inlining of
96 call below in beep_play */ 96 call below in beep_play */
97static void __attribute__((noinline)) ICODE_ATTR 97static void __attribute__((noinline))
98beep_get_more(unsigned char **start, size_t *size) 98beep_get_more(unsigned char **start, size_t *size)
99{ 99{
100 int count = beep_count; 100 int count = beep_count;
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index f2f94e3bc9..5ef517968a 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -76,18 +76,18 @@ struct chunkdesc
76 ((bufsize) / PCMBUF_MINAVG_CHUNK) 76 ((bufsize) / PCMBUF_MINAVG_CHUNK)
77 77
78/* Size of the PCM buffer. */ 78/* Size of the PCM buffer. */
79static size_t pcmbuf_size IDATA_ATTR = 0; 79static size_t pcmbuf_size = 0;
80static char *pcmbuf_bufend IDATA_ATTR; 80static char *pcmbuf_bufend;
81static char *pcmbuffer IDATA_ATTR; 81static char *pcmbuffer;
82/* Current PCM buffer write index. */ 82/* Current PCM buffer write index. */
83static size_t pcmbuffer_pos IDATA_ATTR; 83static size_t pcmbuffer_pos;
84/* Amount pcmbuffer_pos will be increased.*/ 84/* Amount pcmbuffer_pos will be increased.*/
85static size_t pcmbuffer_fillpos IDATA_ATTR; 85static size_t pcmbuffer_fillpos;
86 86
87static struct chunkdesc *first_desc; 87static struct chunkdesc *first_desc;
88 88
89/* Gapless playback */ 89/* Gapless playback */
90static bool track_transition IDATA_ATTR; 90static bool track_transition;
91 91
92/* Fade effect */ 92/* Fade effect */
93static unsigned int fade_vol = MIX_AMP_UNITY; 93static unsigned int fade_vol = MIX_AMP_UNITY;
@@ -97,33 +97,33 @@ static bool soft_mode = false;
97 97
98#ifdef HAVE_CROSSFADE 98#ifdef HAVE_CROSSFADE
99/* Crossfade buffer */ 99/* Crossfade buffer */
100static char *fadebuf IDATA_ATTR; 100static char *fadebuf;
101 101
102/* Crossfade related state */ 102/* Crossfade related state */
103static bool crossfade_enabled; 103static bool crossfade_enabled;
104static bool crossfade_enable_request; 104static bool crossfade_enable_request;
105static bool crossfade_mixmode; 105static bool crossfade_mixmode;
106static bool crossfade_auto_skip; 106static bool crossfade_auto_skip;
107static bool crossfade_active IDATA_ATTR; 107static bool crossfade_active;
108static bool crossfade_track_change_started IDATA_ATTR; 108static bool crossfade_track_change_started;
109 109
110/* Track the current location for processing crossfade */ 110/* Track the current location for processing crossfade */
111static struct chunkdesc *crossfade_chunk IDATA_ATTR; 111static struct chunkdesc *crossfade_chunk;
112static size_t crossfade_sample IDATA_ATTR; 112static size_t crossfade_sample;
113 113
114/* Counters for fading in new data */ 114/* Counters for fading in new data */
115static size_t crossfade_fade_in_total IDATA_ATTR; 115static size_t crossfade_fade_in_total;
116static size_t crossfade_fade_in_rem IDATA_ATTR; 116static size_t crossfade_fade_in_rem;
117#endif 117#endif
118 118
119static struct chunkdesc *read_chunk IDATA_ATTR; 119static struct chunkdesc *read_chunk;
120static struct chunkdesc *read_end_chunk IDATA_ATTR; 120static struct chunkdesc *read_end_chunk;
121static struct chunkdesc *write_chunk IDATA_ATTR; 121static struct chunkdesc *write_chunk;
122static struct chunkdesc *write_end_chunk IDATA_ATTR; 122static struct chunkdesc *write_end_chunk;
123static size_t last_chunksize IDATA_ATTR; 123static size_t last_chunksize;
124 124
125static size_t pcmbuf_unplayed_bytes IDATA_ATTR; 125static size_t pcmbuf_unplayed_bytes;
126static size_t pcmbuf_watermark IDATA_ATTR; 126static size_t pcmbuf_watermark;
127 127
128static bool low_latency_mode = false; 128static bool low_latency_mode = false;
129static bool flush_pcmbuf = false; 129static bool flush_pcmbuf = false;
@@ -635,7 +635,6 @@ bool pcmbuf_start_track_change(bool auto_skip)
635 * buffer is empty except for uncommitted samples. Then they are committed 635 * buffer is empty except for uncommitted samples. Then they are committed
636 * and sent to the PCM driver for playback. The third part performs the 636 * and sent to the PCM driver for playback. The third part performs the
637 * operations involved in sending a new chunk to the DMA. */ 637 * operations involved in sending a new chunk to the DMA. */
638static void pcmbuf_pcm_callback(unsigned char** start, size_t* size) ICODE_ATTR;
639static void pcmbuf_pcm_callback(unsigned char** start, size_t* size) 638static void pcmbuf_pcm_callback(unsigned char** start, size_t* size)
640{ 639{
641 { 640 {
diff --git a/firmware/export/pcm_mixer.h b/firmware/export/pcm_mixer.h
index 3b420e1320..f430ce0efe 100644
--- a/firmware/export/pcm_mixer.h
+++ b/firmware/export/pcm_mixer.h
@@ -37,12 +37,18 @@
37#if defined(CPU_COLDFIRE) || defined(CPU_PP) 37#if defined(CPU_COLDFIRE) || defined(CPU_PP)
38/* For Coldfire, it's just faster 38/* For Coldfire, it's just faster
39 For PortalPlayer, this also avoids more expensive cache coherency */ 39 For PortalPlayer, this also avoids more expensive cache coherency */
40#define DOWNMIX_BUF_IBSS IBSS_ATTR 40#define DOWNMIX_BUF_IBSS IBSS_ATTR
41#else 41#else
42/* Otherwise can't DMA from IRAM, IRAM is pointless or worse */ 42/* Otherwise can't DMA from IRAM, IRAM is pointless or worse */
43#define DOWNMIX_BUF_IBSS 43#define DOWNMIX_BUF_IBSS
44#endif 44#endif
45 45
46#if defined(CPU_COLDFIRE) || defined(CPU_PP)
47#define MIXER_CALLBACK_ICODE ICODE_ATTR
48#else
49#define MIXER_CALLBACK_ICODE
50#endif
51
46 52
47/** Definitions **/ 53/** Definitions **/
48 54
diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c
index e5625fbd32..69a43cfbda 100644
--- a/firmware/pcm_mixer.c
+++ b/firmware/pcm_mixer.c
@@ -218,7 +218,7 @@ static void mixer_pcm_callback(unsigned char **start, size_t *size)
218 218
219/* Buffering callback - calls sub-callbacks and mixes the data for next 219/* Buffering callback - calls sub-callbacks and mixes the data for next
220 buffer to be sent from mixer_pcm_callback() */ 220 buffer to be sent from mixer_pcm_callback() */
221static void ICODE_ATTR mixer_buffer_callback(void) 221static void MIXER_CALLBACK_ICODE mixer_buffer_callback(void)
222{ 222{
223 downmix_index ^= 1; /* Next buffer */ 223 downmix_index ^= 1; /* Next buffer */
224 224