Chromium Code Reviews| 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..cd7edb15aef7b72615f5a741b42ad4a98ea3f74d |
| --- /dev/null |
| +++ b/mojo/monacl/gen/libmojo.cc.template |
| @@ -0,0 +1,27 @@ |
| +// 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. |
| + |
|
Mark Seaborn
2014/08/26 16:25:52
Could you name this "*template.cc" so that it gets
Nick Bray (chromium)
2014/09/03 23:45:02
I suspect the fact it isn't a syntactically valid
|
| +// WARNING this file was generated by $script_name |
|
Mark Seaborn
2014/08/26 16:25:52
Rather confusing because this file *isn't* generat
Nick Bray (chromium)
2014/09/03 23:45:02
Done.
|
| +// 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" |
| + |
| +#define NACL_MOJO_DESC 8 |
|
Mark Seaborn
2014/08/26 16:25:52
No need to hard-code this. Use NACL_CHROME_DESC_B
Nick Bray (chromium)
2014/09/03 23:45:02
Done, but it doesn't seem right to add a dependanc
Mark Seaborn
2014/09/09 19:13:10
It seems right to me.
|
| + |
| +static void DoMojoCall(uint32_t params[], int numParams) { |
| + NaClAbiNaClImcMsgIoVec iov[1] = { |
| + {params, numParams} |
|
Mark Seaborn
2014/08/26 16:25:52
Style nit: num_params
Nick Bray (chromium)
2014/09/03 23:45:02
Done.
|
| + }; |
| + 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 |