summaryrefslogtreecommitdiff
path: root/utils/imxtools/elf.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-05-23 11:03:35 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-05-31 13:57:25 +0200
commita87a9ef37372b4380808ec2efa7c762e137668f1 (patch)
tree9c759088f0f9cf6717d96789b6805812f6b187ea /utils/imxtools/elf.h
parentba8e4367fb4d116ffc01c12cc619bfc714e582c9 (diff)
downloadrockbox-a87a9ef37372b4380808ec2efa7c762e137668f1.zip
rockbox-a87a9ef37372b4380808ec2efa7c762e137668f1.tar.gz
rockbox-a87a9ef37372b4380808ec2efa7c762e137668f1.tar.bz2
rockbox-a87a9ef37372b4380808ec2efa7c762e137668f1.tar.xz
imxtools: move tools to a new sbtools/ subdirectory
Change-Id: I0d8d6831b35037725486f61fc363de87bc8ba92e
Diffstat (limited to 'utils/imxtools/elf.h')
-rw-r--r--utils/imxtools/elf.h94
1 files changed, 0 insertions, 94 deletions
diff --git a/utils/imxtools/elf.h b/utils/imxtools/elf.h
deleted file mode 100644
index 2166833..0000000
--- a/utils/imxtools/elf.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2011 Amaury Pouly
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-#ifndef __ELF_H__
-#define __ELF_H__
-
-#include <stdio.h>
-#include <stdint.h>
-#include <string.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/**
- * API
- */
-enum elf_section_type_t
-{
- EST_LOAD,
- EST_FILL
-};
-
-struct elf_section_t
-{
- uint32_t addr; /* virtual address */
- uint32_t size; /* virtual size */
- enum elf_section_type_t type;
- /* <union> */
- void *section; /* data */
- uint32_t pattern; /* fill pattern */
- /* </union> */
- struct elf_section_t *next;
- /* Internal to elf_write_file */
- uint32_t offset;
-};
-
-struct elf_segment_t
-{
- uint32_t vaddr; /* virtual address */
- uint32_t paddr; /* physical address */
- uint32_t vsize; /* virtual size */
- uint32_t psize; /* physical size */
- struct elf_segment_t *next;
-};
-
-struct elf_params_t
-{
- bool has_start_addr;
- uint32_t start_addr;
- struct elf_section_t *first_section;
- struct elf_section_t *last_section;
- struct elf_segment_t *first_segment;
- struct elf_segment_t *last_segment;
-};
-
-typedef bool (*elf_read_fn_t)(void *user, uint32_t addr, void *buf, size_t count);
-/* write function manages it's own error state */
-typedef void (*elf_write_fn_t)(void *user, uint32_t addr, const void *buf, size_t count);
-typedef void (*elf_printf_fn_t)(void *user, bool error, const char *fmt, ...);
-
-void elf_init(struct elf_params_t *params);
-void elf_add_load_section(struct elf_params_t *params,
- uint32_t load_addr, uint32_t size, const void *section);
-void elf_add_fill_section(struct elf_params_t *params,
- uint32_t fill_addr, uint32_t size, uint32_t pattern);
-uint32_t elf_translate_virtual_address(struct elf_params_t *params, uint32_t addr);
-void elf_translate_addresses(struct elf_params_t *params);
-void elf_write_file(struct elf_params_t *params, elf_write_fn_t write, elf_printf_fn_t printf, void *user);
-bool elf_read_file(struct elf_params_t *params, elf_read_fn_t read, elf_printf_fn_t printf,
- void *user);
-bool elf_is_empty(struct elf_params_t *params);
-void elf_set_start_addr(struct elf_params_t *params, uint32_t addr);
-bool elf_get_start_addr(struct elf_params_t *params, uint32_t *addr);
-int elf_get_nr_sections(struct elf_params_t *params);
-void elf_release(struct elf_params_t *params);
-
-#endif /* __ELF_H__ */