summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-03-04 09:20:43 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-03-04 09:25:21 +0100
commite1fc23f057822b54ae7dceedcca025febdf4dcc2 (patch)
tree90ef6e1807a121b5e95846e713e11c405762f0a0
parentbsp/altera-cyclone-v: Adjust Doxygen file groups (diff)
downloadrtems-e1fc23f057822b54ae7dceedcca025febdf4dcc2.tar.bz2
bsps/powerpc: Fix PAGE_ALIGN() macros
Previous warning fixes which include <sys/param.h> broke this macro. The definition of PAGE_MASK changed.
-rw-r--r--bsps/powerpc/motorola_powerpc/bootloader/misc.c2
-rw-r--r--bsps/powerpc/motorola_powerpc/bootloader/mm.c2
-rw-r--r--bsps/powerpc/shared/start/pgtbl_setup.c2
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 <bsp.h>
/* 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 <limits.h>
/* 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)
/*