diff options
Diffstat (limited to 'cpukit/score/cpu/arm/aarch32-psma-init.c')
-rw-r--r-- | cpukit/score/cpu/arm/aarch32-psma-init.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpukit/score/cpu/arm/aarch32-psma-init.c b/cpukit/score/cpu/arm/aarch32-psma-init.c index ee9338f050..93a3673a98 100644 --- a/cpukit/score/cpu/arm/aarch32-psma-init.c +++ b/cpukit/score/cpu/arm/aarch32-psma-init.c @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,7 +45,7 @@ #include <rtems/score/aarch32-system-registers.h> #include <rtems/score/cpu.h> -#define AARCH32_PSMA_REGION_MAX \ +#define AARCH32_PMSA_REGION_MAX \ ( ( AARCH32_MPUIR_REGION_MASK >> AARCH32_MPUIR_REGION_SHIFT ) + 1 ) static void _AArch32_PMSA_Configure( @@ -133,16 +133,16 @@ size_t _AArch32_PMSA_Map_sections_to_regions( if ( attr == region_attr ) { uint32_t region_end; - if ( end == region_base ) { - /* Extend the region region */ + if ( end - region_base <= AARCH32_PMSA_MIN_REGION_ALIGN ) { + /* Extend the region */ regions[ ri ].base = base; break; } region_end = region_limit + AARCH32_PMSA_MIN_REGION_ALIGN; - if ( base == region_end ) { - /* Extend the region region */ + if ( region_end - base <= AARCH32_PMSA_MIN_REGION_ALIGN ) { + /* Extend the region */ regions[ ri ].limit = limit; break; } @@ -153,7 +153,7 @@ size_t _AArch32_PMSA_Map_sections_to_regions( } } - if ( end <= region_base ) { + if ( base <= region_base ) { size_t i; if ( region_used >= region_max ) { @@ -196,7 +196,7 @@ void _AArch32_PMSA_Initialize( size_t section_count ) { - AArch32_PMSA_Region regions[ AARCH32_PSMA_REGION_MAX ]; + AArch32_PMSA_Region regions[ AARCH32_PMSA_REGION_MAX ]; size_t region_max; size_t region_used; |