Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: sandbox/linux/services/android_x86_ucontext.h

Issue 11639038: ucontext_t support for Android x86. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ucontext_t support for Android x86. Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/services/android_x86_ucontext.h
diff --git a/sandbox/linux/services/android_x86_ucontext.h b/sandbox/linux/services/android_x86_ucontext.h
new file mode 100644
index 0000000000000000000000000000000000000000..4fc0d43fa9d7c30706c5e32cb1ce9bba0dbfd4a2
--- /dev/null
+++ b/sandbox/linux/services/android_x86_ucontext.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SANDBOX_LINUX_SERVICES_ANDROID_X86_UCONTEXT_H_
+#define SANDBOX_LINUX_SERVICES_ANDROID_X86_UCONTEXT_H_
+
+#include <asm/sigcontext.h>
+#include <signal.h>
+
+#if !defined(__BIONIC_HAVE_UCONTEXT_T)
jln (very slow on Chromium) 2013/01/08 22:26:09 That's lovely! Do you mind patching it on the arm
+/* Old versions of the Android <signal.h> didn't define ucontext_t. */
+
+/* Type for general register. */
+typedef int greg_t;
+
+/* asm/sigcontext.h has same structure definition based on Linux kernel header.
+ * But it's not compatible with glibc definition (no gregs).
+ */
+typedef struct {
+ greg_t gregs[19];
+ void* fpregs;
+ unsigned long int oldmask;
+ unsigned long int cr2;
+} mcontext_t;
+
+enum {
+ REG_GS = 0, REG_FS, REG_ES, REG_DS,
+ REG_EDI, REG_ESI, REG_EBP, REG_ESP,
+ REG_EBX, REG_EDX, REG_ECX, REG_EAX,
+ REG_TRAPNO, REG_ERR, REG_EIP, REG_CS,
+ REG_EFL, REG_UESP, REG_SS
+};
+
+/* Machine context at the time a signal was raised. */
+typedef struct ucontext {
+ unsigned long int uc_flags;
+ struct ucontext* uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ sigset_t uc_sigmask;
+} ucontext_t;
digit1 2013/01/09 09:47:18 that looks good to me too :)
+#endif /* !__BIONIC_HAVE_UCONTEXT_T */
+
+#endif // SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698