Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // Copyright (c) 2012, Google Inc. | 1 // Copyright (c) 2012, 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 15 matching lines...) Expand all Loading... | |
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
30 #ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H | 30 #ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H |
31 #define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H | 31 #define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H |
32 | 32 |
33 // The purpose of this file is to glue the mismatching headers (Android NDK vs | 33 // The purpose of this file is to glue the mismatching headers (Android NDK vs |
34 // glibc) and therefore avoid doing otherwise awkward #ifdefs in the code. | 34 // glibc) and therefore avoid doing otherwise awkward #ifdefs in the code. |
35 // The following quirks are currently handled by this file: | 35 // The following quirks are currently handled by this file: |
36 // - MIPS: Use the Android NDK but add register defines which are missing | |
37 // in NDK but exist in glibc. | |
fdegans
2015/04/07 09:46:40
Is there some bug tracking this on the Android sid
| |
38 // - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct. | 36 // - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct. |
37 // - x86_64: Override a typo in user_fpregs_struct (mxcsr_mask -> mxcr_mask). | |
38 // The typo has been fixed in NDK r10d, but a preprocessor workaround is | |
39 // required to make breakpad build with r10c and lower (more details below). | |
39 // - Other platforms: Just use the Android NDK unchanged. | 40 // - Other platforms: Just use the Android NDK unchanged. |
41 | |
42 // TODO(primiano): remove this after Chromium has stably rolled to NDK r10d. | |
43 // Historical context: NDK releases < r10d had a typo in sys/user.h (mxcsr_mask | |
44 // instead of mxcr_mask), which is fixed in r10d. However, just switching to use | |
45 // the correct one (mxcr_mask) would put Breakpad in a state where it can be | |
46 // rolled in chromium only atomically with the r10d NDK. A revert of either | |
47 // project (android_tools, breakpad) would make the other one unrollable. | |
48 // This hack makes breakpad code compatible with both r10c and r10d NDKs, | |
49 // reducing the dependency entangling with android_tools. | |
50 #if defined(__x86_64__) | |
51 #define mxcsr_mask mxcr_mask | |
52 #endif | |
40 | 53 |
41 #include_next <sys/user.h> | 54 #include_next <sys/user.h> |
42 | 55 |
43 #ifdef __mips__ | 56 #if defined(__x86_64__) |
rmcilroy
2015/04/08 08:02:07
Could you move this whole block down into the same
| |
44 #ifdef __cplusplus | 57 #undef mxcsr_mask |
45 extern "C" { | |
46 #endif // __cplusplus | |
47 /* | |
48 * This defines/structures correspond to the register layout on stack - | |
49 * if the order here is changed, it needs to be updated in | |
50 * include/asm-mips/stackframe.h | |
51 */ | |
52 #define EF_REG0 6 | |
53 #define EF_REG1 7 | |
54 #define EF_REG2 8 | |
55 #define EF_REG3 9 | |
56 #define EF_REG4 10 | |
57 #define EF_REG5 11 | |
58 #define EF_REG6 12 | |
59 #define EF_REG7 13 | |
60 #define EF_REG8 14 | |
61 #define EF_REG9 15 | |
62 #define EF_REG10 16 | |
63 #define EF_REG11 17 | |
64 #define EF_REG12 18 | |
65 #define EF_REG13 19 | |
66 #define EF_REG14 20 | |
67 #define EF_REG15 21 | |
68 #define EF_REG16 22 | |
69 #define EF_REG17 23 | |
70 #define EF_REG18 24 | |
71 #define EF_REG19 25 | |
72 #define EF_REG20 26 | |
73 #define EF_REG21 27 | |
74 #define EF_REG22 28 | |
75 #define EF_REG23 29 | |
76 #define EF_REG24 30 | |
77 #define EF_REG25 31 | |
78 /* | |
79 * k0/k1 unsaved | |
80 */ | |
81 #define EF_REG26 32 | |
82 #define EF_REG27 33 | |
83 #define EF_REG28 34 | |
84 #define EF_REG29 35 | |
85 #define EF_REG30 36 | |
86 #define EF_REG31 37 | |
87 /* | |
88 * Saved special registers | |
89 */ | |
90 #define EF_LO 38 | |
91 #define EF_HI 39 | |
92 #define EF_CP0_EPC 40 | |
93 #define EF_CP0_BADVADDR 41 | |
94 #define EF_CP0_STATUS 42 | |
95 #define EF_CP0_CAUSE 43 | |
96 | |
97 #define EF_SIZE 180 /* size in bytes */ | |
98 #ifdef __cplusplus | |
99 } // extern "C" | |
100 #endif // __cplusplus | |
101 | |
102 #endif | 58 #endif |
rmcilroy
2015/04/08 08:02:07
add " // __mips__"
| |
103 | 59 |
104 #ifdef __i386__ | 60 #ifdef __i386__ |
105 #ifdef __cplusplus | 61 #ifdef __cplusplus |
106 extern "C" { | 62 extern "C" { |
107 #endif // __cplusplus | 63 #endif // __cplusplus |
108 typedef struct user_fxsr_struct user_fpxregs_struct; | 64 typedef struct user_fxsr_struct user_fpxregs_struct; |
109 #ifdef __cplusplus | 65 #ifdef __cplusplus |
110 } // extern "C" | 66 } // extern "C" |
111 #endif // __cplusplus | 67 #endif // __cplusplus |
112 #endif // __i386__ | 68 #endif // __i386__ |
113 | 69 |
114 #endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H | 70 #endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H |
LEFT | RIGHT |