diff options
author | Keith Packard <keithp@keithp.com> | 2013-11-28 09:31:02 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-11-28 09:31:02 -0800 |
commit | 14204e3d147ad99cc249ad8de254809180fe5c38 (patch) | |
tree | da6dfb4b4d5ea02af596a83748af27080f0dfec7 /ao-tools/lib/ao-hex.h | |
parent | ee07f1a0f8e431bebb3b948f6249f5f33413e966 (diff) |
ao-tools: Add ao-elftohex and .ihx symbol support
ao-elftohex converts an elf file into a hex file so that we can load
it with java.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/lib/ao-hex.h')
-rw-r--r-- | ao-tools/lib/ao-hex.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ao-tools/lib/ao-hex.h b/ao-tools/lib/ao-hex.h index 8528eb45..98497460 100644 --- a/ao-tools/lib/ao-hex.h +++ b/ao-tools/lib/ao-hex.h @@ -19,6 +19,8 @@ #define _AO_HEX_H_ #include <stdint.h> +#include <stdbool.h> +#include <stdio.h> #define AO_HEX_RECORD_NORMAL 0x00 #define AO_HEX_RECORD_EOF 0x01 @@ -47,6 +49,14 @@ struct ao_hex_image { uint8_t data[0]; }; +struct ao_sym { + unsigned addr; + unsigned default_addr; + char *name; + bool required; + bool found; +}; + struct ao_hex_file * ao_hex_file_read(FILE *file, char *name); @@ -60,9 +70,13 @@ void ao_hex_image_free(struct ao_hex_image *image); struct ao_hex_image * -ao_hex_load(char *filename); +ao_hex_load(char *filename, struct ao_sym **symbols, int *num_symbols); int ao_hex_image_equal(struct ao_hex_image *a, struct ao_hex_image *b); +bool +ao_hex_save(FILE *file, struct ao_hex_image *image, + struct ao_sym *symbols, int num_symbols); + #endif /* _AO_HEX_H_ */ |