Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for compilation errors with the SOF plugin #8489

Merged
merged 6 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions posix/include/rtos/idc.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#define IDC_MSG_UNBIND IDC_TYPE(0xE)
#define IDC_MSG_GET_ATTRIBUTE IDC_TYPE(0xF)

/** \brief IDC component delete message. */
#define IDC_MSG_FREE IDC_TYPE(0x10)
#define IDC_MSG_FREE_EXT(x) IDC_EXTENSION(x)

/** \brief IDC pipeline set state message. */
#define IDC_MSG_PPL_STATE IDC_TYPE(0xC)
#define IDC_PPL_STATE_PPL_ID_SHIFT 0
Expand Down
5 changes: 5 additions & 0 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,13 @@ static int asrc_dai_stop_timestamp(struct comp_data *cd)
return -EINVAL;
}

#if CONFIG_ZEPHYR_NATIVE_DRIVERS
static int asrc_dai_get_timestamp(struct comp_data *cd,
struct dai_ts_data *tsd)
#else
static int asrc_dai_get_timestamp(struct comp_data *cd,
struct timestamp_data *tsd)
#endif
{
if (cd->dai_dev) {
struct processing_module *mod = comp_get_drvdata(cd->dai_dev);
Expand Down
4 changes: 2 additions & 2 deletions src/audio/mixin_mixout/mixin_mixout.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ static int mixout_prepare(struct processing_module *mod,
return 0;
}

int mixout_bind(struct processing_module *mod, void *data)
static int mixout_bind(struct processing_module *mod, void *data)
{
struct ipc4_module_bind_unbind *bu;
struct comp_dev *mixin;
Expand Down Expand Up @@ -776,7 +776,7 @@ int mixout_bind(struct processing_module *mod, void *data)
return 0;
}

int mixout_unbind(struct processing_module *mod, void *data)
static int mixout_unbind(struct processing_module *mod, void *data)
{
struct ipc4_module_bind_unbind *bu;
struct comp_dev *mixin;
Expand Down
10 changes: 0 additions & 10 deletions src/include/ipc4/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,10 @@

#define SOF_IPC4_LOGGING_MTRACE_PAGE_SIZE 0x1000

#if CONFIG_LIBRARY
static inline int ipc4_logging_enable_logs(bool first_block,
bool last_block,
uint32_t data_offset_or_size,
const char *data)
{
return 0;
}
#else
int ipc4_logging_enable_logs(bool first_block,
bool last_block,
uint32_t data_offset_or_size,
const char *data);
#endif

int ipc4_logging_shutdown(void);

Expand Down
6 changes: 3 additions & 3 deletions src/include/ipc4/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ union ipc4_extended_param_id {
uint32_t parameter_type : 8;
uint32_t parameter_instance : 24;
} part;
} __packed __aligned(4);
} __attribute__((packed, aligned(4)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed kernel use left expression for alignment, and sof fw use right ones, any history on this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"__packed" is a linux kernel shortcut, not necessarily available in generic toolchains (like for SOF plugin).


/*
* Host Driver sends this message to create a new module instance.
Expand Down Expand Up @@ -360,7 +360,7 @@ struct ipc4_dx_state_info {
* bit[core_id] = 1 -> put core_id to D0
*/
uint32_t dx_mask;
} __packed __aligned(4);
} __attribute__((packed, aligned(4)));

struct ipc4_module_set_dx {
union {
Expand Down Expand Up @@ -420,7 +420,7 @@ struct ipc4_module_load_library {
uint32_t _reserved_2 : 2;
} r;
} data;
} __packed __aligned(4);
} __attribute__((packed, aligned(4)));

#define IPC4_COMP_ID(x, y) ((y) << 16 | (x))
#define IPC4_MOD_ID(x) (IS_ENABLED(CONFIG_IPC_MAJOR_4) ? ((x) & 0xffff) : 0)
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
* Here we just set pointer end_offset to the end of data
* and iterate until we reach that
*/
const uint8_t *end_offset = data + data_off_size;
const uint8_t *end_offset = (const uint8_t *)data + data_off_size;

while ((const uint8_t *)tlv < end_offset) {
/* check for invalid length */
Expand Down Expand Up @@ -1037,7 +1037,7 @@ static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
data_off_size -= sizeof(struct sof_tlv);
}
return drv->ops.set_large_config(dev, param_id, init_block, final_block,
data_off_size, (uint8_t *)data);
data_off_size, data);
}

static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ipc4)
Expand Down
11 changes: 2 additions & 9 deletions tools/plugin/modules/alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ static int arecord_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa
{
struct comp_buffer *buffer;
struct alsa_comp_data *cd = comp_get_drvdata(dev);
struct comp_buffer __sparse_cache *buf_c;
int ret;

comp_dbg(dev, "arecord params");
Expand All @@ -429,9 +428,7 @@ static int arecord_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa

/* file component sink/source buffer period count */
buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
buf_c = buffer_acquire(buffer);
buffer_reset_pos(buf_c, NULL);
buffer_release(buf_c);
buffer_reset_pos(buffer, NULL);

comp_dbg(dev, "prepare done ret = %d", ret);

Expand Down Expand Up @@ -515,7 +512,6 @@ static int alsa_cmd(struct comp_dev *dev, int cmd, void *data,
static int arecord_copy(struct comp_dev *dev)
{
struct alsa_comp_data *cd = comp_get_drvdata(dev);
struct comp_buffer __sparse_cache *buf_c;
struct comp_buffer *buffer;
struct audio_stream *sink;
snd_pcm_sframes_t frames;
Expand All @@ -533,8 +529,7 @@ static int arecord_copy(struct comp_dev *dev)

/* file component sink buffer */
buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
buf_c = buffer_acquire(buffer);
sink = &buf_c->stream;
sink = &buffer->stream;
pos = sink->w_ptr;

//FIX: this will fill buffer and higher latency, use period size
Expand All @@ -549,7 +544,6 @@ static int arecord_copy(struct comp_dev *dev)
if (frames < 0) {
comp_err(dev, "failed to read: %s: %s\n",
cd->pcm_name, snd_strerror(frames));
buffer_release(buf_c);
return frames;
}

Expand All @@ -561,7 +555,6 @@ static int arecord_copy(struct comp_dev *dev)
/* update sink buffer pointers */
comp_update_buffer_produce(buffer, total * frame_bytes);
comp_dbg(dev, "read %d frames", total);
buffer_release(buf_c);

return 0;
}
Expand Down
Loading