-
Notifications
You must be signed in to change notification settings - Fork 830
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
Enforce WOLFSSL_SP_NO_UMAAL with _CORTEX_M_ASM #6793
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'd like @SparkiDev to review also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UMAAL exists on M4, not M3.
Here is the macro to tell difference:
M3: #define __ARM_ARCH_7M__ 1
M4: #define __ARM_ARCH_7EM__ 1
Perhaps this logic should go into sp.h?
4a6feb3
to
e73fcc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over to @SparkiDev
wolfssl/wolfcrypt/sp_int.h
Outdated
@@ -178,6 +178,15 @@ extern "C" { | |||
#define WOLFSSL_SP_DIV_WORD_HALF | |||
#endif | |||
|
|||
/* Detect Cortex M3 (no UMAAL)*/ | |||
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM | |||
#if defined(__ARM_ARCH) && (__ARM_ARCH < 8) && defined(__ARM_ARCH_7M__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be:
#if defined(__ARM_ARCH) && (__ARM_ARCH < 8) || defined(ARM_ARCH_7M)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that would disable it for M4. It could be just #if defined(ARM_ARCH_7M)
.
These are set exclusively (only one or the other) for each platform:
M3: #define __ARM_ARCH_7M__ 1
M4: #define __ARM_ARCH_7EM__ 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want I could rewrite to:
#if defined(WOLFSSL_SP_ARM_CORTEX_M_ASM) && defined(__ARM_ARCH_7M__)
#undef WOLFSSL_SP_NO_UMAAL
#define WOLFSSL_SP_NO_UMAAL
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK make it just ARM_ARCH_7M like in the your last comment.
e73fcc2
to
347394c
Compare
Retest this please |
Description
Implicitly add WOLFSSL_SP_NO_UMAAL when WOLFSSL_SP_ARM_CORTEX_M_ASM is enabled
Testing
Tested via wolfBoot build