diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2012-09-17 05:44:35 +0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2012-10-03 15:11:25 -0700 |
commit | 717460ee3e8399eb66799cac0bb83217475b7027 (patch) | |
tree | f14d582c9a024a292e6b85dc899ebe59b0e7c972 /arch/xtensa/platforms/iss/network.c | |
parent | 33c8213d6930cfa1d09e2912b9e2d59f251c33b7 (diff) | |
download | op-kernel-dev-717460ee3e8399eb66799cac0bb83217475b7027.zip op-kernel-dev-717460ee3e8399eb66799cac0bb83217475b7027.tar.gz |
xtensa: ISS: fix __simc implementation
Do not rely on compiler implicitly placing function arguments into
specifc registers, place them explicitly.
Move __simc and related helpers to platform/simcall.h
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/platforms/iss/network.c')
-rw-r--r-- | arch/xtensa/platforms/iss/network.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c index 7dde244..7d0fea6 100644 --- a/arch/xtensa/platforms/iss/network.c +++ b/arch/xtensa/platforms/iss/network.c @@ -101,55 +101,6 @@ struct iss_net_private { }; -/* ======================= ISS SIMCALL INTERFACE =========================== */ - -/* Note: __simc must _not_ be declared inline! */ - -static int errno; - -static int __simc (int a, int b, int c, int d, int e, int f) __attribute__((__noinline__)); -static int __simc (int a, int b, int c, int d, int e, int f) -{ - int ret; - __asm__ __volatile__ ("simcall\n" - "mov %0, a2\n" - "mov %1, a3\n" : "=a" (ret), "=a" (errno) - : : "a2", "a3"); - return ret; -} - -static int inline simc_open(char *file, int flags, int mode) -{ - return __simc(SYS_open, (int) file, flags, mode, 0, 0); -} - -static int inline simc_close(int fd) -{ - return __simc(SYS_close, fd, 0, 0, 0, 0); -} - -static int inline simc_ioctl(int fd, int request, void *arg) -{ - return __simc(SYS_ioctl, fd, request, (int) arg, 0, 0); -} - -static int inline simc_read(int fd, void *buf, size_t count) -{ - return __simc(SYS_read, fd, (int) buf, count, 0, 0); -} - -static int inline simc_write(int fd, void *buf, size_t count) -{ - return __simc(SYS_write, fd, (int) buf, count, 0, 0); -} - -static int inline simc_poll(int fd) -{ - struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; - - return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv,0,0); -} - /* ================================ HELPERS ================================ */ |