You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/02/13 12:37:32 UTC

[nuttx] branch master updated: sim/windows: fix build break on visual studio

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 1e7014262c sim/windows: fix build break on visual studio
1e7014262c is described below

commit 1e7014262c5c93598fc00915a97ca39f8866f1f8
Author: chao an <an...@xiaomi.com>
AuthorDate: Wed Feb 8 11:05:25 2023 +0800

    sim/windows: fix build break on visual studio
    
    1. fix build break on visual studio
    2. enable more net config
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 arch/sim/src/sim/posix/sim_hostuart.c        |  8 ++++----
 arch/sim/src/sim/sim_internal.h              | 18 +++++++++---------
 arch/sim/src/sim/win/sim_hostirq.c           | 13 +++++++++++++
 arch/sim/src/sim/win/sim_hostuart.c          |  4 ++--
 boards/sim/sim/sim/configs/windows/defconfig | 20 ++++++++++++++++++--
 5 files changed, 46 insertions(+), 17 deletions(-)

diff --git a/arch/sim/src/sim/posix/sim_hostuart.c b/arch/sim/src/sim/posix/sim_hostuart.c
index 8be67f086d..33afe8c9af 100644
--- a/arch/sim/src/sim/posix/sim_hostuart.c
+++ b/arch/sim/src/sim/posix/sim_hostuart.c
@@ -134,9 +134,9 @@ void host_uart_close(int fd)
  * Name: host_uart_puts
  ****************************************************************************/
 
