summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/ChangeLog4
-rw-r--r--hurd/addr.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog
index d6d9ad7..42b4e3c 100644
--- a/hurd/ChangeLog
+++ b/hurd/ChangeLog
@@ -1,5 +1,9 @@
2008-12-05 Neal H. Walfield <neal@gnu.org>
+ * addr.h (PTR_TO_PAGE): Define.
+
+2008-12-05 Neal H. Walfield <neal@gnu.org>
+
* addr.h: Don't include <l4/math.h>. Include <math.h>.
(addr_depth): Use vg_lsb64, not l4_lsb64.
diff --git a/hurd/addr.h b/hurd/addr.h
index 571c8c0..40092b2 100644
--- a/hurd/addr.h
+++ b/hurd/addr.h
@@ -157,6 +157,10 @@ addr_extract (addr_t addr, int width)
#define PTR_TO_ADDR(ptr_) \
(ADDR ((uintptr_t) (ptr_), ADDR_BITS))
+/* Return the address of the page that would contain pointer PTR_. */
+#define PTR_TO_PAGE(ptr_) \
+ addr_chop (ADDR ((uintptr_t) (ptr_), ADDR_BITS), PAGESIZE_LOG2)
+
static inline addr_t
addr_add (addr_t addr, uint64_t count)
{