mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
e22b4007d3
The following files were deleted: - components/esp_hw_support/include/soc/cpu.h - components/soc/esp32s3/include/soc/cpu.h The following functions are deprecated: - get_sp() The following functions declared in soc/cpu.h are now moved to esp_cpu.h: - esp_cpu_configure_region_protection() The following functions declared in soc/cpu.h are now moved to components/xtensa/include/esp_cpu_utils.h: - esp_cpu_process_stack_pc() All files with soc/cpu.h inclusion are updated to include esp_cpu.h instead. Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
35 lines
757 B
C
35 lines
757 B
C
/*
|
|
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef _ESP_CPU_UTILS_H
|
|
#define _ESP_CPU_UTILS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief Fetch the PC value of the previous instruction
|
|
*
|
|
* @param pc PC value of the current backtrace frame
|
|
*
|
|
*/
|
|
static inline uint32_t esp_cpu_process_stack_pc(uint32_t pc)
|
|
{
|
|
if (pc & 0x80000000) {
|
|
//Top two bits of a0 (return address) specify window increment. Overwrite to map to address space.
|
|
pc = (pc & 0x3fffffff) | 0x40000000;
|
|
}
|
|
//Minus 3 to get PC of previous instruction (i.e. instruction executed before return address)
|
|
return pc - 3;
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // _ESP_CPU_UTILS_H
|