diff options
| author | Dave Chapman <dave@dchapman.com> | 2009-10-04 08:49:23 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2009-10-04 08:49:23 +0000 |
| commit | 9546e4093d8a6f9b27c06db242894c3dc9d9f574 (patch) | |
| tree | 5d7571051b6d08993448ba3493c0bd678998f1fe /apps/codecs | |
| parent | ccec5cfe79025b4f203619a0d8b4083445e6063c (diff) | |
| download | rockbox-9546e4093d8a6f9b27c06db242894c3dc9d9f574.zip rockbox-9546e4093d8a6f9b27c06db242894c3dc9d9f574.tar.gz rockbox-9546e4093d8a6f9b27c06db242894c3dc9d9f574.tar.bz2 rockbox-9546e4093d8a6f9b27c06db242894c3dc9d9f574.tar.xz | |
Add STATICIRAM_NOT_MDCT as a workaround for the gcc bug where static functions are not long called. This is currently only an issue on the Nano2G (S5L8701 CPU) which is the only ARM target with enough IRAM for these functions. Also add multiple-inclusion protection for config-tremor.h. All plugins and codecs now compile cleanly for the Nano2G.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22914 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
| -rw-r--r-- | apps/codecs/libtremor/config-tremor.h | 14 | ||||
| -rw-r--r-- | apps/codecs/libtremor/framing.c | 17 | ||||
| -rw-r--r-- | apps/codecs/libtremor/vorbisfile.c | 4 |
3 files changed, 27 insertions, 8 deletions
diff --git a/apps/codecs/libtremor/config-tremor.h b/apps/codecs/libtremor/config-tremor.h index d360b5f..403fdfd 100644 --- a/apps/codecs/libtremor/config-tremor.h +++ b/apps/codecs/libtremor/config-tremor.h @@ -1,4 +1,8 @@ +#ifndef _CONFIG_TREMOR_H +#define _CONFIG_TREMOR_H + #include "codeclib.h" + #ifdef CPU_ARM #define _ARM_ASSEM_ #endif @@ -17,6 +21,14 @@ #define ICODE_ATTR_TREMOR_MDCT ICODE_ATTR #endif +/* Workaround for gcc bug where all static functions are called with short + calls */ +#if !defined(ICODE_ATTR_TREMOR_NOT_MDCT) && (CONFIG_CPU==S5L8701) +#define STATICIRAM_NOT_MDCT +#else +#define STATICIRAM_NOT_MDCT static +#endif + #ifndef ICODE_ATTR_TREMOR_NOT_MDCT #define ICODE_ATTR_TREMOR_NOT_MDCT ICODE_ATTR #endif @@ -47,3 +59,5 @@ #define CHANNELS 2 // #define _LOW_ACCURACY_ + +#endif /* _CONFIG_TREMOR_H */ diff --git a/apps/codecs/libtremor/framing.c b/apps/codecs/libtremor/framing.c index fb26b02..ec1e4c3 100644 --- a/apps/codecs/libtremor/framing.c +++ b/apps/codecs/libtremor/framing.c @@ -104,9 +104,9 @@ static ogg_buffer *_fetch_buffer(ogg_buffer_state *bs,long bytes){ return ob; } -static ogg_reference *_fetch_ref(ogg_buffer_state *bs) +STATICIRAM_NOT_MDCT ogg_reference *_fetch_ref(ogg_buffer_state *bs) ICODE_ATTR_TREMOR_NOT_MDCT; -static ogg_reference *_fetch_ref(ogg_buffer_state *bs){ +STATICIRAM_NOT_MDCT ogg_reference *_fetch_ref(ogg_buffer_state *bs){ ogg_reference *or; bs->outstanding++; @@ -789,8 +789,9 @@ static void _next_lace(oggbyte_buffer *ob,ogg_stream_state *os){ } } -static void _span_queued_page(ogg_stream_state *os) ICODE_ATTR_TREMOR_NOT_MDCT; -static void _span_queued_page(ogg_stream_state *os){ +STATICIRAM_NOT_MDCT void _span_queued_page(ogg_stream_state *os) + ICODE_ATTR_TREMOR_NOT_MDCT; +STATICIRAM_NOT_MDCT void _span_queued_page(ogg_stream_state *os){ while( !(os->body_fill&FINFLAG) ){ if(!os->header_tail)break; @@ -948,9 +949,9 @@ int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno){ return OGG_SUCCESS; } -static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv) +STATICIRAM_NOT_MDCT int _packetout(ogg_stream_state *os,ogg_packet *op,int adv) ICODE_ATTR_TREMOR_NOT_MDCT; -static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){ +STATICIRAM_NOT_MDCT int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){ ogg_packet_release(op); _span_queued_page(os); @@ -1028,10 +1029,14 @@ static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){ return 1; } +int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op) + ICODE_ATTR_TREMOR_NOT_MDCT; int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op){ return _packetout(os,op,1); } +int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op) + ICODE_ATTR_TREMOR_NOT_MDCT; int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op){ return _packetout(os,op,0); } diff --git a/apps/codecs/libtremor/vorbisfile.c b/apps/codecs/libtremor/vorbisfile.c index 8c81c63..1e03366 100644 --- a/apps/codecs/libtremor/vorbisfile.c +++ b/apps/codecs/libtremor/vorbisfile.c @@ -684,10 +684,10 @@ static void _decode_clear(OggVorbis_File *vf){ 1) got a packet */ -static int _fetch_and_process_packet(OggVorbis_File *vf, +STATICIRAM_NOT_MDCT int _fetch_and_process_packet(OggVorbis_File *vf, int readp, int spanp) ICODE_ATTR_TREMOR_NOT_MDCT; -static int _fetch_and_process_packet(OggVorbis_File *vf, +STATICIRAM_NOT_MDCT int _fetch_and_process_packet(OggVorbis_File *vf, int readp, int spanp){ ogg_page og={0,0,0,0}; |