You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/04/15 15:30:58 UTC

[incubator-nuttx] branch master updated (6548b41 -> b4a50a9)

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

acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 6548b41  drivers/usbdev/usbmsc.c:  Run nxstyle; fix complaints.
     new ab566de  syslog/rpmsg: fix the naming conflict of function 'syslog_rpmsg_putc'.
     new 987472d  syslog/rpmsg: remove unused local variable 'g_syslog_rpmsg_channel' which would cause build break.
     new a41c5e0  arch/sim: add header to remove warning when build with 'CONFIG_SYSLOG_RPMSG_SERVER'.
     new 4ff0edc  arch/sim: add implemntation of 'host_sleep'.
     new b4a50a9  fix nxstyle warning.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/sim/src/sim/up_hosttime.c      |  9 +++++++++
 arch/sim/src/sim/up_internal.h      |  1 +
 arch/sim/src/sim/up_rptun.c         |  6 ++++--
 drivers/syslog/syslog_rpmsg.c       | 34 +++++++++++++---------------------
 include/nuttx/syslog/syslog_rpmsg.h |  4 ++--
 5 files changed, 29 insertions(+), 25 deletions(-)


[incubator-nuttx] 03/05: arch/sim: add header to remove warning when build with 'CONFIG_SYSLOG_RPMSG_SERVER'.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a41c5e01e1f9b803ba1f9b7c768f387b81ba6257
Author: zhongan <zh...@xiaomi.com>
AuthorDate: Thu Apr 9 09:44:35 2020 +0800

    arch/sim: add header to remove warning when build with 'CONFIG_SYSLOG_RPMSG_SERVER'.
    
    Change-Id: I58ebe25434aaebce3812abb52caf3c670118cb66
    Signed-off-by: zhongan <zh...@xiaomi.com>
---
 arch/sim/src/sim/up_rptun.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/sim/src/sim/up_rptun.c b/arch/sim/src/sim/up_rptun.c
index 0a0274f..b89d818 100644
--- a/arch/sim/src/sim/up_rptun.c
+++ b/arch/sim/src/sim/up_rptun.c
@@ -41,6 +41,7 @@
 #include <nuttx/fs/hostfs_rpmsg.h>
 #include <nuttx/rptun/rptun.h>
 #include <nuttx/serial/uart_rpmsg.h>
+#include <nuttx/syslog/syslog_rpmsg.h>
 
 #include "up_internal.h"
 


[incubator-nuttx] 01/05: syslog/rpmsg: fix the naming conflict of function 'syslog_rpmsg_putc'.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ab566de77af3155a1eccd0e81a07cbb1b47ec501
Author: zhongan <zh...@xiaomi.com>
AuthorDate: Tue Apr 7 20:39:53 2020 +0800

    syslog/rpmsg: fix the naming conflict of function 'syslog_rpmsg_putc'.
    
    Change-Id: I3f89bfed71edb85bc3006446c1f9141e95202b5c
    Signed-off-by: zhongan <zh...@xiaomi.com>
---
 drivers/syslog/syslog_rpmsg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index 7ac43d2..2612059 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -88,8 +88,8 @@ struct syslog_rpmsg_s
  ****************************************************************************/
 
 static void syslog_rpmsg_work(FAR void *priv_);
-static void syslog_rpmsg_putc(FAR struct syslog_rpmsg_s *priv, int ch,
-                              bool last);
+static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s *priv, int ch,
+                                 bool last);
 static int  syslog_rpmsg_flush(void);
 static ssize_t syslog_rpmsg_write(FAR const char *buffer, size_t buflen);
 static void syslog_rpmsg_device_created(FAR struct rpmsg_device *rdev,
@@ -177,8 +177,8 @@ static void syslog_rpmsg_work(FAR void *priv_)
   rpmsg_send_nocopy(&priv->ept, msg, sizeof(*msg) + len);
 }
 
