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

Unified Diff: src/untrusted/irt/irt_dev.h

Issue 984713003: Add an IRT interface for subzero/compiler to serve_translate_requests. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: add a log_fatal for now, to marshal back Created 5 years, 9 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
Index: src/untrusted/irt/irt_dev.h
diff --git a/src/untrusted/irt/irt_dev.h b/src/untrusted/irt/irt_dev.h
index 8a6f78300f4cb35b3375726457f7aeb3c7dbc222..0aaf2063ea7a7a33d313acf167dffc755e8b594a 100644
--- a/src/untrusted/irt/irt_dev.h
+++ b/src/untrusted/irt/irt_dev.h
@@ -138,6 +138,48 @@ struct nacl_irt_private_pnacl_translator_link {
int obj_file_fd_count));
};
+/*
+ * 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-
+ * communicating with the browser.
+ *
+ * serve_translate_request(funcs) loops waiting for sequences of requests
+ * via IPC, and then calls the appropriate callback to handle the IPC,
+ * on the same thread.
+ *
+ * (*) 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.
+ * with configuration info:
+ * |num_threads| is the number of recommended *translate* threads
+ * 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
+ * |obj_file_fd| is the FD for writing an output object file.
+ * |cmd_flags| is \0 delimited set of command-line flags.
+ * |cmd_flags_len| is the length of the |cmd_flags| array.
+ * (*) data_callback is invoked to stream additional bitcode data
+ * to the translator.
+ * (*) end_callback is invoked to signal the end of the data stream.
+ * This must block until translation is actually complete and
+ * the translator process can be terminated.
+ *
+ * All callbacks return zero on success or a non-zero value on error.
+ * TODO(jvoung): Add error output.
+ */
+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.
+ int (*init_callback)(uint32_t num_threads,
+ 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
+ const char *cmd_flags, size_t cmd_flags_len);
+
+ int (*data_callback)(unsigned char *data, size_t num_bytes);
+ // TODO(jvoung): UMA out-arg vector, or have a separate method
+ // for that?
+ int (*end_callback)(void);
+};
+
+#define NACL_IRT_PRIVATE_PNACL_TRANSLATOR_SUBZERO_v0_1 \
+ "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.
+struct nacl_irt_private_pnacl_translator_subzero {
+ void (*serve_translate_request)(const struct PNaClSubzeroFunctions *funcs);
+ void (*log_fatal)(const char *message);
+};
+
#if defined(__cplusplus)
}
#endif

Powered by Google App Engine
This is Rietveld 408576698