Chromium Code Reviews| 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..d4dff83c841a281d6e798876b0f12113f6b2524a |
| --- /dev/null |
| +++ b/sandbox/linux/services/android_x86_ucontext.h |
| @@ -0,0 +1,41 @@ |
| +// 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> |
| + |
| +#if !defined(__BIONIC_HAVE_UCONTEXT_T) |
|
Markus (顧孟勤)
2012/12/21 02:03:54
Can you please find another reviewer that can veri
yfw.chromium
2012/12/21 07:23:17
This was introduced in Android with this change:
h
|
| +/* Old versions of the Android <signal.h> didn't define ucontext_t. */ |
| + |
| +/* Type for general register. */ |
| +typedef long int greg_t; |
| + |
| +typedef struct { |
| + uint32_t gregs[32]; |
|
Markus (顧孟勤)
2012/12/21 02:03:54
Did you actually test this? This looks wrong to me
Markus (顧孟勤)
2012/12/21 02:03:54
This should be a "greg_t" instead of a "uint32_t",
yfw.chromium
2012/12/21 07:23:17
Will change 32 to 19 and use greg_t.
|
| + void* fpregs; |
| + uint32_t oldmask; |
| + uint32_t cr2; |
|
Markus (顧孟勤)
2012/12/21 02:03:54
I think, these should be "unsigned long" instead o
yfw.chromium
2012/12/21 07:23:17
OK.
|
| +} 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 uc_flags; |
| + struct ucontext* uc_link; |
| + stack_t uc_stack; |
| + mcontext_t uc_mcontext; |
| + sigset_t uc_sigmask; |
|
Markus (顧孟勤)
2012/12/21 02:03:54
We really have to have a unittest for this. If you
|
| +} ucontext_t; |
| +#endif /* !__BIONIC_HAVE_UCONTEXT_T */ |
| + |
| +#endif // SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_ |