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

Platform: Library: Move mailbox_sw_reg_read64() from posix mailbox.h #9589

Merged

Conversation

singalsu
Copy link
Collaborator

Without this change testbench IPC4 build fails with copier with implicit definition of the function. The mailbox_sw_reg_read64() function should be there in the same platform library mailbox.h header as the 32 bit version of similar function. The header mailbox.h for all Intel platforms is organized similarly.

The argument type is changed to size_t from uint32_t to follow other similar functions.

Without this change testbench IPC4 build fails with copier with
implicit definition of the function. The mailbox_sw_reg_read64()
function should be there in the same platform library mailbox.h
header as the 32 bit version of similar function. The header
mailbox.h for all Intel platforms is organized similarly.

The argument type is changed to size_t from uint32_t to follow
other similar functions.

Signed-off-by: Seppo Ingalsuo <[email protected]>
@singalsu singalsu requested a review from ranj063 October 17, 2024 09:14
Comment on lines -75 to -76
static inline uint64_t mailbox_sw_reg_read64(uint32_t offset)
{
Copy link
Member

Choose a reason for hiding this comment

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

Can testbench include this header ? We really want to get rid of platform/include now with Zephyr.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The failure is not from testbench source code but rest of SOF code built into testbench.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lgirdwood @singalsu This is not really Zephyr build here, but we have sof/posix implement our RTOS abstraction. I think you could drop "#include <platform/lib/mailbox.h>" from this file to simplify the implementation and have no-op implementations for all mailbox_sw_reg*() functions right here in posix/include/sof/lib/mailbox.h.

But there are many users (one can also built a host/library build of SOF using the Zephyr posix platform), so very easy to miss a case.

@singalsu singalsu marked this pull request as ready for review October 17, 2024 11:52
Copy link
Collaborator

@ranj063 ranj063 left a comment

Choose a reason for hiding this comment

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

tested the plugin with this change and it works fine.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

I'm good with this. It's complicated we have multiple concept/facilities in SOF for host builds -- we have 1) "sof/posix" RTOS implementation (alternative to Zephyr and XTOS), 2) we have sof/src/platform/posix definition (used with all RTOS'es), 3) we have CONFIG_LIBRARY Kconfig, and finally 4) we have native_sim Zephyr builds (like scripts/fuzz.sh). Then we have multiple users, testbench, the SOF ALSA plugin, fuzzer that use one or more of these facilities depending on their specific neeeds.

In this case of copier.c, it requires a SOF mailbox abstraction from the platform layer, and current sof/posix does not implement this. So this patch seems to be the correct fix based on the abstractions we currently have in place. It's a good question whether we maintain too many options for host builds, or should we limit (and make the codebase easier to follow in this area).

Comment on lines -75 to -76
static inline uint64_t mailbox_sw_reg_read64(uint32_t offset)
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

@lgirdwood @singalsu This is not really Zephyr build here, but we have sof/posix implement our RTOS abstraction. I think you could drop "#include <platform/lib/mailbox.h>" from this file to simplify the implementation and have no-op implementations for all mailbox_sw_reg*() functions right here in posix/include/sof/lib/mailbox.h.

But there are many users (one can also built a host/library build of SOF using the Zephyr posix platform), so very easy to miss a case.

@lgirdwood lgirdwood merged commit 06aab75 into thesofproject:main Oct 18, 2024
44 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants