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 int dst_offset, const uint8_t *src, unsigned int src_offset, unsigned int bit_count) |
void * | buf_cpy (const void *from, void *_to, unsigned int size) |
Copies size bits out of from and into to . More... | |
bool | buf_eq (const void *_buf1, const void *_buf2, unsigned int size) |
bool | buf_eq_mask (const void *_buf1, const void *_buf2, const void *_mask, unsigned int size) |
static bool | buf_eq_masked (uint8_t a, uint8_t b, uint8_t m) |
static bool | buf_eq_trailing (uint8_t a, uint8_t b, uint8_t m, unsigned int trailing) |
void * | buf_set_buf (const void *_src, unsigned int src_start, void *_dst, unsigned int dst_start, unsigned int len) |
void * | buf_set_ones (void *_buf, unsigned int size) |
Set the contents of buf with count bits, all set to 1. More... | |
char * | buf_to_hex_str (const void *_buf, unsigned int buf_len) |
void | buffer_shr (void *_buf, unsigned int buf_len, unsigned int count) |
uint32_t | flip_u32 (uint32_t value, unsigned int num) |
Inverts the ordering of bits inside a 32-bit word (e.g. More... | |
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... | |
int | str_to_buf (const char *str, void *_buf, unsigned int buf_bitsize) |
Parse an unsigned number (provided as a zero-terminated string) into a bit buffer whose size is buf_len bits. More... | |
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 320 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 309 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 287 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 int | dst_offset, | ||
const uint8_t * | src, | ||
unsigned int | src_offset, | ||
unsigned int | bit_count | ||
) |
Definition at line 292 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().
void* buf_cpy | ( | const void * | from, |
void * | to, | ||
unsigned int | 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(), xtensa_start_algorithm(), xtensa_wait_algorithm(), zephyr_get_arc_state(), and zephyr_get_arm_state().
bool buf_eq | ( | const void * | _buf1, |
const void * | _buf2, | ||
unsigned int | size | ||
) |
Definition at line 70 of file binarybuffer.c.
References buf_eq_trailing(), and size.
Referenced by jtag_check_value_inner().
bool buf_eq_mask | ( | const void * | _buf1, |
const void * | _buf2, | ||
const void * | _mask, | ||
unsigned int | size | ||
) |
Definition at line 87 of file binarybuffer.c.
References buf_eq_masked(), buf_eq_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_eq_mask(), and buf_eq_trailing().
|
static |
Definition at line 64 of file binarybuffer.c.
References buf_eq_masked(), and mask.
Referenced by buf_eq(), and buf_eq_mask().
void* buf_set_buf | ( | const void * | _src, |
unsigned int | src_start, | ||
void * | _dst, | ||
unsigned int | dst_start, | ||
unsigned int | len | ||
) |
Definition at line 120 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 int | 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 105 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 int | buf_len | ||
) |
Definition at line 178 of file binarybuffer.c.
References DIV_ROUND_UP, and hex_digits.
Referenced by COMMAND_HANDLER(), default_interface_jtag_execute_queue(), handle_bp_command_list(), 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 int | buf_len, | ||
unsigned int | count | ||
) |
Definition at line 398 of file binarybuffer.c.
References count.
Referenced by adbg_wb_burst_read(), dmi_scan(), and riscv_batch_run().
uint32_t flip_u32 | ( | uint32_t | value, |
unsigned int | width | ||
) |
Inverts the ordering of bits inside a 32-bit word (e.g.
31..0 -> 0..31). This routine can be used to flip smaller data types by using smaller values for width
.
value | The word to flip. |
width | The number of bits in value (2-32). |
value
in reversed bit-order. Definition at line 165 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(), efinix_load(), feroceon_dummy_clock_out(), flip_u8(), gowin_load_to_sram(), lattice_read_bit_file(), 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 380 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().
int str_to_buf | ( | const char * | str, |
void * | _buf, | ||
unsigned int | buf_bitsize | ||
) |
Parse an unsigned number (provided as a zero-terminated string) into a bit buffer whose size is buf_len bits.
The base of the number is detected between decimal, hexadecimal and octal.
str | Input number, zero-terminated string |
_buf | Output buffer, allocated by the caller |
buf_bitsize | Output buffer size in bits |
Definition at line 201 of file binarybuffer.c.
References DIV_ROUND_UP, ERROR_INVALID_NUMBER, ERROR_NUMBER_EXCEEDS_BUFFER, ERROR_OK, and mask.
Referenced by COMMAND_HELPER().
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 342 of file binarybuffer.c.
References count.
Referenced by COMMAND_HANDLER(), efinix_read_bit_file(), gatemate_read_cfg_line(), gdb_query_packet(), gdb_write_memory_packet(), icdi_get_cmd_result(), icdi_usb_read_reg(), icdi_usb_version(), next_hex_encoded_field(), 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().