arm_mpu:Fix mpu_initialize not taking effect
Modified the input parameters of mpu_initialize to require the caller to provide the number of entries in the table Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
parent
62f598e547
commit
054c564a2d
|
@ -558,6 +558,7 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
* Input Parameters:
|
||||
* table - MPU initialization table.
|
||||
* count - Initialize the number of entries in the region table.
|
||||
* hfnmiena - A boolean indicating whether the MPU should enable the
|
||||
* HFNMIENA bit.
|
||||
* privdefena - A boolean indicating whether the MPU should enable the
|
||||
|
@ -568,14 +569,14 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mpu_initialize(const struct mpu_region_s *table, bool hfnmiena,
|
||||
bool privdefena)
|
||||
void mpu_initialize(const struct mpu_region_s *table, size_t count,
|
||||
bool hfnmiena, bool privdefena)
|
||||
{
|
||||
const struct mpu_region_s *conf;
|
||||
int index;
|
||||
size_t index;
|
||||
|
||||
mpu_control(false, false, false);
|
||||
for (index = 0; index < nitems(table); index++)
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
conf = &table[index];
|
||||
mpu_configure_region(conf->base, conf->size, conf->flags);
|
||||
|
|
|
@ -380,6 +380,7 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
* Input Parameters:
|
||||
* table - MPU initialization table.
|
||||
* count - Initialize the number of entries in the region table.
|
||||
* hfnmiena - A boolean indicating whether the MPU should enable the
|
||||
* HFNMIENA bit.
|
||||
* privdefena - A boolean indicating whether the MPU should enable the
|
||||
|
@ -390,8 +391,8 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mpu_initialize(const struct mpu_region_s *table, bool hfnmiena,
|
||||
bool privdefena);
|
||||
void mpu_initialize(const struct mpu_region_s *table, size_t count,
|
||||
bool hfnmiena, bool privdefena);
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
|
|
|
@ -486,19 +486,20 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
* Input Parameters:
|
||||
* table - MPU Initiaze table.
|
||||
* count - Initialize the number of entries in the region table.
|
||||
*
|
||||
* Returned Value:
|
||||
* NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mpu_initialize(const struct mpu_region_s *table)
|
||||
void mpu_initialize(const struct mpu_region_s *table, size_t count)
|
||||
{
|
||||
const struct mpu_region_s *conf;
|
||||
int index;
|
||||
size_t index;
|
||||
|
||||
mpu_control(false);
|
||||
for (index = 0; index < nitems(table); index++)
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
conf = &table[index];
|
||||
mpu_configure_region(conf->base, conf->size, conf->flags);
|
||||
|
|
|
@ -318,13 +318,14 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
* Input Parameters:
|
||||
* table - MPU Initiaze table.
|
||||
* count - Initialize the number of entries in the region table.
|
||||
*
|
||||
* Returned Value:
|
||||
* NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mpu_initialize(const struct mpu_region_s *table);
|
||||
void mpu_initialize(const struct mpu_region_s *table, size_t count);
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
|
|
|
@ -289,6 +289,7 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
* Input Parameters:
|
||||
* table - MPU initialization table.
|
||||
* count - Initialize the number of entries in the region table.
|
||||
* hfnmiena - A boolean indicating whether the MPU should enable the
|
||||
* HFNMIENA bit.
|
||||
* privdefena - A boolean indicating whether the MPU should enable the
|
||||
|
@ -299,14 +300,14 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mpu_initialize(const struct mpu_region_s *table, bool hfnmiena,
|
||||
bool privdefena)
|
||||
void mpu_initialize(const struct mpu_region_s *table, size_t count,
|
||||
bool hfnmiena, bool privdefena)
|
||||
{
|
||||
const struct mpu_region_s *conf;
|
||||
int index;
|
||||
size_t index;
|
||||
|
||||
mpu_control(false, false, false);
|
||||
for (index = 0; index < nitems(table); index++)
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
conf = &table[index];
|
||||
mpu_configure_region(conf->base, conf->size, conf->flags1,
|
||||
|
|
|
@ -347,6 +347,7 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
* Input Parameters:
|
||||
* table - MPU initialization table.
|
||||
* count - Initialize the number of entries in the region table.
|
||||
* hfnmiena - A boolean indicating whether the MPU should enable the
|
||||
* HFNMIENA bit.
|
||||
* privdefena - A boolean indicating whether the MPU should enable the
|
||||
|
@ -357,8 +358,8 @@ unsigned int mpu_configure_region(uintptr_t base, size_t size,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void mpu_initialize(const struct mpu_region_s *table, bool hfnmiena,
|
||||
bool privdefena);
|
||||
void mpu_initialize(const struct mpu_region_s *table, size_t count,
|
||||
bool hfnmiena, bool privdefena);
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
|
|
Loading…
Reference in New Issue