| .. | .. |
|---|
| 66 | 66 | |
|---|
| 67 | 67 | static inline int __simc(int a, int b, int c, int d) |
|---|
| 68 | 68 | { |
|---|
| 69 | | - int ret; |
|---|
| 70 | 69 | register int a1 asm("a2") = a; |
|---|
| 71 | 70 | register int b1 asm("a3") = b; |
|---|
| 72 | 71 | register int c1 asm("a4") = c; |
|---|
| 73 | 72 | register int d1 asm("a5") = d; |
|---|
| 74 | 73 | __asm__ __volatile__ ( |
|---|
| 75 | 74 | "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) |
|---|
| 79 | 76 | : "r"(c1), "r"(d1) |
|---|
| 80 | 77 | : "memory"); |
|---|
| 81 | | - return ret; |
|---|
| 78 | + errno = b1; |
|---|
| 79 | + return a1; |
|---|
| 82 | 80 | } |
|---|
| 83 | 81 | |
|---|
| 84 | 82 | static inline int simc_exit(int exit_code) |
|---|
| .. | .. |
|---|
| 113 | 111 | |
|---|
| 114 | 112 | static inline int simc_poll(int fd) |
|---|
| 115 | 113 | { |
|---|
| 116 | | - struct timeval tv = { .tv_sec = 0, .tv_usec = 0 }; |
|---|
| 114 | + long timeval[2] = { 0, 0 }; |
|---|
| 117 | 115 | |
|---|
| 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); |
|---|
| 119 | 117 | } |
|---|
| 120 | 118 | |
|---|
| 121 | 119 | static inline int simc_lseek(int fd, uint32_t off, int whence) |
|---|