13958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris/*
23958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * Copyright (C) 2016 The Android Open Source Project
33958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * All rights reserved.
43958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *
53958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * Redistribution and use in source and binary forms, with or without
63958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * modification, are permitted provided that the following conditions
73958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * are met:
83958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *  * Redistributions of source code must retain the above copyright
93958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *    notice, this list of conditions and the following disclaimer.
103958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *  * Redistributions in binary form must reproduce the above copyright
113958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *    notice, this list of conditions and the following disclaimer in
123958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *    the documentation and/or other materials provided with the
133958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *    distribution.
143958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris *
153958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
163958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
173958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
183958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
193958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
203958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
213958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
223958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
233958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
243958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
253958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
263958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris * SUCH DAMAGE.
273958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris */
283958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
29d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris#ifndef _LIBUNWINDSTACK_UCONTEXT_ARM_H
30d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris#define _LIBUNWINDSTACK_UCONTEXT_ARM_H
313958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
32d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris#include <stdint.h>
33d226a5140989f509a0ed3e2723f05d5fc93ce8dfChristopher Ferris
3453914165e4a19e4a320cf3394e4fabff4e89d7c6Christopher Ferris#include <unwindstack/MachineArm.h>
353958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
36d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferrisnamespace unwindstack {
373958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
38d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferrisstruct arm_stack_t {
39d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t ss_sp;    // void __user*
40d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  int32_t ss_flags;  // int
41d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t ss_size;  // size_t
423958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris};
433958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
44d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferrisstruct arm_mcontext_t {
45d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t trap_no;             // unsigned long
46d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t error_code;          // unsigned long
47d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t oldmask;             // unsigned long
48d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t regs[ARM_REG_LAST];  // unsigned long
49d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t cpsr;                // unsigned long
50d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t fault_address;       // unsigned long
513958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris};
523958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
53d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferrisstruct arm_ucontext_t {
54d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t uc_flags;  // unsigned long
55d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  uint32_t uc_link;   // struct ucontext*
56d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  arm_stack_t uc_stack;
57d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  arm_mcontext_t uc_mcontext;
58d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris  // Nothing else is used, so don't define it.
59d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris};
603958f8060ac0adccd977c0fab7a53d45f3fce58dChristopher Ferris
61d226a5140989f509a0ed3e2723f05d5fc93ce8dfChristopher Ferris}  // namespace unwindstack
62d226a5140989f509a0ed3e2723f05d5fc93ce8dfChristopher Ferris
63d06001d6e07b14b865f3294fff82d2571ed7cb2cChristopher Ferris#endif  // _LIBUNWINDSTACK_UCONTEXT_ARM_H
64