Skip to content

Commit

Permalink
[DNM] examples of cold code and data
Browse files Browse the repository at this point in the history
Only for testing - mark some functions and const objects for DRAM
residency.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed Dec 20, 2024
1 parent 8c16eb2 commit 20c2339
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
8 changes: 4 additions & 4 deletions src/audio/drc/drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static int drc_process(struct processing_module *mod,
}

#if CONFIG_IPC_MAJOR_4
static void drc_params(struct processing_module *mod)
__cold static void drc_params(struct processing_module *mod)
{
struct sof_ipc_stream_params *params = mod->stream_params;
struct comp_buffer *sinkb, *sourceb;
Expand All @@ -323,9 +323,9 @@ static void drc_params(struct processing_module *mod)
}
#endif /* CONFIG_IPC_MAJOR_4 */

static int drc_prepare(struct processing_module *mod,
struct sof_source **sources, int num_of_sources,
struct sof_sink **sinks, int num_of_sinks)
__cold static int drc_prepare(struct processing_module *mod,
struct sof_source **sources, int num_of_sources,
struct sof_sink **sinks, int num_of_sinks)
{
struct drc_comp_data *cd = module_get_private_data(mod);
struct comp_buffer *sourceb, *sinkb;
Expand Down
12 changes: 6 additions & 6 deletions src/audio/src/coef/src_ipc4_int32_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@
#include <stdint.h>

/* SRC table */
static const int32_t fir_one = 1073741824;
static const struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };
static const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };
static const int src_in_fs[16] = { 8000, 11025, 12000, 16000, 18900, 22050, 24000, 32000,
__cold_rodata static const int32_t fir_one = 1073741824;
__cold_rodata static const struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &fir_one };
__cold_rodata static const struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &fir_one };
__cold_rodata static const int src_in_fs[16] = { 8000, 11025, 12000, 16000, 18900, 22050, 24000, 32000,
37800, 44100, 48000, 64000, 88200, 96000, 176400, 192000
};
static const int src_out_fs[10] = { 8000, 16000, 24000, 32000, 44100, 48000, 88200, 96000,
__cold_rodata static const int src_out_fs[10] = { 8000, 16000, 24000, 32000, 44100, 48000, 88200, 96000,
176400, 192000};
static const struct src_stage * const src_table1[10][16] = {
__cold_rodata static const struct src_stage * const src_table1[10][16] = {
{ &src_int32_1_1_0_0, &src_int32_16_21_4319_5000,
&src_int32_2_3_4535_5000, &src_int32_1_2_4535_5000,
&src_int32_0_0_0_0, &src_int32_10_21_3455_5000,
Expand Down
2 changes: 1 addition & 1 deletion src/audio/src/src_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int src_prepare_general(struct processing_module *mod,
return ret;
}

int src_init(struct processing_module *mod)
__cold int src_init(struct processing_module *mod)
{
struct module_data *md = &mod->priv;
struct module_config *cfg = &md->cfg;
Expand Down
54 changes: 27 additions & 27 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ static inline const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data(
/*
* Global IPC Operations.
*/
static int ipc4_new_pipeline(struct ipc4_message_request *ipc4)
__cold static int ipc4_new_pipeline(struct ipc4_message_request *ipc4)
{
struct ipc *ipc = ipc_get();

return ipc_pipeline_new(ipc, (ipc_pipe_new *)ipc4);
}

static int ipc4_delete_pipeline(struct ipc4_message_request *ipc4)
__cold static int ipc4_delete_pipeline(struct ipc4_message_request *ipc4)
{
struct ipc4_pipeline_delete *pipe;
struct ipc *ipc = ipc_get();
Expand All @@ -149,7 +149,7 @@ static int ipc4_delete_pipeline(struct ipc4_message_request *ipc4)
return ipc_pipeline_free(ipc, pipe->primary.r.instance_id);
}

static int ipc4_comp_params(struct comp_dev *current,
__cold static int ipc4_comp_params(struct comp_dev *current,
struct comp_buffer *calling_buf,
struct pipeline_walk_context *ctx, int dir)
{
Expand All @@ -171,7 +171,7 @@ static int ipc4_comp_params(struct comp_dev *current,
return pipeline_for_each_comp(current, ctx, dir);
}

static int ipc4_pipeline_params(struct pipeline *p, struct comp_dev *host)
__cold static int ipc4_pipeline_params(struct pipeline *p, struct comp_dev *host)
{
struct sof_ipc_pcm_params hw_params = {{ 0 }};
struct pipeline_data data = {
Expand All @@ -189,7 +189,7 @@ static int ipc4_pipeline_params(struct pipeline *p, struct comp_dev *host)
return param_ctx.comp_func(host, NULL, &param_ctx, host->direction);
}

static int ipc4_pcm_params(struct ipc_comp_dev *pcm_dev)
__cold static int ipc4_pcm_params(struct ipc_comp_dev *pcm_dev)
{
int err, reset_err;

Expand Down Expand Up @@ -229,7 +229,7 @@ static int ipc4_pcm_params(struct ipc_comp_dev *pcm_dev)
return err;
}

static bool is_any_ppl_active(void)
__cold static bool is_any_ppl_active(void)
{
struct ipc_comp_dev *icd;
struct list_item *clist;
Expand All @@ -246,7 +246,7 @@ static bool is_any_ppl_active(void)
return false;
}

static struct ipc_comp_dev *pipeline_get_host_dev(struct ipc_comp_dev *ppl_icd)
__cold static struct ipc_comp_dev *pipeline_get_host_dev(struct ipc_comp_dev *ppl_icd)
{
struct ipc_comp_dev *host_dev;
struct ipc *ipc = ipc_get();
Expand Down Expand Up @@ -315,7 +315,7 @@ static struct ipc_comp_dev *pipeline_get_host_dev(struct ipc_comp_dev *ppl_icd)
* /
*/

int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd)
__cold int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd)
{
struct ipc_comp_dev *host = NULL;
struct ipc *ipc = ipc_get();
Expand Down Expand Up @@ -404,7 +404,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd)
return ret;
}

int ipc4_pipeline_trigger(struct ipc_comp_dev *ppl_icd, uint32_t cmd, bool *delayed)
__cold int ipc4_pipeline_trigger(struct ipc_comp_dev *ppl_icd, uint32_t cmd, bool *delayed)
{
struct ipc_comp_dev *host;
int status;
Expand Down Expand Up @@ -496,15 +496,15 @@ int ipc4_pipeline_trigger(struct ipc_comp_dev *ppl_icd, uint32_t cmd, bool *dela
return ret;
}

static void ipc_compound_pre_start(int msg_id)
__cold static void ipc_compound_pre_start(int msg_id)
{
/* ipc thread will wait for all scheduled tasks to be complete
* Use a reference count to check status of these tasks.
*/
atomic_add(&msg_data.delayed_reply, 1);
}

static void ipc_compound_post_start(uint32_t msg_id, int ret, bool delayed)
__cold static void ipc_compound_post_start(uint32_t msg_id, int ret, bool delayed)
{
if (ret) {
ipc_cmd_err(&ipc_tr, "failed to process msg %d status %d", msg_id, ret);
Expand All @@ -517,7 +517,7 @@ static void ipc_compound_post_start(uint32_t msg_id, int ret, bool delayed)
atomic_sub(&msg_data.delayed_reply, 1);
}

static void ipc_compound_msg_done(uint32_t msg_id, int error)
__cold static void ipc_compound_msg_done(uint32_t msg_id, int error)
{
if (!atomic_read(&msg_data.delayed_reply)) {
ipc_cmd_err(&ipc_tr, "unexpected delayed reply");
Expand All @@ -544,7 +544,7 @@ static int ipc_wait_for_compound_msg(void)
return IPC4_SUCCESS;
}
#else
static int ipc_wait_for_compound_msg(void)
__cold static int ipc_wait_for_compound_msg(void)
{
int try_count = 30;

Expand All @@ -562,7 +562,7 @@ static int ipc_wait_for_compound_msg(void)
}
#endif

const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data_wrapper(void)
__cold const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data_wrapper(void)
{
const struct ipc4_pipeline_set_state_data *ppl_data;

Expand All @@ -571,7 +571,7 @@ const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data_wrapper(void)
return ppl_data;
}

static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4)
__cold static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4)
{
const struct ipc4_pipeline_set_state_data *ppl_data;
struct ipc4_pipeline_set_state state;
Expand Down Expand Up @@ -700,7 +700,7 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4)
}

#if CONFIG_LIBRARY_MANAGER
static int ipc4_load_library(struct ipc4_message_request *ipc4)
__cold static int ipc4_load_library(struct ipc4_message_request *ipc4)
{
struct ipc4_module_load_library library;
int ret;
Expand All @@ -716,7 +716,7 @@ static int ipc4_load_library(struct ipc4_message_request *ipc4)
}
#endif

static int ipc4_process_chain_dma(struct ipc4_message_request *ipc4)
__cold static int ipc4_process_chain_dma(struct ipc4_message_request *ipc4)
{
#if CONFIG_COMP_CHAIN_DMA
struct ipc_comp_dev *cdma_comp;
Expand Down Expand Up @@ -771,7 +771,7 @@ static int ipc4_process_chain_dma(struct ipc4_message_request *ipc4)
#endif
}

static int ipc4_process_ipcgtw_cmd(struct ipc4_message_request *ipc4)
__cold static int ipc4_process_ipcgtw_cmd(struct ipc4_message_request *ipc4)
{
#if CONFIG_IPC4_GATEWAY
struct ipc *ipc = ipc_get();
Expand Down Expand Up @@ -810,7 +810,7 @@ static int ipc4_process_ipcgtw_cmd(struct ipc4_message_request *ipc4)
#endif
}

static int ipc4_process_glb_message(struct ipc4_message_request *ipc4)
__cold static int ipc4_process_glb_message(struct ipc4_message_request *ipc4)
{
uint32_t type;
int ret;
Expand Down Expand Up @@ -891,7 +891,7 @@ static int ipc4_process_glb_message(struct ipc4_message_request *ipc4)
* delete module <-------> free component
*/

static int ipc4_init_module_instance(struct ipc4_message_request *ipc4)
__cold static int ipc4_init_module_instance(struct ipc4_message_request *ipc4)
{
struct ipc4_module_init_instance module_init;
struct comp_dev *dev;
Expand Down Expand Up @@ -921,7 +921,7 @@ static int ipc4_init_module_instance(struct ipc4_message_request *ipc4)
return 0;
}

static int ipc4_bind_module_instance(struct ipc4_message_request *ipc4)
__cold static int ipc4_bind_module_instance(struct ipc4_message_request *ipc4)
{
struct ipc4_module_bind_unbind bu;
struct ipc *ipc = ipc_get();
Expand All @@ -937,7 +937,7 @@ static int ipc4_bind_module_instance(struct ipc4_message_request *ipc4)
return ipc_comp_connect(ipc, (ipc_pipe_comp_connect *)&bu);
}

static int ipc4_unbind_module_instance(struct ipc4_message_request *ipc4)
__cold static int ipc4_unbind_module_instance(struct ipc4_message_request *ipc4)
{
struct ipc4_module_bind_unbind bu;
struct ipc *ipc = ipc_get();
Expand All @@ -953,7 +953,7 @@ static int ipc4_unbind_module_instance(struct ipc4_message_request *ipc4)
return ipc_comp_disconnect(ipc, (ipc_pipe_comp_connect *)&bu);
}

static int ipc4_get_vendor_config_module_instance(struct comp_dev *dev,
__cold static int ipc4_get_vendor_config_module_instance(struct comp_dev *dev,
const struct comp_driver *drv,
bool init_block,
bool final_block,
Expand Down Expand Up @@ -1046,7 +1046,7 @@ static int ipc4_get_vendor_config_module_instance(struct comp_dev *dev,
return IPC4_SUCCESS;
}

static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ipc4)
__cold static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ipc4)
{
struct ipc4_module_large_config_reply reply;
struct ipc4_module_large_config config;
Expand Down Expand Up @@ -1085,7 +1085,7 @@ static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ip
}

if (!drv)
return IPC4_MOD_INVALID_ID;
return IPC4_MOD_INVALID_ID + (config.primary.r.module_id ? 7 : 8);

if (!drv->ops.get_large_config)
return IPC4_INVALID_REQUEST;
Expand Down Expand Up @@ -1146,7 +1146,7 @@ static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ip
return ret;
}

static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
__cold static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
const struct comp_driver *drv,
uint32_t module_id,
uint32_t instance_id,
Expand Down Expand Up @@ -1209,7 +1209,7 @@ static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
data_off_size, data);
}

static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ipc4)
__cold static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ipc4)
{
struct ipc4_module_large_config config;
struct comp_dev *dev = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/schedule/edf_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct edf_schedule_data {
int irq;
};

static const struct scheduler_ops schedule_edf_ops;
__cold_rodata static const struct scheduler_ops schedule_edf_ops;

static int schedule_edf_task_complete(void *data, struct task *task);
static int schedule_edf_task_running(void *data, struct task *task);
Expand Down

0 comments on commit 20c2339

Please sign in to comment.