101         uint32_t first_length;
 
  114             len - first_length, 
buffer + first_length);
 
  132         uint32_t first_length;
 
  154             len - first_length, 
buffer);
 
  183         unsigned int channel_index, 
const uint8_t *
buffer, 
size_t *
length,
 
  193         LOG_ERROR(
"rtt: Failed to read down-channel %u description",
 
  199         LOG_WARNING(
"rtt: Down-channel %u is not active", channel_index);
 
  204         LOG_WARNING(
"rtt: Down-channel %u is not large enough",
 
  248     size_t id_matched_length = 0;
 
  249     const size_t id_length = strlen(
id);
 
  251     LOG_INFO(
"rtt: Searching for control block '%s'", 
id);
 
  256         const size_t buf_size = 
MIN(
sizeof(buf), address_end - 
addr);
 
  262         for (
size_t buf_off = 0; buf_off < buf_size; buf_off++) {
 
  263             if (id_matched_length > 0 &&
 
  264                 buf[buf_off] != 
id[id_matched_length]) {
 
  266                 id_matched_length = 0;
 
  269             if (buf[buf_off] == 
id[id_matched_length])
 
  272             if (id_matched_length == id_length) {
 
  294         LOG_ERROR(
"rtt: Failed to read channel %u description",
 
  332         uint32_t first_length;
 
  345             len - first_length, 
buffer + first_length);
 
  366         size_t num_channels, 
void *user_data)
 
  370     for (
size_t i = 0; i < num_channels; i++) {
 
  383             LOG_ERROR(
"rtt: Failed to read up-channel %zu description", i);
 
  388             LOG_WARNING(
"rtt: Up-channel %zu is not active", i);
 
  393             LOG_WARNING(
"rtt: Up-channel %zu is not large enough", i);
 
  401             LOG_ERROR(
"rtt: Failed to read from up-channel %zu", i);
 
Support functions to access arbitrary bits in a byte array.
 
uint64_t buffer
Pointer to data buffer to send over SPI.
 
uint32_t size
Size of dw_spi_transaction::buffer.
 
uint32_t address
Starting address. Sector aligned.
 
#define LOG_WARNING(expr ...)
 
#define LOG_ERROR(expr ...)
 
#define LOG_INFO(expr ...)
 
#define LOG_DEBUG(expr ...)
 
target_addr_t addr
Start address to search for the control block.
 
struct rtt_control ctrl
Control block.
 
#define RTT_CB_MAX_ID_LENGTH
Control block ID length in bytes, including the trailing null-terminator.
 
#define RTT_CHANNEL_BUFFER_MIN_SIZE
 
rtt_channel_type
Channel type.
 
@ RTT_CHANNEL_TYPE_UP
Up channel (target to host).
 
@ RTT_CHANNEL_TYPE_DOWN
Down channel (host to target).
 
uint32_t read_pos
Read position within the buffer in bytes.
 
uint32_t name_addr
Channel name address on the target.
 
target_addr_t address
Channel structure address on the target.
 
uint32_t write_pos
Write position within the buffer in bytes.
 
uint32_t size
Channel buffer size in bytes.
 
uint32_t flags
Buffer flags.
 
uint32_t buffer_addr
Buffer address on the target.
 
char id[RTT_CB_MAX_ID_LENGTH]
Control block identifier, including trailing null-terminator.
 
target_addr_t address
Control block address on the target.
 
uint32_t num_up_channels
Maximum number of up-channels.
 
uint32_t num_down_channels
Maximum number of down-channels.
 
struct rtt_sink_list * next
 
int target_rtt_read_control_block(struct target *target, target_addr_t address, struct rtt_control *ctrl, void *user_data)
 
static int read_from_channel(struct target *target, const struct rtt_channel *channel, uint8_t *buffer, size_t *length)
 
static int read_channel_name(struct target *target, target_addr_t address, char *name, size_t length)
 
static int read_rtt_channel(struct target *target, const struct rtt_control *ctrl, unsigned int channel_index, enum rtt_channel_type type, struct rtt_channel *channel)
 
static bool channel_is_active(const struct rtt_channel *channel)
 
int target_rtt_read_callback(struct target *target, const struct rtt_control *ctrl, struct rtt_sink_list **sinks, size_t num_channels, void *user_data)
 
static int write_to_channel(struct target *target, const struct rtt_channel *channel, const uint8_t *buffer, size_t *length)
 
int target_rtt_find_control_block(struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data)
 
int target_rtt_stop(struct target *target, void *user_data)
 
int target_rtt_start(struct target *target, const struct rtt_control *ctrl, void *user_data)
 
int target_rtt_write_callback(struct target *target, struct rtt_control *ctrl, unsigned int channel_index, const uint8_t *buffer, size_t *length, void *user_data)
 
int target_rtt_read_channel_info(struct target *target, const struct rtt_control *ctrl, unsigned int channel_index, enum rtt_channel_type type, struct rtt_channel_info *info, void *user_data)
 
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
 
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
 
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
 
uint32_t target_buffer_get_u32(struct target *target, const uint8_t *buffer)
 
static struct ublast_lowlevel_priv info