Don't include the .bss and .ibss sections in the binary image for codecs and plugins. Saves quite some disk space (and buffer space in case of codec changes during playback).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8308 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-01-08 22:50:14 +00:00
parent e8b1787296
commit 07c4254135
13 changed files with 70 additions and 24 deletions

View file

@ -117,6 +117,8 @@ void a52_decode_data(uint8_t *start, uint8_t *end)
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
/* this is the codec entry point */ /* this is the codec entry point */
@ -132,6 +134,7 @@ enum codec_status codec_start(struct codec_api *api)
#ifdef USE_IRAM #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend - iramstart); ci->memcpy(iramstart, iramcopy, iramend - iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_DSP_ENABLE, (bool *)true); ci->configure(CODEC_DSP_ENABLE, (bool *)true);

View file

@ -21,10 +21,12 @@
#include "libm4a/m4a.h" #include "libm4a/m4a.h"
#include "libalac/decomp.h" #include "libalac/decomp.h"
#ifndef SIMULATOR #ifdef USE_IRAM
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE] IBSS_ATTR; int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE] IBSS_ATTR;
@ -53,8 +55,9 @@ enum codec_status codec_start(struct codec_api* api)
rb = api; rb = api;
ci = (struct codec_api*)api; ci = (struct codec_api*)api;
#ifndef SIMULATOR #ifdef USE_IRAM
rb->memcpy(iramstart, iramcopy, iramend-iramstart); rb->memcpy(iramstart, iramcopy, iramend-iramstart);
rb->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512));

View file

@ -20,10 +20,12 @@
#include "codeclib.h" #include "codeclib.h"
#include <codecs/libffmpegFLAC/decoder.h> #include <codecs/libffmpegFLAC/decoder.h>
#ifndef SIMULATOR #ifdef USE_IRAM
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
struct codec_api* rb; struct codec_api* rb;
@ -229,8 +231,9 @@ enum codec_status codec_start(struct codec_api* api)
rb = api; rb = api;
ci = (struct codec_api*)api; ci = (struct codec_api*)api;
#ifndef SIMULATOR #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend-iramstart); ci->memcpy(iramstart, iramcopy, iramend-iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512));

View file

@ -43,6 +43,8 @@ int mpeg_latency[3] = { 0, 481, 529 };
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
struct codec_api *ci; struct codec_api *ci;
@ -83,6 +85,7 @@ enum codec_status codec_start(struct codec_api *api)
#ifdef USE_IRAM #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend - iramstart); ci->memcpy(iramstart, iramcopy, iramend - iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
if (codec_init(api)) if (codec_init(api))

View file

@ -68,6 +68,8 @@ MPC_SAMPLE_FORMAT sample_buffer[MPC_FRAME_LENGTH*2] IBSS_ATTR;
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
/* this is the codec entry point */ /* this is the codec entry point */
@ -83,6 +85,7 @@ enum codec_status codec_start(struct codec_api *api)
TEST_CODEC_API(api); TEST_CODEC_API(api);
#ifdef USE_IRAM #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend - iramstart); ci->memcpy(iramstart, iramcopy, iramend - iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_DSP_ENABLE, (bool *)true); ci->configure(CODEC_DSP_ENABLE, (bool *)true);

View file

@ -20,10 +20,12 @@
#include "codeclib.h" #include "codeclib.h"
#include <codecs/libffmpegFLAC/shndec.h> #include <codecs/libffmpegFLAC/shndec.h>
#ifndef SIMULATOR #ifdef USE_IRAM
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
struct codec_api* rb; struct codec_api* rb;
@ -52,8 +54,9 @@ enum codec_status codec_start(struct codec_api* api)
rb = api; rb = api;
ci = (struct codec_api*)api; ci = (struct codec_api*)api;
#ifndef SIMULATOR #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend-iramstart); ci->memcpy(iramstart, iramcopy, iramend-iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512));

View file

@ -101,6 +101,8 @@ bool vorbis_set_codec_parameters(OggVorbis_File *vf)
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
/* this is the codec entry point */ /* this is the codec entry point */
@ -125,6 +127,7 @@ enum codec_status codec_start(struct codec_api *api)
#ifdef USE_IRAM #ifdef USE_IRAM
rb->memcpy(iramstart, iramcopy, iramend - iramstart); rb->memcpy(iramstart, iramcopy, iramend - iramstart);
rb->memset(iedata, 0, iend - iedata);
#endif #endif
rb->configure(CODEC_DSP_ENABLE, (bool *)true); rb->configure(CODEC_DSP_ENABLE, (bool *)true);

