summaryrefslogtreecommitdiffstats
path: root/src/include/util
diff options
context:
space:
mode:
authorMonte Copeland <copelanm@us.ibm.com>2011-11-16 09:02:17 -0600
committerMIKE J. JONES <mjjones@us.ibm.com>2011-11-21 12:32:19 -0600
commitd4b2086e646ac2444539bac0750af82e5e0b5d7c (patch)
treecf754de98935df10870b5aa96b2ec9cb270e8c8e /src/include/util
parent11c80c5abcf203e5a65098ea047fd6d2a6e607cc (diff)
downloadtalos-hostboot-d4b2086e646ac2444539bac0750af82e5e0b5d7c.tar.gz
talos-hostboot-d4b2086e646ac2444539bac0750af82e5e0b5d7c.zip
collectTrace to allow partial trace buffer collection
Change-Id: I06ce6df416f38c4619281180ea8515c90f8f2fab Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/498 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Tested-by: Jenkins Server
Diffstat (limited to 'src/include/util')
-rw-r--r--src/include/util/align.H18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/include/util/align.H b/src/include/util/align.H
index 55073256d..8ba0e06b9 100644
--- a/src/include/util/align.H
+++ b/src/include/util/align.H
@@ -25,14 +25,20 @@
#include <limits.h>
-// Return a number >= input that is aligned on a 4-byte boundary
-#define ALIGN_4(u) ((u + 0x3ull) & ~0x3ull)
+// Return a number >= input that is aligned up to the next 4-byte boundary
+#define ALIGN_4(u) (((u) + 0x3ull) & ~0x3ull)
-// Return a number >= input that is aligned on a 8-byte bounday
-#define ALIGN_8(u) ((u + 0x7ull) & ~0x7ull)
+// Return a number <= input that is rounded down to nearest 4-byte boundary
+#define ALIGN_DOWN_4(u) ((u) & ~3ull)
-// Return a number >= input that is aligned on a page boundary
-#define ALIGN_PAGE(u) ((u + (PAGESIZE-1)) & ~(PAGESIZE-1))
+// Return a number >= input that is aligned up to the next 8-byte bounday
+#define ALIGN_8(u) (((u) + 0x7ull) & ~0x7ull)
+
+// Return a number <= input that is rounded down to nearest 8-byte boundary
+#define ALIGN_DOWN_8(u) ((u) & ~7ull)
+
+// Return a number >= input that is aligned up to the next page boundary
+#define ALIGN_PAGE(u) (((u) + (PAGESIZE-1)) & ~(PAGESIZE-1))
// Return a number <= input that is aligned on a page boundary
#define ALIGN_PAGE_DOWN(u) ((u) - (u)%PAGESIZE)
OpenPOWER on IntegriCloud