2121#include <rtos/cache.h>
2222#include <sof/lib/cpu.h>
2323#include <sof/lib/mailbox.h>
24+ #include <sof/lib/memory.h>
2425#include <sof/list.h>
2526#include <sof/platform.h>
2627#include <rtos/sof.h>
3738
3839LOG_MODULE_DECLARE (ipc , CONFIG_SOF_LOG_LEVEL );
3940
40- static bool valid_ipc_buffer_desc (const struct sof_ipc_buffer * desc )
41+ __cold static bool valid_ipc_buffer_desc (const struct sof_ipc_buffer * desc )
4142{
43+ assert_can_be_cold ();
44+
4245 if (desc -> caps >= SOF_MEM_CAPS_LOWEST_INVALID )
4346 return false;
4447
@@ -47,10 +50,12 @@ static bool valid_ipc_buffer_desc(const struct sof_ipc_buffer *desc)
4750}
4851
4952/* create a new component in the pipeline */
50- struct comp_buffer * buffer_new (const struct sof_ipc_buffer * desc , bool is_shared )
53+ __cold struct comp_buffer * buffer_new (const struct sof_ipc_buffer * desc , bool is_shared )
5154{
5255 struct comp_buffer * buffer ;
5356
57+ assert_can_be_cold ();
58+
5459 tr_info (& buffer_tr , "buffer new size 0x%x id %d.%d flags 0x%x" ,
5560 desc -> size , desc -> comp .pipeline_id , desc -> comp .id , desc -> flags );
5661
@@ -75,6 +80,7 @@ struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared
7580 return buffer ;
7681}
7782
83+ /* Called from multiple locations, including ipc_get_comp_by_ppl_id(), so cannot be cold */
7884int32_t ipc_comp_pipe_id (const struct ipc_comp_dev * icd )
7985{
8086 switch (icd -> type ) {
@@ -177,9 +183,11 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag,
177183}
178184EXPORT_SYMBOL (comp_verify_params );
179185
180- int comp_buffer_connect (struct comp_dev * comp , uint32_t comp_core ,
181- struct comp_buffer * buffer , uint32_t dir )
186+ __cold int comp_buffer_connect (struct comp_dev * comp , uint32_t comp_core ,
187+ struct comp_buffer * buffer , uint32_t dir )
182188{
189+ assert_can_be_cold ();
190+
183191 /* check if it's a connection between cores */
184192 if (buffer -> core != comp_core ) {
185193#if CONFIG_INCOHERENT
@@ -258,13 +266,15 @@ int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
258266 ipc_ppl_sink -> cd );
259267}
260268
261- int ipc_comp_free (struct ipc * ipc , uint32_t comp_id )
269+ __cold int ipc_comp_free (struct ipc * ipc , uint32_t comp_id )
262270{
263271 struct ipc_comp_dev * icd ;
264272 struct comp_buffer * buffer ;
265273 struct comp_buffer * safe ;
266274 uint32_t flags ;
267275
276+ assert_can_be_cold ();
277+
268278 /* check whether component exists */
269279 icd = ipc_get_comp_by_id (ipc , comp_id );
270280 if (!icd ) {
0 commit comments