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

Unified Diff: components/nacl/loader/bare_metal/elf_util.h

Issue 100373005: Initial implementation of Bare Metal Mode for NaCl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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: components/nacl/loader/bare_metal/elf_util.h
diff --git a/components/nacl/loader/bare_metal/elf_util.h b/components/nacl/loader/bare_metal/elf_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..e1e113ad43ce6cfc87b04e1ebd0e0c4693407f3f
--- /dev/null
+++ b/components/nacl/loader/bare_metal/elf_util.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2013 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.
+ */
+
+#ifndef COMPONENTS_NACL_LOADER_BARE_METAL_ELF_UTIL_H_
+#define COMPONENTS_NACL_LOADER_BARE_METAL_ELF_UTIL_H_
+
+#include "build/build_config.h"
+
+/*
+ * This module provides utilities for ELF binary. Temporarily forked from
+ * native_client/src/trusted/service_runtime/elf_util.{h,c}.
+ * TODO(hidehiko): Unify with it after Bare Metal Mode gets stable.
Mark Seaborn 2013/12/06 03:21:16 I should say now that I am not expecting such a un
hidehiko 2013/12/06 17:40:02 I see. Done. Let's revisit here, when we move the
+ */
+
+#ifndef OS_LINUX
+#error Bare Metal is currently supported only on linux.
+#endif
+
+#include "components/nacl/loader/bare_metal/bare_metal_error_code.h"
+#include "native_client/src/include/portability.h"
+
+struct NaClBareMetalElfImage;
+struct NaClDesc;
+
+/*
+ * Reads the ELF file from the descriptor, and creates an image instance.
+ */
+struct NaClBareMetalElfImage *NaClBareMetalElfImageNew(
+ struct NaClDesc *descriptor,
+ NaClBareMetalErrorCode *error_code);
+
+/*
+ * Releases the image instance allocated by NaClBareMetalElfImageNew declared
+ * above.
+ */
+void NaClBareMetalElfImageDelete(struct NaClBareMetalElfImage *image);
+
+/*
+ * Returns the entry point address of the given ELF image.
+ */
+uintptr_t NaClBareMetalElfImageGetEntryPoint(
+ struct NaClBareMetalElfImage *image);
+
+/*
+ * Loads an ELF executable for Bare Metal nacl.
+ */
+NaClBareMetalErrorCode NaClBareMetalElfImageLoad(
+ struct NaClBareMetalElfImage *image,
+ struct NaClDesc *descriptor);
+
+#endif /* COMPONENTS_NACL_LOADER_BARE_METAL_ELF_UTIL_H_ */

Powered by Google App Engine
This is Rietveld 408576698