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

Unified Diff: mojo/monacl/gen/libmojo.cc.template

Issue 385983008: Mojo + NaCl prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Edits Created 6 years, 5 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: mojo/monacl/gen/libmojo.cc.template
diff --git a/mojo/monacl/gen/libmojo.cc.template b/mojo/monacl/gen/libmojo.cc.template
new file mode 100644
index 0000000000000000000000000000000000000000..650b18b58265bd0d3f55dd07877c46ad09fc08c5
--- /dev/null
+++ b/mojo/monacl/gen/libmojo.cc.template
@@ -0,0 +1,28 @@
+// 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.
+
+// WARNING this file was generated by $script_name
+// Do not edit by hand.
+
+#include <errno.h>
+
+#include "mojo/public/c/system/core.h"
+#include "native_client/src/public/imc_syscalls.h"
+#include "native_client/src/public/imc_types.h"
+#include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h"
+
+#define NACL_MOJO_DESC 5
+
+static void DoMojoCall(uint32_t params[], int numParams) {
+ NaClAbiNaClImcMsgIoVec iov[1] = {
+ {params, numParams}
+ };
+ 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

Powered by Google App Engine
This is Rietveld 408576698