Skip to content

Commit cd347b5

Browse files
committed
Fix visibility of new nsc declarations
1 parent d6ba220 commit cd347b5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

include/wolfboot/wolfboot.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,31 +411,37 @@ int wolfBoot_set_encrypt_key(const uint8_t *key, const uint8_t *nonce);
411411
int wolfBoot_get_encrypt_key(uint8_t *key, uint8_t *nonce);
412412
int wolfBoot_erase_encrypt_key(void);
413413

414-
#ifndef __WOLFBOOT
414+
#if !defined(__WOLFBOOT) && defined(WOLFCRYPT_SECURE_MODE)
415415

416416
/* Applications can access update success/trigger and flash erase/write
417417
* via non-secure callable, to facilitate updates
418418
*/
419419

420420
/* Call wolfBoot_success from non-secure application */
421+
422+
__attribute__((cmse_nonsecure_entry))
421423
void wolfBoot_nsc_success(void);
422424

423425
/* Call wolfBoot_update_trigger from non-secure application */
426+
__attribute__((cmse_nonsecure_entry))
424427
void wolfBoot_nsc_update_trigger(void);
425428

426429
/* Erase one or more sectors in the update partition.
427430
* - address: offset within the update partition ('0' corresponds to PARTITION_UPDATE_ADDRESS)
428431
* - len: size, in bytes
429432
*/
433+
__attribute__((cmse_nonsecure_entry))
430434
int wolfBoot_nsc_erase_update(uint32_t address, uint32_t len);
431435

432436
/* Write the content of buffer `buf` and size `len` to the update partition,
433437
* at offset address, from non-secure application
434438
* - address: offset within the update partition ('0' corresponds to PARTITION_UPDATE_ADDRESS)
435439
* - len: size, in bytes
436440
*/
441+
__attribute__((cmse_nonsecure_entry))
437442
int wolfBoot_nsc_write_update(uint32_t address, const uint8_t *buf, uint32_t len);
438-
#endif /* !__WOLFBOOT */
443+
444+
#endif /* !__WOLFBOOT && WOLFCRYPT_SECURE_MODE */
439445

440446

441447
#ifdef __cplusplus

src/libwolfboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ int wolfBoot_ram_decrypt(uint8_t *src, uint8_t *dst)
19851985
#endif /* MMU */
19861986
#endif /* EXT_ENCRYPTED */
19871987

1988-
#if defined(WOLFCRYPT_SECURE_MODE)
1988+
#if defined(__WOLFBOOT) && defined(WOLFCRYPT_SECURE_MODE)
19891989
__attribute__((cmse_nonsecure_entry))
19901990
void wolfBoot_nsc_success(void)
19911991
{

0 commit comments

Comments
 (0)