File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
subsys/ipc/ipc_service/lib Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,18 @@ void pbuf_handshake_write(struct pbuf *pb, uint32_t value);
269269 */
270270int pbuf_get_initial_buf (struct pbuf * pb , volatile char * * buf , uint16_t * len );
271271
272+ /**
273+ * @brief Remap embedded addresses to native addresses.
274+ *
275+ * This function is to be used only with native simulator based targets and
276+ * remaps addresses of a pbuf from devicetree addesses to
277+ * allocated native memory address ranges.
278+ * This is only used in the IPC backend implementations.
279+ *
280+ * @param pb A buffer to be remapped.
281+ */
282+ void pbuf_native_addr_remap (struct pbuf * pb );
283+
272284/**
273285 * @}
274286 */
Original file line number Diff line number Diff line change @@ -412,6 +412,10 @@ int icmsg_open(const struct icmsg_config_t *conf,
412412 k_mutex_init (& dev_data -> tx_lock );
413413#endif
414414
415+ #if defined(CONFIG_ARCH_POSIX )
416+ pbuf_native_addr_remap (dev_data -> tx_pb );
417+ #endif
418+
415419 ret = pbuf_rx_init (dev_data -> rx_pb );
416420
417421 if (ret < 0 ) {
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ static int validate_cfg(const struct pbuf_cfg *cfg)
6565void pbuf_native_addr_remap (struct pbuf * pb )
6666{
6767 native_emb_addr_remap ((void * * )& pb -> cfg -> rd_idx_loc );
68+ native_emb_addr_remap ((void * * )& pb -> cfg -> handshake_loc );
6869 native_emb_addr_remap ((void * * )& pb -> cfg -> wr_idx_loc );
6970 native_emb_addr_remap ((void * * )& pb -> cfg -> data_loc );
7071}
You can’t perform that action at this time.
0 commit comments