summaryrefslogtreecommitdiff
path: root/src/target/image.h
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-05-31 11:17:54 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-05-31 11:17:54 +0000
commit7087b66f19a7d60025f7315baa26d682804f3640 (patch)
tree739e20bdb3c7d2ebf4041824ba6e5117b64138c7 /src/target/image.h
parentf94d66d7c5f3c018ba72593b720746e4c5be1a16 (diff)
downloadopenocd+libswd-7087b66f19a7d60025f7315baa26d682804f3640.tar.gz
openocd+libswd-7087b66f19a7d60025f7315baa26d682804f3640.tar.bz2
openocd+libswd-7087b66f19a7d60025f7315baa26d682804f3640.tar.xz
openocd+libswd-7087b66f19a7d60025f7315baa26d682804f3640.zip
- add support for ELF images (thanks to Vincent Palatin for this patch)
git-svn-id: svn://svn.berlios.de/openocd/trunk@161 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/image.h')
-rw-r--r--src/target/image.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/target/image.h b/src/target/image.h
index 75288791..38a2b772 100644
--- a/src/target/image.h
+++ b/src/target/image.h
@@ -20,6 +20,7 @@
#ifndef IMAGE_H
#define IMAGE_H
+#include <elf.h>
#include "fileio.h"
#include "target.h"
@@ -31,9 +32,9 @@ typedef enum image_type
IMAGE_BINARY, /* plain binary */
IMAGE_IHEX, /* intel hex-record format */
IMAGE_MEMORY, /* target-memory pseudo-image */
+ IMAGE_ELF, /* ELF binary */
/*
* Possible future enhancements:
- * IMAGE_ELF,
* IMAGE_SRECORD,
*/
} image_type_t;
@@ -43,6 +44,7 @@ typedef struct image_section_s
u32 base_address;
u32 size;
int flags;
+ void *private; /* private data */
} image_section_t;
typedef struct image_s
@@ -75,6 +77,15 @@ typedef struct image_memory_s
target_t *target;
} image_memory_t;
+typedef struct fileio_elf_s
+{
+ fileio_t fileio;
+ Elf32_Ehdr *header;
+ Elf32_Phdr *segments;
+ u32 segment_count;
+ u8 endianness;
+} image_elf_t;
+
extern int image_open(image_t *image, void *source, enum fileio_access access);
extern int image_read_section(image_t *image, int section, u32 offset, u32 size, u8 *buffer, u32 *size_read);
extern int image_close(image_t *image);