OpenAMP / open-amp

The main OpenAMP library implementing RPMSG, Virtio, and Remoteproc for RTOS etc
https://www.openampproject.org/
Other
696 stars 287 forks source link

remoteproc_mmap returns address which can be 0 #236

Open bentheredonethat opened 3 years ago

bentheredonethat commented 3 years ago

1 solution is to move returned address to be an argument and make return value success/failure-reason

arnopo commented 3 years ago

Do you have a use case that highlights the fact that 0 can be a valid virtual address? If 0 can be valid, yes, this API needs to be updated, if not, returning NULL in case of failure seems reasonable to me.

bentheredonethat commented 3 years ago

yes address can be 0 on Xilinx Zynq UltraScale Plus on RPU running baremetal or FreeRTOS application. The address 0 relates to the lowest value on TCM bank 0A for RPU0 and TCM bank 1A for RPU1.

arnopo commented 3 years ago

what about returning METAL_BAD_VA?

edmooring commented 3 years ago

That is probably the best solution, since it doesn't change the documented API. However, the comments in openamp/remoteproc.h need to be enhanced to show the error return value, and any examples that depend on the previous behavior should also be updated. It should probably also be highlighted in the release notes.

github-actions[bot] commented 10 months ago

This issue has been marked as a stale issue because it has been open (more than) 45 days with no activity.