diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-28 09:32:09 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-28 09:32:09 +0000 |
commit | 367b968809f35619e813b9352ce144b341220e22 (patch) | |
tree | 4bfac9bf42be6a1fd4249b43c5284f1c545d28d2 | |
parent | 8e7d9cb3bc9d00470d0fc398cd576db28c29b95d (diff) | |
download | openocd+libswd-367b968809f35619e813b9352ce144b341220e22.tar.gz openocd+libswd-367b968809f35619e813b9352ce144b341220e22.tar.bz2 openocd+libswd-367b968809f35619e813b9352ce144b341220e22.tar.xz openocd+libswd-367b968809f35619e813b9352ce144b341220e22.zip |
added some code that will be used in upcoming minidriver work.
git-svn-id: svn://svn.berlios.de/openocd/trunk@369 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/helper/binarybuffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index feb5724b..34a167d4 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -46,4 +46,14 @@ extern int buf_to_u32_handler(u8 *in_buf, void *priv, struct scan_field_s *field #define CEIL(m, n) ((m + n - 1) / n) +/* read a u32 from a buffer in target memory endianness */ +static __inline u32 fast_target_buffer_get_u32(u8 *buffer, int little) +{ + if (little) + return le_to_h_u32(buffer); + else + return be_to_h_u32(buffer); +} + + #endif /* BINARYBUFFER_H */ |