summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/platform-linux.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 474c5406..39633a24 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -808,7 +808,7 @@ Semaphore* OS::CreateSemaphore(int count) {
#ifdef ENABLE_LOGGING_AND_PROFILING
-#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__) || defined(__i386__))
+#if !defined(__GLIBC__) && (defined(__arm__) || defined(__thumb__))
// Android runs a fairly new Linux kernel, so signal info is there,
// but the C library doesn't have the structs defined.
@@ -830,10 +830,27 @@ typedef struct ucontext {
__sigset_t uc_sigmask;
} ucontext_t;
enum ArmRegisters {R15 = 15, R13 = 13, R11 = 11};
-enum X86Registers {REG_EIP = 14, REG_ESP = 7, REG_EBP = 6};
-#endif
+#elif !defined(__GLIBC__) && defined(__i386__)
+// x86 version for Android.
+struct sigcontext {
+ uint32_t gregs[19];
+ void* fpregs;
+ uint32_t oldmask;
+ uint32_t cr2;
+};
+typedef uint32_t __sigset_t;
+typedef struct sigcontext mcontext_t;
+typedef struct ucontext {
+ uint32_t uc_flags;
+ struct ucontext* uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+} ucontext_t;
+enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 };
+#endif
static int GetThreadID() {
// Glibc doesn't provide a wrapper for gettid(2).