summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-09-03 22:49:37 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-09-20 13:12:35 +0200
commitf6a3fc818bc6a24b6c5bbcc6057f72d2b0b2e2ab (patch)
tree2b9430c70669a47b3503e00612b68238a70a3ea9 /src/target
parent32ab98c9e9672d0f1d8758c7dfb478b0316c13af (diff)
downloadopenocd+libswd-f6a3fc818bc6a24b6c5bbcc6057f72d2b0b2e2ab.tar.gz
openocd+libswd-f6a3fc818bc6a24b6c5bbcc6057f72d2b0b2e2ab.tar.bz2
openocd+libswd-f6a3fc818bc6a24b6c5bbcc6057f72d2b0b2e2ab.tar.xz
openocd+libswd-f6a3fc818bc6a24b6c5bbcc6057f72d2b0b2e2ab.zip
warnings: fix alignment warnings
These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm11.c4
-rw-r--r--src/target/arm_adi_v5.c2
-rw-r--r--src/target/arm_jtag.h4
-rw-r--r--src/target/avr32_ap7k.c8
-rw-r--r--src/target/avr32_mem.c6
-rw-r--r--src/target/etb.c2
-rw-r--r--src/target/mips_m4k.c2
-rw-r--r--src/target/xscale.c2
8 files changed, 15 insertions, 15 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c
index 85d45b00..9955143a 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -901,7 +901,7 @@ static int arm11_read_memory_inner(struct target *target,
{
uint32_t instr = !arm11_config_memrw_no_increment ? 0xecb05e01 : 0xed905e00;
/** \todo TODO: buffer cast to uint32_t* causes alignment warnings */
- uint32_t *words = (uint32_t *)buffer;
+ uint32_t *words = (uint32_t *)(void *)buffer;
/* LDC p14,c5,[R0],#4 */
/* LDC p14,c5,[R0] */
@@ -1023,7 +1023,7 @@ static int arm11_write_memory_inner(struct target *target,
uint32_t instr = !no_increment ? 0xeca05e01 : 0xed805e00;
/** \todo TODO: buffer cast to uint32_t* causes alignment warnings */
- uint32_t *words = (uint32_t*)buffer;
+ uint32_t *words = (uint32_t*)(void *)buffer;
/* "burst" here just means trusting each instruction executes
* fully before we run the next one: per-word roundtrips, to
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index b26175b3..34147967 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -316,7 +316,7 @@ int mem_ap_write_buf_u32(struct adiv5_dap *dap, uint8_t *buffer, int count, uint
for (writecount = 0; writecount < blocksize; writecount++)
{
retval = dap_queue_ap_write(dap, AP_REG_DRW,
- *(uint32_t *) (buffer + 4 * writecount));
+ *(uint32_t *) ((void *) (buffer + 4 * writecount)));
if (retval != ERROR_OK)
break;
}
diff --git a/src/target/arm_jtag.h b/src/target/arm_jtag.h
index f5812781..e90abfe0 100644
--- a/src/target/arm_jtag.h
+++ b/src/target/arm_jtag.h
@@ -77,13 +77,13 @@ int arm_jtag_setup_connection(struct arm_jtag *jtag_info);
static __inline__ void arm7flip32(jtag_callback_data_t arg)
{
uint8_t *in = (uint8_t *)arg;
- *((uint32_t *)in) = flip_u32(le_to_h_u32(in), 32);
+ *((uint32_t *)arg) = flip_u32(le_to_h_u32(in), 32);
}
static __inline__ void arm_le_to_h_u32(jtag_callback_data_t arg)
{
uint8_t *in = (uint8_t *)arg;
- *((uint32_t *)in) = le_to_h_u32(in);
+ *((uint32_t *)arg) = le_to_h_u32(in);
}
diff --git a/src/target/avr32_ap7k.c b/src/target/avr32_ap7k.c
index a5cdbe47..ed10847a 100644
--- a/src/target/avr32_ap7k.c
+++ b/src/target/avr32_ap7k.c
@@ -499,10 +499,10 @@ static int avr32_ap7k_read_memory(struct target *target, uint32_t address,
switch (size)
{
case 4:
- return avr32_jtag_read_memory32(&ap7k->jtag, address, count, (uint32_t*)buffer);
+ return avr32_jtag_read_memory32(&ap7k->jtag, address, count, (uint32_t*)(void *)buffer);
break;
case 2:
- return avr32_jtag_read_memory16(&ap7k->jtag, address, count, (uint16_t*)buffer);
+ return avr32_jtag_read_memory16(&ap7k->jtag, address, count, (uint16_t*)(void *)buffer);
break;
case 1:
return avr32_jtag_read_memory8(&ap7k->jtag, address, count, buffer);
@@ -537,10 +537,10 @@ static int avr32_ap7k_write_memory(struct target *target, uint32_t address,
switch (size)
{
case 4:
- return avr32_jtag_write_memory32(&ap7k->jtag, address, count, (uint32_t*)buffer);
+ return avr32_jtag_write_memory32(&ap7k->jtag, address, count, (uint32_t*)(void *)buffer);
break;
case 2:
- return avr32_jtag_write_memory16(&ap7k->jtag, address, count, (uint16_t*)buffer);
+ return avr32_jtag_write_memory16(&ap7k->jtag, address, count, (uint16_t*)(void *)buffer);
break;
case 1:
return avr32_jtag_write_memory8(&ap7k->jtag, address, count, buffer);
diff --git a/src/target/avr32_mem.c b/src/target/avr32_mem.c
index 0767c55c..fe6b8f0f 100644
--- a/src/target/avr32_mem.c
+++ b/src/target/avr32_mem.c
@@ -112,7 +112,7 @@ int avr32_jtag_read_memory8(struct avr32_jtag *jtag_info,
if (addr & 3)
{
retval = avr32_jtag_mwa_read(jtag_info, SLAVE_HSB_UNCACHED,
- addr + i, (uint32_t*)data);
+ addr + i, (uint32_t*)(void *)data);
if (retval != ERROR_OK)
return retval;
@@ -126,7 +126,7 @@ int avr32_jtag_read_memory8(struct avr32_jtag *jtag_info,
for (; i < (count & ~3); i+=4)
{
retval = avr32_jtag_mwa_read(jtag_info, SLAVE_HSB_UNCACHED,
- addr + i, (uint32_t*)data);
+ addr + i, (uint32_t*)(void *)data);
if (retval != ERROR_OK)
return retval;
@@ -139,7 +139,7 @@ int avr32_jtag_read_memory8(struct avr32_jtag *jtag_info,
if (i < count)
{
retval = avr32_jtag_mwa_read(jtag_info, SLAVE_HSB_UNCACHED,
- addr + i, (uint32_t*)data);
+ addr + i, (uint32_t*)(void *)data);
if (retval != ERROR_OK)
return retval;
diff --git a/src/target/etb.c b/src/target/etb.c
index ba47c39a..489b9ed5 100644
--- a/src/target/etb.c
+++ b/src/target/etb.c
@@ -166,7 +166,7 @@ static void etb_getbuf(jtag_callback_data_t arg)
{
uint8_t *in = (uint8_t *)arg;
- *((uint32_t *)in) = buf_get_u32(in, 0, 32);
+ *((uint32_t *)arg) = buf_get_u32(in, 0, 32);
}
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 62c484a9..c0adc066 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -1000,7 +1000,7 @@ static int mips_m4k_bulk_write_memory(struct target *target, uint32_t address,
}
retval = mips32_pracc_fastdata_xfer(ejtag_info, source, write_t, address,
- count, (uint32_t*) buffer);
+ count, (uint32_t*) (void *)buffer);
if (retval != ERROR_OK)
{
/* FASTDATA access failed, try normal memory write */
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 37a24385..e0ce400b 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -244,7 +244,7 @@ static int xscale_read_dcsr(struct target *target)
static void xscale_getbuf(jtag_callback_data_t arg)
{
uint8_t *in = (uint8_t *)arg;
- *((uint32_t *)in) = buf_get_u32(in, 0, 32);
+ *((uint32_t *)arg) = buf_get_u32(in, 0, 32);
}
static int xscale_receive(struct target *target, uint32_t *buffer, int num_words)