OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SANDBOX_LINUX_SERVICES_ANDROID_X86_UCONTEXT_H_ | |
6 #define SANDBOX_LINUX_SERVICES_ANDROID_X86_UCONTEXT_H_ | |
7 | |
8 #include <asm/sigcontext.h> | |
9 | |
10 #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
| |
11 /* Old versions of the Android <signal.h> didn't define ucontext_t. */ | |
12 | |
13 /* Type for general register. */ | |
14 typedef long int greg_t; | |
15 | |
16 typedef struct { | |
17 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.
| |
18 void* fpregs; | |
19 uint32_t oldmask; | |
20 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.
| |
21 } mcontext_t; | |
22 | |
23 enum { | |
24 REG_GS = 0, REG_FS, REG_ES, REG_DS, | |
25 REG_EDI, REG_ESI, REG_EBP, REG_ESP, | |
26 REG_EBX, REG_EDX, REG_ECX, REG_EAX, | |
27 REG_TRAPNO, REG_ERR, REG_EIP, REG_CS, | |
28 REG_EFL, REG_UESP, REG_SS | |
29 }; | |
30 | |
31 /* Machine context at the time a signal was raised. */ | |
32 typedef struct ucontext { | |
33 unsigned long uc_flags; | |
34 struct ucontext* uc_link; | |
35 stack_t uc_stack; | |
36 mcontext_t uc_mcontext; | |
37 sigset_t uc_sigmask; | |
Markus (顧孟勤)
2012/12/21 02:03:54
We really have to have a unittest for this. If you
| |
38 } ucontext_t; | |
39 #endif /* !__BIONIC_HAVE_UCONTEXT_T */ | |
40 | |
41 #endif // SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_ | |
OLD | NEW |