Chromium Code Reviews| Index: src/nonsfi/linux/nonsfi_signal.h |
| diff --git a/src/nonsfi/linux/nonsfi_signal.h b/src/nonsfi/linux/nonsfi_signal.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..403691130b42833c86432029a8ecba53175ae42f |
| --- /dev/null |
| +++ b/src/nonsfi/linux/nonsfi_signal.h |
| @@ -0,0 +1,91 @@ |
| +/* |
| + * Copyright (c) 2015 The Native Client Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef NATIVE_CLIENT_SRC_NONSFI_LINUX_NONSFI_SIGNAL_H_ |
| +#define NATIVE_CLIENT_SRC_NONSFI_LINUX_NONSFI_SIGNAL_H_ 1 |
| + |
| +#include "native_client/src/include/nacl/nacl_exception.h" |
| + |
| +EXTERN_C_BEGIN |
| + |
| +#if defined(__i386__) |
| + |
| +/* From linux/arch/x86/include/uapi/asm/sigcontext32.h */ |
| +struct sigcontext_ia32 { |
| + uint16_t gs, __gsh; |
| + uint16_t fs, __fsh; |
| + uint16_t es, __esh; |
| + uint16_t ds, __dsh; |
| + uint32_t di; |
| + uint32_t si; |
| + uint32_t bp; |
| + uint32_t sp; |
| + uint32_t bx; |
| + uint32_t dx; |
| + uint32_t cx; |
| + uint32_t ax; |
| + uint32_t trapno; |
| + uint32_t err; |
| + uint32_t ip; |
| + uint16_t cs, __csh; |
| + uint32_t flags; |
| + uint32_t sp_at_signal; |
| + uint16_t ss, __ssh; |
| + uint32_t fpstate; |
| + uint32_t oldmask; |
| + uint32_t cr2; |
| +}; |
| + |
| +typedef struct sigcontext_ia32 linux_mcontext_t; |
| + |
| +#elif defined(__arm__) |
| + |
| +/* From linux/arch/arm/include/uapi/asm/sigcontext.h */ |
| +struct sigcontext_arm { |
| + uint32_t trap_no; |
| + uint32_t error_code; |
| + uint32_t oldmask; |
| + uint32_t arm_r0; |
| + uint32_t arm_r1; |
| + uint32_t arm_r2; |
| + uint32_t arm_r3; |
| + uint32_t arm_r4; |
| + uint32_t arm_r5; |
| + uint32_t arm_r6; |
| + uint32_t arm_r7; |
| + uint32_t arm_r8; |
| + uint32_t arm_r9; |
| + uint32_t arm_r10; |
| + uint32_t arm_r11; /* fp */ |
| + uint32_t arm_r12; /* ip */ |
| + uint32_t arm_sp; |
| + uint32_t arm_lr; |
| + uint32_t arm_pc; |
| + uint32_t arm_cpsr; |
| + uint32_t fault_address; |
| +}; |
| + |
| +typedef struct sigcontext_arm linux_mcontext_t; |
| + |
| +#else |
| +#error "unsupported architecture" |
| +#endif |
| + |
| +struct NonSfiExceptionFrame { |
| + struct NaClExceptionContext context; |
| + struct NaClExceptionPortableContext portable; |
| +}; |
| + |
| +extern pthread_mutex_t g_signal_handler_mutex; |
| +void nonsfi_initialize_signal_handler_locked(void); |
| +void nonsfi_install_exception_handler_locked(void); |
| +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.
|
| + struct NonSfiExceptionFrame *frame, |
| + const void *raw_ctx); |
| + |
| +EXTERN_C_END |
| + |
| +#endif |