1 // Copyright (c) 2009, Google Inc.
2 // All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 // Only recent versions of Android's C library correctly define the
31 // required types for ucontext_t handling. This header provides a
32 // custom declarations that will work when Google Breakpad is built
33 // against any version of the NDK or platform headers, and work on
34 // any version of the system.
36 // See http://code.google.com/p/android/issues/detail?id=34784
38 #ifndef GOOGLE_BREAKPAD_CLIENT_LINUX_ANDROID_UCONTEXT_H_
39 #define GOOGLE_BREAKPAD_CLIENT_LINUX_ANDROID_UCONTEXT_H_
44 #ifndef __BIONIC_HAVE_UCONTEXT_T
48 // Ensure that 'struct sigcontext' is defined.
49 #include <asm/sigcontext.h>
50 typedef struct sigcontext mcontext_t
;
52 typedef struct ucontext
{
54 struct ucontext
* uc_link
;
56 mcontext_t uc_mcontext
;
57 // Other fields are not used by Google Breakpad. Don't define them.
60 #elif defined(__i386__)
62 /* 80-bit floating-point register */
64 unsigned short significand
[4];
65 unsigned short exponent
;
68 /* Simple floating-point state, see FNSTENV instruction */
69 struct _libc_fpstate
{
75 unsigned long dataoff
;
76 unsigned long datasel
;
77 struct _libc_fpreg _st
[8];
83 struct _libc_fpstate
* fpregs
;
114 typedef struct ucontext
{
116 struct ucontext
* uc_link
;
118 mcontext_t uc_mcontext
;
119 // Other fields are not used by Google Breakpad. Don't define them.
122 #elif defined(__mips__)
124 // Not supported by Google Breakpad at this point, but just in case.
146 typedef struct ucontext
{
148 struct ucontext
* uc_link
;
150 mcontext_t uc_mcontext
;
151 // Other fields are not used by Google Breakpad. Don't define them.
155 # error "Unsupported Android CPU ABI!"
158 #endif // !__BIONIC_HAVE_UCONTEXT_T
160 #endif // GOOGLE_BREAKPAD_CLIENT_LINUX_ANDROID_UCONTEXT_H_