sgi-xp: enable building of XPC/XPNET on x86_64
Get XPC/XPNET to build on x86_64. Trying to modprobe them up on a non-UV
or sn2 system will result in a -ENODEV.
Signed-off-by: Dean Nelson <dcn@sgi.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c
index 4b5f69e..fde870a 100644
--- a/drivers/misc/sgi-xp/xpc_sn2.c
+++ b/drivers/misc/sgi-xp/xpc_sn2.c
@@ -13,9 +13,9 @@
*
*/
-#include <linux/kernel.h>
#include <linux/delay.h>
#include <asm/uncached.h>
+#include <asm/sn/mspec.h>
#include <asm/sn/sn_sal.h>
#include "xpc.h"
@@ -176,7 +176,7 @@
local_irq_restore(irq_flags);
- return ((ret == 0) ? xpSuccess : xpPioReadError);
+ return (ret == 0) ? xpSuccess : xpPioReadError;
}
static struct amo *
@@ -284,7 +284,7 @@
short partid = (short)(u64)dev_id;
struct xpc_partition *part = &xpc_partitions[partid];
- DBUG_ON(partid < 0 || partid >= xp_max_npartitions);
+ DBUG_ON(partid < 0 || partid >= XP_MAX_NPARTITIONS_SN2);
if (xpc_part_ref(part)) {
xpc_check_for_sent_chctl_flags_sn2(part);
@@ -577,6 +577,25 @@
}
static enum xp_retval
+xpc_get_partition_rsvd_page_pa_sn2(u64 buf, u64 *cookie, u64 *paddr,
+ size_t *len)
+{
+ s64 status;
+ enum xp_retval ret;
+
+ status = sn_partition_reserved_page_pa(buf, cookie, paddr, len);
+ if (status == SALRET_OK)
+ ret = xpSuccess;
+ else if (status == SALRET_MORE_PASSES)
+ ret = xpNeedMoreInfo;
+ else
+ ret = xpSalError;
+
+ return ret;
+}
+
+
+static enum xp_retval
xpc_rsvd_page_init_sn2(struct xpc_rsvd_page *rp)
{
struct amo *amos_page;
@@ -636,7 +655,7 @@
/* clear xpc_vars_part_sn2 */
memset((u64 *)xpc_vars_part_sn2, 0, sizeof(struct xpc_vars_part_sn2) *
- xp_max_npartitions);
+ XP_MAX_NPARTITIONS_SN2);
/* initialize the activate IRQ related amo variables */
for (i = 0; i < xpc_nasid_mask_nlongs; i++)
@@ -699,7 +718,7 @@
remote_vars = (struct xpc_vars_sn2 *)xpc_remote_copy_buffer_sn2;
- for (partid = 0; partid < xp_max_npartitions; partid++) {
+ for (partid = 0; partid < XP_MAX_NPARTITIONS_SN2; partid++) {
if (xpc_exiting)
break;
@@ -2386,6 +2405,7 @@
int ret;
size_t buf_size;
+ xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2;
xpc_rsvd_page_init = xpc_rsvd_page_init_sn2;
xpc_increment_heartbeat = xpc_increment_heartbeat_sn2;
xpc_offline_heartbeat = xpc_offline_heartbeat_sn2;