From e1fc23f057822b54ae7dceedcca025febdf4dcc2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 4 Mar 2019 09:20:43 +0100 Subject: [PATCH] bsps/powerpc: Fix PAGE_ALIGN() macros Previous warning fixes which include broke this macro. The definition of PAGE_MASK changed. --- bsps/powerpc/motorola_powerpc/bootloader/misc.c | 2 +- bsps/powerpc/motorola_powerpc/bootloader/mm.c | 2 +- bsps/powerpc/shared/start/pgtbl_setup.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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) /*