Chromium Code Reviews| 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_ */ |