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

V2024.05.0 release fixes #596

Merged
merged 4 commits into from
Jun 28, 2024
Merged

V2024.05.0 release fixes #596

merged 4 commits into from
Jun 28, 2024

Conversation

arnopo
Copy link
Collaborator

@arnopo arnopo commented Jun 14, 2024

Issues were detected in Zephyr during CI when integrating the new release v2024.05.0:

[24/182] Building C object zephyr/CMakeFiles/zephyr.dir/lib/open-amp/resource_table.c.obj
In file included from /zephyrproject/zephyr/lib/open-amp/./resource_table.h:11,
                 from /zephyrproject/zephyr/lib/open-amp/resource_table.c:30:
/zephyrproject/modules/lib/open-amp/open-amp/lib/include/openamp/virtio.h:83:2: warning: #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined" [-Wcpp]
   83 | #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined"
      |  ^~~~~~~
[26/182] Building C object CMakeFiles/app.dir/src/main_remote.c.obj
In file included from /zephyrproject/modules/lib/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:19,
                 from /zephyrproject/modules/lib/open-amp/open-amp/lib/include/openamp/open_amp.h:12,
                 from /zephyrproject/zephyr/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c:16:
/zephyrproject/modules/lib/open-amp/open-amp/lib/include/openamp/virtio.h:83:2: warning: #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined" [-Wcpp]
   83 | #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined"
      |  ^~~~~~~

The root cause is that the application can include thevirtio.hheader without defining VIRTIO_DRIVER_SUPPORT or VIRTIO_DEVICE_SUPPORT, which should not result in a warning or error.

This pull request:

  • Fixes the warning message.
  • Defines the VIRTIO_ROLE_IS_DEVICE and VIRTIO_ROLE_IS_DRIVER macros based on the definitions of VIRTIO_DEVICE_SUPPORT and VIRTIO_DRIVER_SUPPORT.

Fix also unreferenced endpoint->priv field, found in Zephyr and introduced in
9905d67

Building the samples/subsys/ipc/openamp_rsc_table/ sample generates the
following warning:

[24/182] Building C object zephyr/CMakeFiles/zephyr.dir/lib/open-amp/resource_table.c.obj
In file included from /zephyrproject/zephyr/lib/open-amp/./resource_table.h:11,
                 from /zephyrproject/zephyr/lib/open-amp/resource_table.c:30:
/zephyrproject/modules/lib/open-amp/open-amp/lib/include/openamp/virtio.h:83:2:
 warning: #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined" [-Wcpp]
   83 | #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined"
      |  ^~~~~~~

The issue occurs because the project includes the virtio API while
VIRTIO_DRIVER_SUPPORT and VIRTIO_DEVICE_SUPPORT is only defined for
the open-amp library build.

Fix the warning by testing deprecated usage of VIRTIO_DRIVER_ONLY and
VIRTIO_DEVICE_ONLY but not under
#if !defined(VIRTIO_DRIVER_SUPPORT) && !defined(VIRTIO_DEVICE_SUPPORT)
condition.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
…RIVER

The virtio.h header can be included by applications. In such cases,
VIRTIO_DRIVER_SUPPORT and VIRTIO_DEVICE_SUPPORT, which are used to
optimize the library, may not be defined in the application.

Define default VIRTIO_ROLE_IS_DEVICE and VIRTIO_ROLE_IS_DRIVER macros
that do not check for VIRTIO_DEVICE_SUPPORT or VIRTIO_DRIVER_SUPPORT if
they are not defined.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
@arnopo
Copy link
Collaborator Author

arnopo commented Jun 24, 2024

New issue found in Zephyr introduced in
9905d67

Copy link
Contributor

@edmooring edmooring left a comment

Choose a reason for hiding this comment

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

Looks good to go.

This patch fixes the rpmsg_create_ept function passing the endpoint's private
data that can be set by the application before the call of
rpmsg_create_ept.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Set library version to 1.6.1

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
@arnopo
Copy link
Collaborator Author

arnopo commented Jun 27, 2024

Minor fix on coommit message subject to add "lib:" prefix

Copy link
Collaborator

@tnmysh tnmysh left a comment

Choose a reason for hiding this comment

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

LGTM.

@arnopo arnopo merged commit 856680e into OpenAMP:v2024.05 Jun 28, 2024
1 check 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.

5 participants