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 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2558 "i"(__NR_clone), "i"(__NR_exit) | 2558 "i"(__NR_clone), "i"(__NR_exit) |
2559 : "cc", "x8", "memory"); | 2559 : "cc", "x8", "memory"); |
2560 } | 2560 } |
2561 LSS_RETURN(int, __res); | 2561 LSS_RETURN(int, __res); |
2562 } | 2562 } |
2563 #elif defined(__mips__) | 2563 #elif defined(__mips__) |
2564 #undef LSS_REG | 2564 #undef LSS_REG |
2565 #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \ | 2565 #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \ |
2566 (unsigned long)(a) | 2566 (unsigned long)(a) |
2567 #undef LSS_BODY | 2567 #undef LSS_BODY |
2568 #undef LSS_SYSCALL_CLOBBERS | |
2569 #if _MIPS_SIM == _MIPS_SIM_ABI32 | |
2570 #define LSS_SYSCALL_CLOBBERS "$8", "$9", "$10", "$11", "$12", \ | |
Mark Seaborn
2014/07/22 18:19:37
Shouldn't this also have $1 (aka $at), $3 (aka $v1
Lei Zhang
2014/07/31 22:52:51
Done.
| |
2571 "$13", "$14", "$15", "$24", "$25", \ | |
2572 "memory" | |
2573 #else | |
2574 #define LSS_SYSCALL_CLOBBERS "$1", "3" "$10", "$11", "$12", \ | |
Mark Seaborn
2014/07/22 18:19:37
Presumably should be:
"$3",
i.e. missing comma
Lei Zhang
2014/07/31 22:52:51
Done.
| |
2575 "$13", "$14", "$15", "$24", "$25", \ | |
2576 "hi", "lo", "memory" | |
2577 #endif | |
2568 #define LSS_BODY(type,name,r7,...) \ | 2578 #define LSS_BODY(type,name,r7,...) \ |
2569 register unsigned long __v0 __asm__("$2") = __NR_##name; \ | 2579 register unsigned long __v0 __asm__("$2") = __NR_##name; \ |
2570 __asm__ __volatile__ ("syscall\n" \ | 2580 __asm__ __volatile__ ("syscall\n" \ |
2571 : "+r"(__v0), r7 (__r7) \ | 2581 : "+r"(__v0), r7 (__r7) \ |
2572 : "0"(__v0), ##__VA_ARGS__ \ | 2582 : "0"(__v0), ##__VA_ARGS__ \ |
2573 : "$8", "$9", "$10", "$11", "$12", \ | 2583 : LSS_SYSCALL_CLOBBERS); \ |
2574 "$13", "$14", "$15", "$24", "$25", \ | |
2575 "memory"); \ | |
2576 LSS_RETURN(type, __v0, __r7) | 2584 LSS_RETURN(type, __v0, __r7) |
2577 #undef _syscall0 | 2585 #undef _syscall0 |
2578 #define _syscall0(type, name) \ | 2586 #define _syscall0(type, name) \ |
2579 type LSS_NAME(name)(void) { \ | 2587 type LSS_NAME(name)(void) { \ |
2580 register unsigned long __r7 __asm__("$7"); \ | 2588 register unsigned long __r7 __asm__("$7"); \ |
2581 LSS_BODY(type, name, "=r"); \ | 2589 LSS_BODY(type, name, "=r"); \ |
2582 } | 2590 } |
2583 #undef _syscall1 | 2591 #undef _syscall1 |
2584 #define _syscall1(type, name, type1, arg1) \ | 2592 #define _syscall1(type, name, type1, arg1) \ |
2585 type LSS_NAME(name)(type1 arg1) { \ | 2593 type LSS_NAME(name)(type1 arg1) { \ |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4011 # pragma pop_macro("fstat64") | 4019 # pragma pop_macro("fstat64") |
4012 # pragma pop_macro("lstat64") | 4020 # pragma pop_macro("lstat64") |
4013 #endif | 4021 #endif |
4014 | 4022 |
4015 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) | 4023 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) |
4016 } | 4024 } |
4017 #endif | 4025 #endif |
4018 | 4026 |
4019 #endif | 4027 #endif |
4020 #endif | 4028 #endif |
OLD | NEW |