summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm720t.c8
-rw-r--r--src/target/arm720t.h4
-rw-r--r--src/target/image.c6
-rw-r--r--src/target/image.h7
-rw-r--r--src/target/target.c3
-rw-r--r--src/target/xscale.c4
6 files changed, 23 insertions, 9 deletions
diff --git a/src/target/arm720t.c b/src/target/arm720t.c
index a3c40d6f..b5c9752b 100644
--- a/src/target/arm720t.c
+++ b/src/target/arm720t.c
@@ -241,8 +241,8 @@ void arm720t_post_debug_entry(target_t *target)
arm720t->armv4_5_mmu.armv4_5_cache.i_cache_enabled = 0;
/* save i/d fault status and address register */
- arm720t_read_cp15(target, 0xee150f10, &arm720t->fsr);
- arm720t_read_cp15(target, 0xee160f10, &arm720t->far);
+ arm720t_read_cp15(target, 0xee150f10, &arm720t->fsr_reg);
+ arm720t_read_cp15(target, 0xee160f10, &arm720t->far_reg);
jtag_execute_queue();
}
@@ -254,8 +254,8 @@ void arm720t_pre_restore_context(target_t *target)
arm720t_common_t *arm720t = arm7tdmi->arch_info;
/* restore i/d fault status and address register */
- arm720t_write_cp15(target, 0xee050f10, arm720t->fsr);
- arm720t_write_cp15(target, 0xee060f10, arm720t->far);
+ arm720t_write_cp15(target, 0xee050f10, arm720t->fsr_reg);
+ arm720t_write_cp15(target, 0xee060f10, arm720t->far_reg);
}
int arm720t_get_arch_pointers(target_t *target, armv4_5_common_t **armv4_5_p, arm7_9_common_t **arm7_9_p, arm7tdmi_common_t **arm7tdmi_p, arm720t_common_t **arm720t_p)
diff --git a/src/target/arm720t.h b/src/target/arm720t.h
index 2479b548..d16e3e6b 100644
--- a/src/target/arm720t.h
+++ b/src/target/arm720t.h
@@ -36,8 +36,8 @@ typedef struct arm720t_common_s
armv4_5_mmu_common_t armv4_5_mmu;
arm7tdmi_common_t arm7tdmi_common;
u32 cp15_control_reg;
- u32 fsr;
- u32 far;
+ u32 fsr_reg;
+ u32 far_reg;
} arm720t_common_t;
#endif /* ARM720T_H */
diff --git a/src/target/image.c b/src/target/image.c
index 6239b994..833381b2 100644
--- a/src/target/image.c
+++ b/src/target/image.c
@@ -23,7 +23,9 @@
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_ELF_H
#include <elf.h>
+#endif
#include "image.h"
@@ -320,8 +322,8 @@ int image_elf_read_headers(image_t *image)
elf->endianness = elf->header->e_ident[EI_DATA];
- if ((elf->endianness==ELFDATANONE)
- ||(elf->endianness>=ELFDATANUM))
+ if ((elf->endianness!=ELFDATA2LSB)
+ &&(elf->endianness!=ELFDATA2MSB))
{
ERROR("invalid ELF file, unknown endianess setting");
return ERROR_IMAGE_FORMAT_ERROR;
diff --git a/src/target/image.h b/src/target/image.h
index 7aa119ca..07931472 100644
--- a/src/target/image.h
+++ b/src/target/image.h
@@ -20,7 +20,14 @@
#ifndef IMAGE_H
#define IMAGE_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_ELF_H
#include <elf.h>
+#endif
+#include "replacements.h"
#include "fileio.h"
#include "target.h"
diff --git a/src/target/target.c b/src/target/target.c
index e7fb3ec8..2eeb2bfc 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -31,6 +31,7 @@
#include <string.h>
#include <stdlib.h>
+#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -1776,7 +1777,7 @@ int handle_dump_image_command(struct command_context_s *cmd_ctx, char *cmd, char
fileio_close(&fileio);
duration_stop_measure(&duration, &duration_text);
- command_print(cmd_ctx, "dumped %lli byte in %s", fileio.size, duration_text);
+ command_print(cmd_ctx, "dumped %"PRIi64" byte in %s", fileio.size, duration_text);
free(duration_text);
return ERROR_OK;
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 334924f3..311e53bc 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -17,7 +17,11 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
+
+#include "replacements.h"
#include "xscale.h"