-ssize_t host_uart_puts(int fd, const char *buf, size_t size)
+int host_uart_puts(int fd, const char *buf, size_t size)
 {
-  ssize_t ret;
+  int ret;
 
   do
     {
@@ -151,9 +151,9 @@ ssize_t host_uart_puts(int fd, const char *buf, size_t size)
  * Name: host_uart_gets
  ****************************************************************************/
 
-ssize_t host_uart_gets(int fd, char *buf, size_t size)
+int host_uart_gets(int fd, char *buf, size_t size)
 {
-  ssize_t ret;
+  int ret;
 
   do
     {
diff --git a/arch/sim/src/sim/sim_internal.h b/arch/sim/src/sim/sim_internal.h
index e498c987b5..a2d7c7167b 100644
--- a/arch/sim/src/sim/sim_internal.h
+++ b/arch/sim/src/sim/sim_internal.h
@@ -215,15 +215,15 @@ void sim_uartinit(void);
 
 /* sim_hostuart.c ***********************************************************/
 
-void    host_uart_start(void);
-int     host_uart_open(const char *pathname);
-void    host_uart_close(int fd);
-ssize_t host_uart_puts(int fd, const char *buf, size_t size);
-ssize_t host_uart_gets(int fd, char *buf, size_t size);
-bool    host_uart_checkin(int fd);
-bool    host_uart_checkout(int fd);
-int     host_uart_setcflag(int fd, unsigned int cflag);
-int     host_uart_getcflag(int fd, unsigned int *cflag);
+void host_uart_start(void);
+int  host_uart_open(const char *pathname);
+void host_uart_close(int fd);
+int  host_uart_puts(int fd, const char *buf, size_t size);
+int  host_uart_gets(int fd, char *buf, size_t size);
+bool host_uart_checkin(int fd);
+bool host_uart_checkout(int fd);
+int  host_uart_setcflag(int fd, unsigned int cflag);
+int  host_uart_getcflag(int fd, unsigned int *cflag);
 
 /* sim_deviceimage.c ********************************************************/
 
diff --git a/arch/sim/src/sim/win/sim_hostirq.c b/arch/sim/src/sim/win/sim_hostirq.c
index bb3ce3d085..b4ea560cf6 100644
--- a/arch/sim/src/sim/win/sim_hostirq.c
+++ b/arch/sim/src/sim/win/sim_hostirq.c
@@ -37,6 +37,19 @@ volatile void *g_current_regs[CONFIG_SMP_NCPUS];
  * Public Functions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: up_irq_flags
+ *
+ * Description:
+ *   Get the current irq flags
+ *
+ ****************************************************************************/
+
+uint64_t up_irq_flags(void)
+{
+  return 0;
+}
+
 /****************************************************************************
  * Name: up_irq_save
  *
diff --git a/arch/sim/src/sim/win/sim_hostuart.c b/arch/sim/src/sim/win/sim_hostuart.c
index 852616aa3f..2dad21907a 100644
--- a/arch/sim/src/sim/win/sim_hostuart.c
+++ b/arch/sim/src/sim/win/sim_hostuart.c
@@ -78,7 +78,7 @@ void host_uart_close(int fd)
  * Name: host_uart_putc
  ****************************************************************************/
 
-ssize_t host_uart_puts(int fd, const char *buf, size_t size)
+int host_uart_puts(int fd, const char *buf, size_t size)
 {
   DWORD nwritten;
   int ret;
@@ -92,7 +92,7 @@ ssize_t host_uart_puts(int fd, const char *buf, size_t size)
  * Name: host_uart_getc
  ****************************************************************************/
 
-ssize_t host_uart_gets(int fd, char *buf, size_t size)
+int host_uart_gets(int fd, char *buf, size_t size)
 {
   DWORD nread;
   int ret;
diff --git a/boards/sim/sim/sim/configs/windows/defconfig b/boards/sim/sim/sim/configs/windows/defconfig
index 6d695cc1f1..a39de30024 100644
--- a/boards/sim/sim/sim/configs/windows/defconfig
+++ b/boards/sim/sim/sim/configs/windows/defconfig
@@ -9,7 +9,6 @@ CONFIG_ARCH="sim"
 CONFIG_ARCH_BOARD="sim"
 CONFIG_ARCH_BOARD_SIM=y
 CONFIG_ARCH_CHIP="sim"
-CONFIG_ARCH_FLOAT_H=y
 CONFIG_ARCH_SIM=y
 CONFIG_BOARDCTL_POWEROFF=y
 CONFIG_BOARD_LATE_INITIALIZE=y
@@ -25,19 +24,36 @@ CONFIG_HOST_WINDOWS=y
 CONFIG_HOST_X86=y
 CONFIG_IDLETHREAD_STACKSIZE=4096
 CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_IOB_NBUFFERS=196
+CONFIG_IOB_THROTTLE=0
+CONFIG_LIBM=y
 CONFIG_NET=y
 CONFIG_NETDB_DNSCLIENT=y
 CONFIG_NETDEV_PHY_IOCTL=y
 CONFIG_NET_ARP_SEND=y
+CONFIG_NET_BINDTODEVICE=y
 CONFIG_NET_BROADCAST=y
-CONFIG_NET_CAN=y
 CONFIG_NET_ICMP=y
 CONFIG_NET_ICMP_SOCKET=y
+CONFIG_NET_ICMPv6=y
+CONFIG_NET_ICMPv6_AUTOCONF=y
+CONFIG_NET_ICMPv6_NEIGHBOR=y
+CONFIG_NET_ICMPv6_ROUTER=y
+CONFIG_NET_ICMPv6_ROUTER_MANUAL=y
+CONFIG_NET_ICMPv6_SOCKET=y
+CONFIG_NET_IPFORWARD=y
+CONFIG_NET_IPFORWARD_BROADCAST=y
+CONFIG_NET_IPFRAG=y
+CONFIG_NET_IPv6=y
 CONFIG_NET_LOCAL=y
 CONFIG_NET_LOOPBACK=y
+CONFIG_NET_NAT=y
 CONFIG_NET_PKT=y
 CONFIG_NET_PROMISCUOUS=y
 CONFIG_NET_STATISTICS=y
+CONFIG_NET_TCP=y
+CONFIG_NET_TCPBACKLOG=y
+CONFIG_NET_TCP_WRITE_BUFFERS=y
 CONFIG_NET_UDP=y
 CONFIG_NET_UDP_WRITE_BUFFERS=y
 CONFIG_NSH_ARCHINIT=y