-static void syslog_rpmsg_putc(FAR struct syslog_rpmsg_s *priv, int ch,
-                              bool last)
+static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s *priv, int ch,
+                                 bool last)
 {
   if (B2C_REM(priv->head) == 0)
     {
@@ -244,7 +244,7 @@ static ssize_t syslog_rpmsg_write(FAR const char *buffer, size_t buflen)
   flags = enter_critical_section();
   for (nwritten = 1; nwritten <= buflen; nwritten++)
     {
-      syslog_rpmsg_putc(priv, *buffer++, nwritten == buflen);
+      syslog_rpmsg_putchar(priv, *buffer++, nwritten == buflen);
     }
 
   leave_critical_section(flags);
@@ -352,7 +352,7 @@ int syslog_rpmsg_putc(int ch)
   irqstate_t flags;
 
   flags = enter_critical_section();
-  syslog_rpmsg_putc(priv, ch, true);
+  syslog_rpmsg_putchar(priv, ch, true);
   leave_critical_section(flags);
 
   return ch;


[incubator-nuttx] 04/05: arch/sim: add implemntation of 'host_sleep'.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4ff0edce257f1e8ecf6fa49bcd61b750f1cc43a2
Author: zhongan <zh...@xiaomi.com>
AuthorDate: Thu Apr 9 09:41:50 2020 +0800

    arch/sim: add implemntation of 'host_sleep'.
    
    Change-Id: Ib82343565ca9541499dec52c753c3f15923f7d1c
    Signed-off-by: zhongan <zh...@xiaomi.com>
---
 arch/sim/src/sim/up_hosttime.c | 9 +++++++++
 arch/sim/src/sim/up_internal.h | 1 +
 arch/sim/src/sim/up_rptun.c    | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/sim/src/sim/up_hosttime.c b/arch/sim/src/sim/up_hosttime.c
index 9544b39..e0d7c4d 100644
--- a/arch/sim/src/sim/up_hosttime.c
+++ b/arch/sim/src/sim/up_hosttime.c
@@ -59,6 +59,15 @@ uint64_t host_gettime(bool rtc)
 }
 
 /****************************************************************************
+ * Name: host_sleep
+ ****************************************************************************/
+
+void host_sleep(uint64_t nsec)
+{
+  usleep(nsec);
+}
+
+/****************************************************************************
  * Name: host_sleepuntil
  ****************************************************************************/
 
diff --git a/arch/sim/src/sim/up_internal.h b/arch/sim/src/sim/up_internal.h
index d7bedaa..9c80960 100644
--- a/arch/sim/src/sim/up_internal.h
+++ b/arch/sim/src/sim/up_internal.h
@@ -231,6 +231,7 @@ void *host_alloc_heap(size_t sz);
 /* up_hosttime.c ************************************************************/
 
 uint64_t host_gettime(bool rtc);
+void host_sleep(uint64_t nsec);
 void host_sleepuntil(uint64_t nsec);
 
 /* up_simsmp.c **************************************************************/
diff --git a/arch/sim/src/sim/up_rptun.c b/arch/sim/src/sim/up_rptun.c
index b89d818..07fe4af 100644
--- a/arch/sim/src/sim/up_rptun.c
+++ b/arch/sim/src/sim/up_rptun.c
@@ -229,7 +229,7 @@ int up_rptun_init(void)
 
       while (g_dev.shmem->base == 0)
         {
-          up_hostusleep(1000);
+          host_sleep(1000);
         }
 
       s_addrenv[0].va               = (uintptr_t)g_dev.shmem;


[incubator-nuttx] 05/05: fix nxstyle warning.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b4a50a91923a470e158461d9b46d15735425064a
Author: zhongan <zh...@xiaomi.com>
AuthorDate: Wed Apr 15 17:45:28 2020 +0800

    fix nxstyle warning.
    
    Signed-off-by: zhongan <zh...@xiaomi.com>
---
 arch/sim/src/sim/up_rptun.c   | 3 ++-
 drivers/syslog/syslog_rpmsg.c | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/sim/src/sim/up_rptun.c b/arch/sim/src/sim/up_rptun.c
index 07fe4af..10339c0 100644
--- a/arch/sim/src/sim/up_rptun.c
+++ b/arch/sim/src/sim/up_rptun.c
@@ -206,7 +206,8 @@ int up_rptun_init(void)
 
       rsc->rsc_tbl_hdr.ver          = 1;
       rsc->rsc_tbl_hdr.num          = 1;
-      rsc->offset[0]                = offsetof(struct rptun_rsc_s, rpmsg_vdev);
+      rsc->offset[0]                = offsetof(struct rptun_rsc_s,
+                                               rpmsg_vdev);
       rsc->rpmsg_vdev.type          = RSC_VDEV;
       rsc->rpmsg_vdev.id            = VIRTIO_ID_RPMSG;
       rsc->rpmsg_vdev.dfeatures     = 1 << VIRTIO_RPMSG_F_NS
diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index 5a9ea32..cec7f30 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -177,7 +177,8 @@ static void syslog_rpmsg_putchar(FAR struct syslog_rpmsg_s *priv, int ch,
       priv->buffer[B2C_OFF(priv->head)] = 0;
     }
 
-  priv->buffer[B2C_OFF(priv->head)] |= (ch & 0xff) << (8 * B2C_REM(priv->head));
+  priv->buffer[B2C_OFF(priv->head)] |= (ch & 0xff) <<
+                                       (8 * B2C_REM(priv->head));
 
   priv->head += 1;
   if (priv->head >= C2B(priv->size))
@@ -276,8 +277,9 @@ static void syslog_rpmsg_device_destroy(FAR struct rpmsg_device *rdev,
     }
 }
 
