arm_linux_ucontext.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.
  4. #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_UCONTEXT_H_
  5. #define SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_UCONTEXT_H_
  6. #include <stddef.h>
  7. // In PNaCl toolchain, sigcontext and stack_t is not defined. So here declare
  8. // them.
  9. struct sigcontext {
  10. unsigned long trap_no;
  11. unsigned long error_code;
  12. unsigned long oldmask;
  13. unsigned long arm_r0;
  14. unsigned long arm_r1;
  15. unsigned long arm_r2;
  16. unsigned long arm_r3;
  17. unsigned long arm_r4;
  18. unsigned long arm_r5;
  19. unsigned long arm_r6;
  20. unsigned long arm_r7;
  21. unsigned long arm_r8;
  22. unsigned long arm_r9;
  23. unsigned long arm_r10;
  24. unsigned long arm_fp;
  25. unsigned long arm_ip;
  26. unsigned long arm_sp;
  27. unsigned long arm_lr;
  28. unsigned long arm_pc;
  29. unsigned long arm_cpsr;
  30. unsigned long fault_address;
  31. };
  32. typedef struct sigaltstack {
  33. void* ss_sp;
  34. int ss_flags;
  35. size_t ss_size;
  36. } stack_t;
  37. // We also need greg_t for the sandbox, include it in this header as well.
  38. typedef unsigned long greg_t;
  39. // typedef unsigned long sigset_t;
  40. typedef struct ucontext {
  41. unsigned long uc_flags;
  42. struct ucontext* uc_link;
  43. stack_t uc_stack;
  44. struct sigcontext uc_mcontext;
  45. sigset_t uc_sigmask;
  46. /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
  47. int __not_used[32 - (sizeof(sigset_t) / sizeof(int))];
  48. /* Last for extensibility. Eight byte aligned because some
  49. coprocessors require eight byte alignment. */
  50. unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
  51. } ucontext_t;
  52. #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_UCONTEXT_H_