mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
esp_hw_support: Removed deprecated CPU util functions
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>
This commit is contained in:
34
components/xtensa/include/esp_cpu_utils.h
Normal file
34
components/xtensa/include/esp_cpu_utils.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user