refactor(esp32c61): bus_monitor backward compatible refactor

This commit is contained in:
laokaiyao
2025-04-02 18:28:11 +08:00
parent ba0a2db037
commit db85cd02be
25 changed files with 124 additions and 39 deletions
+7 -4
View File
@@ -8,17 +8,20 @@ endif()
if(BOOTLOADER_BUILD)
set(priv_requires soc)
set(priv_requires soc hal)
set(srcs "rv_utils.c")
elseif(esp_tee_build)
set(priv_requires soc)
set(priv_requires soc hal)
set(srcs "rv_utils.c")
if(CONFIG_SOC_INT_PLIC_SUPPORTED)
set(srcs "interrupt_plic.c")
list(APPEND srcs "interrupt_plic.c")
endif()
else()
set(priv_requires soc)
set(priv_requires soc hal)
set(srcs
"instruction_decode.c"
"interrupt.c"
"rv_utils.c"
"vectors.S")
if(CONFIG_SOC_INT_CLIC_SUPPORTED)
+4 -11
View File
@@ -9,9 +9,6 @@
#include <stdint.h>
#include "soc/soc_caps.h"
#if SOC_ASSIST_DEBUG_SUPPORTED
#include "soc/assist_debug_reg.h"
#endif
#include "soc/interrupt_reg.h"
#include "esp_attr.h"
#include "riscv/csr.h"
@@ -405,14 +402,10 @@ FORCE_INLINE_ATTR bool rv_utils_is_trigger_fired(int id)
// ---------------------- Debugger -------------------------
FORCE_INLINE_ATTR bool rv_utils_dbgr_is_attached(void)
{
#if SOC_ASSIST_DEBUG_SUPPORTED
return REG_GET_BIT(ASSIST_DEBUG_CORE_0_DEBUG_MODE_REG, ASSIST_DEBUG_CORE_0_DEBUG_MODULE_ACTIVE);
#else
return false;
#endif
}
/** To use hal function for compatibility meanwhile keep hal dependency private,
* this function is implemented in rv_utils.c
*/
bool rv_utils_dbgr_is_attached(void);
FORCE_INLINE_ATTR void rv_utils_dbgr_break(void)
{
+1
View File
@@ -5,3 +5,4 @@ entries:
interrupt:intr_handler_get (default)
interrupt:intr_handler_set (default)
vectors (noflash_text)
rv_utils (noflash_text)
+21
View File
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "soc/soc_caps.h"
#if SOC_ASSIST_DEBUG_SUPPORTED
#include "hal/assist_debug_ll.h"
#endif
#include "esp_attr.h"
bool rv_utils_dbgr_is_attached(void)
{
#if SOC_ASSIST_DEBUG_SUPPORTED
return assist_debug_ll_is_debugger_active();
#else
return false;
#endif
}