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

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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/untrusted/irt/irt_ppapi.c » ('j') | src/untrusted/irt/irt_ppapi.c » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) },
35 { NACL_IRT_RANDOM_v0_1, &nacl_irt_random, sizeof(nacl_irt_random) }, 36 { NACL_IRT_RANDOM_v0_1, &nacl_irt_random, sizeof(nacl_irt_random) },
36 #endif 37 #endif
37 { NACL_IRT_CLOCK_v0_1, &nacl_irt_clock, sizeof(nacl_irt_clock) }, 38 { NACL_IRT_CLOCK_v0_1, &nacl_irt_clock, sizeof(nacl_irt_clock) },
39 { NACL_IRT_CONTROL_v0_1, &nacl_irt_control, sizeof(nacl_irt_control) },
jvoung (off chromium) 2012/08/07 15:33:10 missing file for this?
38 { NACL_IRT_DEV_EXCEPTION_HANDLING_v0_1, &nacl_irt_dev_exception_handling, 40 { NACL_IRT_DEV_EXCEPTION_HANDLING_v0_1, &nacl_irt_dev_exception_handling,
39 sizeof(nacl_irt_dev_exception_handling) }, 41 sizeof(nacl_irt_dev_exception_handling) },
40 }; 42 };
41 43
42 size_t nacl_irt_interface(const char *interface_ident, 44 size_t nacl_irt_interface(const char *interface_ident,
43 void *table, size_t tablesize) { 45 void *table,
44 int i; 46 size_t tablesize) {
45 for (i = 0; i < NACL_ARRAY_SIZE(irt_interfaces); ++i) { 47 for (int i = 0; i < NACL_ARRAY_SIZE(irt_interfaces); ++i) {
46 if (0 == strcmp(interface_ident, irt_interfaces[i].name)) { 48 if (0 == strcmp(interface_ident, irt_interfaces[i].name)) {
47 const size_t size = irt_interfaces[i].size; 49 const size_t size = irt_interfaces[i].size;
48 if (size <= tablesize) { 50 if (size <= tablesize) {
49 memcpy(table, irt_interfaces[i].table, size); 51 memcpy(table, irt_interfaces[i].table, size);
50 return size; 52 return size;
51 } 53 }
52 break; 54 break;
53 } 55 }
54 } 56 }
55 return 0; 57 return 0;
56 } 58 }
OLDNEW
« no previous file with comments | « no previous file | src/untrusted/irt/irt_ppapi.c » ('j') | src/untrusted/irt/irt_ppapi.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698