Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+20
+20
arch/xtensa/platforms/iss/include/platform/simcall.h
··· 6 6 * for more details. 7 7 * 8 8 * Copyright (C) 2001 Tensilica Inc. 9 + * Copyright (C) 2017 Cadence Design Systems Inc. 9 10 */ 10 11 11 12 #ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H ··· 49 48 #define SYS_select_one 29 /* not compitible select, one file descriptor at the time */ 50 49 #define SYS_bind 30 51 50 #define SYS_ioctl 31 51 + 52 + #define SYS_iss_argc 1000 /* returns value of argc */ 53 + #define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */ 54 + #define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */ 52 55 53 56 /* 54 57 * SYS_select_one specifiers ··· 121 116 static inline int simc_lseek(int fd, uint32_t off, int whence) 122 117 { 123 118 return __simc(SYS_lseek, fd, off, whence); 119 + } 120 + 121 + static inline int simc_argc(void) 122 + { 123 + return __simc(SYS_iss_argc, 0, 0, 0); 124 + } 125 + 126 + static inline int simc_argv_size(void) 127 + { 128 + return __simc(SYS_iss_argv_size, 0, 0, 0); 129 + } 130 + 131 + static inline void simc_argv(void *buf) 132 + { 133 + __simc(SYS_iss_set_argv, (int)buf, 0, 0); 124 134 } 125 135 126 136 #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */