Skip to content

Commit

Permalink
llext: export symbols, required for eq_fir
Browse files Browse the repository at this point in the history
When built as an llext module, eq_fir requires several base-firmware
provided symbols, export them.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Jun 26, 2024
1 parent 3ce65e6 commit 87cd5ba
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/audio/data_blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void comp_data_blob_set_validator(struct comp_data_blob_handler *blob_handler,

blob_handler->validator = validator;
}
EXPORT_SYMBOL(comp_data_blob_set_validator);

void *comp_get_data_blob(struct comp_data_blob_handler *blob_handler,
size_t *size, uint32_t *crc)
Expand Down
2 changes: 2 additions & 0 deletions src/audio/sink_source_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <sof/common.h>
#include <rtos/panic.h>
#include <rtos/string.h>
#include <rtos/symbol.h>
#include <sof/math/numbers.h>
#include <limits.h>

Expand Down Expand Up @@ -71,3 +72,4 @@ int source_to_sink_copy(struct sof_source *source,
sink_commit_buffer(sink, INT_MAX);
return 0;
}
EXPORT_SYMBOL(source_to_sink_copy);
3 changes: 3 additions & 0 deletions src/audio/source_api_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright(c) 2023 Intel Corporation. All rights reserved.
*/

#include <rtos/symbol.h>

#include <sof/audio/source_api.h>
#include <sof/audio/audio_stream.h>

Expand Down Expand Up @@ -96,6 +98,7 @@ int source_set_alignment_constants(struct sof_source *source,
return source->ops->set_alignment_constants(source, byte_align, frame_align_req);
return 0;
}
EXPORT_SYMBOL(source_set_alignment_constants);

void source_set_min_available(struct sof_source *source, size_t min_available)
{
Expand Down
5 changes: 5 additions & 0 deletions src/math/fir_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sof/audio/format.h>
#include <sof/math/fir_generic.h>
#include <user/fir.h>
#include <rtos/symbol.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
Expand All @@ -33,6 +34,7 @@ void fir_reset(struct fir_state_32x16 *fir)
* reset so omitting setting also fir->delay to NULL.
*/
}
EXPORT_SYMBOL(fir_reset);

int fir_delay_size(struct sof_fir_coef_data *config)
{
Expand All @@ -49,6 +51,7 @@ int fir_delay_size(struct sof_fir_coef_data *config)
*/
return (config->length + 4) * sizeof(int32_t);
}
EXPORT_SYMBOL(fir_delay_size);

int fir_init_coef(struct fir_state_32x16 *fir,
struct sof_fir_coef_data *config)
Expand All @@ -60,12 +63,14 @@ int fir_init_coef(struct fir_state_32x16 *fir,
fir->coef = ASSUME_ALIGNED(&config->coef[0], 4);
return 0;
}
EXPORT_SYMBOL(fir_init_coef);

void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data)
{
fir->delay = *data;
*data += fir->length; /* Point to next delay line start */
}
EXPORT_SYMBOL(fir_init_delay);

int32_t fir_32x16(struct fir_state_32x16 *fir, int32_t x)
{
Expand Down
6 changes: 6 additions & 0 deletions src/math/fir_hifi2ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <user/fir.h>
#include <xtensa/config/defs.h>
#include <xtensa/tie/xt_hifi2.h>
#include <rtos/symbol.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
Expand All @@ -32,6 +33,7 @@ void fir_reset(struct fir_state_32x16 *fir)
* reset so omitting setting also fir->delay to NULL.
*/
}
EXPORT_SYMBOL(fir_reset);

int fir_delay_size(struct sof_fir_coef_data *config)
{
Expand All @@ -47,6 +49,7 @@ int fir_delay_size(struct sof_fir_coef_data *config)
*/
return (config->length + 2) * sizeof(int32_t);
}
EXPORT_SYMBOL(fir_delay_size);

int fir_init_coef(struct fir_state_32x16 *fir,
struct sof_fir_coef_data *config)
Expand All @@ -62,6 +65,7 @@ int fir_init_coef(struct fir_state_32x16 *fir,
fir->coef = (ae_p16x2s *)&config->coef[0];
return 0;
}
EXPORT_SYMBOL(fir_init_coef);

