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

Unified Diff: chrome/nacl/nacl_helper_bootstrap_linux.c

Issue 7599011: Reserve 1GB at the base address of linux nacl_helper for Native Client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More refinements to gyp files Created 9 years, 4 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: chrome/nacl/nacl_helper_bootstrap_linux.c
diff --git a/chrome/nacl/nacl_helper_bootstrap_linux.c b/chrome/nacl/nacl_helper_bootstrap_linux.c
new file mode 100644
index 0000000000000000000000000000000000000000..4c3b4214eb3e21a089f12ed0c05770eeb1ac8f95
--- /dev/null
+++ b/chrome/nacl/nacl_helper_bootstrap_linux.c
@@ -0,0 +1,24 @@
+/* Copyright (c) 2011 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.
+ *
+ * Bootstraping the nacl_helper. This executable reserves the bottom 1G
+ * of the address space, then invokes nacl_helper_main. Note that,
+ * as the text of this executable will eventually be overwritten by the
+ * native_client module, nacl_helper_init must not attempt to return.
+ */
+
+#include <assert.h>
+
+/* reserve 1GB of space */
+#define ONEGIG 0x40000000
Roland McGrath 2011/08/15 20:15:51 I use (1 << 30).
Brad Chen 2011/08/15 23:02:28 Seems at least as clear. Changed as per your sugge
+char nacl_reserved_space[ONEGIG];
+
+void nacl_helper_init(int argc, char *argv[],
+ const char *nacl_reserved_space);
+
+int main(int argc, char *argv[]) {
+ nacl_helper_init(argc, argv, nacl_reserved_space);
+ assert(0);
Roland McGrath 2011/08/15 20:15:51 It's better to use abort(), in case -DNDEBUG is us
Brad Chen 2011/08/15 23:02:28 Done.
+ return 0; // convince the tools I'm sane.
+}

Powered by Google App Engine
This is Rietveld 408576698