-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug_stubs: Refactor and add support for RISCV
- Loading branch information
Showing
20 changed files
with
160 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// This module implements debug/trace stubs. The stub is a piece of special code which can invoked by OpenOCD | ||
// Currently one stub is used for GCOV functionality | ||
// | ||
|
||
#include "esp_cpu.h" | ||
#include "hal/cpu_hal.h" | ||
|
||
#include "esp_log.h" | ||
const static char *TAG = "esp_dbg_stubs"; | ||
|
||
#define RISCV_DBG_STUBS_SYSNR 0x65 | ||
|
||
/* Advertises apptrace control block address to host */ | ||
static int esp_dbg_stubs_advertise_table(void *stub_table_addr) | ||
{ | ||
if (!esp_cpu_in_ocd_debug_mode()) { | ||
return 0; | ||
} | ||
return cpu_hal_syscall(RISCV_DBG_STUBS_SYSNR, (int)stub_table_addr, 0, 0, 0, NULL); | ||
} | ||
|
||
void esp_dbg_stubs_ll_init(void *stub_table_addr) | ||
{ | ||
// notify host about control block address | ||
int res = esp_dbg_stubs_advertise_table(stub_table_addr); | ||
assert(res == 0 && "Falied to send debug stubs table address to host!"); | ||
ESP_LOGV(TAG, "%s stubs %x", __func__, stub_table_addr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// This module implements debug/trace stubs. The stub is a piece of special code which can invoked by OpenOCD | ||
// Currently one stub is used for GCOV functionality | ||
// | ||
|
||
#include "eri.h" | ||
#include "xtensa-debug-module.h" | ||
|
||
#include "esp_log.h" | ||
const static char *TAG = "esp_dbg_stubs"; | ||
|
||
#define ESP_DBG_STUBS_TRAX_REG ERI_TRAX_TRIGGERPC | ||
|
||
void esp_dbg_stubs_ll_init(void *stub_table) | ||
{ | ||
eri_write(ESP_DBG_STUBS_TRAX_REG, (uint32_t)stub_table); | ||
ESP_LOGV(TAG, "%s stubs %x", __func__, eri_read(ESP_DBG_STUBS_TRAX_REG)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.