diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-31 02:18:26 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-05-31 02:18:26 +0000 |
commit | 12df0f00908d849e79fafa4d34065fc11290c8fa (patch) | |
tree | a45ff58c7db7d8a9f0fe624865984e05456e9ddb /src | |
parent | 79cec48ba286453aa8973e7c6e55429d41107c63 (diff) | |
download | openocd_libswd-12df0f00908d849e79fafa4d34065fc11290c8fa.tar.gz openocd_libswd-12df0f00908d849e79fafa4d34065fc11290c8fa.tar.bz2 openocd_libswd-12df0f00908d849e79fafa4d34065fc11290c8fa.tar.xz openocd_libswd-12df0f00908d849e79fafa4d34065fc11290c8fa.zip |
Make target_buffer_get_uXX interfaces work with constant buffers.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1956 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/target/target.c | 6 | ||||
-rw-r--r-- | src/target/target.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/target/target.c b/src/target/target.c index 95e7e5b7..98831217 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -273,7 +273,7 @@ static int new_target_number(void) static int target_continous_poll = 1; /* read a u32 from a buffer in target memory endianness */ -u32 target_buffer_get_u32(target_t *target, u8 *buffer) +u32 target_buffer_get_u32(target_t *target, const u8 *buffer) { if (target->endianness == TARGET_LITTLE_ENDIAN) return le_to_h_u32(buffer); @@ -282,7 +282,7 @@ u32 target_buffer_get_u32(target_t *target, u8 *buffer) } /* read a u16 from a buffer in target memory endianness */ -u16 target_buffer_get_u16(target_t *target, u8 *buffer) +u16 target_buffer_get_u16(target_t *target, const u8 *buffer) { if (target->endianness == TARGET_LITTLE_ENDIAN) return le_to_h_u16(buffer); @@ -291,7 +291,7 @@ u16 target_buffer_get_u16(target_t *target, u8 *buffer) } /* read a u8 from a buffer in target memory endianness */ -u8 target_buffer_get_u8(target_t *target, u8 *buffer) +u8 target_buffer_get_u8(target_t *target, const u8 *buffer) { return *buffer & 0x0ff; } diff --git a/src/target/target.h b/src/target/target.h index 1c1e10ef..13b463ca 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -401,9 +401,9 @@ extern target_t *all_targets; extern target_event_callback_t *target_event_callbacks; extern target_timer_callback_t *target_timer_callbacks; -extern u32 target_buffer_get_u32(target_t *target, u8 *buffer); -extern u16 target_buffer_get_u16(target_t *target, u8 *buffer); -extern u8 target_buffer_get_u8 (target_t *target, u8 *buffer); +extern u32 target_buffer_get_u32(target_t *target, const u8 *buffer); +extern u16 target_buffer_get_u16(target_t *target, const u8 *buffer); +extern u8 target_buffer_get_u8 (target_t *target, const u8 *buffer); extern void target_buffer_set_u32(target_t *target, u8 *buffer, u32 value); extern void target_buffer_set_u16(target_t *target, u8 *buffer, u16 value); extern void target_buffer_set_u8 (target_t *target, u8 *buffer, u8 value); |