You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
| 2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
| 2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
| 2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
| 2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
| 2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
| 2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
| 2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
| 2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
| 2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
| 2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
| 2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
| 2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
| 2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
| 2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
| 2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
| 2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(54) |
Sep
(47) |
Oct
(15) |
Nov
(58) |
Dec
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-18 10:08:27
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via e17fe4db0f256ee4fb97dcfd6b9f7f55c966b190 (commit)
via 177bafd4cccf505df0d02ace0d235af78cac4d8a (commit)
from 20005eb81abaa3d191d6cdf36fd6f3d4e48a1db7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e17fe4db0f256ee4fb97dcfd6b9f7f55c966b190
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 1 00:29:11 2023 +0200
pld: validate exported functions by including its own .h
Let source files to include its file .h to validate the exported
prototypes.
Detected through 'sparse' tool.
Change-Id: I217c2903fdb19e1a2cce39d2536a903c3d72f3f7
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7664
Tested-by: jenkins
diff --git a/src/pld/certus.c b/src/pld/certus.c
index 692ea1907..1309c1b27 100644
--- a/src/pld/certus.c
+++ b/src/pld/certus.c
@@ -9,6 +9,7 @@
#include "config.h"
#endif
+#include "certus.h"
#include "lattice.h"
#include "lattice_cmd.h"
diff --git a/src/pld/ecp2_3.c b/src/pld/ecp2_3.c
index 6826d0b4a..b1c2833d5 100644
--- a/src/pld/ecp2_3.c
+++ b/src/pld/ecp2_3.c
@@ -9,6 +9,7 @@
#include "config.h"
#endif
+#include "ecp2_3.h"
#include "lattice.h"
#define LSCC_REFRESH 0x23
diff --git a/src/pld/ecp5.c b/src/pld/ecp5.c
index 298b55f4e..2e1009baa 100644
--- a/src/pld/ecp5.c
+++ b/src/pld/ecp5.c
@@ -9,6 +9,7 @@
#include "config.h"
#endif
+#include "ecp5.h"
#include "lattice.h"
#include "lattice_cmd.h"
commit 177bafd4cccf505df0d02ace0d235af78cac4d8a
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 1 00:24:37 2023 +0200
pld: move in pld.h the pld_driver's declaration
The static analyser 'sparse' complains, while compiling a pld
driver, that the struct pld_driver is declared in the file as
non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?
Move the list of pld_driver's declaration in pld.h
Change-Id: I0f917aecc7534c1b51af0afa9b32ccfd33db3511
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7663
Tested-by: jenkins
diff --git a/src/pld/pld.c b/src/pld/pld.c
index dd8f8263f..7dd2cec18 100644
--- a/src/pld/pld.c
+++ b/src/pld/pld.c
@@ -16,15 +16,6 @@
#include <helper/time_support.h>
-/* pld drivers
- */
-extern struct pld_driver efinix_pld;
-extern struct pld_driver gatemate_pld;
-extern struct pld_driver gowin_pld;
-extern struct pld_driver intel_pld;
-extern struct pld_driver lattice_pld;
-extern struct pld_driver virtex2_pld;
-
static struct pld_driver *pld_drivers[] = {
&efinix_pld,
&gatemate_pld,
diff --git a/src/pld/pld.h b/src/pld/pld.h
index a7cd20f64..322b96ec6 100644
--- a/src/pld/pld.h
+++ b/src/pld/pld.h
@@ -38,4 +38,11 @@ struct pld_device *get_pld_device_by_num(int num);
#define ERROR_PLD_DEVICE_INVALID (-1000)
#define ERROR_PLD_FILE_LOAD_FAILED (-1001)
+extern struct pld_driver efinix_pld;
+extern struct pld_driver gatemate_pld;
+extern struct pld_driver gowin_pld;
+extern struct pld_driver intel_pld;
+extern struct pld_driver lattice_pld;
+extern struct pld_driver virtex2_pld;
+
#endif /* OPENOCD_PLD_PLD_H */
-----------------------------------------------------------------------
Summary of changes:
src/pld/certus.c | 1 +
src/pld/ecp2_3.c | 1 +
src/pld/ecp5.c | 1 +
src/pld/pld.c | 9 ---------
src/pld/pld.h | 7 +++++++
5 files changed, 10 insertions(+), 9 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-18 10:08:00
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 20005eb81abaa3d191d6cdf36fd6f3d4e48a1db7 (commit)
from 5d77897526115a59754f625b6d503459c0d73eee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 20005eb81abaa3d191d6cdf36fd6f3d4e48a1db7
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 1 00:17:23 2023 +0200
nor: move in driver.h the flash_driver's declaration
The static analyser 'sparse' complains, while compiling a nor
driver, that the struct flash_driver is declared in the file as
non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?
Move the list of flash_driver's declaration in driver.h
Fix some incorrect non-const declaration and remove redundant
forward declarations.
Change-Id: I5e41d094307aac4a57dfa9a70496ff3cf180bd92
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7662
Tested-by: jenkins
diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c
index fb6d98b56..b1cb8f110 100644
--- a/src/flash/nor/at91sam3.c
+++ b/src/flash/nor/at91sam3.c
@@ -67,8 +67,6 @@
#define OFFSET_EFC_FSR 8
#define OFFSET_EFC_FRR 12
-extern const struct flash_driver at91sam3_flash;
-
static float _tomhz(uint32_t freq_hz)
{
float f;
diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c
index 6b9437390..62127530f 100644
--- a/src/flash/nor/at91sam4.c
+++ b/src/flash/nor/at91sam4.c
@@ -62,8 +62,6 @@
#define OFFSET_EFC_FSR 8
#define OFFSET_EFC_FRR 12
-extern const struct flash_driver at91sam4_flash;
-
static float _tomhz(uint32_t freq_hz)
{
float f;
diff --git a/src/flash/nor/atsamv.c b/src/flash/nor/atsamv.c
index 67533fc1e..24c432cba 100644
--- a/src/flash/nor/atsamv.c
+++ b/src/flash/nor/atsamv.c
@@ -53,8 +53,6 @@
#define SAMV_PAGE_SIZE 512
#define SAMV_FLASH_BASE 0x00400000
-extern const struct flash_driver atsamv_flash;
-
struct samv_flash_bank {
bool probed;
unsigned size_bytes;
diff --git a/src/flash/nor/driver.h b/src/flash/nor/driver.h
index 931f79421..889a811e3 100644
--- a/src/flash/nor/driver.h
+++ b/src/flash/nor/driver.h
@@ -237,4 +237,75 @@ struct flash_driver {
*/
const struct flash_driver *flash_driver_find_by_name(const char *name);
+extern const struct flash_driver aduc702x_flash;
+extern const struct flash_driver aducm360_flash;
+extern const struct flash_driver ambiqmicro_flash;
+extern const struct flash_driver at91sam3_flash;
+extern const struct flash_driver at91sam4_flash;
+extern const struct flash_driver at91sam4l_flash;
+extern const struct flash_driver at91sam7_flash;
+extern const struct flash_driver at91samd_flash;
+extern const struct flash_driver ath79_flash;
+extern const struct flash_driver atsame5_flash;
+extern const struct flash_driver atsamv_flash;
+extern const struct flash_driver avr_flash;
+extern const struct flash_driver bluenrgx_flash;
+extern const struct flash_driver cc26xx_flash;
+extern const struct flash_driver cc3220sf_flash;
+extern const struct flash_driver cfi_flash;
+extern const struct flash_driver dsp5680xx_flash;
+extern const struct flash_driver efm32_flash;
+extern const struct flash_driver em357_flash;
+extern const struct flash_driver esirisc_flash;
+extern const struct flash_driver faux_flash;
+extern const struct flash_driver fespi_flash;
+extern const struct flash_driver fm3_flash;
+extern const struct flash_driver fm4_flash;
+extern const struct flash_driver jtagspi_flash;
+extern const struct flash_driver kinetis_flash;
+extern const struct flash_driver kinetis_ke_flash;
+extern const struct flash_driver lpc2000_flash;
+extern const struct flash_driver lpc288x_flash;
+extern const struct flash_driver lpc2900_flash;
+extern const struct flash_driver lpcspifi_flash;
+extern const struct flash_driver max32xxx_flash;
+extern const struct flash_driver mdr_flash;
+extern const struct flash_driver mrvlqspi_flash;
+extern const struct flash_driver msp432_flash;
+extern const struct flash_driver niietcm4_flash;
+extern const struct flash_driver npcx_flash;
+extern const struct flash_driver nrf51_flash;
+extern const struct flash_driver nrf5_flash;
+extern const struct flash_driver numicro_flash;
+extern const struct flash_driver ocl_flash;
+extern const struct flash_driver pic32mx_flash;
+extern const struct flash_driver psoc4_flash;
+extern const struct flash_driver psoc5lp_eeprom_flash;
+extern const struct flash_driver psoc5lp_flash;
+extern const struct flash_driver psoc5lp_nvl_flash;
+extern const struct flash_driver psoc6_flash;
+extern const struct flash_driver renesas_rpchf_flash;
+extern const struct flash_driver rp2040_flash;
+extern const struct flash_driver rsl10_flash;
+extern const struct flash_driver sh_qspi_flash;
+extern const struct flash_driver sim3x_flash;
+extern const struct flash_driver stellaris_flash;
+extern const struct flash_driver stm32f1x_flash;
+extern const struct flash_driver stm32f2x_flash;
+extern const struct flash_driver stm32h7x_flash;
+extern const struct flash_driver stm32l4x_flash;
+extern const struct flash_driver stm32lx_flash;
+extern const struct flash_driver stmqspi_flash;
+extern const struct flash_driver stmsmi_flash;
+extern const struct flash_driver str7x_flash;
+extern const struct flash_driver str9x_flash;
+extern const struct flash_driver str9xpec_flash;
+extern const struct flash_driver swm050_flash;
+extern const struct flash_driver tms470_flash;
+extern const struct flash_driver virtual_flash;
+extern const struct flash_driver w600_flash;
+extern const struct flash_driver xcf_flash;
+extern const struct flash_driver xmc1xxx_flash;
+extern const struct flash_driver xmc4xxx_flash;
+
#endif /* OPENOCD_FLASH_NOR_DRIVER_H */
diff --git a/src/flash/nor/drivers.c b/src/flash/nor/drivers.c
index b9353d820..92476987e 100644
--- a/src/flash/nor/drivers.c
+++ b/src/flash/nor/drivers.c
@@ -9,77 +9,6 @@
#endif
#include "imp.h"
-extern const struct flash_driver aduc702x_flash;
-extern const struct flash_driver aducm360_flash;
-extern const struct flash_driver ambiqmicro_flash;
-extern const struct flash_driver at91sam3_flash;
-extern const struct flash_driver at91sam4_flash;
-extern const struct flash_driver at91sam4l_flash;
-extern const struct flash_driver at91sam7_flash;
-extern const struct flash_driver at91samd_flash;
-extern const struct flash_driver ath79_flash;
-extern const struct flash_driver atsame5_flash;
-extern const struct flash_driver atsamv_flash;
-extern const struct flash_driver avr_flash;
-extern const struct flash_driver bluenrgx_flash;
-extern const struct flash_driver cc3220sf_flash;
-extern const struct flash_driver cc26xx_flash;
-extern const struct flash_driver cfi_flash;
-extern const struct flash_driver dsp5680xx_flash;
-extern const struct flash_driver efm32_flash;
-extern const struct flash_driver em357_flash;
-extern const struct flash_driver esirisc_flash;
-extern const struct flash_driver faux_flash;
-extern const struct flash_driver fm3_flash;
-extern const struct flash_driver fm4_flash;
-extern const struct flash_driver fespi_flash;
-extern const struct flash_driver jtagspi_flash;
-extern const struct flash_driver kinetis_flash;
-extern const struct flash_driver kinetis_ke_flash;
-extern const struct flash_driver lpc2000_flash;
-extern const struct flash_driver lpc288x_flash;
-extern const struct flash_driver lpc2900_flash;
-extern const struct flash_driver lpcspifi_flash;
-extern const struct flash_driver max32xxx_flash;
-extern const struct flash_driver mdr_flash;
-extern const struct flash_driver mrvlqspi_flash;
-extern const struct flash_driver msp432_flash;
-extern const struct flash_driver niietcm4_flash;
-extern const struct flash_driver npcx_flash;
-extern const struct flash_driver nrf5_flash;
-extern const struct flash_driver nrf51_flash;
-extern const struct flash_driver numicro_flash;
-extern const struct flash_driver ocl_flash;
-extern const struct flash_driver pic32mx_flash;
-extern const struct flash_driver psoc4_flash;
-extern const struct flash_driver psoc5lp_flash;
-extern const struct flash_driver psoc5lp_eeprom_flash;
-extern const struct flash_driver psoc5lp_nvl_flash;
-extern const struct flash_driver psoc6_flash;
-extern const struct flash_driver renesas_rpchf_flash;
-extern const struct flash_driver rp2040_flash;
-extern const struct flash_driver sh_qspi_flash;
-extern const struct flash_driver sim3x_flash;
-extern const struct flash_driver stellaris_flash;
-extern const struct flash_driver stm32f1x_flash;
-extern const struct flash_driver stm32f2x_flash;
-extern const struct flash_driver stm32lx_flash;
-extern const struct flash_driver stm32l4x_flash;
-extern const struct flash_driver stm32h7x_flash;
-extern const struct flash_driver stmqspi_flash;
-extern const struct flash_driver stmsmi_flash;
-extern const struct flash_driver str7x_flash;
-extern const struct flash_driver str9x_flash;
-extern const struct flash_driver str9xpec_flash;
-extern const struct flash_driver swm050_flash;
-extern const struct flash_driver tms470_flash;
-extern const struct flash_driver virtual_flash;
-extern const struct flash_driver w600_flash;
-extern const struct flash_driver xcf_flash;
-extern const struct flash_driver xmc1xxx_flash;
-extern const struct flash_driver xmc4xxx_flash;
-extern const struct flash_driver rsl10_flash;
-
/**
* The list of built-in flash drivers.
* @todo Make this dynamically extendable with loadable modules.
diff --git a/src/flash/nor/rp2040.c b/src/flash/nor/rp2040.c
index b0d118bdb..6c18c7b28 100644
--- a/src/flash/nor/rp2040.c
+++ b/src/flash/nor/rp2040.c
@@ -520,7 +520,7 @@ FLASH_BANK_COMMAND_HANDLER(rp2040_flash_bank_command)
return ERROR_OK;
}
-struct flash_driver rp2040_flash = {
+const struct flash_driver rp2040_flash = {
.name = "rp2040_flash",
.flash_bank_command = rp2040_flash_bank_command,
.erase = rp2040_flash_erase,
diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c
index 77ea4c40d..c9fc1bffa 100644
--- a/src/flash/nor/stmqspi.c
+++ b/src/flash/nor/stmqspi.c
@@ -2447,7 +2447,7 @@ static const struct command_registration stmqspi_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-struct flash_driver stmqspi_flash = {
+const struct flash_driver stmqspi_flash = {
.name = "stmqspi",
.commands = stmqspi_command_handlers,
.flash_bank_command = stmqspi_flash_bank_command,
diff --git a/src/flash/nor/swm050.c b/src/flash/nor/swm050.c
index 89e59ae47..dcf59d380 100644
--- a/src/flash/nor/swm050.c
+++ b/src/flash/nor/swm050.c
@@ -183,7 +183,7 @@ static const struct command_registration swm050_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-struct flash_driver swm050_flash = {
+const struct flash_driver swm050_flash = {
.name = "swm050",
.commands = swm050_command_handlers,
.flash_bank_command = swm050_flash_bank_command,
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/at91sam3.c | 2 --
src/flash/nor/at91sam4.c | 2 --
src/flash/nor/atsamv.c | 2 --
src/flash/nor/driver.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
src/flash/nor/drivers.c | 71 ------------------------------------------------
src/flash/nor/rp2040.c | 2 +-
src/flash/nor/stmqspi.c | 2 +-
src/flash/nor/swm050.c | 2 +-
8 files changed, 74 insertions(+), 80 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-18 10:03:44
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 5d77897526115a59754f625b6d503459c0d73eee (commit)
from f07efff961ede4c8015624679bbfd5b54fcb25b5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5d77897526115a59754f625b6d503459c0d73eee
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 1 00:08:32 2023 +0200
nand: move in driver.h the nand_flash_controller's declaration
The static analyser 'sparse' complains, while compiling a nand
driver, that the struct nand_flash_controller is declared in the
file as non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?
Move the list of nand_flash_controller's declaration in driver.h
While there, drop the unused/commented boundary scan controller.
Change-Id: I7dc32cef55be13ba537abe0f4c47b135d837126c
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7661
Tested-by: jenkins
diff --git a/src/flash/nand/driver.c b/src/flash/nand/driver.c
index 02e5c09a2..ce79e1382 100644
--- a/src/flash/nand/driver.c
+++ b/src/flash/nand/driver.c
@@ -13,25 +13,6 @@
#include "core.h"
#include "driver.h"
-/* NAND flash controller
- */
-extern struct nand_flash_controller nonce_nand_controller;
-extern struct nand_flash_controller davinci_nand_controller;
-extern struct nand_flash_controller lpc3180_nand_controller;
-extern struct nand_flash_controller lpc32xx_nand_controller;
-extern struct nand_flash_controller orion_nand_controller;
-extern struct nand_flash_controller s3c2410_nand_controller;
-extern struct nand_flash_controller s3c2412_nand_controller;
-extern struct nand_flash_controller s3c2440_nand_controller;
-extern struct nand_flash_controller s3c2443_nand_controller;
-extern struct nand_flash_controller s3c6400_nand_controller;
-extern struct nand_flash_controller mxc_nand_flash_controller;
-extern struct nand_flash_controller imx31_nand_flash_controller;
-extern struct nand_flash_controller at91sam9_nand_controller;
-extern struct nand_flash_controller nuc910_nand_controller;
-
-/* extern struct nand_flash_controller boundary_scan_nand_controller; */
-
static struct nand_flash_controller *nand_flash_controllers[] = {
&nonce_nand_controller,
&davinci_nand_controller,
@@ -47,7 +28,6 @@ static struct nand_flash_controller *nand_flash_controllers[] = {
&imx31_nand_flash_controller,
&at91sam9_nand_controller,
&nuc910_nand_controller,
-/* &boundary_scan_nand_controller, */
NULL
};
diff --git a/src/flash/nand/driver.h b/src/flash/nand/driver.h
index a874cc890..4e84f10fb 100644
--- a/src/flash/nand/driver.h
+++ b/src/flash/nand/driver.h
@@ -89,4 +89,19 @@ typedef int (*nand_driver_walker_t)(struct nand_flash_controller *c, void *);
*/
int nand_driver_walk(nand_driver_walker_t f, void *x);
+extern struct nand_flash_controller at91sam9_nand_controller;
+extern struct nand_flash_controller davinci_nand_controller;
+extern struct nand_flash_controller imx31_nand_flash_controller;
+extern struct nand_flash_controller lpc3180_nand_controller;
+extern struct nand_flash_controller lpc32xx_nand_controller;
+extern struct nand_flash_controller mxc_nand_flash_controller;
+extern struct nand_flash_controller nonce_nand_controller;
+extern struct nand_flash_controller nuc910_nand_controller;
+extern struct nand_flash_controller orion_nand_controller;
+extern struct nand_flash_controller s3c2410_nand_controller;
+extern struct nand_flash_controller s3c2412_nand_controller;
+extern struct nand_flash_controller s3c2440_nand_controller;
+extern struct nand_flash_controller s3c2443_nand_controller;
+extern struct nand_flash_controller s3c6400_nand_controller;
+
#endif /* OPENOCD_FLASH_NAND_DRIVER_H */
-----------------------------------------------------------------------
Summary of changes:
src/flash/nand/driver.c | 20 --------------------
src/flash/nand/driver.h | 15 +++++++++++++++
2 files changed, 15 insertions(+), 20 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-18 09:56:15
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via f07efff961ede4c8015624679bbfd5b54fcb25b5 (commit)
from ed46188a72492148be3c694bfea1f6a2fb92b646 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f07efff961ede4c8015624679bbfd5b54fcb25b5
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 30 23:54:44 2023 +0200
rtos: move in rtos.h the rtos_type's declaration
The static analyser 'sparse' complains, while compiling a rtos'
file, that the struct rtos_type is declared in the file as non
static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?
Move the list of rtos_type's declaration in rtos.h
Change-Id: Ia96dff077407a6653b11920519c1724e4c1167a3
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7660
Tested-by: jenkins
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index f1e8956a3..6c88de33c 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -15,22 +15,6 @@
#include "helper/binarybuffer.h"
#include "server/gdb_server.h"
-/* RTOSs */
-extern const struct rtos_type freertos_rtos;
-extern const struct rtos_type threadx_rtos;
-extern const struct rtos_type ecos_rtos;
-extern const struct rtos_type linux_rtos;
-extern const struct rtos_type chibios_rtos;
-extern const struct rtos_type chromium_ec_rtos;
-extern const struct rtos_type embkernel_rtos;
-extern const struct rtos_type mqx_rtos;
-extern const struct rtos_type ucos_iii_rtos;
-extern const struct rtos_type nuttx_rtos;
-extern const struct rtos_type hwthread_rtos;
-extern const struct rtos_type riot_rtos;
-extern const struct rtos_type zephyr_rtos;
-extern const struct rtos_type rtkernel_rtos;
-
static const struct rtos_type *rtos_types[] = {
&threadx_rtos,
&freertos_rtos,
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index 9128c163c..e283dd21b 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -135,4 +135,19 @@ int rtos_read_buffer(struct target *target, target_addr_t address,
int rtos_write_buffer(struct target *target, target_addr_t address,
uint32_t size, const uint8_t *buffer);
+extern const struct rtos_type chibios_rtos;
+extern const struct rtos_type chromium_ec_rtos;
+extern const struct rtos_type ecos_rtos;
+extern const struct rtos_type embkernel_rtos;
+extern const struct rtos_type freertos_rtos;
+extern const struct rtos_type hwthread_rtos;
+extern const struct rtos_type linux_rtos;
+extern const struct rtos_type mqx_rtos;
+extern const struct rtos_type nuttx_rtos;
+extern const struct rtos_type riot_rtos;
+extern const struct rtos_type rtkernel_rtos;
+extern const struct rtos_type threadx_rtos;
+extern const struct rtos_type ucos_iii_rtos;
+extern const struct rtos_type zephyr_rtos;
+
#endif /* OPENOCD_RTOS_RTOS_H */
-----------------------------------------------------------------------
Summary of changes:
src/rtos/rtos.c | 16 ----------------
src/rtos/rtos.h | 15 +++++++++++++++
2 files changed, 15 insertions(+), 16 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-18 09:55:50
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via ed46188a72492148be3c694bfea1f6a2fb92b646 (commit)
from 3a4f445bd92101d3daee3715178d3fbff3b7b029 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ed46188a72492148be3c694bfea1f6a2fb92b646
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 1 00:00:47 2023 +0200
target: move in target_type.h the target_type's declaration
The static analyser 'sparse' complains, while compiling a target's
file, that the struct target_type is declared in the file as non
static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?
Move the list of target_type's declaration in target_type.h
While there, fix a name clash in stm8.c
Change-Id: Ia9c681e0825cfd04d509616dbc04a0cf4944f379
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7659
Tested-by: jenkins
diff --git a/src/target/stm8.c b/src/target/stm8.c
index aa934c9bc..9fd65091c 100644
--- a/src/target/stm8.c
+++ b/src/target/stm8.c
@@ -542,12 +542,12 @@ static int stm8_get_core_reg(struct reg *reg)
int retval;
struct stm8_core_reg *stm8_reg = reg->arch_info;
struct target *target = stm8_reg->target;
- struct stm8_common *stm8_target = target_to_stm8(target);
+ struct stm8_common *stm8 = target_to_stm8(target);
if (target->state != TARGET_HALTED)
return ERROR_TARGET_NOT_HALTED;
- retval = stm8_target->read_core_reg(target, stm8_reg->num);
+ retval = stm8->read_core_reg(target, stm8_reg->num);
return retval;
}
diff --git a/src/target/target.c b/src/target/target.c
index 73fba0da7..fee9583ae 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -66,46 +66,6 @@ static int target_get_gdb_fileio_info_default(struct target *target,
static int target_gdb_fileio_end_default(struct target *target, int retcode,
int fileio_errno, bool ctrl_c);
-/* targets */
-extern struct target_type arm7tdmi_target;
-extern struct target_type arm720t_target;
-extern struct target_type arm9tdmi_target;
-extern struct target_type arm920t_target;
-extern struct target_type arm966e_target;
-extern struct target_type arm946e_target;
-extern struct target_type arm926ejs_target;
-extern struct target_type fa526_target;
-extern struct target_type feroceon_target;
-extern struct target_type dragonite_target;
-extern struct target_type xscale_target;
-extern struct target_type xtensa_chip_target;
-extern struct target_type cortexm_target;
-extern struct target_type cortexa_target;
-extern struct target_type aarch64_target;
-extern struct target_type cortexr4_target;
-extern struct target_type armv8r_target;
-extern struct target_type arm11_target;
-extern struct target_type ls1_sap_target;
-extern struct target_type mips_m4k_target;
-extern struct target_type mips_mips64_target;
-extern struct target_type avr_target;
-extern struct target_type dsp563xx_target;
-extern struct target_type dsp5680xx_target;
-extern struct target_type testee_target;
-extern struct target_type avr32_ap7k_target;
-extern struct target_type hla_target;
-extern struct target_type esp32_target;
-extern struct target_type esp32s2_target;
-extern struct target_type esp32s3_target;
-extern struct target_type or1k_target;
-extern struct target_type quark_x10xx_target;
-extern struct target_type quark_d20xx_target;
-extern struct target_type stm8_target;
-extern struct target_type riscv_target;
-extern struct target_type mem_ap_target;
-extern struct target_type esirisc_target;
-extern struct target_type arcv2_target;
-
static struct target_type *target_types[] = {
&arm7tdmi_target,
&arm9tdmi_target,
diff --git a/src/target/target_type.h b/src/target/target_type.h
index 947080381..5186e9c19 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -311,4 +311,43 @@ struct target_type {
unsigned int (*data_bits)(struct target *target);
};
+extern struct target_type aarch64_target;
+extern struct target_type arcv2_target;
+extern struct target_type arm11_target;
+extern struct target_type arm720t_target;
+extern struct target_type arm7tdmi_target;
+extern struct target_type arm920t_target;
+extern struct target_type arm926ejs_target;
+extern struct target_type arm946e_target;
+extern struct target_type arm966e_target;
+extern struct target_type arm9tdmi_target;
+extern struct target_type armv8r_target;
+extern struct target_type avr32_ap7k_target;
+extern struct target_type avr_target;
+extern struct target_type cortexa_target;
+extern struct target_type cortexm_target;
+extern struct target_type cortexr4_target;
+extern struct target_type dragonite_target;
+extern struct target_type dsp563xx_target;
+extern struct target_type dsp5680xx_target;
+extern struct target_type esirisc_target;
+extern struct target_type esp32s2_target;
+extern struct target_type esp32s3_target;
+extern struct target_type esp32_target;
+extern struct target_type fa526_target;
+extern struct target_type feroceon_target;
+extern struct target_type hla_target;
+extern struct target_type ls1_sap_target;
+extern struct target_type mem_ap_target;
+extern struct target_type mips_m4k_target;
+extern struct target_type mips_mips64_target;
+extern struct target_type or1k_target;
+extern struct target_type quark_d20xx_target;
+extern struct target_type quark_x10xx_target;
+extern struct target_type riscv_target;
+extern struct target_type stm8_target;
+extern struct target_type testee_target;
+extern struct target_type xscale_target;
+extern struct target_type xtensa_chip_target;
+
#endif /* OPENOCD_TARGET_TARGET_TYPE_H */
-----------------------------------------------------------------------
Summary of changes:
src/target/stm8.c | 4 ++--
src/target/target.c | 40 ----------------------------------------
src/target/target_type.h | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+), 42 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 09:24:52
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 3a4f445bd92101d3daee3715178d3fbff3b7b029 (commit)
from 8d12ae796ead267aeef48467ccd49ec4c2f863ad (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3a4f445bd92101d3daee3715178d3fbff3b7b029
Author: Paul Fertser <fer...@gm...>
Date: Tue May 2 15:15:21 2023 +0300
jtag: tcl: show error message when attempting manual "drscan" on a bypassed tap
To perform any meaningful manipulations with DR the corresponding IR should
be set to a relevant instruction, not BYPASS, so warn the user accordingly.
Signed-off-by: Paul Fertser <fer...@gm...>
Change-Id: I42580ecd75ae824a4145f6f17f0df9bcf825b50f
Reviewed-on: https://review.openocd.org/c/openocd/+/7654
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 395439039..934b60352 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -116,6 +116,11 @@ COMMAND_HANDLER(handle_jtag_command_drscan)
return ERROR_COMMAND_ARGUMENT_INVALID;
}
+ if (tap->bypass) {
+ command_print(CMD, "Can't execute as the selected tap is in BYPASS");
+ return ERROR_FAIL;
+ }
+
tap_state_t endstate = TAP_IDLE;
if (CMD_ARGC > 3 && !strcmp("-endstate", CMD_ARGV[CMD_ARGC - 2])) {
const char *state_name = CMD_ARGV[CMD_ARGC - 1];
-----------------------------------------------------------------------
Summary of changes:
src/jtag/tcl.c | 5 +++++
1 file changed, 5 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 09:24:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 8d12ae796ead267aeef48467ccd49ec4c2f863ad (commit)
from 85b5c518062f4d77f73cb5f00620ccebd2d7847a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8d12ae796ead267aeef48467ccd49ec4c2f863ad
Author: Paul Fertser <fer...@gm...>
Date: Tue May 2 15:10:11 2023 +0300
jtag: tcl: change drscan usage to show at least one value is required
It's customary to use [] brackets to mean the argument is optional, but
drscan requires at least one pair of "num_bits value" so change it to ().
In common regular expressions * means 0 or more, and + means 1 or more,
so change that too.
Signed-off-by: Paul Fertser <fer...@gm...>
Change-Id: Ib15d833bda2aa398ad1345a042f97d91c98dbf66
Reviewed-on: https://review.openocd.org/c/openocd/+/7653
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index d792081c4..395439039 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -225,7 +225,7 @@ static const struct command_registration jtag_command_handlers_to_move[] = {
.handler = handle_jtag_command_drscan,
.help = "Execute Data Register (DR) scan for one TAP. "
"Other TAPs must be in BYPASS mode.",
- .usage = "tap_name [num_bits value]* ['-endstate' state_name]",
+ .usage = "tap_name (num_bits value)+ ['-endstate' state_name]",
},
{
.name = "flush_count",
-----------------------------------------------------------------------
Summary of changes:
src/jtag/tcl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:56:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 85b5c518062f4d77f73cb5f00620ccebd2d7847a (commit)
from b931286ab440f4677a9ac983a64b55055d20c438 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 85b5c518062f4d77f73cb5f00620ccebd2d7847a
Author: Antonio Borneo <bor...@gm...>
Date: Mon Mar 27 11:11:46 2023 +0200
target: rewrite command 'arp_reset' as COMMAND_HANDLER
While there, add the missing .usage field and move in target.c the
enum nvp_assert.
Change-Id: Ia4f2f962887b5a35faeaa4eae128fa2865569b24
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7559
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index f2e8d531a..73fba0da7 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -157,7 +157,12 @@ static LIST_HEAD(target_trace_callback_list);
static const int polling_interval = TARGET_DEFAULT_POLLING_INTERVAL;
static LIST_HEAD(empty_smp_targets);
-static const struct jim_nvp nvp_assert[] = {
+enum nvp_assert {
+ NVP_DEASSERT,
+ NVP_ASSERT,
+};
+
+static const struct nvp nvp_assert[] = {
{ .name = "assert", NVP_ASSERT },
{ .name = "deassert", NVP_DEASSERT },
{ .name = "T", NVP_ASSERT },
@@ -5770,40 +5775,30 @@ COMMAND_HANDLER(handle_target_poll)
return target->type->poll(target);
}
-static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_target_reset)
{
- struct jim_getopt_info goi;
- jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
+ if (CMD_ARGC != 2)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- if (goi.argc != 2) {
- Jim_WrongNumArgs(interp, 0, argv,
- "([tT]|[fF]|assert|deassert) BOOL");
- return JIM_ERR;
+ const struct nvp *n = nvp_name2value(nvp_assert, CMD_ARGV[0]);
+ if (!n->name) {
+ nvp_unknown_command_print(CMD, nvp_assert, NULL, CMD_ARGV[0]);
+ return ERROR_COMMAND_ARGUMENT_INVALID;
}
- struct jim_nvp *n;
- int e = jim_getopt_nvp(&goi, nvp_assert, &n);
- if (e != JIM_OK) {
- jim_getopt_nvp_unknown(&goi, nvp_assert, 1);
- return e;
- }
/* the halt or not param */
- jim_wide a;
- e = jim_getopt_wide(&goi, &a);
- if (e != JIM_OK)
- return e;
+ int a;
+ COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], a);
- struct command_context *cmd_ctx = current_command_context(interp);
- assert(cmd_ctx);
- struct target *target = get_current_target(cmd_ctx);
- if (!target->tap->enabled)
- return jim_target_tap_disabled(interp);
+ struct target *target = get_current_target(CMD_CTX);
+ if (!target->tap->enabled) {
+ command_print(CMD, "[TAP is disabled]");
+ return ERROR_FAIL;
+ }
if (!target->type->assert_reset || !target->type->deassert_reset) {
- Jim_SetResultFormatted(interp,
- "No target-specific reset for %s",
- target_name(target));
- return JIM_ERR;
+ command_print(CMD, "No target-specific reset for %s", target_name(target));
+ return ERROR_FAIL;
}
if (target->defer_examine)
@@ -5816,10 +5811,8 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
/* do the assert */
if (n->value == NVP_ASSERT)
- e = target->type->assert_reset(target);
- else
- e = target->type->deassert_reset(target);
- return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
+ return target->type->assert_reset(target);
+ return target->type->deassert_reset(target);
}
COMMAND_HANDLER(handle_target_halt)
@@ -6101,8 +6094,9 @@ static const struct command_registration target_instance_command_handlers[] = {
{
.name = "arp_reset",
.mode = COMMAND_EXEC,
- .jim_handler = jim_target_reset,
+ .handler = handle_target_reset,
.help = "used internally for reset processing",
+ .usage = "'assert'|'deassert' halt",
},
{
.name = "arp_halt",
diff --git a/src/target/target.h b/src/target/target.h
index ef9ba1062..00bf43c58 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -57,11 +57,6 @@ enum target_state {
TARGET_DEBUG_RUNNING = 4,
};
-enum nvp_assert {
- NVP_DEASSERT,
- NVP_ASSERT,
-};
-
enum target_reset_mode {
RESET_UNKNOWN = 0,
RESET_RUN = 1, /* reset and let target run */
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 58 ++++++++++++++++++++++++-----------------------------
src/target/target.h | 5 -----
2 files changed, 26 insertions(+), 37 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:56:01
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via b931286ab440f4677a9ac983a64b55055d20c438 (commit)
from 219412f9d65cff4457f9b9ce339a444ad903a1df (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b931286ab440f4677a9ac983a64b55055d20c438
Author: Antonio Borneo <bor...@gm...>
Date: Mon Mar 27 10:43:30 2023 +0200
target: rewrite command 'arp_halt' as COMMAND_HANDLER
While there, add the missing .usage field.
Change-Id: I748382cafe08443c458ff1d4e47819610cfbf85c
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7558
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index e995f134e..f2e8d531a 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5822,19 +5822,18 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
}
-static int jim_target_halt(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_target_halt)
{
- if (argc != 1) {
- Jim_WrongNumArgs(interp, 1, argv, "[no parameters]");
- return JIM_ERR;
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ struct target *target = get_current_target(CMD_CTX);
+ if (!target->tap->enabled) {
+ command_print(CMD, "[TAP is disabled]");
+ return ERROR_FAIL;
}
- struct command_context *cmd_ctx = current_command_context(interp);
- assert(cmd_ctx);
- struct target *target = get_current_target(cmd_ctx);
- if (!target->tap->enabled)
- return jim_target_tap_disabled(interp);
- int e = target->type->halt(target);
- return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
+
+ return target->type->halt(target);
}
static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -6108,8 +6107,9 @@ static const struct command_registration target_instance_command_handlers[] = {
{
.name = "arp_halt",
.mode = COMMAND_EXEC,
- .jim_handler = jim_target_halt,
+ .handler = handle_target_halt,
.help = "used internally for reset processing",
+ .usage = "",
},
{
.name = "arp_waitstate",
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:55:03
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 219412f9d65cff4457f9b9ce339a444ad903a1df (commit)
from 7319eb3a25732c9d9bcaff804dac6abded99fc43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 219412f9d65cff4457f9b9ce339a444ad903a1df
Author: Antonio Borneo <bor...@gm...>
Date: Mon Mar 27 10:34:14 2023 +0200
target: rewrite command 'arp_poll' as COMMAND_HANDLER
While there, add the missing .usage field.
Change-Id: I16e0aeacdaaada09fa77ad29552fa4025eff0c45
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7557
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index fb5ef7219..e995f134e 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5753,26 +5753,21 @@ COMMAND_HANDLER(handle_target_halt_gdb)
return target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);
}
-static int jim_target_poll(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_target_poll)
{
- if (argc != 1) {
- Jim_WrongNumArgs(interp, 1, argv, "[no parameters]");
- return JIM_ERR;
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ struct target *target = get_current_target(CMD_CTX);
+ if (!target->tap->enabled) {
+ command_print(CMD, "[TAP is disabled]");
+ return ERROR_FAIL;
}
- struct command_context *cmd_ctx = current_command_context(interp);
- assert(cmd_ctx);
- struct target *target = get_current_target(cmd_ctx);
- if (!target->tap->enabled)
- return jim_target_tap_disabled(interp);
- int e;
if (!(target_was_examined(target)))
- e = ERROR_TARGET_NOT_EXAMINED;
- else
- e = target->type->poll(target);
- if (e != ERROR_OK)
- return JIM_ERR;
- return JIM_OK;
+ return ERROR_TARGET_NOT_EXAMINED;
+
+ return target->type->poll(target);
}
static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -6100,8 +6095,9 @@ static const struct command_registration target_instance_command_handlers[] = {
{
.name = "arp_poll",
.mode = COMMAND_EXEC,
- .jim_handler = jim_target_poll,
+ .handler = handle_target_poll,
.help = "used internally for reset processing",
+ .usage = "",
},
{
.name = "arp_reset",
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:54:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 7319eb3a25732c9d9bcaff804dac6abded99fc43 (commit)
from 4bf994fc9c810a996e31f9cd21ffc7d58ad3917d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7319eb3a25732c9d9bcaff804dac6abded99fc43
Author: Antonio Borneo <bor...@gm...>
Date: Mon Jan 2 22:32:53 2023 +0100
jtag: rewrite command 'pathmove' as COMMAND_HANDLER
Change-Id: I1f8c6722021f392b1f065484b63a19964db69ad5
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7556
Tested-by: jenkins
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index ea501022b..d792081c4 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -164,40 +164,37 @@ fail:
return retval;
}
-static int jim_command_pathmove(Jim_Interp *interp, int argc, Jim_Obj * const *args)
+COMMAND_HANDLER(handle_jtag_command_pathmove)
{
tap_state_t states[8];
- if ((argc < 2) || ((size_t)argc > (ARRAY_SIZE(states) + 1))) {
- Jim_WrongNumArgs(interp, 1, args, "wrong arguments");
- return JIM_ERR;
- }
+ if (CMD_ARGC < 1 || CMD_ARGC > ARRAY_SIZE(states))
+ return ERROR_COMMAND_SYNTAX_ERROR;
- int i;
- for (i = 0; i < argc-1; i++) {
- const char *cp;
- cp = Jim_GetString(args[i + 1], NULL);
- states[i] = tap_state_by_name(cp);
+ for (unsigned int i = 0; i < CMD_ARGC; i++) {
+ states[i] = tap_state_by_name(CMD_ARGV[i]);
if (states[i] < 0) {
- /* update the error message */
- Jim_SetResultFormatted(interp, "endstate: %s invalid", cp);
- return JIM_ERR;
+ command_print(CMD, "endstate: %s invalid", CMD_ARGV[i]);
+ return ERROR_COMMAND_ARGUMENT_INVALID;
}
}
- if ((jtag_add_statemove(states[0]) != ERROR_OK) || (jtag_execute_queue() != ERROR_OK)) {
- Jim_SetResultString(interp, "pathmove: jtag execute failed", -1);
- return JIM_ERR;
+ int retval = jtag_add_statemove(states[0]);
+ if (retval == ERROR_OK)
+ retval = jtag_execute_queue();
+ if (retval != ERROR_OK) {
+ command_print(CMD, "pathmove: jtag execute failed");
+ return retval;
}
- jtag_add_pathmove(argc - 2, states + 1);
-
- if (jtag_execute_queue() != ERROR_OK) {
- Jim_SetResultString(interp, "pathmove: failed", -1);
- return JIM_ERR;
+ jtag_add_pathmove(CMD_ARGC - 1, states + 1);
+ retval = jtag_execute_queue();
+ if (retval != ERROR_OK) {
+ command_print(CMD, "pathmove: failed");
+ return retval;
}
- return JIM_OK;
+ return ERROR_OK;
}
COMMAND_HANDLER(handle_jtag_flush_count)
@@ -241,7 +238,7 @@ static const struct command_registration jtag_command_handlers_to_move[] = {
{
.name = "pathmove",
.mode = COMMAND_EXEC,
- .jim_handler = jim_command_pathmove,
+ .handler = handle_jtag_command_pathmove,
.usage = "start_state state1 [state2 [state3 ...]]",
.help = "Move JTAG state machine from current state "
"(start_state) to state1, then state2, state3, etc.",
-----------------------------------------------------------------------
Summary of changes:
src/jtag/tcl.c | 43 ++++++++++++++++++++-----------------------
1 file changed, 20 insertions(+), 23 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:53:44
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 4bf994fc9c810a996e31f9cd21ffc7d58ad3917d (commit)
from 599f1cf763448f043e97702ca8a611f0ab87b849 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4bf994fc9c810a996e31f9cd21ffc7d58ad3917d
Author: Antonio Borneo <bor...@gm...>
Date: Mon Jan 2 22:16:46 2023 +0100
jtag: rewrite command 'drscan' as COMMAND_HANDLER
Reorganize the code to parse the command line only once.
Add check for successful memory allocation.
Change-Id: Ibf6068e177c09e93150d11aecfcf079348c47c21
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7555
Tested-by: jenkins
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index b3cbc48b4..ea501022b 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -72,147 +72,98 @@ static bool scan_is_safe(tap_state_t state)
}
}
-static int jim_command_drscan(Jim_Interp *interp, int argc, Jim_Obj * const *args)
+static COMMAND_HELPER(handle_jtag_command_drscan_fields, struct scan_field *fields)
{
- int retval;
- struct scan_field *fields;
- int num_fields;
- int field_count = 0;
- int i, e;
- struct jtag_tap *tap;
- tap_state_t endstate;
+ unsigned int field_count = 0;
+ for (unsigned int i = 1; i < CMD_ARGC; i += 2) {
+ unsigned int bits;
+ COMMAND_PARSE_NUMBER(uint, CMD_ARGV[i], bits);
+ fields[field_count].num_bits = bits;
- /* args[1] = device
- * args[2] = num_bits
- * args[3] = hex string
- * ... repeat num bits and hex string ...
- *
- * .. optionally:
- * args[N-2] = "-endstate"
- * args[N-1] = statename
- */
- if ((argc < 4) || ((argc % 2) != 0)) {
- Jim_WrongNumArgs(interp, 1, args, "wrong arguments");
- return JIM_ERR;
+ void *t = malloc(DIV_ROUND_UP(bits, 8));
+ if (!t) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
+ fields[field_count].out_value = t;
+ str_to_buf(CMD_ARGV[i + 1], strlen(CMD_ARGV[i + 1]), t, bits, 0);
+ fields[field_count].in_value = t;
+ field_count++;
}
- endstate = TAP_IDLE;
-
- /* validate arguments as numbers */
- e = JIM_OK;
- for (i = 2; i < argc; i += 2) {
- long bits;
- const char *cp;
+ return ERROR_OK;
+}
- e = Jim_GetLong(interp, args[i], &bits);
- /* If valid - try next arg */
- if (e == JIM_OK)
- continue;
+COMMAND_HANDLER(handle_jtag_command_drscan)
+{
+ /*
+ * CMD_ARGV[0] = device
+ * CMD_ARGV[1] = num_bits
+ * CMD_ARGV[2] = hex string
+ * ... repeat num bits and hex string ...
+ *
+ * ... optionally:
+ * CMD_ARGV[CMD_ARGC-2] = "-endstate"
+ * CMD_ARGV[CMD_ARGC-1] = statename
+ */
- /* Not valid.. are we at the end? */
- if (((i + 2) != argc)) {
- /* nope, then error */
- return e;
- }
+ if (CMD_ARGC < 3 || (CMD_ARGC % 2) != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- /* it could be: "-endstate FOO"
- * e.g. DRPAUSE so we can issue more instructions
- * before entering RUN/IDLE and executing them.
- */
+ struct jtag_tap *tap = jtag_tap_by_string(CMD_ARGV[0]);
+ if (!tap) {
+ command_print(CMD, "Tap '%s' could not be found", CMD_ARGV[0]);
+ return ERROR_COMMAND_ARGUMENT_INVALID;
+ }
- /* get arg as a string. */
- cp = Jim_GetString(args[i], NULL);
- /* is it the magic? */
- if (strcmp("-endstate", cp) == 0) {
- /* is the statename valid? */
- cp = Jim_GetString(args[i + 1], NULL);
-
- /* see if it is a valid state name */
- endstate = tap_state_by_name(cp);
- if (endstate < 0) {
- /* update the error message */
- Jim_SetResultFormatted(interp, "endstate: %s invalid", cp);
- } else {
- if (!scan_is_safe(endstate))
- LOG_WARNING("drscan with unsafe "
- "endstate \"%s\"", cp);
-
- /* valid - so clear the error */
- e = JIM_OK;
- /* and remove the last 2 args */
- argc -= 2;
- }
+ tap_state_t endstate = TAP_IDLE;
+ if (CMD_ARGC > 3 && !strcmp("-endstate", CMD_ARGV[CMD_ARGC - 2])) {
+ const char *state_name = CMD_ARGV[CMD_ARGC - 1];
+ endstate = tap_state_by_name(state_name);
+ if (endstate < 0) {
+ command_print(CMD, "endstate: %s invalid", state_name);
+ return ERROR_COMMAND_ARGUMENT_INVALID;
}
- /* Still an error? */
- if (e != JIM_OK)
- return e; /* too bad */
- } /* validate args */
-
- assert(e == JIM_OK);
-
- tap = jtag_tap_by_jim_obj(interp, args[1]);
- if (!tap)
- return JIM_ERR;
+ if (!scan_is_safe(endstate))
+ LOG_WARNING("drscan with unsafe endstate \"%s\"", state_name);
- num_fields = (argc-2)/2;
- if (num_fields <= 0) {
- Jim_SetResultString(interp, "drscan: no scan fields supplied", -1);
- return JIM_ERR;
+ CMD_ARGC -= 2;
}
- fields = malloc(sizeof(struct scan_field) * num_fields);
- for (i = 2; i < argc; i += 2) {
- long bits;
- int len;
- const char *str;
- Jim_GetLong(interp, args[i], &bits);
- str = Jim_GetString(args[i + 1], &len);
-
- fields[field_count].num_bits = bits;
- void *t = malloc(DIV_ROUND_UP(bits, 8));
- fields[field_count].out_value = t;
- str_to_buf(str, len, t, bits, 0);
- fields[field_count].in_value = t;
- field_count++;
+ unsigned int num_fields = (CMD_ARGC - 1) / 2;
+ struct scan_field *fields = calloc(num_fields, sizeof(struct scan_field));
+ if (!fields) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
}
+ int retval = CALL_COMMAND_HANDLER(handle_jtag_command_drscan_fields, fields);
+ if (retval != ERROR_OK)
+ goto fail;
+
jtag_add_dr_scan(tap, num_fields, fields, endstate);
retval = jtag_execute_queue();
if (retval != ERROR_OK) {
- Jim_SetResultString(interp, "drscan: jtag execute failed", -1);
-
- for (i = 0; i < field_count; i++)
- free(fields[i].in_value);
- free(fields);
-
- return JIM_ERR;
+ command_print(CMD, "drscan: jtag execute failed");
+ goto fail;
}
- field_count = 0;
- Jim_Obj *list = Jim_NewListObj(interp, NULL, 0);
- for (i = 2; i < argc; i += 2) {
- long bits;
- char *str;
-
- Jim_GetLong(interp, args[i], &bits);
- str = buf_to_hex_str(fields[field_count].in_value, bits);
- free(fields[field_count].in_value);
-
- Jim_ListAppendElement(interp, list, Jim_NewStringObj(interp, str, strlen(str)));
+ for (unsigned int i = 0; i < num_fields; i++) {
+ char *str = buf_to_hex_str(fields[i].in_value, fields[i].num_bits);
+ command_print(CMD, "%s", str);
free(str);
- field_count++;
}
- Jim_SetResult(interp, list);
-
+fail:
+ for (unsigned int i = 0; i < num_fields; i++)
+ free(fields[i].in_value);
free(fields);
- return JIM_OK;
+ return retval;
}
-
static int jim_command_pathmove(Jim_Interp *interp, int argc, Jim_Obj * const *args)
{
tap_state_t states[8];
@@ -274,7 +225,7 @@ static const struct command_registration jtag_command_handlers_to_move[] = {
{
.name = "drscan",
.mode = COMMAND_EXEC,
- .jim_handler = jim_command_drscan,
+ .handler = handle_jtag_command_drscan,
.help = "Execute Data Register (DR) scan for one TAP. "
"Other TAPs must be in BYPASS mode.",
.usage = "tap_name [num_bits value]* ['-endstate' state_name]",
-----------------------------------------------------------------------
Summary of changes:
src/jtag/tcl.c | 179 +++++++++++++++++++++------------------------------------
1 file changed, 65 insertions(+), 114 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:49:47
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 599f1cf763448f043e97702ca8a611f0ab87b849 (commit)
from 160288137aad7dc8825566f2221dd24db7f81110 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 599f1cf763448f043e97702ca8a611f0ab87b849
Author: Antonio Borneo <bor...@gm...>
Date: Mon Dec 26 22:46:19 2022 +0100
openocd: trivial replace of jim-nvp with new nvp
For some trivial case only, replace calls to jim-nvp with calls
to the new OpenOCD nvp.
Change-Id: Ifd9aff32b67748af8ab808e6a6b6e64f5271b888
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7553
Tested-by: jenkins
diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c
index 85b451308..7175925e4 100644
--- a/src/jtag/drivers/ftdi.c
+++ b/src/jtag/drivers/ftdi.c
@@ -64,6 +64,7 @@
#include <transport/transport.h>
#include <helper/time_support.h>
#include <helper/log.h>
+#include <helper/nvp.h>
#if IS_CYGWIN == 1
#include <windows.h>
@@ -896,22 +897,22 @@ COMMAND_HANDLER(ftdi_handle_vid_pid_command)
COMMAND_HANDLER(ftdi_handle_tdo_sample_edge_command)
{
- struct jim_nvp *n;
- static const struct jim_nvp nvp_ftdi_jtag_modes[] = {
+ const struct nvp *n;
+ static const struct nvp nvp_ftdi_jtag_modes[] = {
{ .name = "rising", .value = JTAG_MODE },
{ .name = "falling", .value = JTAG_MODE_ALT },
{ .name = NULL, .value = -1 },
};
if (CMD_ARGC > 0) {
- n = jim_nvp_name2value_simple(nvp_ftdi_jtag_modes, CMD_ARGV[0]);
+ n = nvp_name2value(nvp_ftdi_jtag_modes, CMD_ARGV[0]);
if (!n->name)
return ERROR_COMMAND_SYNTAX_ERROR;
ftdi_jtag_mode = n->value;
}
- n = jim_nvp_value2name_simple(nvp_ftdi_jtag_modes, ftdi_jtag_mode);
+ n = nvp_value2name(nvp_ftdi_jtag_modes, ftdi_jtag_mode);
command_print(CMD, "ftdi samples TDO on %s edge of TCK", n->name);
return ERROR_OK;
diff --git a/src/target/aarch64.c b/src/target/aarch64.c
index c6ebfb011..5a16b3a3b 100644
--- a/src/target/aarch64.c
+++ b/src/target/aarch64.c
@@ -21,6 +21,7 @@
#include "arm_semihosting.h"
#include "jtag/interface.h"
#include "smp.h"
+#include <helper/nvp.h>
#include <helper/time_support.h>
enum restart_mode {
@@ -2957,15 +2958,15 @@ COMMAND_HANDLER(aarch64_mask_interrupts_command)
struct target *target = get_current_target(CMD_CTX);
struct aarch64_common *aarch64 = target_to_aarch64(target);
- static const struct jim_nvp nvp_maskisr_modes[] = {
+ static const struct nvp nvp_maskisr_modes[] = {
{ .name = "off", .value = AARCH64_ISRMASK_OFF },
{ .name = "on", .value = AARCH64_ISRMASK_ON },
{ .name = NULL, .value = -1 },
};
- const struct jim_nvp *n;
+ const struct nvp *n;
if (CMD_ARGC > 0) {
- n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+ n = nvp_name2value(nvp_maskisr_modes, CMD_ARGV[0]);
if (!n->name) {
LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2974,7 +2975,7 @@ COMMAND_HANDLER(aarch64_mask_interrupts_command)
aarch64->isrmasking_mode = n->value;
}
- n = jim_nvp_value2name_simple(nvp_maskisr_modes, aarch64->isrmasking_mode);
+ n = nvp_value2name(nvp_maskisr_modes, aarch64->isrmasking_mode);
command_print(CMD, "aarch64 interrupt mask %s", n->name);
return ERROR_OK;
diff --git a/src/target/armv8.c b/src/target/armv8.c
index b01afdbc7..ffed263a9 100644
--- a/src/target/armv8.c
+++ b/src/target/armv8.c
@@ -19,6 +19,7 @@
#include "register.h"
#include <helper/binarybuffer.h>
#include <helper/command.h>
+#include <helper/nvp.h>
#include <stdlib.h>
#include <string.h>
@@ -1043,7 +1044,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
unsigned int argp = 0;
int retval;
- static const struct jim_nvp nvp_ecatch_modes[] = {
+ static const struct nvp nvp_ecatch_modes[] = {
{ .name = "off", .value = 0 },
{ .name = "nsec_el1", .value = (1 << 5) },
{ .name = "nsec_el2", .value = (2 << 5) },
@@ -1053,7 +1054,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
{ .name = "sec_el13", .value = (5 << 1) },
{ .name = NULL, .value = -1 },
};
- const struct jim_nvp *n;
+ const struct nvp *n;
if (CMD_ARGC == 0) {
const char *sec = NULL, *nsec = NULL;
@@ -1063,11 +1064,11 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
if (retval != ERROR_OK)
return retval;
- n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0x0f);
+ n = nvp_value2name(nvp_ecatch_modes, edeccr & 0x0f);
if (n->name)
sec = n->name;
- n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0xf0);
+ n = nvp_value2name(nvp_ecatch_modes, edeccr & 0xf0);
if (n->name)
nsec = n->name;
@@ -1081,7 +1082,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
}
while (argp < CMD_ARGC) {
- n = jim_nvp_name2value_simple(nvp_ecatch_modes, CMD_ARGV[argp]);
+ n = nvp_name2value(nvp_ecatch_modes, CMD_ARGV[argp]);
if (!n->name) {
LOG_ERROR("Unknown option: %s", CMD_ARGV[argp]);
return ERROR_FAIL;
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index 3db9c62a5..d9688be13 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -52,6 +52,7 @@
#include "transport/transport.h"
#include "smp.h"
#include <helper/bits.h>
+#include <helper/nvp.h>
#include <helper/time_support.h>
static int cortex_a_poll(struct target *target);
@@ -3246,15 +3247,15 @@ COMMAND_HANDLER(handle_cortex_a_mask_interrupts_command)
struct target *target = get_current_target(CMD_CTX);
struct cortex_a_common *cortex_a = target_to_cortex_a(target);
- static const struct jim_nvp nvp_maskisr_modes[] = {
+ static const struct nvp nvp_maskisr_modes[] = {
{ .name = "off", .value = CORTEX_A_ISRMASK_OFF },
{ .name = "on", .value = CORTEX_A_ISRMASK_ON },
{ .name = NULL, .value = -1 },
};
- const struct jim_nvp *n;
+ const struct nvp *n;
if (CMD_ARGC > 0) {
- n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+ n = nvp_name2value(nvp_maskisr_modes, CMD_ARGV[0]);
if (!n->name) {
LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
@@ -3263,7 +3264,7 @@ COMMAND_HANDLER(handle_cortex_a_mask_interrupts_command)
cortex_a->isrmasking_mode = n->value;
}
- n = jim_nvp_value2name_simple(nvp_maskisr_modes, cortex_a->isrmasking_mode);
+ n = nvp_value2name(nvp_maskisr_modes, cortex_a->isrmasking_mode);
command_print(CMD, "cortex_a interrupt mask %s", n->name);
return ERROR_OK;
@@ -3274,22 +3275,22 @@ COMMAND_HANDLER(handle_cortex_a_dacrfixup_command)
struct target *target = get_current_target(CMD_CTX);
struct cortex_a_common *cortex_a = target_to_cortex_a(target);
- static const struct jim_nvp nvp_dacrfixup_modes[] = {
+ static const struct nvp nvp_dacrfixup_modes[] = {
{ .name = "off", .value = CORTEX_A_DACRFIXUP_OFF },
{ .name = "on", .value = CORTEX_A_DACRFIXUP_ON },
{ .name = NULL, .value = -1 },
};
- const struct jim_nvp *n;
+ const struct nvp *n;
if (CMD_ARGC > 0) {
- n = jim_nvp_name2value_simple(nvp_dacrfixup_modes, CMD_ARGV[0]);
+ n = nvp_name2value(nvp_dacrfixup_modes, CMD_ARGV[0]);
if (!n->name)
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_a->dacrfixup_mode = n->value;
}
- n = jim_nvp_value2name_simple(nvp_dacrfixup_modes, cortex_a->dacrfixup_mode);
+ n = nvp_value2name(nvp_dacrfixup_modes, cortex_a->dacrfixup_mode);
command_print(CMD, "cortex_a domain access control fixup %s", n->name);
return ERROR_OK;
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 88e9bb299..8e55014f9 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -29,6 +29,7 @@
#include "arm_opcodes.h"
#include "arm_semihosting.h"
#include "smp.h"
+#include <helper/nvp.h>
#include <helper/time_support.h>
#include <rtt/rtt.h>
@@ -2935,14 +2936,14 @@ COMMAND_HANDLER(handle_cortex_m_mask_interrupts_command)
struct cortex_m_common *cortex_m = target_to_cm(target);
int retval;
- static const struct jim_nvp nvp_maskisr_modes[] = {
+ static const struct nvp nvp_maskisr_modes[] = {
{ .name = "auto", .value = CORTEX_M_ISRMASK_AUTO },
{ .name = "off", .value = CORTEX_M_ISRMASK_OFF },
{ .name = "on", .value = CORTEX_M_ISRMASK_ON },
{ .name = "steponly", .value = CORTEX_M_ISRMASK_STEPONLY },
{ .name = NULL, .value = -1 },
};
- const struct jim_nvp *n;
+ const struct nvp *n;
retval = cortex_m_verify_pointer(CMD, cortex_m);
@@ -2955,14 +2956,14 @@ COMMAND_HANDLER(handle_cortex_m_mask_interrupts_command)
}
if (CMD_ARGC > 0) {
- n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+ n = nvp_name2value(nvp_maskisr_modes, CMD_ARGV[0]);
if (!n->name)
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_m->isrmasking_mode = n->value;
cortex_m_set_maskints_for_halt(target);
}
- n = jim_nvp_value2name_simple(nvp_maskisr_modes, cortex_m->isrmasking_mode);
+ n = nvp_value2name(nvp_maskisr_modes, cortex_m->isrmasking_mode);
command_print(CMD, "cortex_m interrupt mask %s", n->name);
return ERROR_OK;
diff --git a/src/target/target.c b/src/target/target.c
index c55b67cc9..fb5ef7219 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -31,6 +31,7 @@
#endif
#include <helper/align.h>
+#include <helper/nvp.h>
#include <helper/time_support.h>
#include <jtag/jtag.h>
#include <flash/nor/core.h>
@@ -166,7 +167,7 @@ static const struct jim_nvp nvp_assert[] = {
{ .name = NULL, .value = -1 }
};
-static const struct jim_nvp nvp_error_target[] = {
+static const struct nvp nvp_error_target[] = {
{ .value = ERROR_TARGET_INVALID, .name = "err-invalid" },
{ .value = ERROR_TARGET_INIT_FAILED, .name = "err-init-failed" },
{ .value = ERROR_TARGET_TIMEOUT, .name = "err-timeout" },
@@ -183,9 +184,9 @@ static const struct jim_nvp nvp_error_target[] = {
static const char *target_strerror_safe(int err)
{
- const struct jim_nvp *n;
+ const struct nvp *n;
- n = jim_nvp_value2name_simple(nvp_error_target, err);
+ n = nvp_value2name(nvp_error_target, err);
if (!n->name)
return "unknown";
else
@@ -253,7 +254,7 @@ static const struct jim_nvp nvp_target_state[] = {
{ .name = NULL, .value = -1 },
};
-static const struct jim_nvp nvp_target_debug_reason[] = {
+static const struct nvp nvp_target_debug_reason[] = {
{ .name = "debug-request", .value = DBG_REASON_DBGRQ },
{ .name = "breakpoint", .value = DBG_REASON_BREAKPOINT },
{ .name = "watchpoint", .value = DBG_REASON_WATCHPOINT },
@@ -274,7 +275,7 @@ static const struct jim_nvp nvp_target_endian[] = {
{ .name = NULL, .value = -1 },
};
-static const struct jim_nvp nvp_reset_modes[] = {
+static const struct nvp nvp_reset_modes[] = {
{ .name = "unknown", .value = RESET_UNKNOWN },
{ .name = "run", .value = RESET_RUN },
{ .name = "halt", .value = RESET_HALT },
@@ -286,7 +287,7 @@ const char *debug_reason_name(struct target *t)
{
const char *cp;
- cp = jim_nvp_value2name_simple(nvp_target_debug_reason,
+ cp = nvp_value2name(nvp_target_debug_reason,
t->debug_reason)->name;
if (!cp) {
LOG_ERROR("Invalid debug reason: %d", (int)(t->debug_reason));
@@ -324,7 +325,7 @@ const char *target_event_name(enum target_event event)
const char *target_reset_mode_name(enum target_reset_mode reset_mode)
{
const char *cp;
- cp = jim_nvp_value2name_simple(nvp_reset_modes, reset_mode)->name;
+ cp = nvp_value2name(nvp_reset_modes, reset_mode)->name;
if (!cp) {
LOG_ERROR("Invalid target reset mode: %d", (int)(reset_mode));
cp = "(*BUG*unknown*BUG*)";
@@ -668,8 +669,8 @@ static int target_process_reset(struct command_invocation *cmd, enum target_rese
{
char buf[100];
int retval;
- struct jim_nvp *n;
- n = jim_nvp_value2name_simple(nvp_reset_modes, reset_mode);
+ const struct nvp *n;
+ n = nvp_value2name(nvp_reset_modes, reset_mode);
if (!n->name) {
LOG_ERROR("invalid reset mode");
return ERROR_FAIL;
@@ -1856,7 +1857,7 @@ int target_call_reset_callbacks(struct target *target, enum target_reset_mode re
struct target_reset_callback *callback;
LOG_DEBUG("target reset %i (%s)", reset_mode,
- jim_nvp_value2name_simple(nvp_reset_modes, reset_mode)->name);
+ nvp_value2name(nvp_reset_modes, reset_mode)->name);
list_for_each_entry(callback, &target_reset_callback_list, list)
callback->callback(target, reset_mode, callback->priv);
@@ -3338,8 +3339,8 @@ COMMAND_HANDLER(handle_reset_command)
enum target_reset_mode reset_mode = RESET_RUN;
if (CMD_ARGC == 1) {
- const struct jim_nvp *n;
- n = jim_nvp_name2value_simple(nvp_reset_modes, CMD_ARGV[0]);
+ const struct nvp *n;
+ n = nvp_name2value(nvp_reset_modes, CMD_ARGV[0]);
if ((!n->name) || (n->value == RESET_UNKNOWN))
return ERROR_COMMAND_SYNTAX_ERROR;
reset_mode = n->value;
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/ftdi.c | 9 +++++----
src/target/aarch64.c | 9 +++++----
src/target/armv8.c | 11 ++++++-----
src/target/cortex_a.c | 17 +++++++++--------
src/target/cortex_m.c | 9 +++++----
src/target/target.c | 25 +++++++++++++------------
6 files changed, 43 insertions(+), 37 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:48:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 160288137aad7dc8825566f2221dd24db7f81110 (commit)
from 329b10754aa2294d11717c461f356c174eba5094 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 160288137aad7dc8825566f2221dd24db7f81110
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 8 10:45:25 2023 +0200
xtensa: fix build with gcc 13.1.1
New gcc does not understand that the variable 'restore_ms' is set
to 'true' only when the variable 'ms' is assigned in
static int xtensa_write_dirty_registers(...)
{
xtensa_reg_val_t ms;
bool restore_ms = false;
...
if (...) {
ms = regval;
restore_ms = true;
...
}
...
if (restore_ms) {
USE(ms);
}
...
}
and complains about possible use of uninitialized variable 'ms'.
Sadly initialize 'ms' to zero to hide this false positive.
Change-Id: I1fb3949070c8abbf4aa45a740f0ca2fdb753d4fa
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7681
Reviewed-by: Erhan Kurubas <erh...@es...>
Reviewed-by: Ian Thompson <ia...@ca...>
Tested-by: jenkins
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index 63ffefce7..5880637f4 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -607,7 +607,7 @@ static int xtensa_write_dirty_registers(struct target *target)
xtensa_reg_val_t a3 = 0, woe;
unsigned int ms_idx = (xtensa->core_config->core_type == XT_NX) ?
xtensa->nx_reg_idx[XT_NX_REG_IDX_MS] : reg_list_size;
- xtensa_reg_val_t ms;
+ xtensa_reg_val_t ms = 0;
bool restore_ms = false;
LOG_TARGET_DEBUG(target, "start");
-----------------------------------------------------------------------
Summary of changes:
src/target/xtensa/xtensa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-06 13:35:05
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 329b10754aa2294d11717c461f356c174eba5094 (commit)
from 92c1bee18c8268511de3478aabd226ce4f92322a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 329b10754aa2294d11717c461f356c174eba5094
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 01:00:15 2023 +0200
target: etm: fix check trace status
Current code tests a function pointer against a numeric value that
is the same enum type as returned by the pointed function.
Clearly the author was willing to call the function and check its
returned value.
Fix the check by calling the function.
Detected through 'sparse' tool.
Change-Id: I27d18d26c2c797160a397daa32835c199014b70b
Signed-off-by: Antonio Borneo <bor...@gm...>
Checkpatch-ignore: GIT_COMMIT_ID
Fixes: 237e894805dd ("reworked etm/etb into a generic etm part with trace capture")
Reviewed-on: https://review.openocd.org/c/openocd/+/7599
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/target/etm.c b/src/target/etm.c
index 57417c3fa..6718875ee 100644
--- a/src/target/etm.c
+++ b/src/target/etm.c
@@ -1706,7 +1706,7 @@ COMMAND_HANDLER(handle_etm_dump_command)
return ERROR_FAIL;
}
- if (etm_ctx->capture_driver->status == TRACE_IDLE) {
+ if (etm_ctx->capture_driver->status(etm_ctx) == TRACE_IDLE) {
command_print(CMD, "trace capture wasn't enabled, no trace data captured");
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/etm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-06 13:33:03
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 92c1bee18c8268511de3478aabd226ce4f92322a (commit)
from dd9137dc0e0c9a7dd3468ecb7adb0427b8f06715 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 92c1bee18c8268511de3478aabd226ce4f92322a
Author: Antonio Borneo <bor...@gm...>
Date: Sat May 6 10:16:08 2023 +0200
jtag: xds110: fix check on malloc() returned pointer
Commit 07e1ebcc12cd ("jtag: drivers: with pointers, use NULL
instead of 0") incorrectly inverts the check, making the driver's
pathmove operation not functional and triggering two clang errors.
Fix the check on malloc() returned pointer.
Change-Id: If1f220aca67452adbcd3a1c9cf691fc984b16b27
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 07e1ebcc12cd ("jtag: drivers: with pointers, use NULL instead of 0")
Reviewed-on: https://review.openocd.org/c/openocd/+/7656
Tested-by: jenkins
diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c
index 3ea98ad6b..371dc8803 100644
--- a/src/jtag/drivers/xds110.c
+++ b/src/jtag/drivers/xds110.c
@@ -1688,7 +1688,7 @@ static void xds110_execute_pathmove(struct jtag_command *cmd)
return;
path = malloc(num_states * sizeof(uint8_t));
- if (path) {
+ if (!path) {
LOG_ERROR("XDS110: unable to allocate memory");
return;
}
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/xds110.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:15:47
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via dd9137dc0e0c9a7dd3468ecb7adb0427b8f06715 (commit)
from 57f7ce68a48b03bcd198a009fc9c75fe3948c0db (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dd9137dc0e0c9a7dd3468ecb7adb0427b8f06715
Author: Daniel Anselmi <dan...@gm...>
Date: Thu Apr 13 01:55:10 2023 +0200
pld/virtex2: add missing error checks
Add error checks after allocating memory.
Add error checks for calls to jtag_execute_queue().
Change-Id: I3b63b3d836170244ad3b0566d5bd9d9aabb8e238
Signed-off-by: Daniel Anselmi <dan...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7633
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c
index 98fd58adb..3c174ae59 100644
--- a/src/pld/virtex2.c
+++ b/src/pld/virtex2.c
@@ -23,6 +23,10 @@ static int virtex2_set_instr(struct jtag_tap *tap, uint32_t new_instr)
field.num_bits = tap->ir_length;
void *t = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
+ if (!t) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
field.out_value = t;
buf_set_u32(t, 0, field.num_bits, new_instr);
field.in_value = NULL;
@@ -44,6 +48,10 @@ static int virtex2_send_32(struct pld_device *pld_device,
int i;
values = malloc(num_words * 4);
+ if (!values) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
scan_field.num_bits = num_words * 32;
scan_field.out_value = values;
@@ -52,7 +60,11 @@ static int virtex2_send_32(struct pld_device *pld_device,
for (i = 0; i < num_words; i++)
buf_set_u32(values + 4 * i, 0, 32, flip_u32(*words++, 32));
- virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */
+ int retval = virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */
+ if (retval != ERROR_OK) {
+ free(values);
+ return retval;
+ }
jtag_add_dr_scan(virtex2_info->tap, 1, &scan_field, TAP_DRPAUSE);
@@ -77,7 +89,9 @@ static int virtex2_receive_32(struct pld_device *pld_device,
scan_field.out_value = NULL;
scan_field.in_value = NULL;
- virtex2_set_instr(virtex2_info->tap, 0x4); /* CFG_OUT */
+ int retval = virtex2_set_instr(virtex2_info->tap, 0x4); /* CFG_OUT */
+ if (retval != ERROR_OK)
+ return retval;
while (num_words--) {
scan_field.in_value = (uint8_t *)words;
@@ -103,15 +117,72 @@ static int virtex2_read_stat(struct pld_device *pld_device, uint32_t *status)
data[2] = 0x20000000; /* NOOP (Type 1, read, address 0, 0 words */
data[3] = 0x20000000; /* NOOP */
data[4] = 0x20000000; /* NOOP */
- virtex2_send_32(pld_device, 5, data);
+ int retval = virtex2_send_32(pld_device, 5, data);
+ if (retval != ERROR_OK)
+ return retval;
- virtex2_receive_32(pld_device, 1, status);
+ retval = virtex2_receive_32(pld_device, 1, status);
+ if (retval != ERROR_OK)
+ return retval;
- jtag_execute_queue();
+ retval = jtag_execute_queue();
+ if (retval == ERROR_OK)
+ LOG_DEBUG("status: 0x%8.8" PRIx32, *status);
- LOG_DEBUG("status: 0x%8.8" PRIx32 "", *status);
+ return retval;
+}
- return ERROR_OK;
+static int virtex2_load_prepare(struct pld_device *pld_device)
+{
+ struct virtex2_pld_device *virtex2_info = pld_device->driver_priv;
+ int retval;
+
+ retval = virtex2_set_instr(virtex2_info->tap, 0xb); /* JPROG_B */
+ if (retval != ERROR_OK)
+ return retval;
+
+ retval = jtag_execute_queue();
+ if (retval != ERROR_OK)
+ return retval;
+ jtag_add_sleep(1000);
+
+ retval = virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */
+ if (retval != ERROR_OK)
+ return retval;
+
+ return jtag_execute_queue();
+}
+
+static int virtex2_load_cleanup(struct pld_device *pld_device)
+{
+ struct virtex2_pld_device *virtex2_info = pld_device->driver_priv;
+ int retval;
+
+ jtag_add_tlr();
+
+ if (!(virtex2_info->no_jstart)) {
+ retval = virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
+ if (retval != ERROR_OK)
+ return retval;
+ }
+ jtag_add_runtest(13, TAP_IDLE);
+ retval = virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
+ if (retval != ERROR_OK)
+ return retval;
+ retval = virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
+ if (retval != ERROR_OK)
+ return retval;
+ if (!(virtex2_info->no_jstart)) {
+ retval = virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
+ if (retval != ERROR_OK)
+ return retval;
+ }
+ jtag_add_runtest(13, TAP_IDLE);
+ retval = virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
+ if (retval != ERROR_OK)
+ return retval;
+
+ return jtag_execute_queue();
}
static int virtex2_load(struct pld_device *pld_device, const char *filename)
@@ -128,12 +199,11 @@ static int virtex2_load(struct pld_device *pld_device, const char *filename)
if (retval != ERROR_OK)
return retval;
- virtex2_set_instr(virtex2_info->tap, 0xb); /* JPROG_B */
- jtag_execute_queue();
- jtag_add_sleep(1000);
-
- virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */
- jtag_execute_queue();
+ retval = virtex2_load_prepare(pld_device);
+ if (retval != ERROR_OK) {
+ xilinx_free_bit_file(&bit_file);
+ return retval;
+ }
for (i = 0; i < bit_file.length; i++)
bit_file.data[i] = flip_u32(bit_file.data[i], 8);
@@ -142,24 +212,17 @@ static int virtex2_load(struct pld_device *pld_device, const char *filename)
field.out_value = bit_file.data;
jtag_add_dr_scan(virtex2_info->tap, 1, &field, TAP_DRPAUSE);
- jtag_execute_queue();
-
- jtag_add_tlr();
+ retval = jtag_execute_queue();
+ if (retval != ERROR_OK) {
+ xilinx_free_bit_file(&bit_file);
+ return retval;
+ }
- if (!(virtex2_info->no_jstart))
- virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
- jtag_add_runtest(13, TAP_IDLE);
- virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
- virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
- if (!(virtex2_info->no_jstart))
- virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
- jtag_add_runtest(13, TAP_IDLE);
- virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
- jtag_execute_queue();
+ retval = virtex2_load_cleanup(pld_device);
xilinx_free_bit_file(&bit_file);
- return ERROR_OK;
+ return retval;
}
COMMAND_HANDLER(virtex2_handle_read_stat_command)
@@ -201,6 +264,10 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
}
virtex2_info = malloc(sizeof(struct virtex2_pld_device));
+ if (!virtex2_info) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
virtex2_info->tap = tap;
virtex2_info->no_jstart = 0;
-----------------------------------------------------------------------
Summary of changes:
src/pld/virtex2.c | 121 ++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 94 insertions(+), 27 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:15:30
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 57f7ce68a48b03bcd198a009fc9c75fe3948c0db (commit)
from d771d7f1a7d0181b4670c7c3ddb83ba8b8eb7da0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 57f7ce68a48b03bcd198a009fc9c75fe3948c0db
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 30 22:57:59 2023 +0200
pld: gatemate: fix memory leak
When gatemate_set_instr() fails, the array pointed by
bit_file.raw_file.data is not freed.
Issue identified by OpenOCD Jenkins clang build.
Free the array while propagating the error.
Change-Id: I2f7fadee903f9c65cdc9ab9b52ccb5803b48a59d
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 682f927f8e4e ("pld: add support for cologne chip gatemate fpgas")
Reviewed-on: https://review.openocd.org/c/openocd/+/7632
Tested-by: jenkins
Reviewed-by: Daniel Anselmi <dan...@gm...>
diff --git a/src/pld/gatemate.c b/src/pld/gatemate.c
index afd27efca..43b3f02d1 100644
--- a/src/pld/gatemate.c
+++ b/src/pld/gatemate.c
@@ -192,8 +192,10 @@ static int gatemate_load(struct pld_device *pld_device, const char *filename)
return retval;
retval = gatemate_set_instr(tap, JTAG_CONFIGURE);
- if (retval != ERROR_OK)
+ if (retval != ERROR_OK) {
+ free(bit_file.raw_file.data);
return retval;
+ }
struct scan_field field;
field.num_bits = bit_file.raw_file.length * 8;
-----------------------------------------------------------------------
Summary of changes:
src/pld/gatemate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:14:57
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via d771d7f1a7d0181b4670c7c3ddb83ba8b8eb7da0 (commit)
from 4b7dc557386a7482e8d77b59f543b9a0ef7cae4f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d771d7f1a7d0181b4670c7c3ddb83ba8b8eb7da0
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 01:40:51 2023 +0200
target: with pointers, use NULL instead of 0
Don't assign pointer to 0, use NULL.
Don't pass 0 ad pointer argument, pass NULL.
Detected through 'sparse' tool.
Change-Id: I806031d2ae505fa5f0accc6be1936d48cd365ca4
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7604
Tested-by: jenkins
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index 805330f25..3bacfaefd 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -57,7 +57,7 @@ static const struct arm9tdmi_vector {
{"dabt", ARM9TDMI_DABT_VECTOR},
{"irq", ARM9TDMI_IRQ_VECTOR},
{"fiq", ARM9TDMI_FIQ_VECTOR},
- {0, 0},
+ {NULL, 0},
};
int arm9tdmi_examine_debug_reason(struct target *target)
diff --git a/src/target/armv8_dpm.c b/src/target/armv8_dpm.c
index fcd4d5971..d1eefe5b3 100644
--- a/src/target/armv8_dpm.c
+++ b/src/target/armv8_dpm.c
@@ -274,7 +274,7 @@ static int dpmv8_instr_write_data_dcc(struct arm_dpm *dpm,
if (retval != ERROR_OK)
return retval;
- return dpmv8_exec_opcode(dpm, opcode, 0);
+ return dpmv8_exec_opcode(dpm, opcode, NULL);
}
static int dpmv8_instr_write_data_dcc_64(struct arm_dpm *dpm,
@@ -287,7 +287,7 @@ static int dpmv8_instr_write_data_dcc_64(struct arm_dpm *dpm,
if (retval != ERROR_OK)
return retval;
- return dpmv8_exec_opcode(dpm, opcode, 0);
+ return dpmv8_exec_opcode(dpm, opcode, NULL);
}
static int dpmv8_instr_write_data_r0(struct arm_dpm *dpm,
diff --git a/src/target/dsp563xx_once.c b/src/target/dsp563xx_once.c
index 22445067a..866f33152 100644
--- a/src/target/dsp563xx_once.c
+++ b/src/target/dsp563xx_once.c
@@ -60,7 +60,7 @@ static inline int dsp563xx_once_ir_exec(struct jtag_tap *tap, int flush, uint8_t
{
int err;
- err = dsp563xx_write_dr_u8(tap, 0, instr | (ex << 5) | (go << 6) | (rw << 7), 8, 0);
+ err = dsp563xx_write_dr_u8(tap, NULL, instr | (ex << 5) | (go << 6) | (rw << 7), 8, 0);
if (err != ERROR_OK)
return err;
if (flush)
@@ -226,7 +226,7 @@ int dsp563xx_once_reg_write(struct jtag_tap *tap, int flush, uint8_t reg, uint32
err = dsp563xx_once_ir_exec(tap, flush, reg, 0, 0, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0x00, data, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, data, 24, 0);
if (err != ERROR_OK)
return err;
if (flush)
@@ -242,7 +242,7 @@ int dsp563xx_once_execute_sw_ir(struct jtag_tap *tap, int flush, uint32_t opcode
err = dsp563xx_once_ir_exec(tap, flush, DSP563XX_ONCE_OPDBR, 0, 1, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, opcode, 24, 0);
if (err != ERROR_OK)
return err;
if (flush)
@@ -258,7 +258,7 @@ int dsp563xx_once_execute_dw_ir(struct jtag_tap *tap, int flush, uint32_t opcode
err = dsp563xx_once_ir_exec(tap, flush, DSP563XX_ONCE_OPDBR, 0, 0, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0, opcode, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, opcode, 24, 0);
if (err != ERROR_OK)
return err;
if (flush) {
@@ -270,7 +270,7 @@ int dsp563xx_once_execute_dw_ir(struct jtag_tap *tap, int flush, uint32_t opcode
err = dsp563xx_once_ir_exec(tap, flush, DSP563XX_ONCE_OPDBR, 0, 1, 0);
if (err != ERROR_OK)
return err;
- err = dsp563xx_write_dr_u32(tap, 0, operand, 24, 0);
+ err = dsp563xx_write_dr_u32(tap, NULL, operand, 24, 0);
if (err != ERROR_OK)
return err;
if (flush) {
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index fcd00487c..63ffefce7 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -410,7 +410,7 @@ static int xtensa_core_reg_get(struct reg *reg)
return ERROR_TARGET_NOT_HALTED;
if (!reg->exist) {
if (strncmp(reg->name, "?0x", 3) == 0) {
- unsigned int regnum = strtoul(reg->name + 1, 0, 0);
+ unsigned int regnum = strtoul(reg->name + 1, NULL, 0);
LOG_WARNING("Read unknown register 0x%04x ignored", regnum);
return ERROR_OK;
}
@@ -430,7 +430,7 @@ static int xtensa_core_reg_set(struct reg *reg, uint8_t *buf)
if (!reg->exist) {
if (strncmp(reg->name, "?0x", 3) == 0) {
- unsigned int regnum = strtoul(reg->name + 1, 0, 0);
+ unsigned int regnum = strtoul(reg->name + 1, NULL, 0);
LOG_WARNING("Write unknown register 0x%04x ignored", regnum);
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/arm9tdmi.c | 2 +-
src/target/armv8_dpm.c | 4 ++--
src/target/dsp563xx_once.c | 10 +++++-----
src/target/xtensa/xtensa.c | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:14:35
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 4b7dc557386a7482e8d77b59f543b9a0ef7cae4f (commit)
from ea62f8e22adb0c56509dd1999a2be9cf9798b8aa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4b7dc557386a7482e8d77b59f543b9a0ef7cae4f
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 01:37:11 2023 +0200
target: rtt: include rtt.h
Let source file to include its file .h to validate the exported
prototypes.
Detected through 'sparse' tool.
Change-Id: I8ae2f8f1fdaea5683e157247463533b17237e464
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7602
Tested-by: jenkins
diff --git a/src/target/rtt.c b/src/target/rtt.c
index b14c42f91..5ce049ae1 100644
--- a/src/target/rtt.c
+++ b/src/target/rtt.c
@@ -14,6 +14,7 @@
#include <helper/binarybuffer.h>
#include <helper/command.h>
#include <rtt/rtt.h>
+#include <target/rtt.h>
#include "target.h"
-----------------------------------------------------------------------
Summary of changes:
src/target/rtt.c | 1 +
1 file changed, 1 insertion(+)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:13:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via ea62f8e22adb0c56509dd1999a2be9cf9798b8aa (commit)
from 314f4c665f746ebec3be69a8e26f0a671cfdcb46 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ea62f8e22adb0c56509dd1999a2be9cf9798b8aa
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 01:36:04 2023 +0200
target: use 'ULL' suffix for long constants
On 32 bit hosts, gcc should consider constants without suffix as
32 bits values.
Use the suffix 'ULL' to guarantee it is a 64 bit.
Detected through 'sparse' tool.
Change-Id: I205ca986968fef9a536f87492d1f6c80e41829f3
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7601
Tested-by: jenkins
diff --git a/src/target/aarch64.c b/src/target/aarch64.c
index 6c9673fa2..c6ebfb011 100644
--- a/src/target/aarch64.c
+++ b/src/target/aarch64.c
@@ -588,7 +588,7 @@ static int aarch64_restore_one(struct target *target, int current,
resume_pc &= 0xFFFFFFFC;
break;
case ARM_STATE_AARCH64:
- resume_pc &= 0xFFFFFFFFFFFFFFFC;
+ resume_pc &= 0xFFFFFFFFFFFFFFFCULL;
break;
case ARM_STATE_THUMB:
case ARM_STATE_THUMB_EE:
@@ -1248,7 +1248,7 @@ static int aarch64_set_breakpoint(struct target *target,
| (byte_addr_select << 5)
| (3 << 1) | 1;
brp_list[brp_i].used = 1;
- brp_list[brp_i].value = breakpoint->address & 0xFFFFFFFFFFFFFFFC;
+ brp_list[brp_i].value = breakpoint->address & 0xFFFFFFFFFFFFFFFCULL;
brp_list[brp_i].control = control;
bpt_value = brp_list[brp_i].value;
@@ -1300,28 +1300,28 @@ static int aarch64_set_breakpoint(struct target *target,
buf_set_u32(code, 0, 32, opcode);
retval = target_read_memory(target,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length, 1,
breakpoint->orig_instr);
if (retval != ERROR_OK)
return retval;
armv8_cache_d_inner_flush_virt(armv8,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length);
retval = target_write_memory(target,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length, 1, code);
if (retval != ERROR_OK)
return retval;
armv8_cache_d_inner_flush_virt(armv8,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length);
armv8_cache_i_inner_inval_virt(armv8,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length);
breakpoint->is_set = true;
@@ -1453,7 +1453,7 @@ static int aarch64_set_hybrid_breakpoint(struct target *target, struct breakpoin
| (iva_byte_addr_select << 5)
| (3 << 1) | 1;
brp_list[brp_2].used = 1;
- brp_list[brp_2].value = breakpoint->address & 0xFFFFFFFFFFFFFFFC;
+ brp_list[brp_2].value = breakpoint->address & 0xFFFFFFFFFFFFFFFCULL;
brp_list[brp_2].control = control_iva;
retval = aarch64_dap_write_memap_register_u32(target, armv8->debug_base
+ CPUV8_DBG_BVR_BASE + 16 * brp_list[brp_2].brpn,
@@ -1577,29 +1577,29 @@ static int aarch64_unset_breakpoint(struct target *target, struct breakpoint *br
/* restore original instruction (kept in target endianness) */
armv8_cache_d_inner_flush_virt(armv8,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length);
if (breakpoint->length == 4) {
retval = target_write_memory(target,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
4, 1, breakpoint->orig_instr);
if (retval != ERROR_OK)
return retval;
} else {
retval = target_write_memory(target,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
2, 1, breakpoint->orig_instr);
if (retval != ERROR_OK)
return retval;
}
armv8_cache_d_inner_flush_virt(armv8,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length);
armv8_cache_i_inner_inval_virt(armv8,
- breakpoint->address & 0xFFFFFFFFFFFFFFFE,
+ breakpoint->address & 0xFFFFFFFFFFFFFFFEULL,
breakpoint->length);
}
breakpoint->is_set = false;
diff --git a/src/target/armv8.c b/src/target/armv8.c
index ff71a8e63..b01afdbc7 100644
--- a/src/target/armv8.c
+++ b/src/target/armv8.c
@@ -236,7 +236,7 @@ static int armv8_read_ttbcr(struct target *target)
armv8->pa_size = armv8_pa_size((ttbcr_64 >> 32) & 7);
armv8->page_size = (ttbcr_64 >> 14) & 3;
armv8->armv8_mmu.ttbr1_used = (((ttbcr_64 >> 16) & 0x3F) != 0) ? 1 : 0;
- armv8->armv8_mmu.ttbr0_mask = 0x0000FFFFFFFFFFFF;
+ armv8->armv8_mmu.ttbr0_mask = 0x0000FFFFFFFFFFFFULL;
retval += dpm->instr_read_data_r0_64(dpm,
ARMV8_MRS(SYSTEM_TTBR0_EL1 | (armv8->armv8_mmu.ttbr1_used), 0),
&armv8->ttbr_base);
diff --git a/src/target/lakemont.c b/src/target/lakemont.c
index 5035cdb54..6c0964bfa 100644
--- a/src/target/lakemont.c
+++ b/src/target/lakemont.c
@@ -73,26 +73,26 @@ static const struct {
const char *feature;
} regs[] = {
/* general purpose registers */
- { EAX, "eax", 0x000000D01D660000, 0, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { ECX, "ecx", 0x000000501D660000, 1, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { EDX, "edx", 0x000000901D660000, 2, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { EBX, "ebx", 0x000000101D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { ESP, "esp", 0x000000E01D660000, NOT_PMREG, 32, REG_TYPE_DATA_PTR, "general", "org.gnu.gdb.i386.core" },
- { EBP, "ebp", 0x000000601D660000, NOT_PMREG, 32, REG_TYPE_DATA_PTR, "general", "org.gnu.gdb.i386.core" },
- { ESI, "esi", 0x000000A01D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { EDI, "edi", 0x000000201D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { EAX, "eax", 0x000000D01D660000ULL, 0, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { ECX, "ecx", 0x000000501D660000ULL, 1, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { EDX, "edx", 0x000000901D660000ULL, 2, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { EBX, "ebx", 0x000000101D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { ESP, "esp", 0x000000E01D660000ULL, NOT_PMREG, 32, REG_TYPE_DATA_PTR, "general", "org.gnu.gdb.i386.core" },
+ { EBP, "ebp", 0x000000601D660000ULL, NOT_PMREG, 32, REG_TYPE_DATA_PTR, "general", "org.gnu.gdb.i386.core" },
+ { ESI, "esi", 0x000000A01D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { EDI, "edi", 0x000000201D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
/* instruction pointer & flags */
- { EIP, "eip", 0x000000C01D660000, 3, 32, REG_TYPE_CODE_PTR, "general", "org.gnu.gdb.i386.core" },
- { EFLAGS, "eflags", 0x000000401D660000, 4, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { EIP, "eip", 0x000000C01D660000ULL, 3, 32, REG_TYPE_CODE_PTR, "general", "org.gnu.gdb.i386.core" },
+ { EFLAGS, "eflags", 0x000000401D660000ULL, 4, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
/* segment registers */
- { CS, "cs", 0x000000281D660000, 5, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { SS, "ss", 0x000000C81D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { DS, "ds", 0x000000481D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { ES, "es", 0x000000A81D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { FS, "fs", 0x000000881D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
- { GS, "gs", 0x000000081D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { CS, "cs", 0x000000281D660000ULL, 5, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { SS, "ss", 0x000000C81D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { DS, "ds", 0x000000481D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { ES, "es", 0x000000A81D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { FS, "fs", 0x000000881D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
+ { GS, "gs", 0x000000081D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
/* floating point unit registers - not accessible via JTAG - here to satisfy GDB */
{ ST0, "st0", 0x0, NOT_AVAIL_REG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
@@ -113,56 +113,56 @@ static const struct {
{ FOP, "fop", 0x0, NOT_AVAIL_REG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.core" },
/* control registers */
- { CR0, "cr0", 0x000000001D660000, 6, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { CR2, "cr2", 0x000000BC1D660000, 7, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { CR3, "cr3", 0x000000801D660000, 8, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { CR4, "cr4", 0x0000002C1D660000, 9, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CR0, "cr0", 0x000000001D660000ULL, 6, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CR2, "cr2", 0x000000BC1D660000ULL, 7, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CR3, "cr3", 0x000000801D660000ULL, 8, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CR4, "cr4", 0x0000002C1D660000ULL, 9, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
/* debug registers */
- { DR0, "dr0", 0x0000007C1D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DR1, "dr1", 0x000000FC1D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DR2, "dr2", 0x000000021D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DR3, "dr3", 0x000000821D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DR6, "dr6", 0x000000301D660000, 10, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DR7, "dr7", 0x000000B01D660000, 11, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DR0, "dr0", 0x0000007C1D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DR1, "dr1", 0x000000FC1D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DR2, "dr2", 0x000000021D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DR3, "dr3", 0x000000821D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DR6, "dr6", 0x000000301D660000ULL, 10, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DR7, "dr7", 0x000000B01D660000ULL, 11, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
/* descriptor tables */
- { IDTB, "idtbase", 0x000000581D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { IDTL, "idtlimit", 0x000000D81D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { IDTAR, "idtar", 0x000000981D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { GDTB, "gdtbase", 0x000000B81D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { GDTL, "gdtlimit", 0x000000781D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { GDTAR, "gdtar", 0x000000381D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { TR, "tr", 0x000000701D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { LDTR, "ldtr", 0x000000F01D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { LDTB, "ldbase", 0x000000041D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { LDTL, "ldlimit", 0x000000841D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { LDTAR, "ldtar", 0x000000F81D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { IDTB, "idtbase", 0x000000581D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { IDTL, "idtlimit", 0x000000D81D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { IDTAR, "idtar", 0x000000981D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { GDTB, "gdtbase", 0x000000B81D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { GDTL, "gdtlimit", 0x000000781D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { GDTAR, "gdtar", 0x000000381D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { TR, "tr", 0x000000701D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { LDTR, "ldtr", 0x000000F01D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { LDTB, "ldbase", 0x000000041D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { LDTL, "ldlimit", 0x000000841D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { LDTAR, "ldtar", 0x000000F81D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
/* segment registers */
- { CSB, "csbase", 0x000000F41D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { CSL, "cslimit", 0x0000000C1D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { CSAR, "csar", 0x000000741D660000, 12, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DSB, "dsbase", 0x000000941D660000, 13, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DSL, "dslimit", 0x000000541D660000, 14, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { DSAR, "dsar", 0x000000141D660000, 15, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { ESB, "esbase", 0x0000004C1D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { ESL, "eslimit", 0x000000CC1D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { ESAR, "esar", 0x0000008C1D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { FSB, "fsbase", 0x000000641D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { FSL, "fslimit", 0x000000E41D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { FSAR, "fsar", 0x000000A41D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { GSB, "gsbase", 0x000000C41D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { GSL, "gslimit", 0x000000241D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { GSAR, "gsar", 0x000000441D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { SSB, "ssbase", 0x000000341D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { SSL, "sslimit", 0x000000B41D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { SSAR, "ssar", 0x000000D41D660000, 16, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { TSSB, "tssbase", 0x000000E81D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { TSSL, "tsslimit", 0x000000181D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
- { TSSAR, "tssar", 0x000000681D660000, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CSB, "csbase", 0x000000F41D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CSL, "cslimit", 0x0000000C1D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { CSAR, "csar", 0x000000741D660000ULL, 12, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DSB, "dsbase", 0x000000941D660000ULL, 13, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DSL, "dslimit", 0x000000541D660000ULL, 14, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { DSAR, "dsar", 0x000000141D660000ULL, 15, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { ESB, "esbase", 0x0000004C1D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { ESL, "eslimit", 0x000000CC1D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { ESAR, "esar", 0x0000008C1D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { FSB, "fsbase", 0x000000641D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { FSL, "fslimit", 0x000000E41D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { FSAR, "fsar", 0x000000A41D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { GSB, "gsbase", 0x000000C41D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { GSL, "gslimit", 0x000000241D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { GSAR, "gsar", 0x000000441D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { SSB, "ssbase", 0x000000341D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { SSL, "sslimit", 0x000000B41D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { SSAR, "ssar", 0x000000D41D660000ULL, 16, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { TSSB, "tssbase", 0x000000E81D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { TSSL, "tsslimit", 0x000000181D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { TSSAR, "tssar", 0x000000681D660000ULL, NOT_PMREG, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
/* probemode control register */
- { PMCR, "pmcr", 0x000000421D660000, 17, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
+ { PMCR, "pmcr", 0x000000421D660000ULL, 17, 32, REG_TYPE_INT32, "general", "org.gnu.gdb.i386.sys" },
};
static const struct {
@@ -171,36 +171,36 @@ static const struct {
uint64_t op;
} instructions[] = {
/* memory read/write */
- { MEMRDB32, "MEMRDB32", 0x0909090909090851 },
- { MEMRDB16, "MEMRDB16", 0x09090909090851E6 },
- { MEMRDH32, "MEMRDH32", 0x090909090908D166 },
- { MEMRDH16, "MEMRDH16", 0x090909090908D1E6 },
- { MEMRDW32, "MEMRDW32", 0x09090909090908D1 },
- { MEMRDW16, "MEMRDW16", 0x0909090908D1E666 },
- { MEMWRB32, "MEMWRB32", 0x0909090909090811 },
- { MEMWRB16, "MEMWRB16", 0x09090909090811E6 },
- { MEMWRH32, "MEMWRH32", 0x0909090909089166 },
- { MEMWRH16, "MEMWRH16", 0x09090909090891E6 },
- { MEMWRW32, "MEMWRW32", 0x0909090909090891 },
- { MEMWRW16, "MEMWRW16", 0x090909090891E666 },
+ { MEMRDB32, "MEMRDB32", 0x0909090909090851ULL },
+ { MEMRDB16, "MEMRDB16", 0x09090909090851E6ULL },
+ { MEMRDH32, "MEMRDH32", 0x090909090908D166ULL },
+ { MEMRDH16, "MEMRDH16", 0x090909090908D1E6ULL },
+ { MEMRDW32, "MEMRDW32", 0x09090909090908D1ULL },
+ { MEMRDW16, "MEMRDW16", 0x0909090908D1E666ULL },
+ { MEMWRB32, "MEMWRB32", 0x0909090909090811ULL },
+ { MEMWRB16, "MEMWRB16", 0x09090909090811E6ULL },
+ { MEMWRH32, "MEMWRH32", 0x0909090909089166ULL },
+ { MEMWRH16, "MEMWRH16", 0x09090909090891E6ULL },
+ { MEMWRW32, "MEMWRW32", 0x0909090909090891ULL },
+ { MEMWRW16, "MEMWRW16", 0x090909090891E666ULL },
/* IO read/write */
- { IORDB32, "IORDB32", 0x0909090909090937 },
- { IORDB16, "IORDB16", 0x09090909090937E6 },
- { IORDH32, "IORDH32", 0x090909090909B766 },
- { IORDH16, "IORDH16", 0x090909090909B7E6 },
- { IORDW32, "IORDW32", 0x09090909090909B7 },
- { IORDW16, "IORDW16", 0x0909090909B7E666 },
- { IOWRB32, "IOWRB32", 0x0909090909090977 },
- { IOWRB16, "IOWRB16", 0x09090909090977E6 },
- { IOWRH32, "IOWRH32", 0x090909090909F766 },
- { IOWRH16, "IOWRH16", 0x090909090909F7E6 },
- { IOWRW32, "IOWRW32", 0x09090909090909F7 },
- { IOWRW16, "IOWRW16", 0x0909090909F7E666 },
+ { IORDB32, "IORDB32", 0x0909090909090937ULL },
+ { IORDB16, "IORDB16", 0x09090909090937E6ULL },
+ { IORDH32, "IORDH32", 0x090909090909B766ULL },
+ { IORDH16, "IORDH16", 0x090909090909B7E6ULL },
+ { IORDW32, "IORDW32", 0x09090909090909B7ULL },
+ { IORDW16, "IORDW16", 0x0909090909B7E666ULL },
+ { IOWRB32, "IOWRB32", 0x0909090909090977ULL },
+ { IOWRB16, "IOWRB16", 0x09090909090977E6ULL },
+ { IOWRH32, "IOWRH32", 0x090909090909F766ULL },
+ { IOWRH16, "IOWRH16", 0x090909090909F7E6ULL },
+ { IOWRW32, "IOWRW32", 0x09090909090909F7ULL },
+ { IOWRW16, "IOWRW16", 0x0909090909F7E666ULL },
/* lakemont1 core shadow ram access opcodes */
- { SRAMACCESS, "SRAMACCESS", 0x0000000E9D660000 },
- { SRAM2PDR, "SRAM2PDR", 0x4CF0000000000000 },
- { PDR2SRAM, "PDR2SRAM", 0x0CF0000000000000 },
- { WBINVD, "WBINVD", 0x09090909090990F0 },
+ { SRAMACCESS, "SRAMACCESS", 0x0000000E9D660000ULL },
+ { SRAM2PDR, "SRAM2PDR", 0x4CF0000000000000ULL },
+ { PDR2SRAM, "PDR2SRAM", 0x0CF0000000000000ULL },
+ { WBINVD, "WBINVD", 0x09090909090990F0ULL },
};
bool check_not_halted(const struct target *t)
diff --git a/src/target/mips64_pracc.h b/src/target/mips64_pracc.h
index 65ff6e6ac..19d151946 100644
--- a/src/target/mips64_pracc.h
+++ b/src/target/mips64_pracc.h
@@ -29,7 +29,7 @@
#undef LOWER16
#define UPPER16(v) ((uint32_t)((v >> 16) & 0xFFFF))
#define LOWER16(v) ((uint32_t)(v & 0xFFFF))
-#define MIPS64_PRACC_FASTDATA_AREA 0xffffffffFF200000
+#define MIPS64_PRACC_FASTDATA_AREA 0xffffffffFF200000ull
#define MIPS64_PRACC_FASTDATA_SIZE 16
#define MIPS64_FASTDATA_HANDLER_SIZE 0x80
-----------------------------------------------------------------------
Summary of changes:
src/target/aarch64.c | 26 +++----
src/target/armv8.c | 2 +-
src/target/lakemont.c | 174 +++++++++++++++++++++++-----------------------
src/target/mips64_pracc.h | 2 +-
4 files changed, 102 insertions(+), 102 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:09:35
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 314f4c665f746ebec3be69a8e26f0a671cfdcb46 (commit)
via cd44c6cf83841076b40e7a873285117b7440dd42 (commit)
from 9dc1d90f64168863d350694d38e5ff7f20a57a7e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 314f4c665f746ebec3be69a8e26f0a671cfdcb46
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 00:33:38 2023 +0200
rtos: with pointers, use NULL instead of 0
Don't compare pointers with 0, use NULL when needed.
Don't assign pointer to 0, use NULL.
Detected through 'sparse' tool.
Change-Id: Ifa81ba961c0d490cc74880b4a46b620e6358f779
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7598
Tested-by: jenkins
diff --git a/src/rtos/chibios.c b/src/rtos/chibios.c
index 68fe8a14c..20378274e 100644
--- a/src/rtos/chibios.c
+++ b/src/rtos/chibios.c
@@ -80,12 +80,12 @@ struct chibios_params {
static struct chibios_params chibios_params_list[] = {
{
"cortex_m", /* target_name */
- 0,
+ NULL,
NULL, /* stacking_info */
},
{
"hla_target", /* target_name */
- 0,
+ NULL,
NULL, /* stacking_info */
}
};
@@ -198,7 +198,7 @@ static int chibios_update_memory_signature(struct rtos *rtos)
errfree:
/* Error reading the ChibiOS memory structure */
free(signature);
- param->signature = 0;
+ param->signature = NULL;
return -1;
}
@@ -468,7 +468,7 @@ static int chibios_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
return -1;
/* Update stacking if it can only be determined from runtime information */
- if ((param->stacking_info == 0) &&
+ if (!param->stacking_info &&
(chibios_update_stacking(rtos) != ERROR_OK)) {
LOG_ERROR("Failed to determine exact stacking for the target type %s", rtos->target->type->name);
return -1;
commit cd44c6cf83841076b40e7a873285117b7440dd42
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 00:16:28 2023 +0200
helper: with pointers, use NULL instead of 0
Don't compare pointers with 0, use NULL when needed.
Don't assign pointer to 0, use NULL.
Don't pass 0 ad pointer argument, pass NULL.
Detected through 'sparse' tool.
Change-Id: I3f867cb9c0903f6e396311e7b3970ee5fb3a4231
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7597
Tested-by: jenkins
diff --git a/src/helper/command.c b/src/helper/command.c
index 235bec858..945b890b3 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -582,7 +582,7 @@ int command_run_line(struct command_context *context, char *line)
Jim_DeleteAssocData(interp, "retval");
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK) {
- retcode = Jim_Eval_Named(interp, line, 0, 0);
+ retcode = Jim_Eval_Named(interp, line, NULL, 0);
Jim_DeleteAssocData(interp, "retval");
}
diff --git a/src/helper/jep106.c b/src/helper/jep106.c
index d422561bc..62d24a9b2 100644
--- a/src/helper/jep106.c
+++ b/src/helper/jep106.c
@@ -26,7 +26,7 @@ const char *jep106_table_manufacturer(unsigned int bank, unsigned int id)
/* index is zero based */
id--;
- if (bank >= ARRAY_SIZE(jep106) || jep106[bank][id] == 0)
+ if (bank >= ARRAY_SIZE(jep106) || !jep106[bank][id])
return "<unknown>";
return jep106[bank][id];
diff --git a/src/helper/options.c b/src/helper/options.c
index 327c418d0..05cde6709 100644
--- a/src/helper/options.c
+++ b/src/helper/options.c
@@ -39,12 +39,12 @@ static int help_flag, version_flag;
static const struct option long_options[] = {
{"help", no_argument, &help_flag, 1},
{"version", no_argument, &version_flag, 1},
- {"debug", optional_argument, 0, 'd'},
- {"file", required_argument, 0, 'f'},
- {"search", required_argument, 0, 's'},
- {"log_output", required_argument, 0, 'l'},
- {"command", required_argument, 0, 'c'},
- {0, 0, 0, 0}
+ {"debug", optional_argument, NULL, 'd'},
+ {"file", required_argument, NULL, 'f'},
+ {"search", required_argument, NULL, 's'},
+ {"log_output", required_argument, NULL, 'l'},
+ {"command", required_argument, NULL, 'c'},
+ {NULL, 0, NULL, 0}
};
int configuration_output_handler(struct command_context *context, const char *line)
-----------------------------------------------------------------------
Summary of changes:
src/helper/command.c | 2 +-
src/helper/jep106.c | 2 +-
src/helper/options.c | 12 ++++++------
src/rtos/chibios.c | 8 ++++----
4 files changed, 12 insertions(+), 12 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:09:22
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 9dc1d90f64168863d350694d38e5ff7f20a57a7e (commit)
from aa1214280d11c32f82961da44dee863098e1ac38 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9dc1d90f64168863d350694d38e5ff7f20a57a7e
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 00:14:45 2023 +0200
helper: util: include util.h
Let source file to include its file .h to validate the exported
prototypes.
Detected through 'sparse' tool.
Change-Id: I5de107b4f8a468f0e37f06171f5f0c3c0546db1a
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7596
Tested-by: jenkins
diff --git a/src/helper/util.c b/src/helper/util.c
index 5e12021ff..2e9f6155e 100644
--- a/src/helper/util.c
+++ b/src/helper/util.c
@@ -12,6 +12,7 @@
#include "log.h"
#include "time_support.h"
+#include "util.h"
COMMAND_HANDLER(handler_util_ms)
{
-----------------------------------------------------------------------
Summary of changes:
src/helper/util.c | 1 +
1 file changed, 1 insertion(+)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:08:54
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via aa1214280d11c32f82961da44dee863098e1ac38 (commit)
via d4fe63e36b662ad274783585ff7222befbf54268 (commit)
from 6e4000df9e37ea7eb857c3dcd707057d47a5d0ca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit aa1214280d11c32f82961da44dee863098e1ac38
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 9 00:00:37 2023 +0200
flash: with pointers, use NULL instead of 0
Don't compare pointers with 0, use NULL when needed.
Don't pass 0 ad pointer argument, pass NULL.
Detected through 'sparse' tool.
Change-Id: I118554fffde41c94cea9e1201ea941ff3c1ee762
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7595
Tested-by: jenkins
diff --git a/src/flash/nand/lpc32xx.c b/src/flash/nand/lpc32xx.c
index 2c578d1b4..f8b59b357 100644
--- a/src/flash/nand/lpc32xx.c
+++ b/src/flash/nand/lpc32xx.c
@@ -1029,7 +1029,7 @@ static int lpc32xx_write_page_slc(struct nand_device *nand,
LOG_DEBUG("SLC write page %" PRIx32 " data=%d, oob=%d, "
"data_size=%" PRIu32 ", oob_size=%" PRIu32,
- page, data != 0, oob != 0, data_size, oob_size);
+ page, !!data, !!oob, data_size, oob_size);
target_mem_base = pworking_area->address;
/*
diff --git a/src/flash/nor/msp432.c b/src/flash/nor/msp432.c
index d9b9695df..5e2935d02 100644
--- a/src/flash/nor/msp432.c
+++ b/src/flash/nor/msp432.c
@@ -375,7 +375,7 @@ static int msp432_init(struct flash_bank *bank)
buf_set_u32(reg_params[0].value, 0, 32, ALGO_STACK_POINTER_ADDR);
/* Begin executing the flash helper algorithm */
- retval = target_start_algorithm(target, 0, 0, 1, reg_params,
+ retval = target_start_algorithm(target, 0, NULL, 1, reg_params,
algo_entry_addr, 0, &msp432_bank->armv7m_info);
destroy_reg_param(®_params[0]);
if (retval != ERROR_OK) {
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index 3a78952ef..972686e3f 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -1342,7 +1342,7 @@ COMMAND_HANDLER(stellaris_handle_recover_command)
* cycle to recover.
*/
- Jim_Eval_Named(CMD_CTX->interp, "catch { hla_command \"debug unlock\" }", 0, 0);
+ Jim_Eval_Named(CMD_CTX->interp, "catch { hla_command \"debug unlock\" }", NULL, 0);
if (!strcmp(Jim_GetString(Jim_GetResult(CMD_CTX->interp), NULL), "0")) {
retval = ERROR_OK;
goto user_action;
commit d4fe63e36b662ad274783585ff7222befbf54268
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 8 23:59:42 2023 +0200
flash: nor: add static to local symbols
Add static type to symbols that are not used elsewhere.
Detected through 'sparse' tool.
Change-Id: I2bdac5d2b06a6dbed5c27bfdb1cf36eee90ad823
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7594
Tested-by: jenkins
diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c
index 0b04ce4b7..a0c6e0c81 100644
--- a/src/flash/nor/numicro.c
+++ b/src/flash/nor/numicro.c
@@ -536,8 +536,8 @@ struct numicro_flash_bank {
};
/* Private variables */
-uint32_t m_page_size = NUMICRO_PAGESIZE;
-uint32_t m_address_bias_offset;
+static uint32_t m_page_size = NUMICRO_PAGESIZE;
+static uint32_t m_address_bias_offset;
/* Private methods */
static int numicro_get_arm_arch(struct target *target)
diff --git a/src/flash/nor/rsl10.c b/src/flash/nor/rsl10.c
index d92c4b8b1..5f0ac9b8f 100644
--- a/src/flash/nor/rsl10.c
+++ b/src/flash/nor/rsl10.c
@@ -107,7 +107,7 @@ static const char *const rsl10_error_list[] = {
[RSL10_FLASH_ERR_PROG_FAILED] = "prog failed",
};
-const char *rsl10_error(enum rsl10_flash_status x)
+static const char *rsl10_error(enum rsl10_flash_status x)
{
if (x >= RSL10_FLASH_MAX_ERR_CODES || !rsl10_error_list[x])
return "unknown";
-----------------------------------------------------------------------
Summary of changes:
src/flash/nand/lpc32xx.c | 2 +-
src/flash/nor/msp432.c | 2 +-
src/flash/nor/numicro.c | 4 ++--
src/flash/nor/rsl10.c | 2 +-
src/flash/nor/stellaris.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2023-05-05 22:08:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 6e4000df9e37ea7eb857c3dcd707057d47a5d0ca (commit)
via 07e1ebcc12cdc7e6aba4db2e33aba79d0461f994 (commit)
from 411dfa2409221259108b7cec99ac7824e53e3867 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6e4000df9e37ea7eb857c3dcd707057d47a5d0ca
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 8 23:50:00 2023 +0200
flash: nor: use 'ULL' suffix for long constants
On 32 bit hosts, gcc should consider constants without suffix as
32 bits values. Adding a cast to convert it to 64 bits should not
be enough.
Use the suffix 'ULL' to guarantee it is a 64 bit.
Detected through 'sparse' tool.
Change-Id: If6be35bd3cbbc7c3a83e0da1407e611f07ff6e06
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7593
Tested-by: jenkins
diff --git a/src/flash/nor/at91samd.c b/src/flash/nor/at91samd.c
index 416f07778..36298f19d 100644
--- a/src/flash/nor/at91samd.c
+++ b/src/flash/nor/at91samd.c
@@ -78,7 +78,7 @@
#define SAMD_GET_DEVSEL(id) (id & 0xFF)
/* Bits to mask out lockbits in user row */
-#define NVMUSERROW_LOCKBIT_MASK ((uint64_t)0x0000FFFFFFFFFFFF)
+#define NVMUSERROW_LOCKBIT_MASK 0x0000FFFFFFFFFFFFULL
struct samd_part {
uint8_t id;
@@ -316,31 +316,31 @@ struct samd_family {
static const struct samd_family samd_families[] = {
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_20,
samd20_parts, ARRAY_SIZE(samd20_parts),
- (uint64_t)0xFFFF01FFFE01FF77 },
+ 0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_21,
samd21_parts, ARRAY_SIZE(samd21_parts),
- (uint64_t)0xFFFF01FFFE01FF77 },
+ 0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_09,
samd09_parts, ARRAY_SIZE(samd09_parts),
- (uint64_t)0xFFFF01FFFE01FF77 },
+ 0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_10,
samd10_parts, ARRAY_SIZE(samd10_parts),
- (uint64_t)0xFFFF01FFFE01FF77 },
+ 0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_D, SAMD_SERIES_11,
samd11_parts, ARRAY_SIZE(samd11_parts),
- (uint64_t)0xFFFF01FFFE01FF77 },
+ 0xFFFF01FFFE01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_L, SAMD_SERIES_21,
saml21_parts, ARRAY_SIZE(saml21_parts),
- (uint64_t)0xFFFF03FFFC01FF77 },
+ 0xFFFF03FFFC01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_L, SAMD_SERIES_22,
saml22_parts, ARRAY_SIZE(saml22_parts),
- (uint64_t)0xFFFF03FFFC01FF77 },
+ 0xFFFF03FFFC01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_C, SAMD_SERIES_20,
samc20_parts, ARRAY_SIZE(samc20_parts),
- (uint64_t)0xFFFF03FFFC01FF77 },
+ 0xFFFF03FFFC01FF77ULL },
{ SAMD_PROCESSOR_M0, SAMD_FAMILY_C, SAMD_SERIES_21,
samc21_parts, ARRAY_SIZE(samc21_parts),
- (uint64_t)0xFFFF03FFFC01FF77 },
+ 0xFFFF03FFFC01FF77ULL },
};
struct samd_info {
diff --git a/src/flash/nor/atsame5.c b/src/flash/nor/atsame5.c
index fdd610f5f..c590081fc 100644
--- a/src/flash/nor/atsame5.c
+++ b/src/flash/nor/atsame5.c
@@ -93,7 +93,7 @@
#define SAMD_GET_DEVSEL(id) (id & 0xFF)
/* Bits to mask user row */
-#define NVMUSERROW_SAM_E5_D5_MASK ((uint64_t)0x7FFF00FF3C007FFF)
+#define NVMUSERROW_SAM_E5_D5_MASK 0x7FFF00FF3C007FFFULL
struct samd_part {
uint8_t id;
commit 07e1ebcc12cdc7e6aba4db2e33aba79d0461f994
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 8 23:21:33 2023 +0200
jtag: drivers: with pointers, use NULL instead of 0
Don't compare pointers with 0, use NULL when needed.
Don't assign pointer to 0, use NULL.
Don't pass 0 ad pointer argument, pass NULL.
While there, check for return value from malloc(), replace an
assert() with a LOG_ERROR(), drop a useless cast.
Detected through 'sparse' tool.
Change-Id: Ia7cf52221b12198aba1a07ebdfaf57ce341d5699
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7592
Tested-by: jenkins
diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c
index 7db3c7b15..a37272084 100644
--- a/src/jtag/drivers/arm-jtag-ew.c
+++ b/src/jtag/drivers/arm-jtag-ew.c
@@ -213,7 +213,7 @@ static int armjtagew_init(void)
armjtagew_handle = armjtagew_usb_open();
- if (armjtagew_handle == 0) {
+ if (!armjtagew_handle) {
LOG_ERROR(
"Cannot find ARM-JTAG-EW Interface! Please check connection and permissions.");
return ERROR_JTAG_INIT_FAILED;
diff --git a/src/jtag/drivers/at91rm9200.c b/src/jtag/drivers/at91rm9200.c
index 08daa004b..ba9ee5e34 100644
--- a/src/jtag/drivers/at91rm9200.c
+++ b/src/jtag/drivers/at91rm9200.c
@@ -107,7 +107,7 @@ static int at91rm9200_quit(void);
static struct bitbang_interface at91rm9200_bitbang = {
.read = at91rm9200_read,
.write = at91rm9200_write,
- .blink = 0
+ .blink = NULL,
};
static bb_value_t at91rm9200_read(void)
@@ -157,8 +157,12 @@ COMMAND_HANDLER(at91rm9200_handle_device_command)
return ERROR_COMMAND_SYNTAX_ERROR;
/* only if the device name wasn't overwritten by cmdline */
- if (at91rm9200_device == 0) {
+ if (!at91rm9200_device) {
at91rm9200_device = malloc(strlen(CMD_ARGV[0]) + sizeof(char));
+ if (!at91rm9200_device) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
strcpy(at91rm9200_device, CMD_ARGV[0]);
}
diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c
index 5cb6dff24..c3e841d37 100644
--- a/src/jtag/drivers/ep93xx.c
+++ b/src/jtag/drivers/ep93xx.c
@@ -58,7 +58,7 @@ struct adapter_driver ep93xx_adapter_driver = {
static struct bitbang_interface ep93xx_bitbang = {
.read = ep93xx_read,
.write = ep93xx_write,
- .blink = 0,
+ .blink = NULL,
};
static bb_value_t ep93xx_read(void)
diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c
index 816b2d05e..1d73af4e5 100644
--- a/src/jtag/drivers/ft232r.c
+++ b/src/jtag/drivers/ft232r.c
@@ -235,7 +235,7 @@ static int ft232r_speed(int divisor)
if (jtag_libusb_control_transfer(adapter,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
- SIO_SET_BAUD_RATE, divisor, 0, 0, 0, 1000) != 0) {
+ SIO_SET_BAUD_RATE, divisor, 0, NULL, 0, 1000) != 0) {
LOG_ERROR("cannot set baud rate");
return ERROR_JTAG_DEVICE_ERROR;
}
@@ -266,7 +266,7 @@ static int ft232r_init(void)
/* Reset the device. */
if (jtag_libusb_control_transfer(adapter,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
- SIO_RESET, 0, 0, 0, 0, 1000) != 0) {
+ SIO_RESET, 0, 0, NULL, 0, 1000) != 0) {
LOG_ERROR("unable to reset device");
return ERROR_JTAG_INIT_FAILED;
}
@@ -275,7 +275,7 @@ static int ft232r_init(void)
if (jtag_libusb_control_transfer(adapter,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
SIO_SET_BITMODE, (1<<tck_gpio) | (1<<tdi_gpio) | (1<<tms_gpio) | (1<<ntrst_gpio) | (1<<nsysrst_gpio) | 0x400,
- 0, 0, 0, 1000) != 0) {
+ 0, NULL, 0, 1000) != 0) {
LOG_ERROR("cannot set sync bitbang mode");
return ERROR_JTAG_INIT_FAILED;
}
@@ -288,13 +288,13 @@ static int ft232r_init(void)
if (jtag_libusb_control_transfer(adapter,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
SIO_SET_BAUD_RATE, divisor,
- 0, 0, 0, 1000) != 0) {
+ 0, NULL, 0, 1000) != 0) {
LOG_ERROR("cannot set baud rate");
return ERROR_JTAG_INIT_FAILED;
}
if (jtag_libusb_control_transfer(adapter,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
- SIO_SET_LATENCY_TIMER, latency_timer, 0, 0, 0, 1000) != 0) {
+ SIO_SET_LATENCY_TIMER, latency_timer, 0, NULL, 0, 1000) != 0) {
LOG_ERROR("unable to set latency timer");
return ERROR_JTAG_INIT_FAILED;
}
@@ -315,7 +315,7 @@ static int ft232r_quit(void)
if (jtag_libusb_control_transfer(adapter,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT,
SIO_SET_BITMODE, ft232r_restore_bitmode,
- 0, 0, 0, 1000) != 0) {
+ 0, NULL, 0, 1000) != 0) {
LOG_ERROR("cannot set bitmode to restore serial port");
}
}
diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c
index 6356a4929..85b451308 100644
--- a/src/jtag/drivers/ftdi.c
+++ b/src/jtag/drivers/ftdi.c
@@ -181,7 +181,7 @@ static int ftdi_set_signal(const struct signal *s, char value)
oe = s->invert_oe;
break;
default:
- assert(0 && "invalid signal level specifier");
+ LOG_ERROR("invalid signal level specifier \'%c\'(0x%02x)", value, value);
return ERROR_FAIL;
}
diff --git a/src/jtag/drivers/mpsse.c b/src/jtag/drivers/mpsse.c
index 9f2fdde9f..fad91dde2 100644
--- a/src/jtag/drivers/mpsse.c
+++ b/src/jtag/drivers/mpsse.c
@@ -313,7 +313,7 @@ struct mpsse_ctx *mpsse_open(const uint16_t vids[], const uint16_t pids[], const
int err;
if (!ctx)
- return 0;
+ return NULL;
bit_copy_queue_init(&ctx->read_queue);
ctx->read_chunk_size = 16384;
@@ -348,7 +348,7 @@ struct mpsse_ctx *mpsse_open(const uint16_t vids[], const uint16_t pids[], const
description ? description : "*",
serial ? serial : "*",
location ? location : "*");
- ctx->usb_dev = 0;
+ ctx->usb_dev = NULL;
goto error;
}
@@ -378,7 +378,7 @@ struct mpsse_ctx *mpsse_open(const uint16_t vids[], const uint16_t pids[], const
return ctx;
error:
mpsse_close(ctx);
- return 0;
+ return NULL;
}
void mpsse_close(struct mpsse_ctx *ctx)
@@ -465,13 +465,13 @@ static unsigned buffer_add_read(struct mpsse_ctx *ctx, uint8_t *in, unsigned in_
void mpsse_clock_data_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
unsigned length, uint8_t mode)
{
- mpsse_clock_data(ctx, out, out_offset, 0, 0, length, mode);
+ mpsse_clock_data(ctx, out, out_offset, NULL, 0, length, mode);
}
void mpsse_clock_data_in(struct mpsse_ctx *ctx, uint8_t *in, unsigned in_offset, unsigned length,
uint8_t mode)
{
- mpsse_clock_data(ctx, 0, 0, in, in_offset, length, mode);
+ mpsse_clock_data(ctx, NULL, 0, in, in_offset, length, mode);
}
void mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in,
@@ -548,7 +548,7 @@ void mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_of
void mpsse_clock_tms_cs_out(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset,
unsigned length, bool tdi, uint8_t mode)
{
- mpsse_clock_tms_cs(ctx, out, out_offset, 0, 0, length, tdi, mode);
+ mpsse_clock_tms_cs(ctx, out, out_offset, NULL, 0, length, tdi, mode);
}
void mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in,
@@ -842,7 +842,7 @@ int mpsse_flush(struct mpsse_ctx *ctx)
if (ctx->write_count == 0)
return retval;
- struct libusb_transfer *read_transfer = 0;
+ struct libusb_transfer *read_transfer = NULL;
struct transfer_result read_result = { .ctx = ctx, .done = true };
if (ctx->read_count) {
buffer_write_byte(ctx, 0x87); /* SEND_IMMEDIATE */
diff --git a/src/jtag/drivers/opendous.c b/src/jtag/drivers/opendous.c
index c353aef40..ad980bf23 100644
--- a/src/jtag/drivers/opendous.c
+++ b/src/jtag/drivers/opendous.c
@@ -347,7 +347,7 @@ static int opendous_init(void)
opendous_jtag_handle = opendous_usb_open();
- if (opendous_jtag_handle == 0) {
+ if (!opendous_jtag_handle) {
LOG_ERROR("Cannot find opendous Interface! Please check connection and permissions.");
return ERROR_JTAG_INIT_FAILED;
}
diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c
index 4073d066e..d26a51048 100644
--- a/src/jtag/drivers/parport.c
+++ b/src/jtag/drivers/parport.c
@@ -411,9 +411,13 @@ COMMAND_HANDLER(parport_handle_parport_cable_command)
return ERROR_OK;
/* only if the cable name wasn't overwritten by cmdline */
- if (parport_cable == 0) {
+ if (!parport_cable) {
/* REVISIT first verify that it's listed in cables[] ... */
parport_cable = malloc(strlen(CMD_ARGV[0]) + sizeof(char));
+ if (!parport_cable) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
strcpy(parport_cable, CMD_ARGV[0]);
}
diff --git a/src/jtag/drivers/rlink.c b/src/jtag/drivers/rlink.c
index c933b3e1c..65f7494bd 100644
--- a/src/jtag/drivers/rlink.c
+++ b/src/jtag/drivers/rlink.c
@@ -632,7 +632,7 @@ static int dtc_queue_run(void)
uint8_t dtc_mask, tdo_mask;
uint8_t reply_buffer[USB_EP2IN_SIZE];
- assert((dtc_queue.rq_head != 0) == (dtc_queue.reply_index > 0));
+ assert((!!dtc_queue.rq_head) == (dtc_queue.reply_index > 0));
assert(dtc_queue.cmd_index < USB_EP2BANK_SIZE);
assert(dtc_queue.reply_index <= USB_EP2IN_SIZE);
diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c
index 5b051c1ff..ee629542b 100644
--- a/src/jtag/drivers/stlink_usb.c
+++ b/src/jtag/drivers/stlink_usb.c
@@ -3694,7 +3694,7 @@ static int stlink_open(struct hl_interface_param_s *param, enum stlink_mode mode
h = calloc(1, sizeof(struct stlink_usb_handle_s));
- if (h == 0) {
+ if (!h) {
LOG_DEBUG("malloc failed");
return ERROR_FAIL;
}
diff --git a/src/jtag/drivers/sysfsgpio.c b/src/jtag/drivers/sysfsgpio.c
index ee254d66a..a5f5fd3ac 100644
--- a/src/jtag/drivers/sysfsgpio.c
+++ b/src/jtag/drivers/sysfsgpio.c
@@ -571,7 +571,7 @@ static struct bitbang_interface sysfsgpio_bitbang = {
.swdio_read = sysfsgpio_swdio_read,
.swdio_drive = sysfsgpio_swdio_drive,
.swd_write = sysfsgpio_swd_write,
- .blink = 0
+ .blink = NULL,
};
/* helper func to close and cleanup files only if they were valid/ used */
diff --git a/src/jtag/drivers/ti_icdi_usb.c b/src/jtag/drivers/ti_icdi_usb.c
index ca52559d1..3e3621873 100644
--- a/src/jtag/drivers/ti_icdi_usb.c
+++ b/src/jtag/drivers/ti_icdi_usb.c
@@ -369,7 +369,7 @@ static int icdi_usb_query(void *handle)
if (h->max_packet != ICDI_PACKET_SIZE) {
h->read_buffer = realloc(h->read_buffer, h->max_packet);
h->write_buffer = realloc(h->write_buffer, h->max_packet);
- if (h->read_buffer == 0 || h->write_buffer == 0) {
+ if (!h->read_buffer || !h->write_buffer) {
LOG_ERROR("unable to reallocate memory");
return ERROR_FAIL;
}
@@ -664,7 +664,7 @@ static int icdi_usb_open(struct hl_interface_param_s *param, void **fd)
h = calloc(1, sizeof(struct icdi_usb_handle_s));
- if (h == 0) {
+ if (!h) {
LOG_ERROR("unable to allocate memory");
return ERROR_FAIL;
}
@@ -712,7 +712,7 @@ static int icdi_usb_open(struct hl_interface_param_s *param, void **fd)
h->write_buffer = malloc(ICDI_PACKET_SIZE);
h->max_packet = ICDI_PACKET_SIZE;
- if (h->read_buffer == 0 || h->write_buffer == 0) {
+ if (!h->read_buffer || !h->write_buffer) {
LOG_DEBUG("malloc failed");
goto error_open;
}
diff --git a/src/jtag/drivers/usbprog.c b/src/jtag/drivers/usbprog.c
index 0c0f24ee2..5d41656b4 100644
--- a/src/jtag/drivers/usbprog.c
+++ b/src/jtag/drivers/usbprog.c
@@ -148,7 +148,7 @@ static int usbprog_init(void)
usbprog_jtag_handle = usbprog_jtag_open();
tms_chain_index = 0;
- if (usbprog_jtag_handle == 0) {
+ if (!usbprog_jtag_handle) {
LOG_ERROR("Can't find USB JTAG Interface! Please check connection and permissions.");
return ERROR_JTAG_INIT_FAILED;
}
diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c
index 8e5d638db..3ea98ad6b 100644
--- a/src/jtag/drivers/xds110.c
+++ b/src/jtag/drivers/xds110.c
@@ -1300,7 +1300,7 @@ static int xds110_swd_run_queue(void)
/* Transfer results into caller's buffers */
for (result = 0; result < xds110.txn_result_count; result++)
- if (xds110.txn_dap_results[result] != 0)
+ if (xds110.txn_dap_results[result])
*xds110.txn_dap_results[result] = dap_results[result];
xds110.txn_request_size = 0;
@@ -1611,7 +1611,7 @@ static void xds110_flush(void)
}
bits = 0;
}
- if (xds110.txn_scan_results[result].buffer != 0)
+ if (xds110.txn_scan_results[result].buffer)
bit_copy(xds110.txn_scan_results[result].buffer, 0, data_pntr,
bits, xds110.txn_scan_results[result].num_bits);
bits += xds110.txn_scan_results[result].num_bits;
@@ -1687,8 +1687,8 @@ static void xds110_execute_pathmove(struct jtag_command *cmd)
if (num_states == 0)
return;
- path = (uint8_t *)malloc(num_states * sizeof(uint8_t));
- if (path == 0) {
+ path = malloc(num_states * sizeof(uint8_t));
+ if (path) {
LOG_ERROR("XDS110: unable to allocate memory");
return;
}
@@ -1766,7 +1766,7 @@ static void xds110_queue_scan(struct jtag_command *cmd)
/* Clear data out buffer to default value of all zeros */
memset((void *)buffer, 0x00, total_bytes);
for (i = 0; i < cmd->cmd.scan->num_fields; i++) {
- if (cmd->cmd.scan->fields[i].out_value != 0) {
+ if (cmd->cmd.scan->fields[i].out_value) {
/* Copy over data to scan out into request buffer */
bit_copy(buffer, offset, cmd->cmd.scan->fields[i].out_value, 0,
cmd->cmd.scan->fields[i].num_bits);
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/at91samd.c | 20 ++++++++++----------
src/flash/nor/atsame5.c | 2 +-
src/jtag/drivers/arm-jtag-ew.c | 2 +-
src/jtag/drivers/at91rm9200.c | 8 ++++++--
src/jtag/drivers/ep93xx.c | 2 +-
src/jtag/drivers/ft232r.c | 12 ++++++------
src/jtag/drivers/ftdi.c | 2 +-
src/jtag/drivers/mpsse.c | 14 +++++++-------
src/jtag/drivers/opendous.c | 2 +-
src/jtag/drivers/parport.c | 6 +++++-
src/jtag/drivers/rlink.c | 2 +-
src/jtag/drivers/stlink_usb.c | 2 +-
src/jtag/drivers/sysfsgpio.c | 2 +-
src/jtag/drivers/ti_icdi_usb.c | 6 +++---
src/jtag/drivers/usbprog.c | 2 +-
src/jtag/drivers/xds110.c | 10 +++++-----
16 files changed, 51 insertions(+), 43 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|