forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/xtensa/platforms/iss/include/platform/simcall.h
....@@ -66,19 +66,17 @@
6666
6767 static inline int __simc(int a, int b, int c, int d)
6868 {
69
- int ret;
7069 register int a1 asm("a2") = a;
7170 register int b1 asm("a3") = b;
7271 register int c1 asm("a4") = c;
7372 register int d1 asm("a5") = d;
7473 __asm__ __volatile__ (
7574 "simcall\n"
76
- "mov %0, a2\n"
77
- "mov %1, a3\n"
78
- : "=a" (ret), "=a" (errno), "+r"(a1), "+r"(b1)
75
+ : "+r"(a1), "+r"(b1)
7976 : "r"(c1), "r"(d1)
8077 : "memory");
81
- return ret;
78
+ errno = b1;
79
+ return a1;
8280 }
8381
8482 static inline int simc_exit(int exit_code)
....@@ -113,9 +111,9 @@
113111
114112 static inline int simc_poll(int fd)
115113 {
116
- struct timeval tv = { .tv_sec = 0, .tv_usec = 0 };
114
+ long timeval[2] = { 0, 0 };
117115
118
- return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv);
116
+ return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&timeval);
119117 }
120118
121119 static inline int simc_lseek(int fd, uint32_t off, int whence)