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

Unified Diff: mojo/nacl/generator/libmojo.cc.tmpl

Issue 385983008: Mojo + NaCl prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FinalEdits Created 6 years, 3 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 | « mojo/nacl/generator/interface_dsl.py ('k') | mojo/nacl/generator/mojo_syscall.cc.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/nacl/generator/libmojo.cc.tmpl
diff --git a/mojo/nacl/generator/libmojo.cc.tmpl b/mojo/nacl/generator/libmojo.cc.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..80fbea13b74740b91aab2adbd7f7f64e8c8ed415
--- /dev/null
+++ b/mojo/nacl/generator/libmojo.cc.tmpl
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+{{generator_warning}}
+
+#include "mojo/public/c/system/core.h"
+#include "native_client/src/public/chrome_main.h"
+#include "native_client/src/public/imc_syscalls.h"
+#include "native_client/src/public/imc_types.h"
+
+#define NACL_MOJO_DESC (NACL_CHROME_DESC_BASE + 2)
+
+static void DoMojoCall(uint32_t params[], int num_params) {
+ NaClAbiNaClImcMsgIoVec iov[1] = {
+ {params, num_params}
+ };
+ NaClAbiNaClImcMsgHdr msgh = {iov, 1, NULL, 0};
+ // Note: return value unchecked. We're relying on the result parameter being
+ // unmodified - if the syscall fails, the Mojo function will return whatever
+ // the result parameter was initialized to before this function was called.
+ imc_sendmsg(NACL_MOJO_DESC, &msgh, 0);
+}
+
+{{body}}
« no previous file with comments | « mojo/nacl/generator/interface_dsl.py ('k') | mojo/nacl/generator/mojo_syscall.cc.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698