diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:50 -0400 |
commit | 261f3b4979db88d29fc86aad9f76fbc0c2c6d21a (patch) | |
tree | 1cd1012b3ab52747a12e47f630b864d27af0bdf5 /drivers/misc/sgi-xp/xpc_sn2.c | |
parent | 81fe7883d2c8a80a7145ad22f8cd8514d05412b9 (diff) |
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>
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_sn2.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_sn2.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index 4b5f69edf0d2..fde870aebcb9 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c | |||
@@ -13,9 +13,9 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
18 | #include <asm/uncached.h> | 17 | #include <asm/uncached.h> |
18 | #include <asm/sn/mspec.h> | ||
19 | #include <asm/sn/sn_sal.h> | 19 | #include <asm/sn/sn_sal.h> |
20 | #include "xpc.h" | 20 | #include "xpc.h" |
21 | 21 | ||
@@ -176,7 +176,7 @@ xpc_send_IRQ_sn2(struct amo *amo, u64 flag, int nasid, int phys_cpuid, | |||
176 | 176 | ||
177 | local_irq_restore(irq_flags); | 177 | local_irq_restore(irq_flags); |
178 | 178 | ||
179 | return ((ret == 0) ? xpSuccess : xpPioReadError); | 179 | return (ret == 0) ? xpSuccess : xpPioReadError; |
180 | } | 180 | } |
181 | 181 | ||
182 | static struct amo * | 182 | static struct amo * |
@@ -284,7 +284,7 @@ xpc_handle_notify_IRQ_sn2(int irq, void *dev_id) | |||
284 | short partid = (short)(u64)dev_id; | 284 | short partid = (short)(u64)dev_id; |
285 | struct xpc_partition *part = &xpc_partitions[partid]; | 285 | struct xpc_partition *part = &xpc_partitions[partid]; |
286 | 286 | ||
287 | DBUG_ON(partid < 0 || partid >= xp_max_npartitions); | 287 | DBUG_ON(partid < 0 || partid >= XP_MAX_NPARTITIONS_SN2); |
288 | 288 | ||
289 | if (xpc_part_ref(part)) { | 289 | if (xpc_part_ref(part)) { |
290 | xpc_check_for_sent_chctl_flags_sn2(part); | 290 | xpc_check_for_sent_chctl_flags_sn2(part); |
@@ -577,6 +577,25 @@ xpc_allow_amo_ops_shub_wars_1_1_sn2(void) | |||
577 | } | 577 | } |
578 | 578 | ||
579 | static enum xp_retval | 579 | static enum xp_retval |
580 | xpc_get_partition_rsvd_page_pa_sn2(u64 buf, u64 *cookie, u64 *paddr, | ||
581 | size_t *len) | ||
582 | { | ||
583 | s64 status; | ||
584 | enum xp_retval ret; | ||
585 | |||
586 | status = sn_partition_reserved_page_pa(buf, cookie, paddr, len); | ||
587 | if (status == SALRET_OK) | ||
588 | ret = xpSuccess; | ||
589 | else if (status == SALRET_MORE_PASSES) | ||
590 | ret = xpNeedMoreInfo; | ||
591 | else | ||
592 | ret = xpSalError; | ||
593 | |||
594 | return ret; | ||
595 | } | ||
596 | |||
597 | |||
598 | static enum xp_retval | ||
580 | xpc_rsvd_page_init_sn2(struct xpc_rsvd_page *rp) | 599 | xpc_rsvd_page_init_sn2(struct xpc_rsvd_page *rp) |
581 | { | 600 | { |
582 | struct amo *amos_page; | 601 | struct amo *amos_page; |
@@ -636,7 +655,7 @@ xpc_rsvd_page_init_sn2(struct xpc_rsvd_page *rp) | |||
636 | 655 | ||
637 | /* clear xpc_vars_part_sn2 */ | 656 | /* clear xpc_vars_part_sn2 */ |
638 | memset((u64 *)xpc_vars_part_sn2, 0, sizeof(struct xpc_vars_part_sn2) * | 657 | memset((u64 *)xpc_vars_part_sn2, 0, sizeof(struct xpc_vars_part_sn2) * |
639 | xp_max_npartitions); | 658 | XP_MAX_NPARTITIONS_SN2); |
640 | 659 | ||
641 | /* initialize the activate IRQ related amo variables */ | 660 | /* initialize the activate IRQ related amo variables */ |
642 | for (i = 0; i < xpc_nasid_mask_nlongs; i++) | 661 | for (i = 0; i < xpc_nasid_mask_nlongs; i++) |
@@ -699,7 +718,7 @@ xpc_check_remote_hb_sn2(void) | |||
699 | 718 | ||
700 | remote_vars = (struct xpc_vars_sn2 *)xpc_remote_copy_buffer_sn2; | 719 | remote_vars = (struct xpc_vars_sn2 *)xpc_remote_copy_buffer_sn2; |
701 | 720 | ||
702 | for (partid = 0; partid < xp_max_npartitions; partid++) { | 721 | for (partid = 0; partid < XP_MAX_NPARTITIONS_SN2; partid++) { |
703 | 722 | ||
704 | if (xpc_exiting) | 723 | if (xpc_exiting) |
705 | break; | 724 | break; |
@@ -2386,6 +2405,7 @@ xpc_init_sn2(void) | |||
2386 | int ret; | 2405 | int ret; |
2387 | size_t buf_size; | 2406 | size_t buf_size; |
2388 | 2407 | ||
2408 | xpc_get_partition_rsvd_page_pa = xpc_get_partition_rsvd_page_pa_sn2; | ||
2389 | xpc_rsvd_page_init = xpc_rsvd_page_init_sn2; | 2409 | xpc_rsvd_page_init = xpc_rsvd_page_init_sn2; |
2390 | xpc_increment_heartbeat = xpc_increment_heartbeat_sn2; | 2410 | xpc_increment_heartbeat = xpc_increment_heartbeat_sn2; |
2391 | xpc_offline_heartbeat = xpc_offline_heartbeat_sn2; | 2411 | xpc_offline_heartbeat = xpc_offline_heartbeat_sn2; |