12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include <zephyr.h>
- #include <resource_table.h>
- 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,
- .offset = {
- #if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)
- offsetof(struct fw_resource_table, vdev),
- #endif
- #if defined(CONFIG_RAM_CONSOLE)
- offsetof(struct fw_resource_table, cm_trace),
- #endif
- },
- #if (CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF > 0)
-
- .vdev = {
- RSC_VDEV, VIRTIO_ID_RPMSG, 0, RPMSG_IPU_C0_FEATURES, 0, 0, 0,
- VRING_COUNT, {0, 0},
- },
-
- .vring0 = {VRING_TX_ADDRESS, VRING_ALIGNMENT,
- CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF,
- VRING0_ID, 0},
- .vring1 = {VRING_RX_ADDRESS, VRING_ALIGNMENT,
- CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF,
- VRING1_ID, 0},
- #endif
- #if defined(CONFIG_RAM_CONSOLE)
- .cm_trace = {
- RSC_TRACE,
- (uint32_t)ram_console, CONFIG_RAM_CONSOLE_BUFFER_SIZE + 1, 0,
- "Zephyr_log",
- },
- #endif
- };
- void rsc_table_get(void **table_ptr, int *length)
- {
- *table_ptr = (void *)&resource_table;
- *length = sizeof(resource_table);
- }
- #endif
|