OLD | NEW |
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 // - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct. | 36 // - aarch64: Add missing <stdint.h> include. |
37 // - aarch64: Add missing user_regs_struct and user_fpsimd_struct structs. | |
38 // - Other platforms: Just use the Android NDK unchanged. | 37 // - Other platforms: Just use the Android NDK unchanged. |
39 | 38 |
40 // TODO(primiano): remove these changes after Chromium has stably rolled to | 39 // TODO(primiano): remove these changes after Chromium has stably rolled to |
41 // an NDK with the appropriate fixes. | 40 // an NDK with the appropriate fixes. |
42 | 41 |
| 42 #ifdef __aarch64__ |
| 43 #include <stdint.h> |
| 44 #endif // __aarch64__ |
| 45 |
43 #include_next <sys/user.h> | 46 #include_next <sys/user.h> |
44 | 47 |
45 #ifdef __i386__ | |
46 #ifdef __cplusplus | |
47 extern "C" { | |
48 #endif // __cplusplus | |
49 typedef struct user_fxsr_struct user_fpxregs_struct; | |
50 #ifdef __cplusplus | |
51 } // extern "C" | |
52 #endif // __cplusplus | |
53 #endif // __i386__ | |
54 | |
55 #ifdef __aarch64__ | |
56 #ifdef __cplusplus | |
57 extern "C" { | |
58 #endif // __cplusplus | |
59 struct user_regs_struct { | |
60 __u64 regs[31]; | |
61 __u64 sp; | |
62 __u64 pc; | |
63 __u64 pstate; | |
64 }; | |
65 struct user_fpsimd_struct { | |
66 __uint128_t vregs[32]; | |
67 __u32 fpsr; | |
68 __u32 fpcr; | |
69 }; | |
70 #ifdef __cplusplus | |
71 } // extern "C" | |
72 #endif // __cplusplus | |
73 #endif // __aarch64__ | |
74 | |
75 #endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H | 48 #endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H |
OLD | NEW |