|
From: <sv...@va...> - 2009-05-09 12:33:00
|
Author: bart
Date: 2009-05-09 13:32:56 +0100 (Sat, 09 May 2009)
New Revision: 9804
Log:
Added two more functions.
Modified:
branches/DRDDEV/drd/drd_bitmap.h
Modified: branches/DRDDEV/drd/drd_bitmap.h
===================================================================
--- branches/DRDDEV/drd/drd_bitmap.h 2009-05-09 10:51:27 UTC (rev 9803)
+++ branches/DRDDEV/drd/drd_bitmap.h 2009-05-09 12:32:56 UTC (rev 9804)
@@ -78,6 +78,26 @@
UWord address_lsb(const Addr a)
{ return (a >> ADDR_IGNORED_BITS) & ADDR_LSB_MASK; }
+/**
+ * Compute the first address for which address_lsb() is equal to
+ * address_lsb(a).
+ */
+static __inline__
+Addr first_address_with_same_lsb(const Addr a)
+{
+ return ((a | ADDR_IGNORED_MASK) ^ ADDR_IGNORED_MASK);
+}
+
+/**
+ * Compute the first address for which address_lsb() is greater than
+ * address_lsb(a).
+ */
+static __inline__
+Addr first_address_with_higher_lsb(const Addr a)
+{
+ return ((a | ADDR_IGNORED_MASK) + 1U);
+}
+
/** Compute most significant bits of an address of type Addr. */
static __inline__
UWord address_msb(const Addr a)
|