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

Side by Side Diff: linux_syscall_support.h

Issue 219483003: Fix for x64 Android. __unused is #defined elsewhere. (Closed) Base URL: http://linux-syscall-support.googlecode.com/svn/trunk/lss
Patch Set: Fix for alternative Linux compiler configuration Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2005-2011, Google Inc. 1 /* Copyright (c) 2005-2011, Google Inc.
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 uint64_t st_rdev; 419 uint64_t st_rdev;
420 int64_t st_size; 420 int64_t st_size;
421 int64_t st_blksize; 421 int64_t st_blksize;
422 int64_t st_blocks; 422 int64_t st_blocks;
423 uint64_t st_atime_; 423 uint64_t st_atime_;
424 uint64_t st_atime_nsec_; 424 uint64_t st_atime_nsec_;
425 uint64_t st_mtime_; 425 uint64_t st_mtime_;
426 uint64_t st_mtime_nsec_; 426 uint64_t st_mtime_nsec_;
427 uint64_t st_ctime_; 427 uint64_t st_ctime_;
428 uint64_t st_ctime_nsec_; 428 uint64_t st_ctime_nsec_;
429 int64_t __unused[3]; 429 int64_t __unused4[3];
430 }; 430 };
431 #elif defined(__PPC__) 431 #elif defined(__PPC__)
432 struct kernel_stat { 432 struct kernel_stat {
433 unsigned st_dev; 433 unsigned st_dev;
434 unsigned long st_ino; // ino_t 434 unsigned long st_ino; // ino_t
435 unsigned long st_mode; // mode_t 435 unsigned long st_mode; // mode_t
436 unsigned short st_nlink; // nlink_t 436 unsigned short st_nlink; // nlink_t
437 unsigned st_uid; // uid_t 437 unsigned st_uid; // uid_t
438 unsigned st_gid; // gid_t 438 unsigned st_gid; // gid_t
439 unsigned st_rdev; 439 unsigned st_rdev;
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 long __res; 2234 long __res;
2235 { 2235 {
2236 register int __flags __asm__("r0") = flags; 2236 register int __flags __asm__("r0") = flags;
2237 register void *__stack __asm__("r1") = child_stack; 2237 register void *__stack __asm__("r1") = child_stack;
2238 register void *__ptid __asm__("r2") = parent_tidptr; 2238 register void *__ptid __asm__("r2") = parent_tidptr;
2239 register void *__tls __asm__("r3") = newtls; 2239 register void *__tls __asm__("r3") = newtls;
2240 register int *__ctid __asm__("r4") = child_tidptr; 2240 register int *__ctid __asm__("r4") = child_tidptr;
2241 __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL) 2241 __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL)
2242 * return -EINVAL; 2242 * return -EINVAL;
2243 */ 2243 */
2244 #ifdef __thumb2__» » » 2244 #ifdef __thumb2__
2245 "push {r7}\n" 2245 "push {r7}\n"
2246 #endif» » » 2246 #endif
2247 "cmp %2,#0\n" 2247 "cmp %2,#0\n"
2248 "it ne\n" 2248 "it ne\n"
2249 "cmpne %3,#0\n" 2249 "cmpne %3,#0\n"
2250 "it eq\n" 2250 "it eq\n"
2251 "moveq %0,%1\n" 2251 "moveq %0,%1\n"
2252 "beq 1f\n" 2252 "beq 1f\n"
2253 2253
2254 /* Push "arg" and "fn" onto the stack that will be 2254 /* Push "arg" and "fn" onto the stack that will be
2255 * used by the child. 2255 * used by the child.
2256 */ 2256 */
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 "ldr pc,[sp]\n" 2294 "ldr pc,[sp]\n"
2295 #endif 2295 #endif
2296 2296
2297 /* Call _exit(%r0). 2297 /* Call _exit(%r0).
2298 */ 2298 */
2299 "mov r7, %10\n" 2299 "mov r7, %10\n"
2300 "swi 0x0\n" 2300 "swi 0x0\n"
2301 "1:\n" 2301 "1:\n"
2302 #ifdef __thumb2__ 2302 #ifdef __thumb2__
2303 "pop {r7}" 2303 "pop {r7}"
2304 #endif» » » 2304 #endif
2305 : "=r" (__res) 2305 : "=r" (__res)
2306 : "i"(-EINVAL), 2306 : "i"(-EINVAL),
2307 "r"(fn), "r"(__stack), "r"(__flags), "r"(arg), 2307 "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
2308 "r"(__ptid), "r"(__tls), "r"(__ctid), 2308 "r"(__ptid), "r"(__tls), "r"(__ctid),
2309 "i"(__NR_clone), "i"(__NR_exit) 2309 "i"(__NR_clone), "i"(__NR_exit)
2310 #ifdef __thumb2__ 2310 #ifdef __thumb2__
2311 : "cc", "lr", "memory"); 2311 : "cc", "lr", "memory");
2312 #else 2312 #else
2313 : "cc", "r7", "lr", "memory"); 2313 : "cc", "r7", "lr", "memory");
2314 #endif 2314 #endif
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2923 } 2923 }
2924 2924
2925 LSS_INLINE int LSS_NAME(getresuid32)(uid_t *ruid, 2925 LSS_INLINE int LSS_NAME(getresuid32)(uid_t *ruid,
2926 uid_t *euid, 2926 uid_t *euid,
2927 uid_t *suid) { 2927 uid_t *suid) {
2928 return LSS_NAME(getresuid)(ruid, euid, suid); 2928 return LSS_NAME(getresuid)(ruid, euid, suid);
2929 } 2929 }
2930 2930
2931 /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */ 2931 /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */
2932 LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d, 2932 LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
2933 #ifdef __ANDROID__
2934 // Recent versions of NDK do not define __off64_t, where as Linux
2935 // only defines off64_t if __USE_LARGEFILE64 is defined.
2936 off64_t o) {
Mark Seaborn 2014/04/02 17:27:37 How about just using int64_t here?
2937 #else
2933 __off64_t o) { 2938 __off64_t o) {
2939 #endif
2934 LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l), 2940 LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
2935 LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f), 2941 LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
2936 LSS_SYSCALL_ARG(d), (uint64_t)(o)); 2942 LSS_SYSCALL_ARG(d), (uint64_t)(o));
2937 } 2943 }
2938 2944
2939 LSS_INLINE _syscall4(int, newfstatat, int, d, 2945 LSS_INLINE _syscall4(int, newfstatat, int, d,
2940 const char *, p, 2946 const char *, p,
2941 struct kernel_stat*, b, int, f) 2947 struct kernel_stat*, b, int, f)
2942 2948
2943 LSS_INLINE int LSS_NAME(setfsgid32)(gid_t gid) { 2949 LSS_INLINE int LSS_NAME(setfsgid32)(gid_t gid) {
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
3665 # pragma pop_macro("fstat64") 3671 # pragma pop_macro("fstat64")
3666 # pragma pop_macro("lstat64") 3672 # pragma pop_macro("lstat64")
3667 #endif 3673 #endif
3668 3674
3669 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) 3675 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS)
3670 } 3676 }
3671 #endif 3677 #endif
3672 3678
3673 #endif 3679 #endif
3674 #endif 3680 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698