-static int syslog_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept, FAR void *data,
-                               size_t len, uint32_t src, FAR void *priv_)
+static int syslog_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
+                               FAR void *data, size_t len, uint32_t src,
+                               FAR void *priv_)
 {
   FAR struct syslog_rpmsg_s *priv = priv_;
   FAR struct syslog_rpmsg_header_s *header = data;


[incubator-nuttx] 02/05: syslog/rpmsg: remove unused local variable 'g_syslog_rpmsg_channel' which would cause build break.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 987472d3bb3e911c0774a322fbad763a82b07958
Author: zhongan <zh...@xiaomi.com>
AuthorDate: Thu Apr 9 09:37:04 2020 +0800

    syslog/rpmsg: remove unused local variable 'g_syslog_rpmsg_channel' which would cause build break.
    
    Change-Id: Ie02ef9202ec2a9ecade62c47e4f8956adb96673f
    Signed-off-by: zhongan <zh...@xiaomi.com>
---
 drivers/syslog/syslog_rpmsg.c       | 14 ++------------
 include/nuttx/syslog/syslog_rpmsg.h |  4 ++--
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c
index 2612059..5a9ea32 100644
--- a/drivers/syslog/syslog_rpmsg.c
+++ b/drivers/syslog/syslog_rpmsg.c
@@ -106,14 +106,6 @@ static int  syslog_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
 
 static struct syslog_rpmsg_s g_syslog_rpmsg;
 
-static const struct syslog_channel_s g_syslog_rpmsg_channel =
-{
-  up_putc,
-  up_putc,
-  syslog_rpmsg_flush,
-  syslog_rpmsg_write,
-};
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
@@ -358,8 +350,8 @@ int syslog_rpmsg_putc(int ch)
   return ch;
 }
 
-int syslog_rpmsg_init_early(FAR const char *cpuname, FAR void *buffer,
-                            size_t size)
+void syslog_rpmsg_init_early(FAR const char *cpuname, FAR void *buffer,
+                             size_t size)
 {
   FAR struct syslog_rpmsg_s *priv = &g_syslog_rpmsg;
   char prev, cur;
@@ -403,8 +395,6 @@ out:
       priv->head = priv->tail = 0;
       memset(priv->buffer, 0, size);
     }
-
-  return syslog_channel(&g_syslog_rpmsg_channel);
 }
 
 int syslog_rpmsg_init(void)
diff --git a/include/nuttx/syslog/syslog_rpmsg.h b/include/nuttx/syslog/syslog_rpmsg.h
index 33ec670..ac762f6 100644
--- a/include/nuttx/syslog/syslog_rpmsg.h
+++ b/include/nuttx/syslog/syslog_rpmsg.h
@@ -56,8 +56,8 @@ extern "C"
 #endif
 
 #ifdef CONFIG_SYSLOG_RPMSG
-int syslog_rpmsg_init_early(FAR const char *cpu_name, FAR void *buffer,
-                            size_t size);
+void syslog_rpmsg_init_early(FAR const char *cpu_name, FAR void *buffer,
+                             size_t size);
 int syslog_rpmsg_init(void);
 int syslog_rpmsg_putc(int ch);
 #endif