diff --git a/bsps/powerpc/motorola_powerpc/bootloader/misc.c b/bsps/powerpc/motorola_powerpc/bootloader/misc.c index 40bd8a71fd..0b8e42c83a 100644 --- a/bsps/powerpc/motorola_powerpc/bootloader/misc.c +++ b/bsps/powerpc/motorola_powerpc/bootloader/misc.c @@ -25,7 +25,7 @@ #include /* to align the pointer to the (next) page boundary */ -#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) +#define PAGE_ALIGN(addr) (((addr) + PAGE_MASK) & ~PAGE_MASK) SPR_RO(PPC_PVR) diff --git a/bsps/powerpc/motorola_powerpc/bootloader/mm.c b/bsps/powerpc/motorola_powerpc/bootloader/mm.c index 13479cb106..1b3df41d49 100644 --- a/bsps/powerpc/motorola_powerpc/bootloader/mm.c +++ b/bsps/powerpc/motorola_powerpc/bootloader/mm.c @@ -45,7 +45,7 @@ #include /* to align the pointer to the (next) page boundary */ -#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) +#define PAGE_ALIGN(addr) (((addr) + PAGE_MASK) & ~PAGE_MASK) extern void (tlb_handlers)(void); extern void (_handler_glue)(void); diff --git a/bsps/powerpc/shared/start/pgtbl_setup.c b/bsps/powerpc/shared/start/pgtbl_setup.c index f2543f5ff3..a52e73b380 100644 --- a/bsps/powerpc/shared/start/pgtbl_setup.c +++ b/bsps/powerpc/shared/start/pgtbl_setup.c @@ -16,7 +16,7 @@ * *pmemsize by the size of the page table. */ /* to align the pointer to the (next) page boundary */ -#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) +#define PAGE_ALIGN(addr) (((addr) + PAGE_MASK) & ~PAGE_MASK) /*