You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/05/03 13:50:00 UTC

[incubator-nuttx] branch master updated: x86_64: Add nsh configuration with procfs bringup

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6204e10  x86_64: Add nsh configuration with procfs bringup
6204e10 is described below

commit 6204e10e2ed49aa8af6c77ff0f49b5f80908aeec
Author: Brennan Ashton <ba...@brennanashton.com>
AuthorDate: Sat May 2 15:38:30 2020 -0700

    x86_64: Add nsh configuration with procfs bringup
    
    Signed-off-by: Brennan Ashton <ba...@brennanashton.com>
---
 .../intel64/qemu-intel64/configs/nsh/defconfig     | 60 ++++++++++++++++++++++
 boards/x86_64/intel64/qemu-intel64/src/Makefile    |  2 +-
 .../x86_64/intel64/qemu-intel64/src/qemu_appinit.c | 13 +++--
 .../src/{qemu_intel64.h => qemu_bringup.c}         | 43 ++++++++++------
 .../x86_64/intel64/qemu-intel64/src/qemu_intel64.h |  2 +
 5 files changed, 99 insertions(+), 21 deletions(-)

diff --git a/boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig b/boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig
new file mode 100644
index 0000000..732bb5a
--- /dev/null
+++ b/boards/x86_64/intel64/qemu-intel64/configs/nsh/defconfig
@@ -0,0 +1,60 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+CONFIG_16550_ADDRWIDTH=16
+CONFIG_16550_UART0=y
+CONFIG_16550_UART0_BASE=0x3f8
+CONFIG_16550_UART0_CLOCK=1843200
+CONFIG_16550_UART0_IRQ=36
+CONFIG_16550_UART0_RXBUFSIZE=16
+CONFIG_16550_UART0_SERIAL_CONSOLE=y
+CONFIG_16550_UART0_TXBUFSIZE=16
+CONFIG_16550_UART=y
+CONFIG_ARCH="x86_64"
+CONFIG_ARCH_BOARD="qemu-intel64"
+CONFIG_ARCH_BOARD_INTEL64_QEMU=y
+CONFIG_ARCH_CHIP="intel64"
+CONFIG_ARCH_INTEL64_CORE_FREQ_KHZ=2600000
+CONFIG_ARCH_SIZET_LONG=y
+CONFIG_ARCH_X86_64=y
+CONFIG_BOARD_LOOPSPERMSEC=999
+CONFIG_BOOT_RUNFROMEXTSRAM=y
+CONFIG_BUILTIN=y
+CONFIG_CLOCK_MONOTONIC=y
+CONFIG_CONSOLE_SYSLOG=y
+CONFIG_EXAMPLES_HELLO=y
+CONFIG_EXAMPLES_HELLO_STACKSIZE=4194304
+CONFIG_FS_PROCFS=y
+CONFIG_IDLETHREAD_STACKSIZE=4194304
+CONFIG_MAX_TASKS=64
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_DISABLE_IFCONFIG=y
+CONFIG_NSH_DISABLE_IFUPDOWN=y
+CONFIG_PREALLOC_CHILDSTATUS=16
+CONFIG_PRIORITY_INHERITANCE=y
+CONFIG_PTHREAD_MUTEX_TYPES=y
+CONFIG_PTHREAD_STACK_DEFAULT=4194304
+CONFIG_PTHREAD_STACK_MIN=4194304
+CONFIG_RAM_SIZE=268435456
+CONFIG_SCHED_CHILD_STATUS=y
+CONFIG_SCHED_HAVE_PARENT=y
+CONFIG_SCHED_TICKLESS=y
+CONFIG_SCHED_TICKLESS_ALARM=y
+CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SIG_DEFAULT=y
+CONFIG_START_DAY=3
+CONFIG_START_MONTH=3
+CONFIG_START_YEAR=2011
+CONFIG_SYSTEM_NSH=y
+CONFIG_SYSTEM_TIME64=y
+CONFIG_USEC_PER_TICK=1
+CONFIG_USERMAIN_STACKSIZE=4194304
+CONFIG_USER_ENTRYPOINT="nsh_main"
diff --git a/boards/x86_64/intel64/qemu-intel64/src/Makefile b/boards/x86_64/intel64/qemu-intel64/src/Makefile
index 990c431..b8eaed3 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/Makefile
+++ b/boards/x86_64/intel64/qemu-intel64/src/Makefile
@@ -21,7 +21,7 @@
 -include $(TOPDIR)/Make.defs
 
 ASRCS =
-CSRCS = qemu_boot.c qemu_freq.c qemu_net.c
+CSRCS = qemu_boot.c qemu_bringup.c qemu_freq.c qemu_net.c
 
 ifeq ($(CONFIG_LIB_BOARDCTL),y)
   CSRCS += qemu_appinit.c
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c
index 50fcb30..65fecf3 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_appinit.c
@@ -26,6 +26,7 @@
 #include <nuttx/board.h>
 
 #include "up_internal.h"
+#include "qemu_intel64.h"
 
 /****************************************************************************
  * Public Functions
@@ -56,9 +57,15 @@
  *
  ****************************************************************************/
 
-#ifdef CONFIG_LIB_BOARDCTL
 int board_app_initialize(uintptr_t arg)
 {
-  return 0;
+#ifdef CONFIG_BOARD_LATE_INITIALIZE
+  /* Board initialization already performed by board_late_initialize() */
+
+  return OK;
+#else
+  /* Perform board-specific initialization */
+
+  return qemu_bringup();
+#endif
 }
-#endif /* CONFIG_LIB_BOARDCTL */
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c
similarity index 65%
copy from boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h
copy to boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c
index a400d59..e9e7f0f 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/x86_64/intel64/qemu/src/qemu_intel64.h
+ * boards/x86_64/intel64/qemu-intel64/src/qemu_bringup.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,35 +18,44 @@
  *
  ****************************************************************************/
 
-#ifndef __BOARDS_X86_64_INTEL64_QEMU_SRC_QEMU_INTEL64_H
-#define __BOARDS_X86_64_INTEL64_QEMU_SRC_QEMU_INTEL64_H
-
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
-#include <nuttx/compiler.h>
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
+#include <sys/mount.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <syslog.h>
+#include <errno.h>
+
+#include <nuttx/board.h>
+#include <nuttx/input/buttons.h>
 
-/* GPIO Pin Definitions *****************************************************/
+#include "qemu_intel64.h"
 
 /****************************************************************************
- * Public Types
+ * Public Functions
  ****************************************************************************/
 
 /****************************************************************************
- * Public data
+ * Name: qemu_bringup
  ****************************************************************************/
 
-#ifndef __ASSEMBLY__
+int qemu_bringup(void)
+{
+  int ret = OK;
 
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
+#ifdef CONFIG_FS_PROCFS
+  /* Mount the procfs file system */
+
+  ret = mount(NULL, "/proc", "procfs", 0, NULL);
+  if (ret < 0)
+    {
+      serr("ERROR: Failed to mount procfs at %s: %d\n", "/proc", ret);
+    }
+#endif
 
-#endif /* __ASSEMBLY__ */
-#endif /* __BOARDS_X86_64_INTEL64_QEMU_SRC_QEMU_INTEL64_H */
+  return ret;
+}
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h b/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h
index a400d59..d1a10e0 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_intel64.h
@@ -48,5 +48,7 @@
  * Public Function Prototypes
  ****************************************************************************/
 
+int qemu_bringup(void);
+
 #endif /* __ASSEMBLY__ */
 #endif /* __BOARDS_X86_64_INTEL64_QEMU_SRC_QEMU_INTEL64_H */