1570af302Sopenharmony_ci#define __SYSCALL_LL_E(x) (x) 2570af302Sopenharmony_ci#define __SYSCALL_LL_O(x) (x) 3570af302Sopenharmony_ci 4570af302Sopenharmony_cistatic inline long __syscall0(long n) 5570af302Sopenharmony_ci{ 6570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 7570af302Sopenharmony_ci register long r3 __asm__("r3"); 8570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 9570af302Sopenharmony_ci : "+r"(r0), "=r"(r3) 10570af302Sopenharmony_ci :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); 11570af302Sopenharmony_ci return r3; 12570af302Sopenharmony_ci} 13570af302Sopenharmony_ci 14570af302Sopenharmony_cistatic inline long __syscall1(long n, long a) 15570af302Sopenharmony_ci{ 16570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 17570af302Sopenharmony_ci register long r3 __asm__("r3") = a; 18570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 19570af302Sopenharmony_ci : "+r"(r0), "+r"(r3) 20570af302Sopenharmony_ci :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); 21570af302Sopenharmony_ci return r3; 22570af302Sopenharmony_ci} 23570af302Sopenharmony_ci 24570af302Sopenharmony_cistatic inline long __syscall2(long n, long a, long b) 25570af302Sopenharmony_ci{ 26570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 27570af302Sopenharmony_ci register long r3 __asm__("r3") = a; 28570af302Sopenharmony_ci register long r4 __asm__("r4") = b; 29570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 30570af302Sopenharmony_ci : "+r"(r0), "+r"(r3), "+r"(r4) 31570af302Sopenharmony_ci :: "memory", "cr0", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); 32570af302Sopenharmony_ci return r3; 33570af302Sopenharmony_ci} 34570af302Sopenharmony_ci 35570af302Sopenharmony_cistatic inline long __syscall3(long n, long a, long b, long c) 36570af302Sopenharmony_ci{ 37570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 38570af302Sopenharmony_ci register long r3 __asm__("r3") = a; 39570af302Sopenharmony_ci register long r4 __asm__("r4") = b; 40570af302Sopenharmony_ci register long r5 __asm__("r5") = c; 41570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 42570af302Sopenharmony_ci : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5) 43570af302Sopenharmony_ci :: "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12"); 44570af302Sopenharmony_ci return r3; 45570af302Sopenharmony_ci} 46570af302Sopenharmony_ci 47570af302Sopenharmony_cistatic inline long __syscall4(long n, long a, long b, long c, long d) 48570af302Sopenharmony_ci{ 49570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 50570af302Sopenharmony_ci register long r3 __asm__("r3") = a; 51570af302Sopenharmony_ci register long r4 __asm__("r4") = b; 52570af302Sopenharmony_ci register long r5 __asm__("r5") = c; 53570af302Sopenharmony_ci register long r6 __asm__("r6") = d; 54570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 55570af302Sopenharmony_ci : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6) 56570af302Sopenharmony_ci :: "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12"); 57570af302Sopenharmony_ci return r3; 58570af302Sopenharmony_ci} 59570af302Sopenharmony_ci 60570af302Sopenharmony_cistatic inline long __syscall5(long n, long a, long b, long c, long d, long e) 61570af302Sopenharmony_ci{ 62570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 63570af302Sopenharmony_ci register long r3 __asm__("r3") = a; 64570af302Sopenharmony_ci register long r4 __asm__("r4") = b; 65570af302Sopenharmony_ci register long r5 __asm__("r5") = c; 66570af302Sopenharmony_ci register long r6 __asm__("r6") = d; 67570af302Sopenharmony_ci register long r7 __asm__("r7") = e; 68570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 69570af302Sopenharmony_ci : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7) 70570af302Sopenharmony_ci :: "memory", "cr0", "r8", "r9", "r10", "r11", "r12"); 71570af302Sopenharmony_ci return r3; 72570af302Sopenharmony_ci} 73570af302Sopenharmony_ci 74570af302Sopenharmony_cistatic inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) 75570af302Sopenharmony_ci{ 76570af302Sopenharmony_ci register long r0 __asm__("r0") = n; 77570af302Sopenharmony_ci register long r3 __asm__("r3") = a; 78570af302Sopenharmony_ci register long r4 __asm__("r4") = b; 79570af302Sopenharmony_ci register long r5 __asm__("r5") = c; 80570af302Sopenharmony_ci register long r6 __asm__("r6") = d; 81570af302Sopenharmony_ci register long r7 __asm__("r7") = e; 82570af302Sopenharmony_ci register long r8 __asm__("r8") = f; 83570af302Sopenharmony_ci __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:" 84570af302Sopenharmony_ci : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7), "+r"(r8) 85570af302Sopenharmony_ci :: "memory", "cr0", "r9", "r10", "r11", "r12"); 86570af302Sopenharmony_ci return r3; 87570af302Sopenharmony_ci} 88570af302Sopenharmony_ci 89570af302Sopenharmony_ci#define SO_RCVTIMEO_OLD 18 90570af302Sopenharmony_ci#define SO_SNDTIMEO_OLD 19 91