File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ struct wolfBoot_image {
166166 * With ARMORED setup, the flag is redundant, and the information is wrapped in
167167 * between canary variables, to mitigate attacks based on memory corruptions.
168168 */
169- static void __attribute__(( noinline )) wolfBoot_image_confirm_signature_ok (
169+ static void NOINLINEFUNCTION wolfBoot_image_confirm_signature_ok (
170170 struct wolfBoot_image * img )
171171{
172172 img -> canary_FEED4567 = 0xFEED4567UL ;
@@ -176,7 +176,7 @@ static void __attribute__((noinline)) wolfBoot_image_confirm_signature_ok(
176176 img -> canary_FEED89AB = 0xFEED89ABUL ;
177177}
178178
179- static void __attribute__(( noinline )) wolfBoot_image_clear_signature_ok (
179+ static void NOINLINEFUNCTION wolfBoot_image_clear_signature_ok (
180180 struct wolfBoot_image * img )
181181{
182182 img -> canary_FEED4567 = 0xFEED4567UL ;
Original file line number Diff line number Diff line change @@ -83,6 +83,20 @@ extern "C" {
8383# endif
8484#endif
8585
86+ #ifndef NOINLINEFUNCTION
87+ # if defined(__has_attribute )
88+ # if __has_attribute (noinline )
89+ # define NOINLINEFUNCTION __attribute__((noinline))
90+ # else
91+ # define NOINLINEFUNCTION
92+ # endif
93+ # elif defined(__GNUC__ ) || defined(__CC_ARM )
94+ # define NOINLINEFUNCTION __attribute__((noinline))
95+ # else
96+ # define NOINLINEFUNCTION
97+ # endif
98+ #endif
99+
86100
87101/* Helpers for memory alignment */
88102#ifndef XALIGNED
Original file line number Diff line number Diff line change 5858/* Globals */
5959static uint8_t digest [WOLFBOOT_SHA_DIGEST_SIZE ] XALIGNED (4 );
6060
61- int __attribute__(( noinline )) image_CT_compare (
61+ int NOINLINEFUNCTION image_CT_compare (
6262 const uint8_t * expected , const uint8_t * actual , uint32_t len )
6363{
6464 uint8_t diff = 0 ;
You can’t perform that action at this time.
0 commit comments