Skip to content

uapi: replace sof_man_get_module with SOF_MAN_MODULE_OFFSET - #1405

Merged
tlauda merged 1 commit into
thesofproject:masterfrom
jajanusz:move-sof-man-get-module
May 17, 2019
Merged

tlauda merged 1 commit into
thesofproject:masterfrom
jajanusz:move-sof-man-get-module

Conversation

@jajanusz

@jajanusz jajanusz commented May 10, 2019 •

Copy link
Copy Markdown
Contributor

Fix #1377

There should be no logic in uapi headers.
Also there is no good place for headers shared only by rimage and FW,
so it has to be duplicated for now.

Signed-off-by: Janusz Jankowski janusz.jankowski@linux.intel.com

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

comment below

Comment thread rimage/manifest.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it's a bit sad to use duplicated code.
What about creating a 3rd directory like uapi/apps/ for stuff like manifest and trace?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know it's sad, but you pushed to have it solved atm. I wrote that we need some kind of directory like that, but I guess that's something that you and @lgirdwood has to decide, so unless you figure out how to divide api/headers between apps/fw/kernel I made something like this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lgirdwood any objection to create a 3rd directory, we'd have
ipc
user (can be renamed as kernel if needed)
apps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

or we could make this a macro

#define SOF_MAN_MODULE_OFFSET(index) \
        (sizeof(struct sof_man_fw_header) +         \
			index * sizeof(struct sof_man_module))

The pointer arithe is then done by the user and not in the header.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lgirdwood Your workaround is better if we want to just get rid of static inlines from uapi headers, but the real problem is that we want no logic in headers and now the question is if we consider simple addition and multiplication kind of logic?

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
@jajanusz
jajanusz force-pushed the move-sof-man-get-module branch from a466a3c to d268852 Compare May 14, 2019 08:48
@jajanusz jajanusz changed the title uapi: move out sof_man_get_module logic uapi: replace sof_man_get_module with SOF_MAN_MODULE_OFFSET May 14, 2019
@jajanusz

Copy link
Copy Markdown
Contributor Author

@lgirdwood @plbossart
Changed to macro workaround, if you prefer do it another way, just let me know, these ABI fixes are not rocket science so we can do anything you want pretty quick, we just need to decide what to do and push forward. These issues take a way too much time and are blocking other ABI changes.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks.

@jajanusz

Copy link
Copy Markdown
Contributor Author

@tlauda @lgirdwood ping

@jajanusz

Copy link
Copy Markdown
Contributor Author

@tlauda @lgirdwood @mmaka1 need 1 more review to merge

@tlauda
tlauda merged commit 291525d into thesofproject:master May 17, 2019
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.

[BUG] sof_man_get_module() has nothing to do in manifest.h

4 participants