summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-21 05:12:32 +0000
committerkc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-21 05:12:32 +0000
commit4b992717b54165368e61eeb9971340f84011f758 (patch)
tree85888a5c3e971370db43e1269bf8302ce54003c8 /src
parent869ef01f3c83b93343064f3b4720188d13984c26 (diff)
downloadopenocd+libswd-4b992717b54165368e61eeb9971340f84011f758.tar.gz
openocd+libswd-4b992717b54165368e61eeb9971340f84011f758.tar.bz2
openocd+libswd-4b992717b54165368e61eeb9971340f84011f758.tar.xz
openocd+libswd-4b992717b54165368e61eeb9971340f84011f758.zip
Author: Øyvind Harboe <oyvind.harboe@zylin.com>
- Allow target_read/write_buffer of size 0 git-svn-id: svn://svn.berlios.de/openocd/trunk@1870 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/target/target.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 7571e4e3..3bb2fa36 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -985,6 +985,10 @@ int target_write_buffer(struct target_s *target, u32 address, u32 size, u8 *buff
return ERROR_FAIL;
}
+ if (size == 0) {
+ return ERROR_OK;
+ }
+
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
@@ -1060,6 +1064,10 @@ int target_read_buffer(struct target_s *target, u32 address, u32 size, u8 *buffe
return ERROR_FAIL;
}
+ if (size == 0) {
+ return ERROR_OK;
+ }
+
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/