mirror of
https://github.com/openocd-org/openocd.git
synced 2025-10-18 00:51:42 +08:00
Compare commits
5 Commits
v0.12.0-rc
...
v0.12.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9ea7f3d647 | ||
![]() |
f71b5f5a37 | ||
![]() |
d92ebb5ab4 | ||
![]() |
7dd5b6a464 | ||
![]() |
dfe57baa16 |
2
NEWS
2
NEWS
@@ -121,7 +121,7 @@ This release also contains a number of other important functional and
|
|||||||
cosmetic bugfixes. For more details about what has changed since the
|
cosmetic bugfixes. For more details about what has changed since the
|
||||||
last release, see the git repository history:
|
last release, see the git repository history:
|
||||||
|
|
||||||
http://sourceforge.net/p/openocd/code/ci/v0.12.0-rc3/log/?path=
|
http://sourceforge.net/p/openocd/code/ci/v0.12.0/log/?path=
|
||||||
|
|
||||||
|
|
||||||
For older NEWS, see the NEWS files associated with each release
|
For older NEWS, see the NEWS files associated with each release
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
AC_INIT([openocd], [0.12.0-rc3],
|
AC_INIT([openocd], [0.12.0],
|
||||||
[OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
|
[OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
|
||||||
AC_CONFIG_SRCDIR([src/openocd.c])
|
AC_CONFIG_SRCDIR([src/openocd.c])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
@@ -574,7 +574,7 @@ AS_IF([test "x$enable_buspirate" != "xno"], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
|
AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
|
||||||
AS_IF([test -f "$srcdir/jimtcl/configure.ac"], [
|
AS_IF([test -f "$srcdir/jimtcl/configure"], [
|
||||||
AS_IF([test "x$use_internal_jimtcl_maintainer" = "xyes"], [
|
AS_IF([test "x$use_internal_jimtcl_maintainer" = "xyes"], [
|
||||||
jimtcl_config_options="--disable-install-jim --with-ext=json --maintainer"
|
jimtcl_config_options="--disable-install-jim --with-ext=json --maintainer"
|
||||||
], [
|
], [
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
#include "bitq.h"
|
#include "bitq.h"
|
||||||
#include "libusb_helper.h"
|
#include "libusb_helper.h"
|
||||||
|
|
||||||
#define __packed __attribute__((packed))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Holy Crap, it's protocol documentation, and it's even vendor-provided!
|
Holy Crap, it's protocol documentation, and it's even vendor-provided!
|
||||||
|
|
||||||
@@ -110,7 +108,7 @@ descriptor.
|
|||||||
struct jtag_proto_caps_hdr {
|
struct jtag_proto_caps_hdr {
|
||||||
uint8_t proto_ver; /* Protocol version. Expects JTAG_PROTO_CAPS_VER for now. */
|
uint8_t proto_ver; /* Protocol version. Expects JTAG_PROTO_CAPS_VER for now. */
|
||||||
uint8_t length; /* of this plus any following descriptors */
|
uint8_t length; /* of this plus any following descriptors */
|
||||||
} __packed;
|
} __attribute__((packed));
|
||||||
|
|
||||||
/* start of the descriptor headers */
|
/* start of the descriptor headers */
|
||||||
#define JTAG_BUILTIN_DESCR_START_OFF 0 /* Devices with builtin usb jtag */
|
#define JTAG_BUILTIN_DESCR_START_OFF 0 /* Devices with builtin usb jtag */
|
||||||
@@ -133,7 +131,7 @@ of caps header to assume this. If no such caps exist, assume a minimum (in) buff
|
|||||||
struct jtag_gen_hdr {
|
struct jtag_gen_hdr {
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint8_t length;
|
uint8_t length;
|
||||||
} __packed;
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct jtag_proto_caps_speed_apb {
|
struct jtag_proto_caps_speed_apb {
|
||||||
uint8_t type; /* Type, always JTAG_PROTO_CAPS_SPEED_APB_TYPE */
|
uint8_t type; /* Type, always JTAG_PROTO_CAPS_SPEED_APB_TYPE */
|
||||||
@@ -141,7 +139,7 @@ struct jtag_proto_caps_speed_apb {
|
|||||||
uint8_t apb_speed_10khz[2]; /* ABP bus speed, in 10KHz increments. Base speed is half this. */
|
uint8_t apb_speed_10khz[2]; /* ABP bus speed, in 10KHz increments. Base speed is half this. */
|
||||||
uint8_t div_min[2]; /* minimum divisor (to base speed), inclusive */
|
uint8_t div_min[2]; /* minimum divisor (to base speed), inclusive */
|
||||||
uint8_t div_max[2]; /* maximum divisor (to base speed), inclusive */
|
uint8_t div_max[2]; /* maximum divisor (to base speed), inclusive */
|
||||||
} __packed;
|
} __attribute__((packed));
|
||||||
|
|
||||||
#define JTAG_PROTO_CAPS_DATA_LEN 255
|
#define JTAG_PROTO_CAPS_DATA_LEN 255
|
||||||
#define JTAG_PROTO_CAPS_SPEED_APB_TYPE 1
|
#define JTAG_PROTO_CAPS_SPEED_APB_TYPE 1
|
||||||
|
@@ -241,43 +241,37 @@ int target_rtt_find_control_block(struct target *target,
|
|||||||
target_addr_t *address, size_t size, const char *id, bool *found,
|
target_addr_t *address, size_t size, const char *id, bool *found,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
|
target_addr_t address_end = *address + size;
|
||||||
uint8_t buf[1024];
|
uint8_t buf[1024];
|
||||||
|
|
||||||
*found = false;
|
*found = false;
|
||||||
|
|
||||||
size_t j = 0;
|
size_t id_matched_length = 0;
|
||||||
size_t cb_offset = 0;
|
|
||||||
const size_t id_length = strlen(id);
|
const size_t id_length = strlen(id);
|
||||||
|
|
||||||
LOG_INFO("rtt: Searching for control block '%s'", id);
|
LOG_INFO("rtt: Searching for control block '%s'", id);
|
||||||
|
|
||||||
for (target_addr_t addr = 0; addr < size; addr = addr + sizeof(buf)) {
|
for (target_addr_t addr = *address; addr < address_end; addr += sizeof(buf)) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
const size_t buf_size = MIN(sizeof(buf), size - addr);
|
const size_t buf_size = MIN(sizeof(buf), address_end - addr);
|
||||||
ret = target_read_buffer(target, *address + addr, buf_size, buf);
|
ret = target_read_buffer(target, addr, buf_size, buf);
|
||||||
|
|
||||||
if (ret != ERROR_OK)
|
if (ret != ERROR_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
size_t start = 0;
|
for (size_t buf_off = 0; buf_off < buf_size; buf_off++) {
|
||||||
size_t i = 0;
|
if (id_matched_length > 0 &&
|
||||||
|
buf[buf_off] != id[id_matched_length]) {
|
||||||
while (i < buf_size) {
|
/* Start from beginning */
|
||||||
if (buf[i] != id[j]) {
|
id_matched_length = 0;
|
||||||
start++;
|
|
||||||
cb_offset++;
|
|
||||||
i = start;
|
|
||||||
j = 0;
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
if (buf[buf_off] == id[id_matched_length])
|
||||||
j++;
|
id_matched_length++;
|
||||||
|
|
||||||
if (j == id_length) {
|
if (id_matched_length == id_length) {
|
||||||
*address = *address + cb_offset;
|
*address = addr + buf_off + 1 - id_length;
|
||||||
*found = true;
|
*found = true;
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user