2 * include/asm-xtensa/platform-iss/simcall.h
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 2001 Tensilica Inc.
9 * Copyright (C) 2017 - 2021 Cadence Design Systems Inc.
12 #ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H
13 #define _XTENSA_PLATFORM_ISS_SIMCALL_H
15 #include <linux/bug.h>
17 #ifdef CONFIG_XTENSA_SIMCALL_ISS
18 #include <platform/simcall-iss.h>
20 #ifdef CONFIG_XTENSA_SIMCALL_GDBIO
21 #include <platform/simcall-gdbio.h>
24 static inline int simc_exit(int exit_code)
27 return __simc(SYS_exit, exit_code, 0, 0);
29 WARN_ONCE(1, "%s: not implemented\n", __func__);
34 static inline int simc_open(const char *file, int flags, int mode)
36 return __simc(SYS_open, (int) file, flags, mode);
39 static inline int simc_close(int fd)
41 return __simc(SYS_close, fd, 0, 0);
44 static inline int simc_ioctl(int fd, int request, void *arg)
47 return __simc(SYS_ioctl, fd, request, (int) arg);
49 WARN_ONCE(1, "%s: not implemented\n", __func__);
54 static inline int simc_read(int fd, void *buf, size_t count)
56 return __simc(SYS_read, fd, (int) buf, count);
59 static inline int simc_write(int fd, const void *buf, size_t count)
61 return __simc(SYS_write, fd, (int) buf, count);
64 static inline int simc_poll(int fd)
67 long timeval[2] = { 0, 0 };
69 return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&timeval);
71 WARN_ONCE(1, "%s: not implemented\n", __func__);
76 static inline int simc_lseek(int fd, uint32_t off, int whence)
78 return __simc(SYS_lseek, fd, off, whence);
81 static inline int simc_argc(void)
84 return __simc(SYS_iss_argc, 0, 0, 0);
86 WARN_ONCE(1, "%s: not implemented\n", __func__);
91 static inline int simc_argv_size(void)
93 #ifdef SYS_iss_argv_size
94 return __simc(SYS_iss_argv_size, 0, 0, 0);
96 WARN_ONCE(1, "%s: not implemented\n", __func__);
101 static inline void simc_argv(void *buf)
103 #ifdef SYS_iss_set_argv
104 __simc(SYS_iss_set_argv, (int)buf, 0, 0);
106 WARN_ONCE(1, "%s: not implemented\n", __func__);
110 #endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */