diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:49 -0400 |
commit | bc63d387e4f5dbbe4ea0c5ade862c38073fd7fa3 (patch) | |
tree | ebeb9a381224a935fc50697902fcc38b9df47d90 /drivers/misc/sgi-xp/xpc_partition.c | |
parent | 78ce1bbe446e9b46dcd6c1e60a4768448a8ce355 (diff) |
sgi-xp: support runtime selection of xp_max_npartitions
Support runtime selection of the max number of partitions based on the
hardware being run on.
Signed-off-by: Dean Nelson <dcn@sgi.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_partition.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_partition.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index 7dd4b5812c42..02a858eddd8d 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -51,13 +51,7 @@ struct xpc_vars_part *xpc_vars_part; | |||
51 | static int xp_nasid_mask_bytes; /* actual size in bytes of nasid mask */ | 51 | static int xp_nasid_mask_bytes; /* actual size in bytes of nasid mask */ |
52 | static int xp_nasid_mask_words; /* actual size in words of nasid mask */ | 52 | static int xp_nasid_mask_words; /* actual size in words of nasid mask */ |
53 | 53 | ||
54 | /* | 54 | struct xpc_partition *xpc_partitions; |
55 | * For performance reasons, each entry of xpc_partitions[] is cacheline | ||
56 | * aligned. And xpc_partitions[] is padded with an additional entry at the | ||
57 | * end so that the last legitimate entry doesn't share its cacheline with | ||
58 | * another variable. | ||
59 | */ | ||
60 | struct xpc_partition xpc_partitions[XP_MAX_PARTITIONS + 1]; | ||
61 | 55 | ||
62 | /* | 56 | /* |
63 | * Generic buffer used to store a local copy of portions of a remote | 57 | * Generic buffer used to store a local copy of portions of a remote |
@@ -261,7 +255,7 @@ xpc_rsvd_page_init(void) | |||
261 | 255 | ||
262 | /* clear xpc_vars_part */ | 256 | /* clear xpc_vars_part */ |
263 | memset((u64 *)xpc_vars_part, 0, sizeof(struct xpc_vars_part) * | 257 | memset((u64 *)xpc_vars_part, 0, sizeof(struct xpc_vars_part) * |
264 | XP_MAX_PARTITIONS); | 258 | xp_max_npartitions); |
265 | 259 | ||
266 | /* initialize the activate IRQ related AMO variables */ | 260 | /* initialize the activate IRQ related AMO variables */ |
267 | for (i = 0; i < xp_nasid_mask_words; i++) | 261 | for (i = 0; i < xp_nasid_mask_words; i++) |
@@ -408,7 +402,7 @@ xpc_check_remote_hb(void) | |||
408 | 402 | ||
409 | remote_vars = (struct xpc_vars *)xpc_remote_copy_buffer; | 403 | remote_vars = (struct xpc_vars *)xpc_remote_copy_buffer; |
410 | 404 | ||
411 | for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) { | 405 | for (partid = 0; partid < xp_max_npartitions; partid++) { |
412 | 406 | ||
413 | if (xpc_exiting) | 407 | if (xpc_exiting) |
414 | break; | 408 | break; |
@@ -487,10 +481,8 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids, | |||
487 | 481 | ||
488 | /* check that the partid is for another partition */ | 482 | /* check that the partid is for another partition */ |
489 | 483 | ||
490 | if (remote_rp->partid < 1 || | 484 | if (remote_rp->partid < 0 || remote_rp->partid >= xp_max_npartitions) |
491 | remote_rp->partid > (XP_MAX_PARTITIONS - 1)) { | ||
492 | return xpInvalidPartid; | 485 | return xpInvalidPartid; |
493 | } | ||
494 | 486 | ||
495 | if (remote_rp->partid == sn_partition_id) | 487 | if (remote_rp->partid == sn_partition_id) |
496 | return xpLocalPartid; | 488 | return xpLocalPartid; |