OpenOCD
|
Go to the source code of this file.
Functions | |
void | bit_copy_discard (struct bit_copy_queue *q) |
void | bit_copy_execute (struct bit_copy_queue *q) |
void | bit_copy_queue_init (struct bit_copy_queue *q) |
int | bit_copy_queued (struct bit_copy_queue *q, uint8_t *dst, unsigned dst_offset, const uint8_t *src, unsigned src_offset, unsigned bit_count) |
bool | buf_cmp (const void *_buf1, const void *_buf2, unsigned size) |
bool | buf_cmp_mask (const void *_buf1, const void *_buf2, const void *_mask, unsigned size) |
static bool | buf_cmp_masked (uint8_t a, uint8_t b, uint8_t m) |
static bool | buf_cmp_trailing (uint8_t a, uint8_t b, uint8_t m, unsigned trailing) |
void * | buf_cpy (const void *from, void *_to, unsigned size) |
Copies size bits out of from and into to . More... | |
void * | buf_set_buf (const void *_src, unsigned src_start, void *_dst, unsigned dst_start, unsigned len) |
void * | buf_set_ones (void *_buf, unsigned size) |
Set the contents of buf with count bits, all set to 1. More... | |
char * | buf_to_hex_str (const void *_buf, unsigned buf_len) |
void | buffer_shr (void *_buf, unsigned buf_len, unsigned count) |
static int | ceil_f_to_u32 (float x) |
uint32_t | flip_u32 (uint32_t value, unsigned int num) |
size_t | hexify (char *hex, const uint8_t *bin, size_t count, size_t length) |
Convert binary data into a string of hexadecimal pairs. More... | |
static void | str_radix_guess (const char **_str, unsigned *_str_len, unsigned *_radix) |
identify radix, and skip radix-prefix (0, 0x or 0X) More... | |
int | str_to_buf (const char *str, unsigned str_len, void *_buf, unsigned buf_len, unsigned radix) |
size_t | unhexify (uint8_t *bin, const char *hex, size_t count) |
Convert a string of hexadecimal pairs into its binary representation. More... | |
Variables | |
static const unsigned char | bit_reverse_table256 [] |
static const char | hex_digits [] |
void bit_copy_discard | ( | struct bit_copy_queue * | q | ) |
Definition at line 332 of file binarybuffer.c.
References bit_copy_queue_entry::list, bit_copy_queue::list, list_del(), and list_for_each_entry_safe.
Referenced by mpsse_close(), mpsse_flush(), and mpsse_purge().
void bit_copy_execute | ( | struct bit_copy_queue * | q | ) |
Definition at line 321 of file binarybuffer.c.
References bit_copy(), bit_copy_queue_entry::bit_count, bit_copy_queue_entry::dst, bit_copy_queue_entry::dst_offset, bit_copy_queue_entry::list, bit_copy_queue::list, list_del(), list_for_each_entry_safe, bit_copy_queue_entry::src, and bit_copy_queue_entry::src_offset.
Referenced by mpsse_flush().
void bit_copy_queue_init | ( | struct bit_copy_queue * | q | ) |
Definition at line 299 of file binarybuffer.c.
References INIT_LIST_HEAD(), and bit_copy_queue::list.
Referenced by mpsse_open().
int bit_copy_queued | ( | struct bit_copy_queue * | q, |
uint8_t * | dst, | ||
unsigned | dst_offset, | ||
const uint8_t * | src, | ||
unsigned | src_offset, | ||
unsigned | bit_count | ||
) |
Definition at line 304 of file binarybuffer.c.
References bit_copy_queue_entry::bit_count, bit_copy_queue_entry::dst, bit_copy_queue_entry::dst_offset, ERROR_FAIL, ERROR_OK, bit_copy_queue_entry::list, bit_copy_queue::list, list_add_tail(), bit_copy_queue_entry::src, and bit_copy_queue_entry::src_offset.
Referenced by buffer_add_read().
bool buf_cmp | ( | const void * | _buf1, |
const void * | _buf2, | ||
unsigned | size | ||
) |
Definition at line 70 of file binarybuffer.c.
References buf_cmp_trailing(), and size.
Referenced by jtag_check_value_inner().
bool buf_cmp_mask | ( | const void * | _buf1, |
const void * | _buf2, | ||
const void * | _mask, | ||
unsigned | size | ||
) |
Definition at line 87 of file binarybuffer.c.
References buf_cmp_masked(), buf_cmp_trailing(), mask, and size.
Referenced by jtag_check_value_inner(), and svf_check_tdo().
|
static |
Definition at line 60 of file binarybuffer.c.
Referenced by buf_cmp_mask(), and buf_cmp_trailing().
|
static |
Definition at line 64 of file binarybuffer.c.
References buf_cmp_masked(), and mask.
Referenced by buf_cmp(), and buf_cmp_mask().
void* buf_cpy | ( | const void * | from, |
void * | to, | ||
unsigned | size | ||
) |
Copies size
bits out of from
and into to
.
Any extra bits in the final byte will be set to zero.
from | The buffer to copy into to . |
to | The buffer that will receive the copy of from . |
size | The number of bits to copy. |
Definition at line 43 of file binarybuffer.c.
References DIV_ROUND_UP, NULL, and size.
Referenced by armv7m_read_core_reg(), armv7m_set_core_reg(), armv7m_write_core_reg(), cortex_m_fast_read_all_regs(), esirisc_read_memory(), interface_add_tms_seq(), interface_jtag_add_ir_scan(), jtag_add_plain_scan(), jtag_read_buffer(), jtag_scan_field_clone(), riscv_run_algorithm(), rtos_generic_stack_read(), xscale_get_reg(), xtensa_canonical_to_windowbase_offset(), xtensa_fetch_all_regs(), zephyr_get_arc_state(), and zephyr_get_arm_state().
void* buf_set_buf | ( | const void * | _src, |
unsigned | src_start, | ||
void * | _dst, | ||
unsigned | dst_start, | ||
unsigned | len | ||
) |
Definition at line 121 of file binarybuffer.c.
Referenced by armjtagew_tap_execute(), bit_copy(), buspirate_tap_execute(), esirisc_jtag_recv(), jlink_clock_data(), jlink_flush(), jtag_build_buffer(), jtag_read_buffer(), opendous_tap_execute(), osbdm_add_tms(), osbdm_flush(), and vsllink_jtag_execute().
void* buf_set_ones | ( | void * | buf, |
unsigned | size | ||
) |
Set the contents of buf
with count
bits, all set to 1.
buf | The buffer to fill with ones. |
size | The number of bits. |
buf
). Definition at line 106 of file binarybuffer.c.
Referenced by interface_jtag_add_ir_scan(), jtag_reset_callback(), jtag_tap_init(), and jtag_validate_ircapture().
char* buf_to_hex_str | ( | const void * | _buf, |
unsigned | buf_len | ||
) |
Definition at line 192 of file binarybuffer.c.
References DIV_ROUND_UP, and hex_digits.
Referenced by COMMAND_HANDLER(), default_interface_jtag_execute_queue(), handle_bp_command_list(), jim_command_drscan(), jtag_build_buffer(), jtag_check_value_inner(), jtag_read_buffer(), jtag_validate_ircapture(), jtag_vpi_queue_tdi_xfer(), jtag_vpi_send_cmd(), register_get(), register_set(), and target_jim_get_reg().
void buffer_shr | ( | void * | _buf, |
unsigned | buf_len, | ||
unsigned | count | ||
) |
Definition at line 410 of file binarybuffer.c.
References count.
Referenced by adbg_wb_burst_read(), dmi_scan(), and riscv_batch_run().
|
static |
Definition at line 179 of file binarybuffer.c.
Referenced by str_to_buf().
uint32_t flip_u32 | ( | uint32_t | value, |
unsigned int | num | ||
) |
Definition at line 166 of file binarybuffer.c.
References bit_reverse_table256.
Referenced by arm720t_scan_cp15(), arm7_9_endianness_callback(), arm7flip32(), arm7tdmi_clock_out_inner(), arm9tdmi_clock_out(), armjtagew_tap_execute(), feroceon_dummy_clock_out(), flip_u8(), virtex2_load(), virtex2_send_32(), and virtexflip32().
size_t hexify | ( | char * | hex, |
const uint8_t * | bin, | ||
size_t | count, | ||
size_t | length | ||
) |
Convert binary data into a string of hexadecimal pairs.
[out] | hex | Buffer to store string of hexadecimal pairs. The buffer size must be at least length . |
[in] | bin | Buffer with binary data to convert into hexadecimal pairs. |
[in] | count | Number of bytes to convert. |
[in] | length | Maximum number of characters, including null-terminator, to store into hex . |
Definition at line 392 of file binarybuffer.c.
References count, hex_digits, and length.
Referenced by COMMAND_HANDLER(), gdb_output_con(), gdb_query_packet(), gdb_read_memory_packet(), gdb_read_smp_packet(), icdi_send_remote_cmd(), icdi_usb_write_reg(), linux_thread_extra_info(), rtos_put_gdb_reg_list(), rtos_qsymbol(), rtos_thread_packet(), and tcl_target_callback_trace_handler().
|
static |
identify radix, and skip radix-prefix (0, 0x or 0X)
Definition at line 210 of file binarybuffer.c.
Referenced by str_to_buf().
int str_to_buf | ( | const char * | str, |
unsigned | str_len, | ||
void * | _buf, | ||
unsigned | buf_len, | ||
unsigned | radix | ||
) |
Definition at line 233 of file binarybuffer.c.
References ceil_f_to_u32(), DIV_ROUND_UP, str_radix_guess(), and strndup().
Referenced by COMMAND_HANDLER(), jim_command_drscan(), and target_jim_set_reg().
size_t unhexify | ( | uint8_t * | bin, |
const char * | hex, | ||
size_t | count | ||
) |
Convert a string of hexadecimal pairs into its binary representation.
[out] | bin | Buffer to store binary representation. The buffer size must be at least count . |
[in] | hex | String with hexadecimal pairs to convert into its binary representation. |
[in] | count | Number of hexadecimal pairs to convert. |
Definition at line 354 of file binarybuffer.c.
References count.
Referenced by COMMAND_HANDLER(), gdb_query_packet(), gdb_write_memory_packet(), icdi_get_cmd_result(), icdi_usb_read_reg(), icdi_usb_version(), next_hex_encoded_field(), nuttx_thread_packet(), and rtos_qsymbol().
|
static |
Definition at line 19 of file binarybuffer.c.
Referenced by flip_u32().
|
static |
Definition at line 38 of file binarybuffer.c.
Referenced by buf_to_hex_str(), and hexify().