summaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-03-13 10:23:02 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2017-03-13 13:47:12 -0700
commite8cd8da934f29a0aca2c4bd96310a0b6ba6e31a7 (patch)
treeb1663fe4afeaabca64b9a297078de182cb7bb2d4 /arch/xtensa
parent3ced97305ded104e0c2814241952e261997dbb65 (diff)
downloadtalos-obmc-linux-e8cd8da934f29a0aca2c4bd96310a0b6ba6e31a7.tar.gz
talos-obmc-linux-e8cd8da934f29a0aca2c4bd96310a0b6ba6e31a7.zip
xtensa: ISS: add argc/argv simcall definitions
There are three simcalls implemented by ISS and QEMU related to argc/argv processing: SYS_iss_argc (get number of command line arguments), SYS_iss_argv_size (get size of command line argument block) and SYS_iss_set_argv (copy command line arguments to virtual guest address). Add definitions for these calls to iss/include/platform/simcall.h Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/platforms/iss/include/platform/simcall.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h
index 27d7a528b41a..2ba45858e50a 100644
--- a/arch/xtensa/platforms/iss/include/platform/simcall.h
+++ b/arch/xtensa/platforms/iss/include/platform/simcall.h
@@ -6,6 +6,7 @@
* for more details.
*
* Copyright (C) 2001 Tensilica Inc.
+ * Copyright (C) 2017 Cadence Design Systems Inc.
*/
#ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H
@@ -49,6 +50,10 @@
#define SYS_bind 30
#define SYS_ioctl 31
+#define SYS_iss_argc 1000 /* returns value of argc */
+#define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */
+#define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */
+
/*
* SYS_select_one specifiers
*/
@@ -118,5 +123,20 @@ static inline int simc_lseek(int fd, uint32_t off, int whence)
return __simc(SYS_lseek, fd, off, whence);
}
+static inline int simc_argc(void)
+{
+ return __simc(SYS_iss_argc, 0, 0, 0);
+}
+
+static inline int simc_argv_size(void)
+{
+ return __simc(SYS_iss_argv_size, 0, 0, 0);
+}
+
+static inline void simc_argv(void *buf)
+{
+ __simc(SYS_iss_set_argv, (int)buf, 0, 0);
+}
+
#endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */
OpenPOWER on IntegriCloud