Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2015 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 #ifndef NATIVE_CLIENT_SRC_NONSFI_LINUX_NONSFI_SIGNAL_H_ | |
| 8 #define NATIVE_CLIENT_SRC_NONSFI_LINUX_NONSFI_SIGNAL_H_ 1 | |
| 9 | |
| 10 #include "native_client/src/include/nacl/nacl_exception.h" | |
| 11 | |
| 12 EXTERN_C_BEGIN | |
| 13 | |
| 14 #if defined(__i386__) | |
| 15 | |
| 16 /* From linux/arch/x86/include/uapi/asm/sigcontext32.h */ | |
| 17 struct sigcontext_ia32 { | |
| 18 uint16_t gs, __gsh; | |
| 19 uint16_t fs, __fsh; | |
| 20 uint16_t es, __esh; | |
| 21 uint16_t ds, __dsh; | |
| 22 uint32_t di; | |
| 23 uint32_t si; | |
| 24 uint32_t bp; | |
| 25 uint32_t sp; | |
| 26 uint32_t bx; | |
| 27 uint32_t dx; | |
| 28 uint32_t cx; | |
| 29 uint32_t ax; | |
| 30 uint32_t trapno; | |
| 31 uint32_t err; | |
| 32 uint32_t ip; | |
| 33 uint16_t cs, __csh; | |
| 34 uint32_t flags; | |
| 35 uint32_t sp_at_signal; | |
| 36 uint16_t ss, __ssh; | |
| 37 uint32_t fpstate; | |
| 38 uint32_t oldmask; | |
| 39 uint32_t cr2; | |
| 40 }; | |
| 41 | |
| 42 typedef struct sigcontext_ia32 linux_mcontext_t; | |
| 43 | |
| 44 #elif defined(__arm__) | |
| 45 | |
| 46 /* From linux/arch/arm/include/uapi/asm/sigcontext.h */ | |
| 47 struct sigcontext_arm { | |
| 48 uint32_t trap_no; | |
| 49 uint32_t error_code; | |
| 50 uint32_t oldmask; | |
| 51 uint32_t arm_r0; | |
| 52 uint32_t arm_r1; | |
| 53 uint32_t arm_r2; | |
| 54 uint32_t arm_r3; | |
| 55 uint32_t arm_r4; | |
| 56 uint32_t arm_r5; | |
| 57 uint32_t arm_r6; | |
| 58 uint32_t arm_r7; | |
| 59 uint32_t arm_r8; | |
| 60 uint32_t arm_r9; | |
| 61 uint32_t arm_r10; | |
| 62 uint32_t arm_r11; /* fp */ | |
| 63 uint32_t arm_r12; /* ip */ | |
| 64 uint32_t arm_sp; | |
| 65 uint32_t arm_lr; | |
| 66 uint32_t arm_pc; | |
| 67 uint32_t arm_cpsr; | |
| 68 uint32_t fault_address; | |
| 69 }; | |
| 70 | |
| 71 typedef struct sigcontext_arm linux_mcontext_t; | |
| 72 | |
| 73 #else | |
| 74 #error "unsupported architecture" | |
| 75 #endif | |
| 76 | |
| 77 struct NonSfiExceptionFrame { | |
| 78 struct NaClExceptionContext context; | |
| 79 struct NaClExceptionPortableContext portable; | |
| 80 }; | |
| 81 | |
| 82 extern pthread_mutex_t g_signal_handler_mutex; | |
| 83 void nonsfi_initialize_signal_handler_locked(void); | |
| 84 void nonsfi_install_exception_handler_locked(void); | |
| 85 void exception_frame_from_signal_context( | |
|
Mark Seaborn
2015/08/12 01:43:07
How about prefixing this with "nonsfi_" too?
Luis Héctor Chávez
2015/08/12 22:14:27
Done.
| |
| 86 struct NonSfiExceptionFrame *frame, | |
| 87 const void *raw_ctx); | |
| 88 | |
| 89 EXTERN_C_END | |
| 90 | |
| 91 #endif | |
| OLD | NEW |