• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
6 #define SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
7 
8 #include <stdint.h>
9 
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 #if !defined(__BIONIC_HAVE_UCONTEXT_T)
13 // Ensure that 'stack_t' is defined.
14 #include <asm/signal.h>
15 
16 // We also need greg_t for the sandbox, include it in this header as well.
17 typedef unsigned long greg_t;
18 
19 typedef struct {
20   uint32_t regmask;
21   uint32_t status;
22   uint64_t pc;
23   uint64_t gregs[32];
24   uint64_t fpregs[32];
25   uint32_t acx;
26   uint32_t fpc_csr;
27   uint32_t fpc_eir;
28   uint32_t used_math;
29   uint32_t dsp;
30   uint64_t mdhi;
31   uint64_t mdlo;
32   uint32_t hi1;
33   uint32_t lo1;
34   uint32_t hi2;
35   uint32_t lo2;
36   uint32_t hi3;
37   uint32_t lo3;
38 } mcontext_t;
39 
40 typedef struct ucontext {
41   uint32_t uc_flags;
42   struct ucontext* uc_link;
43   stack_t uc_stack;
44   mcontext_t uc_mcontext;
45   sigset_t uc_sigmask;
46   // Other fields are not used by Google Breakpad. Don't define them.
47 } ucontext_t;
48 
49 #else
50 #include <sys/ucontext.h>
51 #endif  // __BIONIC_HAVE_UCONTEXT_T
52 
53 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
54