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 1 commit
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
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
Loading