[PATCH rtems 1/2] cpu/armv7m: Avoid regions with negative size

Peter Dufault dufault at hda.com
Fri Jun 4 21:40:52 UTC 2021


Looks good to me.

> On Jun 4, 2021, at 03:47 , Christian Mauderer <christian.mauderer at embedded-brains.de> wrote:
> 
> Don't initialze regions that have a negative size (for example due to a
> wrong calculation).
> 
> Update #4450
> ---
> cpukit/score/cpu/arm/include/rtems/score/armv7m.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cpukit/score/cpu/arm/include/rtems/score/armv7m.h b/cpukit/score/cpu/arm/include/rtems/score/armv7m.h
> index 8f926e826a..a5eaaef418 100644
> --- a/cpukit/score/cpu/arm/include/rtems/score/armv7m.h
> +++ b/cpukit/score/cpu/arm/include/rtems/score/armv7m.h
> @@ -656,7 +656,7 @@ static inline void _ARMV7M_MPU_Set_region(
>   RTEMS_OBFUSCATE_VARIABLE(end);
>   size = (uintptr_t) end - (uintptr_t) begin;
> 
> -  if ( size > 0 ) {
> +  if ( (uintptr_t) end > (uintptr_t) begin ) {
>     rbar = (uintptr_t) begin | region | ARMV7M_MPU_RBAR_VALID;
>     rasr |= _ARMV7M_MPU_Get_region_size(size);
>   } else {
> --
> 2.26.2
> 
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering

This email is delivered through the public internet using protocols subject to interception and tampering.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210604/968eb12b/attachment.bin>


More information about the devel mailing list