forked from len0rd/rockbox
rbcodec dsp: Remove INIT_ATTR from the DSP library
All of these are technically unsafe cross-section references but most aren't reported by the linker, probably due to inlining. In practice there was no problem because the affected code was only run at init time anyway. For now, remove INIT_ATTR until the init code can be refactored to avoid the problematic references. This should also save code size by moving more code to the init section. dsp_init() gets to keep its attribute because it's already OK. Change-Id: Idc9ac0e02cb07f31d186686e0382275c02a85dbb
This commit is contained in:
parent
b650e774a1
commit
8165a6c245
8 changed files with 15 additions and 20 deletions
|
@ -505,7 +505,7 @@ enum dsp_ids dsp_get_id(const struct dsp_config *dsp)
|
|||
|
||||
/* Do what needs initializing before enable/disable calls can be made.
|
||||
* Must be done before changing settings for the first time. */
|
||||
void INIT_ATTR dsp_init(void)
|
||||
void dsp_init(void)
|
||||
{
|
||||
static const uint8_t slot_count[DSP_COUNT] INITDATA_ATTR =
|
||||
{
|
||||
|
|
|
@ -144,6 +144,6 @@ intptr_t dsp_configure(struct dsp_config *dsp, unsigned int setting,
|
|||
intptr_t value);
|
||||
|
||||
/* One-time startup init that must come before settings reset/apply */
|
||||
void dsp_init(void);
|
||||
void dsp_init(void) INIT_ATTR;
|
||||
|
||||
#endif /* _DSP_H */
|
||||
|
|
|
@ -149,8 +149,7 @@ unsigned int dsp_get_output_frequency(struct dsp_config *dsp)
|
|||
return dsp_configure(dsp, DSP_GET_OUT_FREQUENCY, 0);
|
||||
}
|
||||
|
||||
static void INIT_ATTR misc_dsp_init(struct dsp_config *dsp,
|
||||
enum dsp_ids dsp_id)
|
||||
static void misc_dsp_init(struct dsp_config *dsp, enum dsp_ids dsp_id)
|
||||
{
|
||||
/* Enable us for the audio DSP at startup */
|
||||
if (dsp_id == CODEC_IDX_AUDIO)
|
||||
|
|
|
@ -257,8 +257,8 @@ static void dsp_sample_input_flush(struct sample_io_data *this)
|
|||
this->sample_buf.remcount = 0;
|
||||
}
|
||||
|
||||
static void INIT_ATTR dsp_sample_input_init(struct sample_io_data *this,
|
||||
enum dsp_ids dsp_id)
|
||||
static void dsp_sample_input_init(struct sample_io_data *this,
|
||||
enum dsp_ids dsp_id)
|
||||
{
|
||||
int32_t *lbuf, *rbuf;
|
||||
|
||||
|
@ -283,8 +283,8 @@ static void INIT_ATTR dsp_sample_input_init(struct sample_io_data *this,
|
|||
this->sample_buf_p[1] = rbuf;
|
||||
}
|
||||
|
||||
static void INIT_ATTR dsp_sample_io_init(struct sample_io_data *this,
|
||||
enum dsp_ids dsp_id)
|
||||
static void dsp_sample_io_init(struct sample_io_data *this,
|
||||
enum dsp_ids dsp_id)
|
||||
{
|
||||
this->output_sampr = DSP_OUT_DEFAULT_HZ;
|
||||
dsp_sample_input_init(this, dsp_id);
|
||||
|
|
|
@ -181,7 +181,7 @@ void dsp_sample_output_format_change(struct sample_io_data *this,
|
|||
this->output_version = format->version;
|
||||
}
|
||||
|
||||
void INIT_ATTR dsp_sample_output_init(struct sample_io_data *this)
|
||||
void dsp_sample_output_init(struct sample_io_data *this)
|
||||
{
|
||||
this->output_version = 0;
|
||||
this->output_samples = sample_output_stereo;
|
||||
|
|
|
@ -262,8 +262,8 @@ static intptr_t resample_new_format(struct dsp_proc_entry *this,
|
|||
return PROC_NEW_FORMAT_DEACTIVATED;
|
||||
}
|
||||
|
||||
static void INIT_ATTR resample_dsp_init(struct dsp_config *dsp,
|
||||
enum dsp_ids dsp_id)
|
||||
static void resample_dsp_init(struct dsp_config *dsp,
|
||||
enum dsp_ids dsp_id)
|
||||
{
|
||||
int32_t *lbuf, *rbuf;
|
||||
|
||||
|
@ -291,8 +291,8 @@ static void INIT_ATTR resample_dsp_init(struct dsp_config *dsp,
|
|||
resample_data[dsp_id].resample_out_p[1] = rbuf;
|
||||
}
|
||||
|
||||
static void INIT_ATTR resample_proc_init(struct dsp_proc_entry *this,
|
||||
struct dsp_config *dsp)
|
||||
static void resample_proc_init(struct dsp_proc_entry *this,
|
||||
struct dsp_config *dsp)
|
||||
{
|
||||
struct resample_data *data = &resample_data[dsp_get_id(dsp)];
|
||||
this->data = (intptr_t)data;
|
||||
|
|
|
@ -521,8 +521,8 @@ static intptr_t tdspeed_new_format(struct dsp_proc_entry *this,
|
|||
(void)this;
|
||||
}
|
||||
|
||||
static void INIT_ATTR tdspeed_dsp_init(struct tdspeed_state_s *st,
|
||||
enum dsp_ids dsp_id)
|
||||
static void tdspeed_dsp_init(struct tdspeed_state_s *st,
|
||||
enum dsp_ids dsp_id)
|
||||
{
|
||||
/* everything is at 100% until dsp_set_timestretch is called with
|
||||
some other value and timestretch is enabled at the time */
|
||||
|
|
|
@ -107,11 +107,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
|
|||
#ifndef IDATA_ATTR
|
||||
# define IDATA_ATTR
|
||||
#endif
|
||||
/*
|
||||
#ifndef INIT_ATTR
|
||||
# define INIT_ATTR
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef MEM_ALIGN_ATTR
|
||||
# define MEM_ALIGN_ATTR
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue