Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: fusl/arch/x32/src/syscall_cp_fixup.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/arch/x32/reloc.h ('k') | fusl/arch/x32/src/sysinfo.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <sys/syscall.h>
2
3 __attribute__((__visibility__("hidden")))
4 long __syscall_cp_internal(volatile void*, long long, long long, long long, long long,
5 long long, long long, long long);
6
7 struct __timespec { long long tv_sec; long tv_nsec; };
8 struct __timespec_kernel { long long tv_sec; long long tv_nsec; };
9 #define __tsc(X) ((struct __timespec*)(unsigned long)(X))
10 #define __fixup(X) do { if(X) { \
11 ts->tv_sec = __tsc(X)->tv_sec; \
12 ts->tv_nsec = __tsc(X)->tv_nsec; \
13 (X) = (unsigned long)ts; } } while(0)
14
15 __attribute__((__visibility__("hidden")))
16 long __syscall_cp_asm (volatile void * foo, long long n, long long a1, long long a2, long long a3,
17 long long a4, long long a5, long long a6)
18 {
19 struct __timespec_kernel ts[1];
20 switch (n) {
21 case SYS_mq_timedsend: case SYS_mq_timedreceive: case SYS_pselect6:
22 __fixup(a5);
23 break;
24 case SYS_futex:
25 if((a2 & (~128 /* FUTEX_PRIVATE_FLAG */)) == 0 /* FUTEX_WAIT */)
26 __fixup(a4);
27 break;
28 case SYS_clock_nanosleep:
29 case SYS_rt_sigtimedwait: case SYS_ppoll:
30 __fixup(a3);
31 break;
32 case SYS_nanosleep:
33 __fixup(a1);
34 break;
35 }
36 return __syscall_cp_internal(foo, n, a1, a2, a3, a4, a5, a6);
37 }
38
OLDNEW
« no previous file with comments | « fusl/arch/x32/reloc.h ('k') | fusl/arch/x32/src/sysinfo.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698