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 2021/07/27 02:36:09 UTC
[incubator-nuttx] branch master updated: sim/cmdline: save boot
cmdline to g_argc g_argv
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/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e98220c sim/cmdline: save boot cmdline to g_argc g_argv
e98220c is described below
commit e98220c81ac0ddb6deb339d147cce3d1276a8a74
Author: Jiuzhu Dong <do...@xiaomi.com>
AuthorDate: Fri Jul 16 18:17:10 2021 +0800
sim/cmdline: save boot cmdline to g_argc g_argv
Change-Id: I989850a09528e3868957284c9f419d0992ae8d1f
Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
---
arch/sim/src/sim/up_head.c | 10 ++++++++++
arch/sim/src/sim/up_internal.h | 5 +++++
2 files changed, 15 insertions(+)
diff --git a/arch/sim/src/sim/up_head.c b/arch/sim/src/sim/up_head.c
index 6868c9a..1784be5 100644
--- a/arch/sim/src/sim/up_head.c
+++ b/arch/sim/src/sim/up_head.c
@@ -38,6 +38,13 @@
#include "up_internal.h"
/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+int g_argc;
+char **g_argv;
+
+/****************************************************************************
* Private Data
****************************************************************************/
@@ -62,6 +69,9 @@ static char g_logbuffer[4096];
int main(int argc, char **argv, char **envp)
{
+ g_argc = argc;
+ g_argv = argv;
+
#ifdef CONFIG_SYSLOG_RPMSG
syslog_rpmsg_init_early(g_logbuffer, sizeof(g_logbuffer));
#endif
diff --git a/arch/sim/src/sim/up_internal.h b/arch/sim/src/sim/up_internal.h
index 3a73afa..a0bfe4b 100644
--- a/arch/sim/src/sim/up_internal.h
+++ b/arch/sim/src/sim/up_internal.h
@@ -123,6 +123,11 @@ extern volatile void *g_current_regs[1];
#endif
+/* The command line arguments passed to simulator */
+
+extern int g_argc;
+extern char **g_argv;
+
/****************************************************************************
* Public Function Prototypes
****************************************************************************/