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 2548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2559 "i"(__NR_clone), "i"(__NR_exit) | 2559 "i"(__NR_clone), "i"(__NR_exit) |
2560 : "cc", "x8", "memory"); | 2560 : "cc", "x8", "memory"); |
2561 } | 2561 } |
2562 LSS_RETURN(int, __res); | 2562 LSS_RETURN(int, __res); |
2563 } | 2563 } |
2564 #elif defined(__mips__) | 2564 #elif defined(__mips__) |
2565 #undef LSS_REG | 2565 #undef LSS_REG |
2566 #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \ | 2566 #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \ |
2567 (unsigned long)(a) | 2567 (unsigned long)(a) |
2568 #undef LSS_BODY | 2568 #undef LSS_BODY |
2569 #if _MIPS_SIM == _MIPS_SIM_ABI32 | |
2569 #define LSS_BODY(type,name,r7,...) \ | 2570 #define LSS_BODY(type,name,r7,...) \ |
2570 register unsigned long __v0 __asm__("$2") = __NR_##name; \ | 2571 register unsigned long __v0 __asm__("$2") = __NR_##name; \ |
2571 __asm__ __volatile__ ("syscall\n" \ | 2572 __asm__ __volatile__ ("syscall\n" \ |
2572 : "+r"(__v0), r7 (__r7) \ | 2573 : "+r"(__v0), r7 (__r7) \ |
2573 : "0"(__v0), ##__VA_ARGS__ \ | 2574 : "0"(__v0), ##__VA_ARGS__ \ |
2574 : "$8", "$9", "$10", "$11", "$12", \ | 2575 : "$8", "$9", "$10", "$11", "$12", \ |
2575 "$13", "$14", "$15", "$24", "$25", \ | 2576 "$13", "$14", "$15", "$24", "$25", \ |
2576 "memory"); \ | 2577 "memory"); \ |
2577 LSS_RETURN(type, __v0, __r7) | 2578 LSS_RETURN(type, __v0, __r7) |
2579 #else | |
2580 #define LSS_BODY(type,name,r7,...) \ | |
2581 register unsigned long __v0 __asm__("$2") = __NR_##name; \ | |
2582 __asm__ __volatile__ ("syscall\n" \ | |
2583 : "+r"(__v0), r7 (__r7) \ | |
2584 : "0"(__v0), ##__VA_ARGS__ \ | |
2585 : "$10", "$11", "$12", "$13", "$14", \ | |
Mark Seaborn
2014/07/12 23:58:08
So, you're only changing the list of clobbered reg
Lei Zhang
2014/07/14 19:39:28
Disclaimer: I've never worked on this before. So i
petarj
2014/07/16 02:23:24
breakpad does not support mips64 yet.
Lei Zhang
2014/07/16 23:42:07
Done.
| |
2586 "$15", "$24", "$25", "memory"); \ | |
2587 LSS_RETURN(type, __v0, __r7) | |
2588 #endif | |
2578 #undef _syscall0 | 2589 #undef _syscall0 |
2579 #define _syscall0(type, name) \ | 2590 #define _syscall0(type, name) \ |
2580 type LSS_NAME(name)(void) { \ | 2591 type LSS_NAME(name)(void) { \ |
2581 register unsigned long __r7 __asm__("$7"); \ | 2592 register unsigned long __r7 __asm__("$7"); \ |
2582 LSS_BODY(type, name, "=r"); \ | 2593 LSS_BODY(type, name, "=r"); \ |
2583 } | 2594 } |
2584 #undef _syscall1 | 2595 #undef _syscall1 |
2585 #define _syscall1(type, name, type1, arg1) \ | 2596 #define _syscall1(type, name, type1, arg1) \ |
2586 type LSS_NAME(name)(type1 arg1) { \ | 2597 type LSS_NAME(name)(type1 arg1) { \ |
2587 register unsigned long __r7 __asm__("$7"); \ | 2598 register unsigned long __r7 __asm__("$7"); \ |
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4012 # pragma pop_macro("fstat64") | 4023 # pragma pop_macro("fstat64") |
4013 # pragma pop_macro("lstat64") | 4024 # pragma pop_macro("lstat64") |
4014 #endif | 4025 #endif |
4015 | 4026 |
4016 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) | 4027 #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS) |
4017 } | 4028 } |
4018 #endif | 4029 #endif |
4019 | 4030 |
4020 #endif | 4031 #endif |
4021 #endif | 4032 #endif |
OLD | NEW |