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

Unified Diff: src/untrusted/nacl/nacl_ext_supply.c

Issue 511253005: Added irt extension support for supplying the nacl_irt_memory interface. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Moved size declaration down Created 6 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 | « no previous file | tests/irt_ext/file_desc.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/nacl/nacl_ext_supply.c
diff --git a/src/untrusted/nacl/nacl_ext_supply.c b/src/untrusted/nacl/nacl_ext_supply.c
index 83a89185f51f7f8baf7563f39b9db0295ce1fb9d..d19459733f2cde19b72f28c0d921994f525ba84f 100644
--- a/src/untrusted/nacl/nacl_ext_supply.c
+++ b/src/untrusted/nacl/nacl_ext_supply.c
@@ -11,12 +11,6 @@
#include "native_client/src/untrusted/irt/irt_extension.h"
#include "native_client/src/untrusted/nacl/nacl_irt.h"
-static size_t ext_struct_memcpy_init(void *dest_table, const void *src_table,
- size_t tablesize) {
- memcpy(dest_table, src_table, tablesize);
- return tablesize;
-}
-
struct nacl_irt_ext_struct {
const char *interface_ident;
void *table;
@@ -27,27 +21,15 @@ static const struct nacl_irt_ext_struct nacl_irt_ext_structs[] = {
{
.interface_ident = NACL_IRT_DEV_FDIO_v0_3,
.table = &__libnacl_irt_dev_fdio,
- .tablesize = sizeof(__libnacl_irt_dev_fdio)
- }, {
- .interface_ident = NACL_IRT_DEV_FDIO_v0_2,
- .table = &__libnacl_irt_dev_fdio,
- .tablesize = sizeof(struct nacl_irt_dev_fdio_v0_2)
- }, {
- .interface_ident = NACL_IRT_FDIO_v0_1,
- .table = &__libnacl_irt_fdio,
- .tablesize = sizeof(__libnacl_irt_fdio)
+ .tablesize = sizeof(__libnacl_irt_dev_fdio),
}, {
.interface_ident = NACL_IRT_DEV_FILENAME_v0_3,
.table = &__libnacl_irt_dev_filename,
- .tablesize = sizeof(__libnacl_irt_dev_filename)
- }, {
- .interface_ident = NACL_IRT_DEV_FILENAME_v0_2,
- .table = &__libnacl_irt_dev_filename,
- .tablesize = sizeof(struct nacl_irt_dev_filename_v0_2)
+ .tablesize = sizeof(__libnacl_irt_dev_filename),
}, {
- .interface_ident = NACL_IRT_FILENAME_v0_1,
- .table = &__libnacl_irt_dev_filename,
- .tablesize = sizeof(struct nacl_irt_filename)
+ .interface_ident = NACL_IRT_MEMORY_v0_3,
+ .table = &__libnacl_irt_memory,
+ .tablesize = sizeof(struct nacl_irt_memory),
},
};
@@ -56,9 +38,8 @@ size_t nacl_interface_ext_supply(const char *interface_ident,
for (int i = 0; i < NACL_ARRAY_SIZE(nacl_irt_ext_structs); i++) {
if (nacl_irt_ext_structs[i].tablesize == tablesize &&
strcmp(nacl_irt_ext_structs[i].interface_ident, interface_ident) == 0) {
- return ext_struct_memcpy_init(nacl_irt_ext_structs[i].table,
- table,
- tablesize);
+ memcpy(nacl_irt_ext_structs[i].table, table, tablesize);
+ return tablesize;
}
}
« no previous file with comments | « no previous file | tests/irt_ext/file_desc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698