Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put each ICACHE_RAM_ATTR function in its own section. #2334

Merged
merged 2 commits into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/include/user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ extern void luaL_assertfail(const char *file, int line, const char *message);

#define ICACHE_STORE_TYPEDEF_ATTR __attribute__((aligned(4),packed))
#define ICACHE_STORE_ATTR __attribute__((aligned(4)))
#define ICACHE_RAM_ATTR __attribute__((section(".iram0.text")))
#define STRINGIZE(x) STRINGIZE2(x)
Copy link
Collaborator

@TerryE TerryE Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defines in user_confgi.h in practice end up getting included in most modules and platform files, so should these be prefixed to remove the risk of a collision with another use of STRINGIZE, e.g.

  • STRINGIZE->ICACHE_STRINGIZE
  • STRINGIZE2->ICACHE_STRINGIZE2

Other than that, 👍

#define STRINGIZE2(x) #x
#define ICACHE_RAM_ATTR __attribute__((section(".iram0.text." __FILE__ "." STRINGIZE(__LINE__))))
#ifdef GPIO_SAFE_NO_INTR_ENABLE
#define NO_INTR_CODE ICACHE_RAM_ATTR __attribute__ ((noinline))
#else
Expand Down
2 changes: 1 addition & 1 deletion ld/nodemcu.ld
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ SECTIONS
/* *libwpa.a:*(.literal .text) - tested that safe to keep in iROM */
/* *libwps.a:*(.literal .text) - tested that safe to keep in iROM */

*(.iram.text .iram0.text)
*(.iram.text .iram0.text .iram0.text.*)

*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)

Expand Down