From: openocd-gerrit <ope...@us...> - 2025-05-01 15:23: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 cbd7987c7ca2656b60bc8964bb1d9b7819e66ccb (commit) from 4d4c45cfd25703f39f9e2413b22d91a48c4b4565 (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 cbd7987c7ca2656b60bc8964bb1d9b7819e66ccb Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 19 11:03:46 2025 +0200 target: stm8: drop include file stm8.h The file stm8.h is only included by stm8.c and provides some basic declaration that can be simply part of the C file. Drop the file stm8.h and move its content in stm8.c Replace the macro 'STM8_NUM_CORE_REGS' with the existing macro 'STM8_NUM_REGS'. While there: - drop the useless include of "hello.h". Change-Id: Iecd1a27f0630cdbbfd51033d34aa3d468aa63464 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8856 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/target/Makefile.am b/src/target/Makefile.am index 1fc7d2afa..1a7686418 100644 --- a/src/target/Makefile.am +++ b/src/target/Makefile.am @@ -224,7 +224,6 @@ ARC_SRC = \ %D%/avr32_mem.h \ %D%/avr32_regs.h \ %D%/semihosting_common.h \ - %D%/stm8.h \ %D%/lakemont.h \ %D%/x86_32_common.h \ %D%/arm_cti.h \ diff --git a/src/target/stm8.c b/src/target/stm8.c index c80ea0eb2..81c41f2b2 100644 --- a/src/target/stm8.c +++ b/src/target/stm8.c @@ -13,14 +13,12 @@ #include <helper/log.h> #include "target.h" #include "target_type.h" -#include "hello.h" #include "jtag/interface.h" #include "jtag/jtag.h" #include "jtag/swim.h" #include "register.h" #include "breakpoints.h" #include "algorithm.h" -#include "stm8.h" static struct reg_cache *stm8_build_reg_cache(struct target *target); static int stm8_read_core_reg(struct target *target, unsigned int num); @@ -54,6 +52,8 @@ static const struct { { 5, "cc", 8, REG_TYPE_UINT8, "general", "org.gnu.gdb.stm8.core", 0 }, }; +#define STM8_COMMON_MAGIC 0x53544D38U + #define STM8_NUM_REGS ARRAY_SIZE(stm8_regs) #define STM8_PC 0 #define STM8_A 1 @@ -168,6 +168,51 @@ struct stm8_comparator { enum hw_break_type type; }; +struct stm8_common { + unsigned int common_magic; + + void *arch_info; + struct reg_cache *core_cache; + uint32_t core_regs[STM8_NUM_REGS]; + + /* working area for fastdata access */ + struct working_area *fast_data_area; + + bool swim_configured; + bool bp_scanned; + uint8_t num_hw_bpoints; + uint8_t num_hw_bpoints_avail; + struct stm8_comparator *hw_break_list; + uint32_t blocksize; + uint32_t flashstart; + uint32_t flashend; + uint32_t eepromstart; + uint32_t eepromend; + uint32_t optionstart; + uint32_t optionend; + bool enable_step_irq; + + bool enable_stm8l; + uint32_t flash_cr2; + uint32_t flash_ncr2; + uint32_t flash_iapsr; + uint32_t flash_dukr; + uint32_t flash_pukr; + + /* cc value used for interrupt flags restore */ + uint32_t cc; + bool cc_valid; + + /* register cache to processor synchronization */ + int (*read_core_reg)(struct target *target, unsigned int num); + int (*write_core_reg)(struct target *target, unsigned int num); +}; + +static struct stm8_common *target_to_stm8(struct target *target) +{ + return target->arch_info; +} + static int stm8_adapter_read_memory(struct target *target, uint32_t addr, int size, int count, void *buf) { diff --git a/src/target/stm8.h b/src/target/stm8.h deleted file mode 100644 index 55e1071ab..000000000 --- a/src/target/stm8.h +++ /dev/null @@ -1,63 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -/* -* OpenOCD STM8 target driver -* Copyright (C) 2017 Ake Rehnman -* ake.rehnman(at)gmail.com -*/ - -#ifndef OPENOCD_TARGET_STM8_H -#define OPENOCD_TARGET_STM8_H - -struct target; - -#define STM8_COMMON_MAGIC 0x53544D38U -#define STM8_NUM_CORE_REGS 6 - -struct stm8_common { - unsigned int common_magic; - - void *arch_info; - struct reg_cache *core_cache; - uint32_t core_regs[STM8_NUM_CORE_REGS]; - - /* working area for fastdata access */ - struct working_area *fast_data_area; - - bool swim_configured; - bool bp_scanned; - uint8_t num_hw_bpoints; - uint8_t num_hw_bpoints_avail; - struct stm8_comparator *hw_break_list; - uint32_t blocksize; - uint32_t flashstart; - uint32_t flashend; - uint32_t eepromstart; - uint32_t eepromend; - uint32_t optionstart; - uint32_t optionend; - bool enable_step_irq; - - bool enable_stm8l; - uint32_t flash_cr2; - uint32_t flash_ncr2; - uint32_t flash_iapsr; - uint32_t flash_dukr; - uint32_t flash_pukr; - - /* cc value used for interrupt flags restore */ - uint32_t cc; - bool cc_valid; - - /* register cache to processor synchronization */ - int (*read_core_reg)(struct target *target, unsigned int num); - int (*write_core_reg)(struct target *target, unsigned int num); -}; - -static inline struct stm8_common * -target_to_stm8(struct target *target) -{ - return target->arch_info; -} - -#endif /* OPENOCD_TARGET_STM8_H */ ----------------------------------------------------------------------- Summary of changes: src/target/Makefile.am | 1 - src/target/stm8.c | 49 +++++++++++++++++++++++++++++++++++++-- src/target/stm8.h | 63 -------------------------------------------------- 3 files changed, 47 insertions(+), 66 deletions(-) delete mode 100644 src/target/stm8.h hooks/post-receive -- Main OpenOCD repository |