lib: open-amp: add support for an empty resource table
This allows a resource table to be included even if neither virtIO nor the RAM console are used. Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
This commit is contained in:
parent
b83b72beec
commit
fc4055852e
2 changed files with 6 additions and 3 deletions
|
@ -33,8 +33,6 @@ extern char ram_console[];
|
|||
|
||||
#define __resource Z_GENERIC_SECTION(.resource_table)
|
||||
|
||||
#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0) || defined(CONFIG_RAM_CONSOLE)
|
||||
|
||||
static struct fw_resource_table __resource resource_table = {
|
||||
.ver = 1,
|
||||
.num = RSC_TABLE_NUM_ENTRY,
|
||||
|
@ -79,4 +77,3 @@ void rsc_table_get(void **table_ptr, int *length)
|
|||
*table_ptr = (void *)&resource_table;
|
||||
*length = sizeof(resource_table);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -42,9 +42,11 @@ struct fw_resource_table {
|
|||
unsigned int reserved[2];
|
||||
unsigned int offset[RSC_TABLE_NUM_ENTRY];
|
||||
|
||||
#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)
|
||||
struct fw_rsc_vdev vdev;
|
||||
struct fw_rsc_vdev_vring vring0;
|
||||
struct fw_rsc_vdev_vring vring1;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RAM_CONSOLE)
|
||||
/* rpmsg trace entry */
|
||||
|
@ -54,6 +56,8 @@ struct fw_resource_table {
|
|||
|
||||
void rsc_table_get(void **table_ptr, int *length);
|
||||
|
||||
#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)
|
||||
|
||||
inline struct fw_rsc_vdev *rsc_table_to_vdev(void *rsc_table)
|
||||
{
|
||||
return &((struct fw_resource_table *)rsc_table)->vdev;
|
||||
|
@ -70,3 +74,5 @@ inline struct fw_rsc_vdev_vring *rsc_table_get_vring1(void *rsc_table)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue