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

Unified Diff: src/nonsfi/irt/irt_interfaces.c

Issue 1300883003: Revert of Non-SFI mode: Add Linux asynchronous signal support (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « src/nonsfi/irt/irt.gyp ('k') | src/nonsfi/linux/irt_exception_handling.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/nonsfi/irt/irt_interfaces.c
diff --git a/src/nonsfi/irt/irt_interfaces.c b/src/nonsfi/irt/irt_interfaces.c
index 6294cda080fff86dac79d2ac58f7378f3a91540a..f0e0c01c0a312330a4b37aa46c18401b97af339f 100644
--- a/src/nonsfi/irt/irt_interfaces.c
+++ b/src/nonsfi/irt/irt_interfaces.c
@@ -28,6 +28,7 @@
#include "native_client/src/include/nacl/nacl_exception.h"
#include "native_client/src/include/nacl_macros.h"
#include "native_client/src/public/irt_core.h"
+#include "native_client/src/public/nonsfi/irt_exception_handling.h"
#include "native_client/src/trusted/service_runtime/include/machine/_types.h"
#include "native_client/src/trusted/service_runtime/include/sys/mman.h"
#include "native_client/src/trusted/service_runtime/include/sys/stat.h"
@@ -43,7 +44,6 @@
#endif
#if defined(__native_client__)
-# include "native_client/src/nonsfi/linux/irt_signal_handling.h"
# include "native_client/src/nonsfi/linux/linux_pthread_private.h"
#endif
@@ -366,9 +366,9 @@
abort();
}
+static int thread_create(void (*start_func)(void), void *stack,
+ void *thread_ptr) {
#if defined(__native_client__)
-static int thread_create_nonsfi(void (*start_func)(void), void *stack,
- void *thread_ptr, nacl_irt_tid_t *child_tid) {
struct thread_args *args = malloc(sizeof(struct thread_args));
if (args == NULL) {
return ENOMEM;
@@ -376,25 +376,10 @@
args->start_func = start_func;
args->thread_ptr = thread_ptr;
/* In Linux, it is possible to use the provided stack directly. */
- int error = nacl_user_thread_create(start_thread, stack, args, child_tid);
+ int error = nacl_user_thread_create(start_thread, stack, args);
if (error != 0)
free(args);
return error;
-}
-
-static void thread_exit_nonsfi(int32_t *stack_flag) {
- nacl_user_thread_exit(stack_flag);
-}
-#endif
-
-static int thread_create(void (*start_func)(void), void *stack,
- void *thread_ptr) {
-#if defined(__native_client__)
- /*
- * When available, use the nonsfi version that does allow the |stack| to be
- * set in the new thread.
- */
- return thread_create_nonsfi(start_func, stack, thread_ptr, NULL);
#else
/*
* For now, we ignore the stack that user code provides and just use
@@ -426,11 +411,7 @@
static void thread_exit(int32_t *stack_flag) {
#if defined(__native_client__)
- /*
- * Since we used the nonsfi version of thread_create, we must also call the
- * nonsfi version of thread_exit to correctly clean it up.
- */
- thread_exit_nonsfi(stack_flag);
+ nacl_user_thread_exit(stack_flag);
#else
*stack_flag = 0; /* Indicate that the user code's stack can be freed. */
pthread_exit(NULL);
@@ -681,14 +662,6 @@
thread_nice,
};
-#if defined(__native_client__)
-const struct nacl_irt_thread_v0_2 nacl_irt_thread_v0_2 = {
- thread_create_nonsfi,
- thread_exit_nonsfi,
- thread_nice,
-};
-#endif
-
#if defined(__linux__)
const struct nacl_irt_futex nacl_irt_futex = {
futex_wait_abs,
@@ -748,11 +721,6 @@
nacl_exception_set_stack,
nacl_exception_clear_flag,
};
-
-const struct nacl_irt_async_signal_handling nacl_irt_async_signal_handling = {
- nacl_async_signal_set_handler,
- nacl_async_signal_send_async_signal,
-};
#endif
#if defined(__native_client__) && defined(__arm__)
@@ -779,10 +747,6 @@
{ NACL_IRT_MEMORY_v0_3, &nacl_irt_memory, sizeof(nacl_irt_memory), NULL },
{ NACL_IRT_TLS_v0_1, &nacl_irt_tls, sizeof(nacl_irt_tls), NULL },
{ NACL_IRT_THREAD_v0_1, &nacl_irt_thread, sizeof(nacl_irt_thread), NULL },
-#if defined(__native_client__)
- { NACL_IRT_THREAD_v0_2, &nacl_irt_thread_v0_2,
- sizeof(nacl_irt_thread_v0_2), NULL },
-#endif
{ NACL_IRT_FUTEX_v0_1, &nacl_irt_futex, sizeof(nacl_irt_futex), NULL },
{ NACL_IRT_RANDOM_v0_1, &nacl_irt_random, sizeof(nacl_irt_random), NULL },
#if defined(__linux__) || defined(__native_client__)
@@ -795,8 +759,6 @@
#if defined(__native_client__)
{ NACL_IRT_EXCEPTION_HANDLING_v0_1, &nacl_irt_exception_handling,
sizeof(nacl_irt_exception_handling), NULL },
- { NACL_IRT_ASYNC_SIGNAL_HANDLING_v0_1, &nacl_irt_async_signal_handling,
- sizeof(nacl_irt_async_signal_handling), NULL },
#endif
#if defined(__native_client__) && defined(__arm__)
{ NACL_IRT_ICACHE_v0_1, &nacl_irt_icache, sizeof(nacl_irt_icache), NULL },
« no previous file with comments | « src/nonsfi/irt/irt.gyp ('k') | src/nonsfi/linux/irt_exception_handling.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698