void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data)
{
Expand All @@ -70,13 +74,15 @@ void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data)
fir->rwp = (ae_p24x2f *)(fir->delay + fir->length - 1);
*data += fir->length; /* Point to next delay line start */
}
EXPORT_SYMBOL(fir_init_delay);

void fir_get_lrshifts(struct fir_state_32x16 *fir, int *lshift,
int *rshift)
{
*lshift = (fir->out_shift < 0) ? -fir->out_shift : 0;
*rshift = (fir->out_shift > 0) ? fir->out_shift : 0;
}
EXPORT_SYMBOL(fir_get_lrshifts);

/* HiFi EP has the follow number of reqisters that should not be exceeded
* 4x 56 bit registers in register file Q
Expand Down
7 changes: 7 additions & 0 deletions src/math/fir_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <user/fir.h>
#include <xtensa/config/defs.h>
#include <xtensa/tie/xt_hifi3.h>
#include <rtos/symbol.h>
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
Expand All @@ -32,6 +33,7 @@ void fir_reset(struct fir_state_32x16 *fir)
* reset so omitting setting also fir->delay to NULL.
*/
}
EXPORT_SYMBOL(fir_reset);

int fir_delay_size(struct sof_fir_coef_data *config)
{
Expand All @@ -48,6 +50,7 @@ int fir_delay_size(struct sof_fir_coef_data *config)
*/
return (config->length + 2) * sizeof(int32_t);
}
EXPORT_SYMBOL(fir_delay_size);

int fir_init_coef(struct fir_state_32x16 *fir,
struct sof_fir_coef_data *config)
Expand All @@ -63,6 +66,7 @@ int fir_init_coef(struct fir_state_32x16 *fir,
fir->coef = (ae_f16x4 *)&config->coef[0];
return 0;
}
EXPORT_SYMBOL(fir_init_coef);

void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data)
{
Expand All @@ -71,13 +75,15 @@ void fir_init_delay(struct fir_state_32x16 *fir, int32_t **data)
fir->rwp = (ae_int32 *)(fir->delay + fir->length - 1);
*data += fir->length; /* Point to next delay line start */
}
EXPORT_SYMBOL(fir_init_delay);

void fir_get_lrshifts(struct fir_state_32x16 *fir, int *lshift,
int *rshift)
{
*lshift = (fir->out_shift < 0) ? -fir->out_shift : 0;
*rshift = (fir->out_shift > 0) ? fir->out_shift : 0;
}
EXPORT_SYMBOL(fir_get_lrshifts);

/* HiFi EP has the follow number of reqisters that should not be exceeded
* 4x 56 bit registers in register file Q
Expand Down Expand Up @@ -245,5 +251,6 @@ void fir_32x16_2x_hifi3(struct fir_state_32x16 *fir, ae_int32 x0, ae_int32 x1,
AE_S32_L_I(AE_ROUND32F48SSYM(b), (ae_int32 *)y1, 0);
AE_S32_L_I(AE_ROUND32F48SSYM(a), (ae_int32 *)y0, 0);
}
EXPORT_SYMBOL(fir_32x16_2x_hifi3);

#endif
4 changes: 4 additions & 0 deletions src/module/audio/sink_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ int sink_set_rate(struct sof_sink *sink, unsigned int rate)
return sink->ops->on_audio_format_set(sink);
return 0;
}
EXPORT_SYMBOL(sink_set_rate);

int sink_set_channels(struct sof_sink *sink, unsigned int channels)
{
Expand All @@ -114,6 +115,7 @@ int sink_set_buffer_fmt(struct sof_sink *sink, uint32_t buffer_fmt)
return sink->ops->on_audio_format_set(sink);
return 0;
}
EXPORT_SYMBOL(sink_set_buffer_fmt);

int sink_set_overrun(struct sof_sink *sink, bool overrun_permitted)
{
Expand All @@ -129,6 +131,7 @@ int sink_set_params(struct sof_sink *sink, struct sof_ipc_stream_params *params,
return sink->ops->audio_set_ipc_params(sink, params, force_update);
return 0;
}
EXPORT_SYMBOL(sink_set_params);

int sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_align,
const uint32_t frame_align_req)
Expand All @@ -137,3 +140,4 @@ int sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_alig
return sink->ops->set_alignment_constants(sink, byte_align, frame_align_req);
return 0;
}
EXPORT_SYMBOL(sink_set_alignment_constants);

0 comments on commit 87cd5ba

Please sign in to comment.