Commit e8a70202 authored by Iuliana Prodan's avatar Iuliana Prodan Committed by Benjamin Cabé
Browse files

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: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
parent a50ddace
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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
+3 −16
Original line number Diff line number Diff line
@@ -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