View file

@ -94,6 +94,8 @@ enum
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
/* Those are lookup tables, so they should be in the idata section /* Those are lookup tables, so they should be in the idata section
@ -235,6 +237,7 @@ enum codec_status codec_start(struct codec_api* api)
#ifdef USE_IRAM #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend-iramstart); ci->memcpy(iramstart, iramcopy, iramend-iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512));

View file

@ -40,6 +40,8 @@ static long read_callback (void *buffer, long bytes)
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
/* this is the codec entry point */ /* this is the codec entry point */
@ -56,6 +58,7 @@ enum codec_status codec_start(struct codec_api* api)
#ifdef USE_IRAM #ifdef USE_IRAM
ci->memcpy(iramstart, iramcopy, iramend-iramstart); ci->memcpy(iramstart, iramcopy, iramend-iramstart);
ci->memset(iedata, 0, iend - iedata);
#endif #endif
ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512));

View file

@ -60,7 +60,8 @@ MEMORY
SECTIONS SECTIONS
{ {
.text : { .text :
{
KEEP(*(.entry)) KEEP(*(.entry))
*(.text*) *(.text*)
#if CONFIG_CPU==PP5020 #if CONFIG_CPU==PP5020
@ -69,26 +70,25 @@ SECTIONS
#endif #endif
} > PLUGIN_RAM } > PLUGIN_RAM
.data : { .rodata :
*(.data*) {
} > PLUGIN_RAM
/DISCARD/ : {
*(.eh_frame)
}
.bss : {
*(.bss*)
} > PLUGIN_RAM
.rodata : {
*(.rodata*) *(.rodata*)
. = ALIGN(0x4); . = ALIGN(0x4);
} > PLUGIN_RAM
.data :
{
*(.data*)
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) #if defined(ARCH_IRIVER) || defined(ARCH_IPOD)
iramcopy = .; iramcopy = .;
#endif #endif
} > PLUGIN_RAM } > PLUGIN_RAM
/DISCARD/ :
{
*(.eh_frame)
}
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) #if defined(ARCH_IRIVER) || defined(ARCH_IPOD)
.iram IRAMORIG : AT ( iramcopy) .iram IRAMORIG : AT ( iramcopy)
{ {
@ -96,13 +96,29 @@ SECTIONS
*(.icode) *(.icode)
*(.irodata) *(.irodata)
*(.idata) *(.idata)
*(.ibss)
iramend = .; iramend = .;
} > PLUGIN_IRAM } > PLUGIN_IRAM
.ibss (NOLOAD) :
{
iedata = .;
*(.ibss)
. = ALIGN(0x4);
iend = .;
} > PLUGIN_IRAM
.bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
#else
.bss :
#endif #endif
{
*(.bss*)
} > PLUGIN_RAM
/* Special trick to avoid a linker error when no other sections are /* Special trick to avoid a linker error when no other sections are
left after garbage collection (plugin not for this platform) */ left after garbage collection (plugin not for this platform) */
.comment 0 : { .comment 0 :
{
KEEP(*(.comment)) KEEP(*(.comment))
} }
} }

View file

@ -17,7 +17,7 @@
#endif #endif
struct cpu cpu IDATA_ATTR; struct cpu cpu IBSS_ATTR;

View file

@ -15,7 +15,7 @@
struct lcd lcd; struct lcd lcd;
struct scan scan IDATA_ATTR; struct scan scan IBSS_ATTR;
#define BG (scan.bg) #define BG (scan.bg)
#define WND (scan.wnd) #define WND (scan.wnd)

View file

@ -42,6 +42,8 @@ const struct {
extern char iramcopy[]; extern char iramcopy[];
extern char iramstart[]; extern char iramstart[];
extern char iramend[]; extern char iramend[];
extern char iedata[];
extern char iend[];
#endif #endif
/* here is a global api struct pointer. while not strictly necessary, /* here is a global api struct pointer. while not strictly necessary,
@ -116,6 +118,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
#ifdef USE_IRAM #ifdef USE_IRAM
memcpy(iramstart, iramcopy, iramend-iramstart); memcpy(iramstart, iramcopy, iramend-iramstart);
memset(iedata, 0, iend - iedata);
#endif #endif
shut=0; shut=0;
cleanshut=0; cleanshut=0;