From 12df0f00908d849e79fafa4d34065fc11290c8fa Mon Sep 17 00:00:00 2001 From: zwelch Date: Sun, 31 May 2009 02:18:26 +0000 Subject: 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 --- src/target/target.c | 6 +++--- 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); -- cgit v1.2.3