* @param num The number of bits from @c value to copy (1-32).
* @param value Up to 32 bits that will be copied to _buffer.
*/
-static inline void buf_set_u32(void *_buffer,
+static inline void buf_set_u32(uint8_t *_buffer,
unsigned first, unsigned num, uint32_t value)
{
uint8_t *buffer = _buffer;
* @param num The number of bits from @c value to copy (1-64).
* @param value Up to 64 bits that will be copied to _buffer.
*/
-static inline void buf_set_u64(void *_buffer,
+static inline void buf_set_u64(uint8_t *_buffer,
unsigned first, unsigned num, uint64_t value)
{
uint8_t *buffer = _buffer;
* @param num The number of bits from @c _buffer to read (1-32).
* @returns Up to 32-bits that were read from @c _buffer.
*/
-static inline uint32_t buf_get_u32(const void *_buffer,
+static inline uint32_t buf_get_u32(const uint8_t *_buffer,
unsigned first, unsigned num)
{
const uint8_t *buffer = _buffer;
* @param num The number of bits from @c _buffer to read (1-64).
* @returns Up to 64-bits that were read from @c _buffer.
*/
-static inline uint64_t buf_get_u64(const void *_buffer,
+static inline uint64_t buf_get_u64(const uint8_t *_buffer,
unsigned first, unsigned num)
{
const uint8_t *buffer = _buffer;
}
for (size_t i = 0; i < swd_cmd_queue_length; i++) {
- int ack = buf_get_u32(&swd_cmd_queue[i].trn_ack_data_parity_trn, 1, 3);
+ int ack = buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn, 1, 3);
LOG_DEBUG("%s %s %s reg %X = %08"PRIx32,
ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK",
fields[0].num_bits = 32;
uint8_t temp0[4];
fields[0].out_value = temp0;
- buf_set_u32(&temp0, 0, 32, value);
+ buf_set_u32(temp0, 0, 32, value);
fields[0].in_value = NULL;
fields[1].num_bits = 7;
etm_core, 1);
etm_get_reg(reg_list);
- etm_ctx->config = buf_get_u32(&arch_info->value, 0, 32);
+ etm_ctx->config = buf_get_u32(arch_info->value, 0, 32);
config = etm_ctx->config;
/* figure ETM version then add base registers */
etm_core + 1, 1);
etm_get_reg(reg_list + 1);
etm_ctx->id = buf_get_u32(
- &arch_info[1].value, 0, 32);
+ arch_info[1].value, 0, 32);
LOG_DEBUG("ETM ID: %08x", (unsigned) etm_ctx->id);
bcd_vers = 0x10 + (((etm_ctx->id) >> 4) & 0xff);
};
struct etm_reg {
- uint32_t value;
+ uint8_t value[4];
const struct etm_reg_info *reg_info;
struct arm_jtag *jtag_info;
};
if (strncmp(packet, "jc", 2) == 0) {
const uint32_t len = sizeof(target->gdb_service->core[0]);
char hex_buffer[len * 2 + 1];
- char buffer[len];
+ uint8_t buffer[len];
buf_set_u32(buffer, 0, len * 8, target->gdb_service->core[0]);
- int pkt_len = hexify(hex_buffer, buffer, sizeof(buffer), sizeof(hex_buffer));
+ int pkt_len = hexify(hex_buffer, (char *)buffer, sizeof(buffer), sizeof(hex_buffer));
retval = gdb_put_packet(connection, hex_buffer, pkt_len);
}