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.
5 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ANDROID_I386_UCONTEXT_H_
6 #define SANDBOX_LINUX_SYSTEM_HEADERS_ANDROID_I386_UCONTEXT_H_
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.
13 #if !defined(__BIONIC_HAVE_UCONTEXT_T)
14 #if !defined(__native_client_nonsfi__)
15 #include <asm/sigcontext.h>
17 // In PNaCl toolchain, sigcontext is not defined. So here declare it.
18 typedef struct sigaltstack
{
25 /* 80-bit floating-point register */
27 unsigned short significand
[4];
28 unsigned short exponent
;
31 /* Simple floating-point state, see FNSTENV instruction */
32 struct _libc_fpstate
{
38 unsigned long dataoff
;
39 unsigned long datasel
;
40 struct _libc_fpreg _st
[8];
44 typedef uint32_t greg_t
;
48 struct _libc_fpstate
* fpregs
;
75 typedef struct ucontext
{
77 struct ucontext
* uc_link
;
79 mcontext_t uc_mcontext
;
80 // Android and PNaCl toolchain's sigset_t has only 32 bits, though Linux
81 // ABI requires 64 bits.
84 uint32_t kernel_sigmask
[2];
86 struct _libc_fpstate __fpregs_mem
;
90 #include <sys/ucontext.h>
91 #endif // __BIONIC_HAVE_UCONTEXT_T
93 #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ANDROID_I386_UCONTEXT_H_