memprot: move memprot functions out of IRAM

Memprot functions are no longer placed by default in IRAM,
selecting ESP_PANIC_HANDLER_IRAM will still force panic related memprot
functions to be placed in IRAM.
This commit is contained in:
Marius Vikhammer
2022-09-23 14:33:26 +08:00
parent c77b5752ef
commit 43784e7a24
9 changed files with 32 additions and 481 deletions

View File

@@ -514,7 +514,7 @@ esp_err_t esp_mprot_get_monitor_en(esp_mprot_mem_t mem_type, bool *enabled, cons
//////////////////////////////////////////////////////////////////////////////
// PMS-violation interrupt handling APIs (IRAM section - called from panic-handler)
esp_err_t IRAM_ATTR esp_mprot_get_active_intr(esp_memp_intr_source_t *active_memp_intr)
esp_err_t esp_mprot_get_active_intr(esp_memp_intr_source_t *active_memp_intr)
{
if (active_memp_intr == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -601,7 +601,7 @@ esp_err_t IRAM_ATTR esp_mprot_get_active_intr(esp_memp_intr_source_t *active_mem
return ESP_OK;
}
esp_err_t IRAM_ATTR esp_mprot_monitor_clear_intr(esp_mprot_mem_t mem_type, const int core)
esp_err_t esp_mprot_monitor_clear_intr(esp_mprot_mem_t mem_type, const int core)
{
esp_err_t err;
ESP_MEMPROT_ERR_CHECK(err, esp_mprot_cpuid_valid(core))
@@ -626,7 +626,7 @@ esp_err_t IRAM_ATTR esp_mprot_monitor_clear_intr(esp_mprot_mem_t mem_type, const
return ESP_OK;
}
esp_err_t IRAM_ATTR esp_mprot_is_conf_locked_any(bool *locked)
esp_err_t esp_mprot_is_conf_locked_any(bool *locked)
{
if (locked == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -695,7 +695,7 @@ esp_err_t IRAM_ATTR esp_mprot_is_conf_locked_any(bool *locked)
return ESP_OK;
}
esp_err_t IRAM_ATTR esp_mprot_is_intr_ena_any(bool *enabled)
esp_err_t esp_mprot_is_intr_ena_any(bool *enabled)
{
if (enabled == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -740,7 +740,7 @@ esp_err_t IRAM_ATTR esp_mprot_is_intr_ena_any(bool *enabled)
return ESP_OK;
}
esp_err_t IRAM_ATTR esp_mprot_get_violate_addr(const esp_mprot_mem_t mem_type, void **fault_addr, const int core)
esp_err_t esp_mprot_get_violate_addr(const esp_mprot_mem_t mem_type, void **fault_addr, const int core)
{
if (fault_addr == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -770,7 +770,7 @@ esp_err_t IRAM_ATTR esp_mprot_get_violate_addr(const esp_mprot_mem_t mem_type, v
return ESP_OK;
}
esp_err_t IRAM_ATTR esp_mprot_get_violate_world(const esp_mprot_mem_t mem_type, esp_mprot_pms_world_t *world, const int core)
esp_err_t esp_mprot_get_violate_world(const esp_mprot_mem_t mem_type, esp_mprot_pms_world_t *world, const int core)
{
if (world == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -804,7 +804,7 @@ esp_err_t IRAM_ATTR esp_mprot_get_violate_world(const esp_mprot_mem_t mem_type,
return ESP_OK;
}
esp_err_t IRAM_ATTR esp_mprot_get_violate_operation(const esp_mprot_mem_t mem_type, uint32_t *oper, const int core)
esp_err_t esp_mprot_get_violate_operation(const esp_mprot_mem_t mem_type, uint32_t *oper, const int core)
{
if (oper == NULL) {
return ESP_ERR_INVALID_ARG;
@@ -849,12 +849,12 @@ esp_err_t IRAM_ATTR esp_mprot_get_violate_operation(const esp_mprot_mem_t mem_ty
return ESP_OK;
}
bool IRAM_ATTR esp_mprot_has_byte_enables(const esp_mprot_mem_t mem_type)
bool esp_mprot_has_byte_enables(const esp_mprot_mem_t mem_type)
{
return mem_type == MEMPROT_TYPE_DRAM0_SRAM;
}
esp_err_t IRAM_ATTR esp_mprot_get_violate_byte_enables(const esp_mprot_mem_t mem_type, uint32_t *byte_en, const int core)
esp_err_t esp_mprot_get_violate_byte_enables(const esp_mprot_mem_t mem_type, uint32_t *byte_en, const int core)
{
if (byte_en == NULL) {
return ESP_ERR_INVALID_ARG;