changeset 527:06ba1772ee9c

cp: move ADDR31 to a more logical place, add ADDR64 Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Mon, 25 Apr 2011 22:19:59 -0400
parents eb49ee3e562d
children 737dce57f60d
files cp/include/nucleus.h cp/include/page.h
diffstat 2 files changed, 25 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/cp/include/nucleus.h	Mon Apr 25 21:32:29 2011 -0400
+++ b/cp/include/nucleus.h	Mon Apr 25 22:19:59 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007-2010  Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * (C) Copyright 2007-2011  Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * This file is released under the GPLv2.  See the COPYING file for more
  * details.
@@ -50,24 +50,6 @@
 #include <config.h>
 
 /*
- * This should be as simple as a cast, but unfortunately, the BUG_ON check
- * is there to make sure we never submit a truncated address to the channels
- *
- * In the future, the io code should check if IDA is necessary, and in that
- * case allocate an IDAL & set the IDA ccw flag. Other parts of the system
- * that require 31-bit address should do whatever their equivalent action
- * is.
- */
-static inline u32 ADDR31(void *ptr)
-{
-	u64 ip = (u64) ptr;
-
-	BUG_ON(ip & ~0x7fffffffull);
-
-	return (u32) ip;
-}
-
-/*
  * stdio.h equivalents
  */
 struct console;
--- a/cp/include/page.h	Mon Apr 25 21:32:29 2011 -0400
+++ b/cp/include/page.h	Mon Apr 25 22:19:59 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007-2010  Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * (C) Copyright 2007-2011  Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * This file is released under the GPLv2.  See the COPYING file for more
  * details.
@@ -71,4 +71,27 @@
 	return IS_LOW_ZONE(page) ? ZONE_LOW : ZONE_NORMAL;
 }
 
+/*
+ * This should be as simple as a cast, but unfortunately, the BUG_ON check
+ * is there to make sure we never submit a truncated address to the channels
+ *
+ * In the future, the io code should check if IDA is necessary, and in that
+ * case allocate an IDAL & set the IDA ccw flag. Other parts of the system
+ * that require 31-bit address should do whatever their equivalent action
+ * is.
+ */
+static inline u32 ADDR31(void *ptr)
+{
+	u64 ip = (u64) ptr;
+
+	BUG_ON(ip & ~0x7fffffffull);
+
+	return (u32) ip;
+}
+
+static inline u64 ADDR64(void *ptr)
+{
+	return (u64) ptr;
+}
+
 #endif