OLD | NEW |
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 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_NACL_IRT_H_ | 7 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_NACL_IRT_H_ |
8 #define NATIVE_CLIENT_SRC_UNTRUSTED_NACL_IRT_H_ | 8 #define NATIVE_CLIENT_SRC_UNTRUSTED_NACL_IRT_H_ |
9 | 9 |
10 #include <errno.h> | 10 #include <errno.h> |
11 | 11 |
12 #include "native_client/src/include/elf32.h" | 12 #include "native_client/src/include/elf32.h" |
13 #include "native_client/src/untrusted/irt/irt.h" | 13 #include "native_client/src/untrusted/irt/irt.h" |
14 #include "native_client/src/untrusted/irt/irt_dev.h" | 14 #include "native_client/src/untrusted/irt/irt_dev.h" |
15 | 15 |
| 16 extern TYPE_nacl_irt_query nacl_irt_module_init( |
| 17 TYPE_nacl_irt_query irt_query) __attribute((weak)); |
| 18 |
16 extern TYPE_nacl_irt_query __nacl_irt_query; | 19 extern TYPE_nacl_irt_query __nacl_irt_query; |
17 | 20 |
| 21 extern struct nacl_irt_instance __libnacl_irt_instance; |
18 extern struct nacl_irt_basic __libnacl_irt_basic; | 22 extern struct nacl_irt_basic __libnacl_irt_basic; |
19 extern struct nacl_irt_fdio __libnacl_irt_fdio; | 23 extern struct nacl_irt_fdio __libnacl_irt_fdio; |
20 extern struct nacl_irt_dev_fdio __libnacl_irt_dev_fdio; | 24 extern struct nacl_irt_dev_fdio __libnacl_irt_dev_fdio; |
21 extern struct nacl_irt_dev_filename __libnacl_irt_dev_filename; | 25 extern struct nacl_irt_dev_filename __libnacl_irt_dev_filename; |
22 extern struct nacl_irt_memory __libnacl_irt_memory; | 26 extern struct nacl_irt_memory __libnacl_irt_memory; |
23 extern struct nacl_irt_tls __libnacl_irt_tls; | 27 extern struct nacl_irt_tls __libnacl_irt_tls; |
24 extern struct nacl_irt_clock __libnacl_irt_clock; | 28 extern struct nacl_irt_clock __libnacl_irt_clock; |
25 extern struct nacl_irt_dev_getpid __libnacl_irt_dev_getpid; | 29 extern struct nacl_irt_dev_getpid __libnacl_irt_dev_getpid; |
26 | 30 |
27 extern int __libnacl_irt_query(const char *interface, | 31 extern int __libnacl_irt_query(const char *interface, |
28 void *table, size_t table_size); | 32 void *table, size_t table_size); |
| 33 |
| 34 extern int nacl_irt_interface_set(const char *interface_ident, |
| 35 void *table, size_t tablesize, void *old_table
); |
| 36 |
29 extern void __libnacl_mandatory_irt_query(const char *interface_ident, | 37 extern void __libnacl_mandatory_irt_query(const char *interface_ident, |
30 void *table, size_t table_size); | 38 void *table, size_t table_size); |
31 extern void __libnacl_irt_init(Elf32_auxv_t *auxv); | 39 extern void __libnacl_irt_init(int argc, char **argv, Elf32_auxv_t *auxv); |
32 | 40 |
33 extern void __libnacl_irt_dev_fdio_init(void); | 41 extern void __libnacl_irt_dev_fdio_init(void); |
34 extern void __libnacl_irt_dev_filename_init(void); | 42 extern void __libnacl_irt_dev_filename_init(void); |
35 | 43 |
36 extern int __libnacl_irt_init_fn(void *interface_field, void (*init)(void)); | 44 extern int __libnacl_irt_init_fn(void *interface_field, void (*init)(void)); |
37 | 45 |
38 /* | 46 /* |
39 * NACL_OPTIONAL_FN is used to create libc wrapper functions. | 47 * NACL_OPTIONAL_FN is used to create libc wrapper functions. |
40 * | 48 * |
41 * iface is the "name" of the IRT interface, where nacl_irt_ ## iface | 49 * iface is the "name" of the IRT interface, where nacl_irt_ ## iface |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } \ | 93 } \ |
86 error = iface_obj.fname arglist; \ | 94 error = iface_obj.fname arglist; \ |
87 if (0 != error) { \ | 95 if (0 != error) { \ |
88 errno = error; \ | 96 errno = error; \ |
89 return -1; \ | 97 return -1; \ |
90 } \ | 98 } \ |
91 return 0; \ | 99 return 0; \ |
92 } | 100 } |
93 | 101 |
94 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_NACL_IRT_H_ */ | 102 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_NACL_IRT_H_ */ |
OLD | NEW |