Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2013 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 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_DEV_H_ | 6 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_DEV_H_ |
| 7 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_DEV_H_ | 7 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_DEV_H_ |
| 8 | 8 |
| 9 #include <stdarg.h> | 9 #include <stdarg.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 * success or a non-zero value on error. | 131 * success or a non-zero value on error. |
| 132 */ | 132 */ |
| 133 #define NACL_IRT_PRIVATE_PNACL_TRANSLATOR_LINK_v0_1 \ | 133 #define NACL_IRT_PRIVATE_PNACL_TRANSLATOR_LINK_v0_1 \ |
| 134 "nacl-irt-private-pnacl-translator-link-0.1" | 134 "nacl-irt-private-pnacl-translator-link-0.1" |
| 135 struct nacl_irt_private_pnacl_translator_link { | 135 struct nacl_irt_private_pnacl_translator_link { |
| 136 void (*serve_link_request)(int (*func)(int nexe_fd, | 136 void (*serve_link_request)(int (*func)(int nexe_fd, |
| 137 const int *obj_file_fds, | 137 const int *obj_file_fds, |
| 138 int obj_file_fd_count)); | 138 int obj_file_fd_count)); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 /* | |
| 142 * This is an internal interface, for use by PNaCl's subzero translator for | |
|
Jim Stichnoth
2015/03/23 18:13:40
Sorry for the pedantry - can we capitalize Subzero
jvoung (off chromium)
2015/03/23 21:18:55
Alright, well if we are going with a shared pnacl-
| |
| 143 * communicating with the browser. | |
| 144 * | |
| 145 * serve_translate_request(funcs) loops waiting for sequences of requests | |
| 146 * via IPC, and then calls the appropriate callback to handle the IPC, | |
| 147 * on the same thread. | |
| 148 * | |
| 149 * (*) init_callback is used to initialze the translation process | |
|
Jim Stichnoth
2015/03/23 18:13:40
initialize
jvoung (off chromium)
2015/03/23 21:18:55
Done.
| |
| 150 * with configuration info: | |
| 151 * |num_threads| is the number of recommended *translate* threads | |
| 152 * to use (there may be other worker threads). | |
|
Jim Stichnoth
2015/03/23 18:13:40
Mention that num_threads=0 means completely sequen
jvoung (off chromium)
2015/03/23 21:18:55
Hmm, alright added that conditional on pnacl-sz. I
| |
| 153 * |obj_file_fd| is the FD for writing an output object file. | |
| 154 * |cmd_flags| is \0 delimited set of command-line flags. | |
| 155 * |cmd_flags_len| is the length of the |cmd_flags| array. | |
| 156 * (*) data_callback is invoked to stream additional bitcode data | |
| 157 * to the translator. | |
| 158 * (*) end_callback is invoked to signal the end of the data stream. | |
| 159 * This must block until translation is actually complete and | |
| 160 * the translator process can be terminated. | |
| 161 * | |
| 162 * All callbacks return zero on success or a non-zero value on error. | |
| 163 * TODO(jvoung): Add error output. | |
| 164 */ | |
| 165 struct PNaClSubzeroFunctions { | |
|
Mark Seaborn
2015/03/23 18:09:38
Nit: Use lower_case_with_underscores, following th
jvoung (off chromium)
2015/03/23 21:18:55
Done.
| |
| 166 int (*init_callback)(uint32_t num_threads, | |
| 167 int obj_file_fd, | |
|
Mark Seaborn
2015/03/23 18:15:56
So I guess this is specific to Subzero? llc would
Jim Stichnoth
2015/03/23 18:21:16
Subzero doesn't need to resort to module splitting
jvoung (off chromium)
2015/03/23 21:18:55
Right.
Alright, I guess Petr is close enough to u
| |
| 168 const char *cmd_flags, size_t cmd_flags_len); | |
| 169 | |
| 170 int (*data_callback)(unsigned char *data, size_t num_bytes); | |
| 171 // TODO(jvoung): UMA out-arg vector, or have a separate method | |
| 172 // for that? | |
| 173 int (*end_callback)(void); | |
| 174 }; | |
| 175 | |
| 176 #define NACL_IRT_PRIVATE_PNACL_TRANSLATOR_SUBZERO_v0_1 \ | |
| 177 "nacl-irt-private-pnacl-trnalsator-subzero-0.1" | |
|
Mark Seaborn
2015/03/23 18:09:38
"translator" typo
Can you avoid naming this after
Jim Stichnoth
2015/03/23 18:13:40
translator
jvoung (off chromium)
2015/03/23 21:18:55
Done.
| |
| 178 struct nacl_irt_private_pnacl_translator_subzero { | |
| 179 void (*serve_translate_request)(const struct PNaClSubzeroFunctions *funcs); | |
| 180 void (*log_fatal)(const char *message); | |
| 181 }; | |
| 182 | |
| 141 #if defined(__cplusplus) | 183 #if defined(__cplusplus) |
| 142 } | 184 } |
| 143 #endif | 185 #endif |
| 144 | 186 |
| 145 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_DEV_H */ | 187 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_DEV_H */ |
| OLD | NEW |