Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(22)

Unified Diff: common/android/include/sys/user.h

Issue 9714003: Fix breakpad on mips and x86_64 for the NDK r10c update. Base URL: https://chromium.googlesource.com/external/google-breakpad/src.git@master
Patch Set: Fix indent Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/linux/dump_writer_common/ucontext_reader.cc ('k') | common/android/ucontext_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/android/include/sys/user.h
diff --git a/common/android/include/sys/user.h b/common/android/include/sys/user.h
index 4a79ba0578525ae6cb4eeb27fa02c247c36f6a64..d41a82cbf833a3a24814287d09a5078e4d030ef0 100644
--- a/common/android/include/sys/user.h
+++ b/common/android/include/sys/user.h
@@ -30,9 +30,91 @@
#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
+// The purpose of this file is to glue the mismatching headers (Android NDK vs
+// glibc) and therefore avoid doing otherwise awkward #ifdefs in the code.
+// The following quirks are currently handled by this file:
+// - MIPS: Keep using forked definitions of user.h structs. The definition in
+// the NDK is completely different.
+// Internal bug b/18097715
+// - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct.
+// - Other platforms: Just use the Android NDK unchanged.
+
+#ifdef __mips__
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#define EF_REG0 6
+#define EF_REG1 7
+#define EF_REG2 8
+#define EF_REG3 9
+#define EF_REG4 10
+#define EF_REG5 11
+#define EF_REG6 12
+#define EF_REG7 13
+#define EF_REG8 14
+#define EF_REG9 15
+#define EF_REG10 16
+#define EF_REG11 17
+#define EF_REG12 18
+#define EF_REG13 19
+#define EF_REG14 20
+#define EF_REG15 21
+#define EF_REG16 22
+#define EF_REG17 23
+#define EF_REG18 24
+#define EF_REG19 25
+#define EF_REG20 26
+#define EF_REG21 27
+#define EF_REG22 28
+#define EF_REG23 29
+#define EF_REG24 30
+#define EF_REG25 31
+
+/*
+ * k0/k1 unsaved
+ */
+#define EF_REG26 32
+#define EF_REG27 33
+#define EF_REG28 34
+#define EF_REG29 35
+#define EF_REG30 36
+#define EF_REG31 37
+
+/*
+ * Saved special registers
+ */
+#define EF_LO 38
+#define EF_HI 39
+#define EF_CP0_EPC 40
+#define EF_CP0_BADVADDR 41
+#define EF_CP0_STATUS 42
+#define EF_CP0_CAUSE 43
+
+struct user_regs_struct {
+ unsigned long long regs[32];
+ unsigned long long lo;
+ unsigned long long hi;
+ unsigned long long epc;
+ unsigned long long badvaddr;
+ unsigned long long status;
+ unsigned long long cause;
+};
+
+struct user_fpregs_struct {
+ unsigned long long regs[32];
+ unsigned int fpcsr;
+ unsigned int fir;
+};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif // __cplusplus
+
+#else // __mips__
+
#include_next <sys/user.h>
-// This struct is defined under a different name in the Android NDK.
#ifdef __i386__
#ifdef __cplusplus
extern "C" {
@@ -41,6 +123,8 @@ typedef struct user_fxsr_struct user_fpxregs_struct;
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
-#endif // __i386__
+#endif // __i386__
+
+#endif // __mips__
#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
« no previous file with comments | « client/linux/dump_writer_common/ucontext_reader.cc ('k') | common/android/ucontext_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted