Browse Source

lib: open-amp: Allow vendor specific resource table definition

Enhance flexibility by allowing vendors to define their own
resource tables. This is achieved by moving the vdev and vring
functions into the source file, requiring each vendor to
implement these functions within their specific resource
table definitions.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
pull/92175/head
Iuliana Prodan 4 weeks ago committed by Benjamin Cabé
parent
commit
e8a702026a
  1. 19
      lib/open-amp/resource_table.c
  2. 19
      lib/open-amp/resource_table.h

19
lib/open-amp/resource_table.c

@ -90,3 +90,22 @@ void rsc_table_get(void **table_ptr, int *length) @@ -90,3 +90,22 @@ void rsc_table_get(void **table_ptr, int *length)
*table_ptr = &resource_table;
#endif
}
#if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)
struct fw_rsc_vdev *rsc_table_to_vdev(void *rsc_table)
{
return &((struct fw_resource_table *)rsc_table)->vdev;
}
struct fw_rsc_vdev_vring *rsc_table_get_vring0(void *rsc_table)
{
return &((struct fw_resource_table *)rsc_table)->vring0;
}
struct fw_rsc_vdev_vring *rsc_table_get_vring1(void *rsc_table)
{
return &((struct fw_resource_table *)rsc_table)->vring1;
}
#endif

19
lib/open-amp/resource_table.h

@ -59,22 +59,9 @@ struct fw_resource_table { @@ -59,22 +59,9 @@ 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;
}
inline struct fw_rsc_vdev_vring *rsc_table_get_vring0(void *rsc_table)
{
return &((struct fw_resource_table *)rsc_table)->vring0;
}
inline struct fw_rsc_vdev_vring *rsc_table_get_vring1(void *rsc_table)
{
return &((struct fw_resource_table *)rsc_table)->vring1;
}
struct fw_rsc_vdev *rsc_table_to_vdev(void *rsc_table);
struct fw_rsc_vdev_vring *rsc_table_get_vring0(void *rsc_table);
struct fw_rsc_vdev_vring *rsc_table_get_vring1(void *rsc_table);
#endif
#ifdef __cplusplus

Loading…
Cancel
Save