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

Side by Side Diff: src/untrusted/irt/irt_interfaces.c

Issue 10826171: Incorporate shimming into the irt (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "native_client/src/include/nacl_macros.h" 9 #include "native_client/src/include/nacl_macros.h"
10 #include "native_client/src/untrusted/irt/irt.h" 10 #include "native_client/src/untrusted/irt/irt.h"
(...skipping 12 matching lines...) Expand all
23 { NACL_IRT_MEMORY_v0_1, &nacl_irt_memory, sizeof(nacl_irt_memory) }, 23 { NACL_IRT_MEMORY_v0_1, &nacl_irt_memory, sizeof(nacl_irt_memory) },
24 { NACL_IRT_DYNCODE_v0_1, &nacl_irt_dyncode, sizeof(nacl_irt_dyncode) }, 24 { NACL_IRT_DYNCODE_v0_1, &nacl_irt_dyncode, sizeof(nacl_irt_dyncode) },
25 { NACL_IRT_THREAD_v0_1, &nacl_irt_thread, sizeof(nacl_irt_thread) }, 25 { NACL_IRT_THREAD_v0_1, &nacl_irt_thread, sizeof(nacl_irt_thread) },
26 { NACL_IRT_MUTEX_v0_1, &nacl_irt_mutex, sizeof(nacl_irt_mutex) }, 26 { NACL_IRT_MUTEX_v0_1, &nacl_irt_mutex, sizeof(nacl_irt_mutex) },
27 { NACL_IRT_COND_v0_1, &nacl_irt_cond, sizeof(nacl_irt_cond) }, 27 { NACL_IRT_COND_v0_1, &nacl_irt_cond, sizeof(nacl_irt_cond) },
28 { NACL_IRT_SEM_v0_1, &nacl_irt_sem, sizeof(nacl_irt_sem) }, 28 { NACL_IRT_SEM_v0_1, &nacl_irt_sem, sizeof(nacl_irt_sem) },
29 { NACL_IRT_TLS_v0_1, &nacl_irt_tls, sizeof(nacl_irt_tls) }, 29 { NACL_IRT_TLS_v0_1, &nacl_irt_tls, sizeof(nacl_irt_tls) },
30 { NACL_IRT_BLOCKHOOK_v0_1, &nacl_irt_blockhook, sizeof(nacl_irt_blockhook) }, 30 { NACL_IRT_BLOCKHOOK_v0_1, &nacl_irt_blockhook, sizeof(nacl_irt_blockhook) },
31 { NACL_IRT_RESOURCE_OPEN_v0_1, &nacl_irt_resource_open, 31 { NACL_IRT_RESOURCE_OPEN_v0_1, &nacl_irt_resource_open,
32 sizeof(nacl_irt_resource_open) }, 32 sizeof(nacl_irt_resource_open) },
33 /* @IGNORE_LINES_FOR_CODE_HYGIENE[1] */
33 #ifdef IRT_PPAPI 34 #ifdef IRT_PPAPI
34 { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook) }, 35 { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook) },
36 /* Enable this once we have migrated the shimminh to the chrome tree. */
37 #if 0
38 { NACL_IRT_PPAPIHOOK_SHIMMED_v0_1, &nacl_irt_ppapihook_shimmed,
39 sizeof(nacl_irt_ppapihook) },
40 #endif
35 #endif 41 #endif
36 { NACL_IRT_RANDOM_v0_1, &nacl_irt_random, sizeof(nacl_irt_random) }, 42 { NACL_IRT_RANDOM_v0_1, &nacl_irt_random, sizeof(nacl_irt_random) },
37 { NACL_IRT_CLOCK_v0_1, &nacl_irt_clock, sizeof(nacl_irt_clock) }, 43 { NACL_IRT_CLOCK_v0_1, &nacl_irt_clock, sizeof(nacl_irt_clock) },
38 { NACL_IRT_DEV_EXCEPTION_HANDLING_v0_1, &nacl_irt_dev_exception_handling, 44 { NACL_IRT_DEV_EXCEPTION_HANDLING_v0_1, &nacl_irt_dev_exception_handling,
39 sizeof(nacl_irt_dev_exception_handling) }, 45 sizeof(nacl_irt_dev_exception_handling) },
40 }; 46 };
41 47
42 size_t nacl_irt_interface(const char *interface_ident, 48 size_t nacl_irt_interface(const char *interface_ident,
43 void *table, size_t tablesize) { 49 void *table, size_t tablesize) {
44 int i; 50 for (int i = 0; i < NACL_ARRAY_SIZE(irt_interfaces); ++i) {
Mark Seaborn 2012/08/28 18:57:07 The formatting change to this function is unnecess
Robert Muth (chromium) 2012/08/28 20:22:46 Done.
45 for (i = 0; i < NACL_ARRAY_SIZE(irt_interfaces); ++i) {
46 if (0 == strcmp(interface_ident, irt_interfaces[i].name)) { 51 if (0 == strcmp(interface_ident, irt_interfaces[i].name)) {
47 const size_t size = irt_interfaces[i].size; 52 const size_t size = irt_interfaces[i].size;
48 if (size <= tablesize) { 53 if (size <= tablesize) {
49 memcpy(table, irt_interfaces[i].table, size); 54 memcpy(table, irt_interfaces[i].table, size);
50 return size; 55 return size;
51 } 56 }
52 break; 57 break;
53 } 58 }
54 } 59 }
55 return 0; 60 return 0;
56 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698