summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/aiff_enc.c14
-rw-r--r--apps/codecs/mp3_enc.c14
-rw-r--r--apps/codecs/wav_enc.c9
-rw-r--r--apps/codecs/wavpack_enc.c9
-rw-r--r--firmware/drivers/ata.c25
-rw-r--r--firmware/export/config.h9
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/ata-e200.c12
-rwxr-xr-xtools/configure4
8 files changed, 56 insertions, 40 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c
index 5f993084c7..02d159e52f 100644
--- a/apps/codecs/aiff_enc.c
+++ b/apps/codecs/aiff_enc.c
@@ -75,8 +75,9 @@ static uint32_t enc_size;
static int32_t err IBSS_ATTR;
/* convert unsigned 32 bit value to 80-bit floating point number */
-static void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l) ICODE_ATTR;
-static void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l)
+STATICIRAM void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l)
+ ICODE_ATTR;
+STATICIRAM void uint32_h_to_ieee754_extended_be(uint8_t f[10], uint32_t l)
{
int32_t exp;
@@ -192,8 +193,9 @@ static bool on_end_file(struct enc_file_event_data *data)
return true;
} /* on_end_file */
-static void enc_events_callback(enum enc_events event, void *data) ICODE_ATTR;
-static void enc_events_callback(enum enc_events event, void *data)
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
+ ICODE_ATTR;
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
{
if (event == ENC_WRITE_CHUNK)
{
@@ -219,8 +221,8 @@ static void enc_events_callback(enum enc_events event, void *data)
} /* enc_events_callback */
/* convert native pcm samples to aiff format samples */
-static void chunk_to_aiff_format(uint32_t *src, uint32_t *dst) ICODE_ATTR;
-static void chunk_to_aiff_format(uint32_t *src, uint32_t *dst)
+STATICIRAM void chunk_to_aiff_format(uint32_t *src, uint32_t *dst) ICODE_ATTR;
+STATICIRAM void chunk_to_aiff_format(uint32_t *src, uint32_t *dst)
{
if (num_channels == 1)
{
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index 70b327aef2..81ea47e56b 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2044,8 +2044,8 @@ bool init_mp3_encoder_engine(int sample_rate,
return true;
}
-static void to_mono_mm(void) ICODE_ATTR;
-static void to_mono_mm(void)
+STATICIRAM void to_mono_mm(void) ICODE_ATTR;
+STATICIRAM void to_mono_mm(void)
{
/* |llllllllllllllll|rrrrrrrrrrrrrrrr| =>
* |mmmmmmmmmmmmmmmm|mmmmmmmmmmmmmmmm|
@@ -2100,8 +2100,9 @@ static inline void byte_swap_frame32(uint32_t *dst, uint32_t *src,
} /* byte_swap_frame32 */
#endif /* ROCKBOX_LITTLE_ENDIAN */
-static void encode_frame(char *buffer, struct enc_chunk_hdr *chunk) ICODE_ATTR;
-static void encode_frame(char *buffer, struct enc_chunk_hdr *chunk)
+STATICIRAM void encode_frame(char *buffer, struct enc_chunk_hdr *chunk)
+ ICODE_ATTR;
+STATICIRAM void encode_frame(char *buffer, struct enc_chunk_hdr *chunk)
{
int gr, gr_cnt;
int max, min;
@@ -2382,8 +2383,9 @@ static void on_rec_new_stream(struct enc_buffer_event_data *data)
}
} /* on_rec_new_stream */
-static void enc_events_callback(enum enc_events event, void *data) ICODE_ATTR;
-static void enc_events_callback(enum enc_events event, void *data)
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
+ ICODE_ATTR;
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
{
if (event == ENC_WRITE_CHUNK)
{
diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c
index dddca3f5c2..622ff3a6d1 100644
--- a/apps/codecs/wav_enc.c
+++ b/apps/codecs/wav_enc.c
@@ -181,8 +181,9 @@ static bool on_end_file(struct enc_file_event_data *data)
return true;
} /* on_end_file */
-static void enc_events_callback(enum enc_events event, void *data) ICODE_ATTR;
-static void enc_events_callback(enum enc_events event, void *data)
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
+ ICODE_ATTR;
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
{
if (event == ENC_WRITE_CHUNK)
{
@@ -208,8 +209,8 @@ static void enc_events_callback(enum enc_events event, void *data)
} /* enc_events_callback */
/* convert native pcm samples to wav format samples */
-static void chunk_to_wav_format(uint32_t *src, uint32_t *dst) ICODE_ATTR;
-static void chunk_to_wav_format(uint32_t *src, uint32_t *dst)
+STATICIRAM void chunk_to_wav_format(uint32_t *src, uint32_t *dst) ICODE_ATTR;
+STATICIRAM void chunk_to_wav_format(uint32_t *src, uint32_t *dst)
{
if (num_channels == 1)
{
diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c
index 71222597e0..547d309159 100644
--- a/apps/codecs/wavpack_enc.c
+++ b/apps/codecs/wavpack_enc.c
@@ -99,8 +99,8 @@ static const struct riff_header riff_header =
/* (*) updated during ENC_END_FILE event */
};
-static void chunk_to_int32(int32_t *src) ICODE_ATTR;
-static void chunk_to_int32(int32_t *src)
+STATICIRAM void chunk_to_int32(int32_t *src) ICODE_ATTR;
+STATICIRAM void chunk_to_int32(int32_t *src)
{
int32_t *src_end, *dst;
#ifdef USE_IRAM
@@ -306,8 +306,9 @@ static bool on_end_file(struct enc_file_event_data *data)
return true;
} /* on_end_file */
-static void enc_events_callback(enum enc_events event, void *data) ICODE_ATTR;
-static void enc_events_callback(enum enc_events event, void *data)
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
+ ICODE_ATTR;
+STATICIRAM void enc_events_callback(enum enc_events event, void *data)
{
if (event == ENC_WRITE_CHUNK)
{
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 349f76c0ec..91aae158c6 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -98,8 +98,8 @@ static int perform_soft_reset(void);
static int set_multiple_mode(int sectors);
static int set_features(void);
-static int wait_for_bsy(void) ICODE_ATTR;
-static int wait_for_bsy(void)
+STATICIRAM int wait_for_bsy(void) ICODE_ATTR;
+STATICIRAM int wait_for_bsy(void)
{
long timeout = current_tick + HZ*30;
while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) {
@@ -113,8 +113,8 @@ static int wait_for_bsy(void)
return 0; /* timeout */
}
-static int wait_for_rdy(void) ICODE_ATTR;
-static int wait_for_rdy(void)
+STATICIRAM int wait_for_rdy(void) ICODE_ATTR;
+STATICIRAM int wait_for_rdy(void)
{
long timeout;
@@ -135,8 +135,8 @@ static int wait_for_rdy(void)
return 0; /* timeout */
}
-static int wait_for_start_of_transfer(void) ICODE_ATTR;
-static int wait_for_start_of_transfer(void)
+STATICIRAM int wait_for_start_of_transfer(void) ICODE_ATTR;
+STATICIRAM int wait_for_start_of_transfer(void)
{
if (!wait_for_bsy())
return 0;
@@ -144,8 +144,8 @@ static int wait_for_start_of_transfer(void)
return (ATA_ALT_STATUS & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ;
}
-static int wait_for_end_of_transfer(void) ICODE_ATTR;
-static int wait_for_end_of_transfer(void)
+STATICIRAM int wait_for_end_of_transfer(void) ICODE_ATTR;
+STATICIRAM int wait_for_end_of_transfer(void)
{
if (!wait_for_bsy())
return 0;
@@ -166,8 +166,8 @@ static void ata_led(bool on)
#endif
#ifndef ATA_OPTIMIZED_READING
-static void copy_read_sectors(unsigned char* buf, int wordcount) ICODE_ATTR;
-static void copy_read_sectors(unsigned char* buf, int wordcount)
+STATICIRAM void copy_read_sectors(unsigned char* buf, int wordcount) ICODE_ATTR;
+STATICIRAM void copy_read_sectors(unsigned char* buf, int wordcount)
{
unsigned short tmp = 0;
@@ -365,8 +365,9 @@ int ata_read_sectors(IF_MV2(int drive,)
}
#ifndef ATA_OPTIMIZED_WRITING
-static void copy_write_sectors(const unsigned char* buf, int wordcount) ICODE_ATTR;
-static void copy_write_sectors(const unsigned char* buf, int wordcount)
+STATICIRAM void copy_write_sectors(const unsigned char* buf, int wordcount)
+ ICODE_ATTR;
+STATICIRAM void copy_write_sectors(const unsigned char* buf, int wordcount)
{
if ( (unsigned long)buf & 1)
{ /* not 16-bit aligned, copy byte by byte */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 5e127b430d..4d7a3aecdf 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -298,11 +298,20 @@
#if CONFIG_CPU != SH7034
#define IRAM_STEAL
#endif
+#if defined(CPU_ARM)
+/* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
+ * when not compiling with -ffunction-sections, even when the function has
+ * a section attribute. */
+#define STATICIRAM
+#else
+#define STATICIRAM static
+#endif
#else
#define ICODE_ATTR
#define ICONST_ATTR
#define IDATA_ATTR
#define IBSS_ATTR
+#define STATICIRAM static
#endif
#ifndef IRAM_LCDFRAMEBUFFER
diff --git a/firmware/target/arm/sandisk/sansa-e200/ata-e200.c b/firmware/target/arm/sandisk/sansa-e200/ata-e200.c
index bfb0d27f97..56f351c001 100644
--- a/firmware/target/arm/sandisk/sansa-e200/ata-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/ata-e200.c
@@ -234,10 +234,10 @@ void sd_wait_for_state(tSDCardInfo* card, unsigned int state)
}
-static void copy_read_sectors(unsigned char* buf, int wordcount)
- NOINLINE_ATTR ICODE_ATTR;
+STATICIRAM void copy_read_sectors(unsigned char* buf, int wordcount)
+ NOINLINE_ATTR ICODE_ATTR;
-static void copy_read_sectors(unsigned char* buf, int wordcount)
+STATICIRAM void copy_read_sectors(unsigned char* buf, int wordcount)
{
unsigned int tmp = 0;
@@ -262,10 +262,10 @@ static void copy_read_sectors(unsigned char* buf, int wordcount)
}
}
-static void copy_write_sectors(const unsigned char* buf, int wordcount)
- NOINLINE_ATTR ICODE_ATTR;
+STATICIRAM void copy_write_sectors(const unsigned char* buf, int wordcount)
+ NOINLINE_ATTR ICODE_ATTR;
-static void copy_write_sectors(const unsigned char* buf, int wordcount)
+STATICIRAM void copy_write_sectors(const unsigned char* buf, int wordcount)
{
unsigned short tmp = 0;
const unsigned char* bufend = buf + wordcount*2;
diff --git a/tools/configure b/tools/configure
index 799ac638f1..77884ef02c 100755
--- a/tools/configure
+++ b/tools/configure
@@ -229,7 +229,7 @@ arm7tdmicc () {
prefixtools arm-elf-
GCCOPTS="$CCOPTS -mcpu=arm7tdmi"
if test "X$1" != "Xshort"; then
- GCCOPTS="$GCCOPTS -ffunction-sections -mlong-calls"
+ GCCOPTS="$GCCOPTS -mlong-calls"
fi
GCCOPTIMIZE="-fomit-frame-pointer"
endian="little"
@@ -237,7 +237,7 @@ arm7tdmicc () {
arm9tdmicc () {
prefixtools arm-elf-
- GCCOPTS="$CCOPTS -mcpu=arm9tdmi -ffunction-sections -mlong-calls"
+ GCCOPTS="$CCOPTS -mcpu=arm9tdmi -mlong-calls"
GCCOPTIMIZE="-fomit-frame-pointer"
endian="little"
}