This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c4537c00870ae15e51b4d2dc1a18d6593197fc33
Author: wangshaoxin <[email protected]>
AuthorDate: Fri Jun 6 15:06:50 2025 +0800

    arch/sim/sim_rptun: take the rpmsg CPU names from the configuration
    
    The rpmsg vdev hard-coded "server" and "proxy" as the host and remote
    CPU names. Use CONFIG_RPMSG_LOCAL_CPUNAME for the host and the name
    passed to sim_rptun_init() for the remote, so that sim instances with
    other names connect.
    
    Signed-off-by: wangshaoxin <[email protected]>
---
 arch/sim/src/sim/sim_rptun.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/sim/src/sim/sim_rptun.c b/arch/sim/src/sim/sim_rptun.c
index 9a7144fca8f..88436ad97e3 100644
--- a/arch/sim/src/sim/sim_rptun.c
+++ b/arch/sim/src/sim/sim_rptun.c
@@ -234,8 +234,10 @@ sim_rptun_get_resource(struct rptun_dev_s *dev)
       rsc->rpmsg0_vring1.da           = 0;
       rsc->rpmsg0_config.h2r_buf_size = 0x600;
       rsc->rpmsg0_config.r2h_buf_size = 0x600;
-      memcpy(rsc->rpmsg0_config.host_cpuname, "server", 6);
-      memcpy(rsc->rpmsg0_config.remote_cpuname, "proxy", 5);
+      strlcpy((FAR char *)rsc->rpmsg0_config.host_cpuname,
+        CONFIG_RPMSG_LOCAL_CPUNAME, VIRTIO_RPMSG_CPUNAME_SIZE);
+      strlcpy((FAR char *)rsc->rpmsg0_config.remote_cpuname,
+        priv->cpuname, VIRTIO_RPMSG_CPUNAME_SIZE);
 
       /* Virtio Rpmsg0 share memory buffer */
 

Reply via email to