mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-25 08:59:32 +08:00
bsps/aarch64: Fix warning on ILP32
ILP32 can't represent 4GB in uintptr_t. Avoid the warning that this assignment generates and update MMU config processing to avoid overflow when ILP32 is in use.
This commit is contained in:
committed by
Gedare Bloom
parent
b40fba2686
commit
2cc6af6188
@@ -264,9 +264,9 @@ aarch64_mmu_set_translation_table_entries(
|
||||
{
|
||||
uint64_t max_mappable = 1LLU << aarch64_mmu_get_cpu_pa_bits();
|
||||
/* Align to page boundaries */
|
||||
uintptr_t begin = RTEMS_ALIGN_DOWN( config->begin, MMU_PAGE_SIZE );
|
||||
uintptr_t end = RTEMS_ALIGN_UP( config->end, MMU_PAGE_SIZE );
|
||||
uintptr_t size = end - begin;
|
||||
uint64_t begin = RTEMS_ALIGN_DOWN( config->begin, MMU_PAGE_SIZE );
|
||||
uint64_t end = RTEMS_ALIGN_UP( (uint64_t) config->end, MMU_PAGE_SIZE );
|
||||
uint64_t size = end - begin;
|
||||
|
||||
if ( config->begin == config->end ) {
|
||||
return RTEMS_SUCCESSFUL;
|
||||
|
||||
@@ -54,7 +54,12 @@ aarch64_mmu_config_table[] = {
|
||||
/* Map OCM space */
|
||||
}, {
|
||||
.begin = 0xfffc0000U,
|
||||
.end = 0x100000000U,
|
||||
/*
|
||||
* This should be 4GB, but uintptr_t can't hold that for ILP32. This will be
|
||||
* rounded up to MMU page alignment during initial setup and will end up
|
||||
* being 4GB anyway.
|
||||
*/
|
||||
.end = 0xffffffffU,
|
||||
.flags = AARCH64_MMU_DATA_RW
|
||||
}, { /* DDRMC_region1_mem, if not used size is 0 and ignored */
|
||||
.begin = (uintptr_t) bsp_r1_ram_base,
|
||||
|
||||
Reference in New Issue
Block a user