All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro
@ 2008-05-20 20:24 Andy Fleming
  2008-05-20 20:24 ` [U-Boot-Users] [PATCH 2/4] Add lmb_free Andy Fleming
  2008-05-20 21:09 ` [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 10+ messages in thread
From: Andy Fleming @ 2008-05-20 20:24 UTC (permalink / raw)
  To: u-boot

ALIGN() returns the smallest aligned value greater than the passed
in address or size.  Taken from Linux.

Signed-off-by: Andy Fleming <afleming@freescale.com>
---
 include/common.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/common.h b/include/common.h
index d0f5704..68e0cbc 100644
--- a/include/common.h
+++ b/include/common.h
@@ -671,6 +671,9 @@ void __attribute__((weak)) show_boot_progress (int val);
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
 
+#define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask)    (((x)+(mask))&~(mask))
+
 /* Multicore arch functions */
 #ifdef CONFIG_MP
 int cpu_status(int nr);
-- 
1.5.4.GIT

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-20 22:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20 20:24 [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro Andy Fleming
2008-05-20 20:24 ` [U-Boot-Users] [PATCH 2/4] Add lmb_free Andy Fleming
2008-05-20 20:24   ` [U-Boot-Users] [PATCH 3/4] Fix an underflow bug in __lmb_alloc_base Andy Fleming
2008-05-20 20:24     ` [U-Boot-Users] [PATCH 4/4] Resize device tree to allow space for board changes and the chosen node Andy Fleming
2008-05-20 21:11   ` [U-Boot-Users] [PATCH 2/4] Add lmb_free Jean-Christophe PLAGNIOL-VILLARD
2008-05-20 22:31     ` Wolfgang Denk
2008-05-20 21:09 ` [U-Boot-Users] [PATCH 1/4] Add ALIGN() macro Jean-Christophe PLAGNIOL-VILLARD
2008-05-20 21:54   ` Scott Wood
2008-05-20 22:33     ` Wolfgang Denk
2008-05-20 22:29   ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.