tools/profiler/android-signal-defs.h
author James Willcox <jwillcox@mozilla.com>
Wed, 06 Jun 2012 22:39:01 -0400
changeset 98745 21ff29da4c41c86bc573d31a983557688c6d13f3
parent 96742 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 117350 ec3ad127d56794c1c7ae88ee4dc6b0b3ee3b8e96
permissions -rw-r--r--
Bug 759799 - Hook up Hal WakeLocks on Android r=blassey

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// Android runs a fairly new Linux kernel, so signal info is there,
// but the C library doesn't have the structs defined.

struct sigcontext {
  uint32_t trap_no;
  uint32_t error_code;
  uint32_t oldmask;
  uint32_t gregs[16];
  uint32_t arm_cpsr;
  uint32_t fault_address;
};
typedef uint32_t __sigset_t;
typedef struct sigcontext mcontext_t;
typedef struct ucontext {
  uint32_t uc_flags;
  struct ucontext* uc_link;
  stack_t uc_stack;
  mcontext_t uc_mcontext;
  __sigset_t uc_sigmask;
} ucontext_t;
enum ArmRegisters {R0 = 0, R1 = 1, R2 = 2, R3 = 3, R4 = 4, R5 = 5,
                   R6 = 6, R7 = 7, R8 = 8, R9 = 9, R10 = 10,
                   R11 = 11, R12 = 12, R13 = 13, R14 = 14, R15 = 15};