[riot-notifications] [RIOT-OS/RIOT] cpu/cortexm_common: function to check address validity (#11358)

Francisco notifications at github.com
Thu Apr 11 18:04:52 CEST 2019

@kaspar030 I was dooing a final round of testing and found that the M0 catch wasn't working, well it was but the function was allwats returning 1. Looking in to it i found that:

```register uint32_t result __asm("r5") = 1;```

was being optimized in a way where result was always though to be 1. My fix was to load the register with 1 before assigning result to "r5". I'm honestly not very knowledge in assembly, so I would love your input on that fix, or a suggestion for a different one.

    __asm__ volatile (
        "ldr  r5, =0x1   \n" /* load r5 with 1 to set result    */

    /* R5 will be set to 0 by HardFault handler */
    /* to indicate HardFault has occured */
    register uint32_t result __asm("r5");

PS: didn't squash this late modification since I'm not sure why it wasn't a problem in the original branch, maybe my compiler version?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190411/63fc96c6/attachment.html>

More information about the notifications mailing list