diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-06-29 09:39:13 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-06-29 09:39:13 +0000 |
commit | 5ff641fb8153e0a935317cca4330ca5ea4826c5a (patch) | |
tree | 29c66631e6bfa3b4b837c623556a57ef0227159d | |
parent | 40ff07140de0afa86ff3e0c29ee24e0e012f0c42 (diff) | |
download | rockbox-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.c | 2 | ||||
-rw-r--r-- | apps/pcmbuf.c | 41 | ||||
-rw-r--r-- | firmware/export/pcm_mixer.h | 8 | ||||
-rw-r--r-- | firmware/pcm_mixer.c | 2 |
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 */ |
97 | static void __attribute__((noinline)) ICODE_ATTR | 97 | static void __attribute__((noinline)) |
98 | beep_get_more(unsigned char **start, size_t *size) | 98 | beep_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. */ |
79 | static size_t pcmbuf_size IDATA_ATTR = 0; | 79 | static size_t pcmbuf_size = 0; |
80 | static char *pcmbuf_bufend IDATA_ATTR; | 80 | static char *pcmbuf_bufend; |
81 | static char *pcmbuffer IDATA_ATTR; | 81 | static char *pcmbuffer; |
82 | /* Current PCM buffer write index. */ | 82 | /* Current PCM buffer write index. */ |
83 | static size_t pcmbuffer_pos IDATA_ATTR; | 83 | static size_t pcmbuffer_pos; |
84 | /* Amount pcmbuffer_pos will be increased.*/ | 84 | /* Amount pcmbuffer_pos will be increased.*/ |
85 | static size_t pcmbuffer_fillpos IDATA_ATTR; | 85 | static size_t pcmbuffer_fillpos; |
86 | 86 | ||
87 | static struct chunkdesc *first_desc; | 87 | static struct chunkdesc *first_desc; |
88 | 88 | ||
89 | /* Gapless playback */ | 89 | /* Gapless playback */ |
90 | static bool track_transition IDATA_ATTR; | 90 | static bool track_transition; |
91 | 91 | ||
92 | /* Fade effect */ | 92 | /* Fade effect */ |
93 | static unsigned int fade_vol = MIX_AMP_UNITY; | 93 | static 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 */ |
100 | static char *fadebuf IDATA_ATTR; | 100 | static char *fadebuf; |
101 | 101 | ||
102 | /* Crossfade related state */ | 102 | /* Crossfade related state */ |
103 | static bool crossfade_enabled; | 103 | static bool crossfade_enabled; |
104 | static bool crossfade_enable_request; | 104 | static bool crossfade_enable_request; |
105 | static bool crossfade_mixmode; | 105 | static bool crossfade_mixmode; |
106 | static bool crossfade_auto_skip; | 106 | static bool crossfade_auto_skip; |
107 | static bool crossfade_active IDATA_ATTR; | 107 | static bool crossfade_active; |
108 | static bool crossfade_track_change_started IDATA_ATTR; | 108 | static bool crossfade_track_change_started; |
109 | 109 | ||
110 | /* Track the current location for processing crossfade */ | 110 | /* Track the current location for processing crossfade */ |
111 | static struct chunkdesc *crossfade_chunk IDATA_ATTR; | 111 | static struct chunkdesc *crossfade_chunk; |
112 | static size_t crossfade_sample IDATA_ATTR; | 112 | static size_t crossfade_sample; |
113 | 113 | ||
114 | /* Counters for fading in new data */ | 114 | /* Counters for fading in new data */ |
115 | static size_t crossfade_fade_in_total IDATA_ATTR; | 115 | static size_t crossfade_fade_in_total; |
116 | static size_t crossfade_fade_in_rem IDATA_ATTR; | 116 | static size_t crossfade_fade_in_rem; |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | static struct chunkdesc *read_chunk IDATA_ATTR; | 119 | static struct chunkdesc *read_chunk; |
120 | static struct chunkdesc *read_end_chunk IDATA_ATTR; | 120 | static struct chunkdesc *read_end_chunk; |
121 | static struct chunkdesc *write_chunk IDATA_ATTR; | 121 | static struct chunkdesc *write_chunk; |
122 | static struct chunkdesc *write_end_chunk IDATA_ATTR; | 122 | static struct chunkdesc *write_end_chunk; |
123 | static size_t last_chunksize IDATA_ATTR; | 123 | static size_t last_chunksize; |
124 | 124 | ||
125 | static size_t pcmbuf_unplayed_bytes IDATA_ATTR; | 125 | static size_t pcmbuf_unplayed_bytes; |
126 | static size_t pcmbuf_watermark IDATA_ATTR; | 126 | static size_t pcmbuf_watermark; |
127 | 127 | ||
128 | static bool low_latency_mode = false; | 128 | static bool low_latency_mode = false; |
129 | static bool flush_pcmbuf = false; | 129 | static 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. */ |
638 | static void pcmbuf_pcm_callback(unsigned char** start, size_t* size) ICODE_ATTR; | ||
639 | static void pcmbuf_pcm_callback(unsigned char** start, size_t* size) | 638 | static 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() */ |
221 | static void ICODE_ATTR mixer_buffer_callback(void) | 221 | static void MIXER_CALLBACK_ICODE mixer_buffer_callback(void) |
222 | { | 222 | { |
223 | downmix_index ^= 1; /* Next buffer */ | 223 | downmix_index ^= 1; /* Next buffer */ |
224 | 224 | ||