Esp8266/Components/spi_flash/include/iram_precache.h
Go to the documentation of this file.
1 /*
2  Original code: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/core_esp8266_features.cpp
3  core_esp8266_features.cpp
4 
5  Copyright (c) 2019 Mike Nix. All rights reserved.
6  This file is part of the esp8266 core for Arduino environment.
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 
23 #include <stdint.h>
24 
25 #pragma once
26 
46 #define IRAM_PRECACHE_ATTR __attribute__((optimize("no-reorder-blocks"))) __attribute__((noinline))
47 
53 #define IRAM_PRECACHE_START(tag) \
54  iram_precache(NULL, (uint8_t*)&&iram_precache_end_##tag - (uint8_t*)&&iram_precache_start_##tag); \
55  iram_precache_start_##tag:
56 
61 #define IRAM_PRECACHE_END(tag) iram_precache_end_##tag:
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
73 void iram_precache(void* addr, uint32_t bytes);
74 
77 #ifdef __cplusplus
78 }
79 #endif
void iram_precache(void *addr, uint32_t bytes)
Pre-load flash data into the flash instruction cache.
Definition: Esp32/Components/spi_flash/include/iram_precache.h:29