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

Side by Side Diff: sandbox/linux/services/android_i386_ucontext.h

Issue 12025004: Android make sandbox/linux/seccomp-bpf compile on i386 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_I386_UCONTEXT_H_
6 #define SANDBOX_LINUX_SERVICES_ANDROID_I386_UCONTEXT_H_
7
8 // We do something compatible with glibc. Hopefully, at some point Android will
9 // provide that for us, and __BIONIC_HAVE_UCONTEXT_T should be defined.
10 // This is mostly copied from breakpad (common/android/include/sys/ucontext.h),
11 // except we do use sigset_t for uc_sigmask instead of a custom type.
12
13 #if !defined(__BIONIC_HAVE_UCONTEXT_T)
14 #include <asm/sigcontext.h>
15
16 /* 80-bit floating-point register */
17 struct _libc_fpreg {
18 unsigned short significand[4];
19 unsigned short exponent;
20 };
21
22 /* Simple floating-point state, see FNSTENV instruction */
23 struct _libc_fpstate {
24 unsigned long cw;
25 unsigned long sw;
26 unsigned long tag;
27 unsigned long ipoff;
28 unsigned long cssel;
29 unsigned long dataoff;
30 unsigned long datasel;
31 struct _libc_fpreg _st[8];
32 unsigned long status;
33 };
34
35 typedef uint32_t greg_t;
36
37 typedef struct {
38 uint32_t gregs[19];
39 struct _libc_fpstate* fpregs;
40 uint32_t oldmask;
41 uint32_t cr2;
42 } mcontext_t;
43
44 enum {
45 REG_GS = 0,
46 REG_FS,
47 REG_ES,
48 REG_DS,
49 REG_EDI,
50 REG_ESI,
51 REG_EBP,
52 REG_ESP,
53 REG_EBX,
54 REG_EDX,
55 REG_ECX,
56 REG_EAX,
57 REG_TRAPNO,
58 REG_ERR,
59 REG_EIP,
60 REG_CS,
61 REG_EFL,
62 REG_UESP,
63 REG_SS,
Markus (顧孟勤) 2013/01/18 00:09:34 You could add a NUM_INTEGER_REGS. Then you can do
64 };
65
66 typedef struct ucontext {
67 uint32_t uc_flags;
68 struct ucontext* uc_link;
69 stack_t uc_stack;
70 mcontext_t uc_mcontext;
71 sigset_t uc_sigmask;
72 struct _libc_fpstate __fpregs_mem;
73 } ucontext_t;
74
75 #else
76 #include <sys/ucontext.h>
77 #endif // __BIONIC_HAVE_UCONTEXT_T
78
79 #endif // SANDBOX_LINUX_SERVICES_ANDROID_I386_UCONTEXT_H_
OLDNEW
« no previous file with comments | « sandbox/linux/services/android_arm_ucontext.h ('k') | sandbox/linux/services/android_ucontext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698