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

lib: open-amp: Replace struct fw_resource_table with void



Switching to void allows greater flexibility in supporting
vendor-specific resource tables.

This change reverts commit 39863b66, and adds some fixes.

Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
parent dc140c09
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -80,11 +80,11 @@ static struct fw_resource_table __resource resource_table = {
#endif
};

void rsc_table_get(struct fw_resource_table **table_ptr, int *length)
void rsc_table_get(void **table_ptr, int *length)
{
	*length = sizeof(resource_table);
#ifdef CONFIG_OPENAMP_COPY_RSC_TABLE
	*table_ptr = (struct fw_resource_table *)RSC_TABLE_ADDR;
	*table_ptr = (void *)RSC_TABLE_ADDR;
	memcpy(*table_ptr, &resource_table, *length);
#else
	*table_ptr = &resource_table;
+7 −7
Original line number Diff line number Diff line
@@ -56,23 +56,23 @@ struct fw_resource_table {
#endif
} METAL_PACKED_END;

void rsc_table_get(struct fw_resource_table **table_ptr, int *length);
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(struct fw_resource_table *rsc_table)
inline struct fw_rsc_vdev *rsc_table_to_vdev(void *rsc_table)
{
	return &rsc_table->vdev;
	return &((struct fw_resource_table *)rsc_table)->vdev;
}

inline struct fw_rsc_vdev_vring *rsc_table_get_vring0(struct fw_resource_table *rsc_table)
inline struct fw_rsc_vdev_vring *rsc_table_get_vring0(void *rsc_table)
{
	return &rsc_table->vring0;
	return &((struct fw_resource_table *)rsc_table)->vring0;
}

inline struct fw_rsc_vdev_vring *rsc_table_get_vring1(struct fw_resource_table *rsc_table)
inline struct fw_rsc_vdev_vring *rsc_table_get_vring1(void *rsc_table)
{
	return &rsc_table->vring1;
	return &((struct fw_resource_table *)rsc_table)->vring1;
}

#endif
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static struct metal_io_region *shm_io = &shm_io_data;
static struct metal_io_region *rsc_io = &rsc_io_data;
static struct rpmsg_virtio_device rvdev;

static struct fw_resource_table *rsc_table;
static void *rsc_table;
static struct rpmsg_device *rpdev;

static char rx_sc_msg[20];  /* should receive "Hello world!" */