summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-06-14 09:47:00 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-06-14 09:47:00 +0000
commit53d1f9b2ca5718e4996e9cf3406f857d0ed26df2 (patch)
tree76c0dbf27a9114fb6f8a4c9f71af6117716a05d5 /src/helper
parent7087b66f19a7d60025f7315baa26d682804f3640 (diff)
downloadopenocd+libswd-53d1f9b2ca5718e4996e9cf3406f857d0ed26df2.tar.gz
openocd+libswd-53d1f9b2ca5718e4996e9cf3406f857d0ed26df2.tar.bz2
openocd+libswd-53d1f9b2ca5718e4996e9cf3406f857d0ed26df2.tar.xz
openocd+libswd-53d1f9b2ca5718e4996e9cf3406f857d0ed26df2.zip
- added manpage for OpenOCD (thanks to Uwe Hermann)
- fixed bug in ARM926EJ-S cache handling that caused cache linefills to be disabled after first debug entry - added support for auto image type detection (thanks to Vincent Palatin) - further work on ETM trace decoding (tested with a ETB interface using an ETM in normal 16-bit port mode, still experimental) git-svn-id: svn://svn.berlios.de/openocd/trunk@169 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/fileio.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/helper/fileio.c b/src/helper/fileio.c
index 3a760cd8..7075fc16 100644
--- a/src/helper/fileio.c
+++ b/src/helper/fileio.c
@@ -258,6 +258,27 @@ int fileio_read(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_read)
}
}
+int fileio_read_u32(fileio_t *fileio, u32 *data)
+{
+ u8 buf[4];
+ u32 size_read;
+ int retval;
+
+ switch (fileio->location)
+ {
+ case FILEIO_LOCAL:
+ if ((retval = fileio_local_read(fileio, 4, buf, &size_read)) != ERROR_OK)
+ return retval;
+ *data = be_to_h_u32(buf);
+ break;
+ default:
+ ERROR("BUG: should never get here");
+ exit(-1);
+ }
+
+ return ERROR_OK;
+}
+
int fileio_local_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_written)
{
fileio_local_t *fileio_local = fileio->location_private;
@@ -280,3 +301,24 @@ int fileio_write(fileio_t *fileio, u32 size, u8 *buffer, u32 *size_written)
return ERROR_OK;
}
+
+int fileio_write_u32(fileio_t *fileio, u32 data)
+{
+ u8 buf[4];
+ u32 size_written;
+ int retval;
+
+ h_u32_to_be(buf, data);
+
+ switch (fileio->location)
+ {
+ case FILEIO_LOCAL:
+ if ((retval = fileio_local_write(fileio, 4, buf, &size_written)) != ERROR_OK)
+ return retval;
+ break;
+ default:
+ ERROR("BUG: should never get here");
+ }
+
+ return ERROR_OK;
+}