Commit 12df0f00 authored by zwelch's avatar zwelch
Browse files

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
parent 79cec48b
......@@ -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;
}
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment