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

Enforce WOLFSSL_SP_NO_UMAAL with _CORTEX_M_ASM #6793

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

danielinux
Copy link
Member

Description

Implicitly add WOLFSSL_SP_NO_UMAAL when WOLFSSL_SP_ARM_CORTEX_M_ASM is enabled

Testing

Tested via wolfBoot build

Copy link
Contributor

@dgarske dgarske left a 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.

Copy link
Contributor

@dgarske dgarske left a 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?

dgarske
dgarske previously approved these changes Sep 20, 2023
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Over to @SparkiDev

@dgarske dgarske assigned SparkiDev and unassigned danielinux Sep 20, 2023
@@ -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__)
Copy link
Contributor

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)

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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.

@dgarske
Copy link
Contributor

dgarske commented Sep 21, 2023

Retest this please

@dgarske dgarske assigned SparkiDev and wolfSSL-Bot and unassigned SparkiDev Sep 21, 2023
@SparkiDev SparkiDev merged commit 9442ec4 into wolfSSL:master Sep 21, 2023
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants