OLD | NEW |
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 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2572 "$11", "$12", "$13", "$14", "$15", \ | 2572 "$11", "$12", "$13", "$14", "$15", \ |
2573 "$24", "$25", "hi", "lo", "memory" | 2573 "$24", "$25", "hi", "lo", "memory" |
2574 #else | 2574 #else |
2575 #define LSS_SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", \ | 2575 #define LSS_SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", \ |
2576 "$13", "$14", "$15", "$24", "$25", \ | 2576 "$13", "$14", "$15", "$24", "$25", \ |
2577 "hi", "lo", "memory" | 2577 "hi", "lo", "memory" |
2578 #endif | 2578 #endif |
2579 #define LSS_BODY(type,name,r7,...) \ | 2579 #define LSS_BODY(type,name,r7,...) \ |
2580 register unsigned long __v0 __asm__("$2") = __NR_##name; \ | 2580 register unsigned long __v0 __asm__("$2") = __NR_##name; \ |
2581 __asm__ __volatile__ ("syscall\n" \ | 2581 __asm__ __volatile__ ("syscall\n" \ |
2582 : "+r"(__v0), r7 (__r7) \ | 2582 : "=r"(__v0), r7 (__r7) \ |
2583 : "0"(__v0), ##__VA_ARGS__ \ | 2583 : "0"(__v0), ##__VA_ARGS__ \ |
2584 : LSS_SYSCALL_CLOBBERS); \ | 2584 : LSS_SYSCALL_CLOBBERS); \ |
2585 LSS_RETURN(type, __v0, __r7) | 2585 LSS_RETURN(type, __v0, __r7) |
2586 #undef _syscall0 | 2586 #undef _syscall0 |
2587 #define _syscall0(type, name) \ | 2587 #define _syscall0(type, name) \ |
2588 type LSS_NAME(name)(void) { \ | 2588 type LSS_NAME(name)(void) { \ |
2589 register unsigned long __r7 __asm__("$7"); \ | 2589 register unsigned long __r7 __asm__("$7"); \ |
2590 LSS_BODY(type, name, "=r"); \ | 2590 LSS_BODY(type, name, "=r"); \ |
2591 } | 2591 } |
2592 #undef _syscall1 | 2592 #undef _syscall1 |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3735 #endif | 3735 #endif |
3736 #if defined(__mips__) | 3736 #if defined(__mips__) |
3737 /* sys_pipe() on MIPS has non-standard calling conventions, as it returns | 3737 /* sys_pipe() on MIPS has non-standard calling conventions, as it returns |
3738 * both file handles through CPU registers. | 3738 * both file handles through CPU registers. |
3739 */ | 3739 */ |
3740 LSS_INLINE int LSS_NAME(pipe)(int *p) { | 3740 LSS_INLINE int LSS_NAME(pipe)(int *p) { |
3741 register unsigned long __v0 __asm__("$2") = __NR_pipe; | 3741 register unsigned long __v0 __asm__("$2") = __NR_pipe; |
3742 register unsigned long __v1 __asm__("$3"); | 3742 register unsigned long __v1 __asm__("$3"); |
3743 register unsigned long __r7 __asm__("$7"); | 3743 register unsigned long __r7 __asm__("$7"); |
3744 __asm__ __volatile__ ("syscall\n" | 3744 __asm__ __volatile__ ("syscall\n" |
3745 : "+r"(__v0), "=r"(__v1), "=r" (__r7) | 3745 : "=r"(__v0), "=r"(__v1), "=r" (__r7) |
3746 : "0"(__v0) | 3746 : "0"(__v0) |
3747 : "$8", "$9", "$10", "$11", "$12", | 3747 : "$8", "$9", "$10", "$11", "$12", |
3748 "$13", "$14", "$15", "$24", "$25", "memory"); | 3748 "$13", "$14", "$15", "$24", "$25", "memory"); |
3749 if (__r7) { | 3749 if (__r7) { |
3750 unsigned long __errnovalue = __v0; | 3750 unsigned long __errnovalue = __v0; |
3751 LSS_ERRNO = __errnovalue; | 3751 LSS_ERRNO = __errnovalue; |
3752 return -1; | 3752 return -1; |
3753 } else { | 3753 } else { |
3754 p[0] = __v0; | 3754 p[0] = __v0; |
3755 p[1] = __v1; | 3755 p[1] = __v1; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4020 # pragma pop_macro("fstat64") | 4020 # pragma pop_macro("fstat64") |
4021 # pragma pop_macro("lstat64") | 4021 # pragma pop_macro("lstat64") |
4022 #endif | 4022 #endif |
4023 | 4023 |
4024 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) | 4024 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) |
4025 } | 4025 } |
4026 #endif | 4026 #endif |
4027 | 4027 |
4028 #endif | 4028 #endif |
4029 #endif | 4029 #endif |
OLD | NEW |