Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: src/trusted/service_runtime/osx/crash_filter.h

Issue 12207165: Mac x86_64: Mach exception support (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/osx/crash_filter.h
===================================================================
--- src/trusted/service_runtime/osx/crash_filter.h (revision 10857)
+++ src/trusted/service_runtime/osx/crash_filter.h (working copy)
@@ -8,12 +8,14 @@
#define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_OSX_CRASH_FILTER_H_ 1
-#include <mach/port.h>
+#include <mach/mach.h>
#include "native_client/src/include/nacl_base.h"
EXTERN_C_BEGIN
+#if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86
+
/*
* This function is intended for use by Chromium's embedding of
* Breakpad crash reporting. Given the Mach port for a thread in this
@@ -23,7 +25,24 @@
*/
int NaClMachThreadIsInUntrusted(mach_port_t thread_port);
+/*
+ * The internal implementation of NaClMachThreadIsInUntrusted. This function
+ * may be called by Native Client's own Mach exception handler to determine
+ * whether an exception occurred in untrusted code.
+ *
+ * Determining whether code is untrusted, for the purposes of this function,
+ * considers only the executing code based on the code segment (x86-32) or
+ * instruction pointer (x86-64). This is sufficient for determining whether
+ * the executing code is untrusted. Callers that are concerned that trusted
+ * code may have jumped to untrusted code may also want to consider
+ * natp->suspend_state before deciding how to proceed.
+ */
+int NaClMachThreadStateIsInUntrusted(x86_thread_state_t *state,
+ size_t nacl_thread_index);
+
+#endif /* NACL_ARCH(NACL_BUILD_ARCH) */
+
EXTERN_C_END
-#endif
+#endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_OSX_CRASH_FILTER_H_ */

Powered by Google App Engine
This is Rietveld 408576698