summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/ata.c12
-rw-r--r--firmware/export/config.h10
-rw-r--r--firmware/target/arm/pp/ata-pp5020.c2
-rw-r--r--lib/rbcodec/codecs/aiff_enc.c12
-rw-r--r--lib/rbcodec/codecs/mod.c22
-rw-r--r--lib/rbcodec/codecs/mp3_enc.c8
-rw-r--r--lib/rbcodec/codecs/wav_enc.c8
-rw-r--r--lib/rbcodec/codecs/wavpack_enc.c8
-rw-r--r--lib/rbcodec/platform.h6
9 files changed, 37 insertions, 51 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index f567a4bb8a..8dfc8d965d 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -205,7 +205,7 @@ static int set_multiple_mode(int sectors);
205static int set_features(void); 205static int set_features(void);
206 206
207#ifndef ATA_TARGET_POLLING 207#ifndef ATA_TARGET_POLLING
208STATICIRAM ICODE_ATTR int wait_for_bsy(void) 208static ICODE_ATTR int wait_for_bsy(void)
209{ 209{
210 long timeout = current_tick + HZ*30; 210 long timeout = current_tick + HZ*30;
211 211
@@ -220,7 +220,7 @@ STATICIRAM ICODE_ATTR int wait_for_bsy(void)
220 return 0; /* timeout */ 220 return 0; /* timeout */
221} 221}
222 222
223STATICIRAM ICODE_ATTR int wait_for_rdy(void) 223static ICODE_ATTR int wait_for_rdy(void)
224{ 224{
225 long timeout; 225 long timeout;
226 226
@@ -244,7 +244,7 @@ STATICIRAM ICODE_ATTR int wait_for_rdy(void)
244#define wait_for_rdy ata_wait_for_rdy 244#define wait_for_rdy ata_wait_for_rdy
245#endif 245#endif
246 246
247STATICIRAM ICODE_ATTR int wait_for_start_of_transfer(void) 247static ICODE_ATTR int wait_for_start_of_transfer(void)
248{ 248{
249 if (!wait_for_bsy()) 249 if (!wait_for_bsy())
250 return 0; 250 return 0;
@@ -252,7 +252,7 @@ STATICIRAM ICODE_ATTR int wait_for_start_of_transfer(void)
252 return (ATA_IN8(ATA_ALT_STATUS) & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ; 252 return (ATA_IN8(ATA_ALT_STATUS) & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ;
253} 253}
254 254
255STATICIRAM ICODE_ATTR int wait_for_end_of_transfer(void) 255static ICODE_ATTR int wait_for_end_of_transfer(void)
256{ 256{
257 if (!wait_for_bsy()) 257 if (!wait_for_bsy())
258 return 0; 258 return 0;
@@ -275,7 +275,7 @@ static void ata_led(bool on)
275#endif 275#endif
276 276
277#ifndef ATA_OPTIMIZED_READING 277#ifndef ATA_OPTIMIZED_READING
278STATICIRAM ICODE_ATTR void copy_read_sectors(unsigned char* buf, int wordcount) 278static ICODE_ATTR void copy_read_sectors(unsigned char* buf, int wordcount)
279{ 279{
280 unsigned short tmp = 0; 280 unsigned short tmp = 0;
281 281
@@ -307,7 +307,7 @@ STATICIRAM ICODE_ATTR void copy_read_sectors(unsigned char* buf, int wordcount)
307#endif /* !ATA_OPTIMIZED_READING */ 307#endif /* !ATA_OPTIMIZED_READING */
308 308
309#ifndef ATA_OPTIMIZED_WRITING 309#ifndef ATA_OPTIMIZED_WRITING
310STATICIRAM ICODE_ATTR void copy_write_sectors(const unsigned char* buf, 310static ICODE_ATTR void copy_write_sectors(const unsigned char* buf,
311 int wordcount) 311 int wordcount)
312{ 312{
313 if ( (unsigned long)buf & 1) 313 if ( (unsigned long)buf & 1)
diff --git a/firmware/export/config.h b/firmware/export/config.h
index d85cf1e784..b642775b95 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -912,21 +912,11 @@ Lyre prototype 1 */
912 && CONFIG_CPU != JZ4732 && CONFIG_CPU != AS3525v2 && CONFIG_CPU != IMX233 912 && CONFIG_CPU != JZ4732 && CONFIG_CPU != AS3525v2 && CONFIG_CPU != IMX233
913#define PLUGIN_USE_IRAM 913#define PLUGIN_USE_IRAM
914#endif 914#endif
915#if defined(CPU_ARM) && !defined(__ARM_EABI__)
916/* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
917 * when not compiling with -ffunction-sections, even when the function has
918 * a section attribute.
919 * This is fixed with eabi since all calls are short ones by default */
920#define STATICIRAM
921#else
922#define STATICIRAM static
923#endif
924#else 915#else
925#define ICODE_ATTR 916#define ICODE_ATTR
926#define ICONST_ATTR 917#define ICONST_ATTR
927#define IDATA_ATTR 918#define IDATA_ATTR
928#define IBSS_ATTR 919#define IBSS_ATTR
929#define STATICIRAM static
930#endif 920#endif
931 921
932#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \ 922#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
diff --git a/firmware/target/arm/pp/ata-pp5020.c b/firmware/target/arm/pp/ata-pp5020.c
index 50a38cb23d..1fc302a60d 100644
--- a/firmware/target/arm/pp/ata-pp5020.c
+++ b/firmware/target/arm/pp/ata-pp5020.c
@@ -133,7 +133,7 @@ void ata_dma_set_mode(unsigned char mode) {
133/* This waits for an ATA interrupt using polling. 133/* This waits for an ATA interrupt using polling.
134 In ATA_CONTROL, CONTROL_nIEN must be cleared. 134 In ATA_CONTROL, CONTROL_nIEN must be cleared.
135 */ 135 */
136STATICIRAM ICODE_ATTR int ata_wait_intrq(void) 136static ICODE_ATTR int ata_wait_intrq(void)
137{ 137{
138 long timeout = current_tick + HZ*10; 138 long timeout = current_tick + HZ*10;
139 139
diff --git a/lib/rbcodec/codecs/aiff_enc.c b/lib/rbcodec/codecs/aiff_enc.c
index fc44196eb0..8e9246d2bb 100644
--- a/lib/rbcodec/codecs/aiff_enc.c
+++ b/lib/rbcodec/codecs/aiff_enc.c
@@ -76,9 +76,9 @@ static uint32_t enc_size;
76static int32_t err IBSS_ATTR; 76static int32_t err IBSS_ATTR;
77 77
78/* convert unsigned 32 bit value to 80-bit floating point number */ 78/* convert unsigned 32 bit value to 80-bit floating point number */
79STATICIRAM void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l) 79static void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l)
80 ICODE_ATTR; 80 ICODE_ATTR;
81STATICIRAM void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l) 81static void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l)
82{ 82{
83 int32_t exp; 83 int32_t exp;
84 84
@@ -196,9 +196,9 @@ static bool on_end_file(struct enc_file_event_data *data)
196 return true; 196 return true;
197} /* on_end_file */ 197} /* on_end_file */
198 198
199STATICIRAM void enc_events_callback(enum enc_events event, void *data) 199static void enc_events_callback(enum enc_events event, void *data)
200 ICODE_ATTR; 200 ICODE_ATTR;
201STATICIRAM void enc_events_callback(enum enc_events event, void *data) 201static void enc_events_callback(enum enc_events event, void *data)
202{ 202{
203 switch (event) 203 switch (event)
204 { 204 {
@@ -266,8 +266,8 @@ static inline void sample_to_mono(uint32_t **src, uint32_t **dst)
266 *(*dst)++ = htobe32((lr1 << 16) | (uint16_t)lr2); 266 *(*dst)++ = htobe32((lr1 << 16) | (uint16_t)lr2);
267} /* sample_to_mono */ 267} /* sample_to_mono */
268 268
269STATICIRAM void chunk_to_aiff_format(uint32_t *src, uint32_t *dst) ICODE_ATTR; 269static void chunk_to_aiff_format(uint32_t *src, uint32_t *dst) ICODE_ATTR;
270STATICIRAM void chunk_to_aiff_format(uint32_t *src, uint32_t *dst) 270static void chunk_to_aiff_format(uint32_t *src, uint32_t *dst)
271{ 271{
272 if (num_channels == 1) 272 if (num_channels == 1)
273 { 273 {
diff --git a/lib/rbcodec/codecs/mod.c b/lib/rbcodec/codecs/mod.c
index 5bd64994f1..8bb2dc5163 100644
--- a/lib/rbcodec/codecs/mod.c
+++ b/lib/rbcodec/codecs/mod.c
@@ -292,7 +292,7 @@ static signed short s_sintable[0x40] IDATA_ATTR =
292 292
293const unsigned short mixingrate = 44100; 293const unsigned short mixingrate = 44100;
294 294
295STATICIRAM void mixer_playsample(int channel, int instrument) ICODE_ATTR; 295static void mixer_playsample(int channel, int instrument) ICODE_ATTR;
296void mixer_playsample(int channel, int instrument) 296void mixer_playsample(int channel, int instrument)
297{ 297{
298 struct s_channel *p_channel = &mixer.channel[channel]; 298 struct s_channel *p_channel = &mixer.channel[channel];
@@ -347,7 +347,7 @@ static inline void mixer_setamigaperiod(int channel, int amigaperiod)
347} 347}
348 348
349/* Initialize the MOD Player with default values and precalc tables */ 349/* Initialize the MOD Player with default values and precalc tables */
350STATICIRAM void initmodplayer(void) ICODE_ATTR; 350static void initmodplayer(void) ICODE_ATTR;
351void initmodplayer(void) 351void initmodplayer(void)
352{ 352{
353 unsigned int c; 353 unsigned int c;
@@ -432,7 +432,7 @@ void initmodplayer(void)
432} 432}
433 433
434/* Load the MOD File from memory */ 434/* Load the MOD File from memory */
435STATICIRAM bool loadmod(void *modfile) ICODE_ATTR; 435static bool loadmod(void *modfile) ICODE_ATTR;
436bool loadmod(void *modfile) 436bool loadmod(void *modfile)
437{ 437{
438 int i; 438 int i;
@@ -561,7 +561,7 @@ bool loadmod(void *modfile)
561} 561}
562 562
563/* Apply vibrato to channel */ 563/* Apply vibrato to channel */
564STATICIRAM void vibrate(int channel) ICODE_ATTR; 564static void vibrate(int channel) ICODE_ATTR;
565void vibrate(int channel) 565void vibrate(int channel)
566{ 566{
567 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel]; 567 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel];
@@ -579,7 +579,7 @@ void vibrate(int channel)
579 579
580/* Apply tremolo to channel 580/* Apply tremolo to channel
581 * (same as vibrato, but only apply on volume instead of pitch) */ 581 * (same as vibrato, but only apply on volume instead of pitch) */
582STATICIRAM void tremolo(int channel) ICODE_ATTR; 582static void tremolo(int channel) ICODE_ATTR;
583void tremolo(int channel) 583void tremolo(int channel)
584{ 584{
585 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel]; 585 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel];
@@ -598,7 +598,7 @@ void tremolo(int channel)
598} 598}
599 599
600/* Apply Slide to Note effect to channel */ 600/* Apply Slide to Note effect to channel */
601STATICIRAM void slidetonote(int channel) ICODE_ATTR; 601static void slidetonote(int channel) ICODE_ATTR;
602void slidetonote(int channel) 602void slidetonote(int channel)
603{ 603{
604 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel]; 604 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel];
@@ -625,7 +625,7 @@ void slidetonote(int channel)
625 625
626/* Apply Slide to Note effect on channel, 626/* Apply Slide to Note effect on channel,
627 * but this time with glissando enabled */ 627 * but this time with glissando enabled */
628STATICIRAM void slidetonoteglissando(int channel) ICODE_ATTR; 628static void slidetonoteglissando(int channel) ICODE_ATTR;
629void slidetonoteglissando(int channel) 629void slidetonoteglissando(int channel)
630{ 630{
631 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel]; 631 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel];
@@ -650,7 +650,7 @@ void slidetonoteglissando(int channel)
650} 650}
651 651
652/* Apply Volume Slide */ 652/* Apply Volume Slide */
653STATICIRAM void volumeslide(int channel, int effectx, int effecty) ICODE_ATTR; 653static void volumeslide(int channel, int effectx, int effecty) ICODE_ATTR;
654void volumeslide(int channel, int effectx, int effecty) 654void volumeslide(int channel, int effectx, int effecty)
655{ 655{
656 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel]; 656 struct s_modchannel *p_modchannel = &modplayer.modchannel[channel];
@@ -669,7 +669,7 @@ void volumeslide(int channel, int effectx, int effecty)
669} 669}
670 670
671/* Play the current line (at tick 0) */ 671/* Play the current line (at tick 0) */
672STATICIRAM void playline(int pattern, int line) ICODE_ATTR; 672static void playline(int pattern, int line) ICODE_ATTR;
673void playline(int pattern, int line) 673void playline(int pattern, int line)
674{ 674{
675 int c; 675 int c;
@@ -984,7 +984,7 @@ void playline(int pattern, int line)
984} 984}
985 985
986/* Play the current effect of the note (ticks 1..speed) */ 986/* Play the current effect of the note (ticks 1..speed) */
987STATICIRAM void playeffect(int currenttick) ICODE_ATTR; 987static void playeffect(int currenttick) ICODE_ATTR;
988void playeffect(int currenttick) 988void playeffect(int currenttick)
989{ 989{
990 int c; 990 int c;
@@ -1155,7 +1155,7 @@ static inline int clip(int i)
1155 else return(i); 1155 else return(i);
1156} 1156}
1157 1157
1158STATICIRAM void synthrender(int32_t *renderbuffer, int samplecount) ICODE_ATTR; 1158static void synthrender(int32_t *renderbuffer, int samplecount) ICODE_ATTR;
1159void synthrender(int32_t *renderbuffer, int samplecount) 1159void synthrender(int32_t *renderbuffer, int samplecount)
1160{ 1160{
1161 /* 125bpm equals to 50Hz (= 0.02s) 1161 /* 125bpm equals to 50Hz (= 0.02s)
diff --git a/lib/rbcodec/codecs/mp3_enc.c b/lib/rbcodec/codecs/mp3_enc.c
index f765e6bba6..e66ee1d910 100644
--- a/lib/rbcodec/codecs/mp3_enc.c
+++ b/lib/rbcodec/codecs/mp3_enc.c
@@ -2110,8 +2110,8 @@ static inline void to_mono(uint16_t **samp)
2110 *(*samp)++ = (uint16_t)m; 2110 *(*samp)++ = (uint16_t)m;
2111} /* to_mono */ 2111} /* to_mono */
2112 2112
2113STATICIRAM void to_mono_mm(void) ICODE_ATTR; 2113static void to_mono_mm(void) ICODE_ATTR;
2114STATICIRAM void to_mono_mm(void) 2114static void to_mono_mm(void)
2115{ 2115{
2116 /* |llllllllllllllll|rrrrrrrrrrrrrrrr| => 2116 /* |llllllllllllllll|rrrrrrrrrrrrrrrr| =>
2117 * |mmmmmmmmmmmmmmmm|mmmmmmmmmmmmmmmm| 2117 * |mmmmmmmmmmmmmmmm|mmmmmmmmmmmmmmmm|
@@ -2188,9 +2188,9 @@ static void set_scale_facs(int *mdct_freq)
2188 } 2188 }
2189} 2189}
2190 2190
2191STATICIRAM void encode_frame(char *buffer, struct enc_chunk_hdr *chunk) 2191static void encode_frame(char *buffer, struct enc_chunk_hdr *chunk)
2192 ICODE_ATTR; 2192 ICODE_ATTR;
2193STATICIRAM void encode_frame(char *buffer, struct enc_chunk_hdr *chunk) 2193static void encode_frame(char *buffer, struct enc_chunk_hdr *chunk)
2194{ 2194{
2195 int gr, gr_cnt; 2195 int gr, gr_cnt;
2196 uint32_t max; 2196 uint32_t max;
diff --git a/lib/rbcodec/codecs/wav_enc.c b/lib/rbcodec/codecs/wav_enc.c
index e4afeaf93c..85b6f560e3 100644
--- a/lib/rbcodec/codecs/wav_enc.c
+++ b/lib/rbcodec/codecs/wav_enc.c
@@ -182,9 +182,9 @@ static bool on_end_file(struct enc_file_event_data *data)
182 return true; 182 return true;
183} /* on_end_file */ 183} /* on_end_file */
184 184
185STATICIRAM void enc_events_callback(enum enc_events event, void *data) 185static void enc_events_callback(enum enc_events event, void *data)
186 ICODE_ATTR; 186 ICODE_ATTR;
187STATICIRAM void enc_events_callback(enum enc_events event, void *data) 187static void enc_events_callback(enum enc_events event, void *data)
188{ 188{
189 switch (event) 189 switch (event)
190 { 190 {
@@ -252,8 +252,8 @@ static inline void sample_to_mono(uint32_t **src, uint32_t **dst)
252 *(*dst)++ = htole32((lr2 << 16) | (uint16_t)lr1); 252 *(*dst)++ = htole32((lr2 << 16) | (uint16_t)lr1);
253} /* sample_to_mono */ 253} /* sample_to_mono */
254 254
255STATICIRAM void chunk_to_wav_format(uint32_t *src, uint32_t *dst) ICODE_ATTR; 255static void chunk_to_wav_format(uint32_t *src, uint32_t *dst) ICODE_ATTR;
256STATICIRAM void chunk_to_wav_format(uint32_t *src, uint32_t *dst) 256static void chunk_to_wav_format(uint32_t *src, uint32_t *dst)
257{ 257{
258 if (num_channels == 1) 258 if (num_channels == 1)
259 { 259 {
diff --git a/lib/rbcodec/codecs/wavpack_enc.c b/lib/rbcodec/codecs/wavpack_enc.c
index 730cf0734b..71454fff7d 100644
--- a/lib/rbcodec/codecs/wavpack_enc.c
+++ b/lib/rbcodec/codecs/wavpack_enc.c
@@ -118,8 +118,8 @@ static inline void sample_to_int32_stereo(int32_t **src, int32_t **dst)
118#endif 118#endif
119} /* sample_to_int32_stereo */ 119} /* sample_to_int32_stereo */
120 120
121STATICIRAM void chunk_to_int32(int32_t *src) ICODE_ATTR; 121static void chunk_to_int32(int32_t *src) ICODE_ATTR;
122STATICIRAM void chunk_to_int32(int32_t *src) 122static void chunk_to_int32(int32_t *src)
123{ 123{
124 int32_t *src_end, *dst; 124 int32_t *src_end, *dst;
125#ifdef USE_IRAM 125#ifdef USE_IRAM
@@ -307,9 +307,9 @@ static bool on_end_file(struct enc_file_event_data *data)
307 return true; 307 return true;
308} /* on_end_file */ 308} /* on_end_file */
309 309
310STATICIRAM void enc_events_callback(enum enc_events event, void *data) 310static void enc_events_callback(enum enc_events event, void *data)
311 ICODE_ATTR; 311 ICODE_ATTR;
312STATICIRAM void enc_events_callback(enum enc_events event, void *data) 312static void enc_events_callback(enum enc_events event, void *data)
313{ 313{
314 switch (event) 314 switch (event)
315 { 315 {
diff --git a/lib/rbcodec/platform.h b/lib/rbcodec/platform.h
index 47df8fe6a2..fe79358b21 100644
--- a/lib/rbcodec/platform.h
+++ b/lib/rbcodec/platform.h
@@ -101,11 +101,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
101#ifndef MEM_ALIGN_ATTR 101#ifndef MEM_ALIGN_ATTR
102# define MEM_ALIGN_ATTR 102# define MEM_ALIGN_ATTR
103#endif 103#endif
104/* 104
105#ifndef STATICIRAM
106# define STATICIRAM
107#endif
108*/
109#ifndef CACHEALIGN_SIZE 105#ifndef CACHEALIGN_SIZE
110# define CACHEALIGN_SIZE 1 106# define CACHEALIGN_SIZE 1
111#endif 107#endif