diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:50 -0400 |
commit | ee6665e3b6e1283c30ae240732af1345bc02154e (patch) | |
tree | 91fbfb2a4cab26e3979df44a9bdcd6851efc9c50 /drivers/misc/sgi-xp/xpc_partition.c | |
parent | a7b4d509205db5e9cd3ffc77b306d7b10fe6a34d (diff) |
sgi-xp: isolate remote copy buffer to sn2 only
Make the remote copy buffer an sn2 only item.
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 | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index c769ab8f74ef..9f104450478f 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -34,21 +34,12 @@ struct xpc_rsvd_page *xpc_rsvd_page; | |||
34 | static u64 *xpc_part_nasids; | 34 | static u64 *xpc_part_nasids; |
35 | u64 *xpc_mach_nasids; | 35 | u64 *xpc_mach_nasids; |
36 | 36 | ||
37 | /* >>> next two variables should be 'xpc_' if they remain here */ | 37 | static int xpc_sizeof_nasid_mask; /* actual size in bytes of nasid mask */ |
38 | static int xp_sizeof_nasid_mask; /* actual size in bytes of nasid mask */ | 38 | int xpc_nasid_mask_words; /* actual size in words of nasid mask */ |
39 | int xp_nasid_mask_words; /* actual size in words of nasid mask */ | ||
40 | 39 | ||
41 | struct xpc_partition *xpc_partitions; | 40 | struct xpc_partition *xpc_partitions; |
42 | 41 | ||
43 | /* | 42 | /* |
44 | * Generic buffer used to store a local copy of portions of a remote | ||
45 | * partition's reserved page (either its header and part_nasids mask, | ||
46 | * or its vars). | ||
47 | */ | ||
48 | char *xpc_remote_copy_buffer; | ||
49 | void *xpc_remote_copy_buffer_base; | ||
50 | |||
51 | /* | ||
52 | * Guarantee that the kmalloc'd memory is cacheline aligned. | 43 | * Guarantee that the kmalloc'd memory is cacheline aligned. |
53 | */ | 44 | */ |
54 | void * | 45 | void * |
@@ -176,9 +167,9 @@ xpc_setup_rsvd_page(void) | |||
176 | /* SAL_version 1 didn't set the nasids_size field */ | 167 | /* SAL_version 1 didn't set the nasids_size field */ |
177 | rp->SAL_nasids_size = 128; | 168 | rp->SAL_nasids_size = 128; |
178 | } | 169 | } |
179 | xp_sizeof_nasid_mask = rp->SAL_nasids_size; | 170 | xpc_sizeof_nasid_mask = rp->SAL_nasids_size; |
180 | xp_nasid_mask_words = DIV_ROUND_UP(xp_sizeof_nasid_mask, | 171 | xpc_nasid_mask_words = DIV_ROUND_UP(xpc_sizeof_nasid_mask, |
181 | BYTES_PER_WORD); | 172 | BYTES_PER_WORD); |
182 | 173 | ||
183 | /* setup the pointers to the various items in the reserved page */ | 174 | /* setup the pointers to the various items in the reserved page */ |
184 | xpc_part_nasids = XPC_RP_PART_NASIDS(rp); | 175 | xpc_part_nasids = XPC_RP_PART_NASIDS(rp); |
@@ -222,14 +213,14 @@ xpc_get_remote_rp(int nasid, u64 *discovered_nasids, | |||
222 | 213 | ||
223 | /* pull over the reserved page header and part_nasids mask */ | 214 | /* pull over the reserved page header and part_nasids mask */ |
224 | ret = xp_remote_memcpy(remote_rp, (void *)*remote_rp_pa, | 215 | ret = xp_remote_memcpy(remote_rp, (void *)*remote_rp_pa, |
225 | XPC_RP_HEADER_SIZE + xp_sizeof_nasid_mask); | 216 | XPC_RP_HEADER_SIZE + xpc_sizeof_nasid_mask); |
226 | if (ret != xpSuccess) | 217 | if (ret != xpSuccess) |
227 | return ret; | 218 | return ret; |
228 | 219 | ||
229 | if (discovered_nasids != NULL) { | 220 | if (discovered_nasids != NULL) { |
230 | u64 *remote_part_nasids = XPC_RP_PART_NASIDS(remote_rp); | 221 | u64 *remote_part_nasids = XPC_RP_PART_NASIDS(remote_rp); |
231 | 222 | ||
232 | for (i = 0; i < xp_nasid_mask_words; i++) | 223 | for (i = 0; i < xpc_nasid_mask_words; i++) |
233 | discovered_nasids[i] |= remote_part_nasids[i]; | 224 | discovered_nasids[i] |= remote_part_nasids[i]; |
234 | } | 225 | } |
235 | 226 | ||
@@ -414,12 +405,12 @@ xpc_discovery(void) | |||
414 | enum xp_retval ret; | 405 | enum xp_retval ret; |
415 | 406 | ||
416 | remote_rp = xpc_kmalloc_cacheline_aligned(XPC_RP_HEADER_SIZE + | 407 | remote_rp = xpc_kmalloc_cacheline_aligned(XPC_RP_HEADER_SIZE + |
417 | xp_sizeof_nasid_mask, | 408 | xpc_sizeof_nasid_mask, |
418 | GFP_KERNEL, &remote_rp_base); | 409 | GFP_KERNEL, &remote_rp_base); |
419 | if (remote_rp == NULL) | 410 | if (remote_rp == NULL) |
420 | return; | 411 | return; |
421 | 412 | ||
422 | discovered_nasids = kzalloc(sizeof(u64) * xp_nasid_mask_words, | 413 | discovered_nasids = kzalloc(sizeof(u64) * xpc_nasid_mask_words, |
423 | GFP_KERNEL); | 414 | GFP_KERNEL); |
424 | if (discovered_nasids == NULL) { | 415 | if (discovered_nasids == NULL) { |
425 | kfree(remote_rp_base); | 416 | kfree(remote_rp_base); |
@@ -521,10 +512,10 @@ xpc_initiate_partid_to_nasids(short partid, void *nasid_mask) | |||
521 | if (part->remote_rp_pa == 0) | 512 | if (part->remote_rp_pa == 0) |
522 | return xpPartitionDown; | 513 | return xpPartitionDown; |
523 | 514 | ||
524 | memset(nasid_mask, 0, XP_NASID_MASK_BYTES); | 515 | memset(nasid_mask, 0, xpc_sizeof_nasid_mask); |
525 | 516 | ||
526 | part_nasid_pa = (u64)XPC_RP_PART_NASIDS(part->remote_rp_pa); | 517 | part_nasid_pa = (u64)XPC_RP_PART_NASIDS(part->remote_rp_pa); |
527 | 518 | ||
528 | return xp_remote_memcpy(nasid_mask, (void *)part_nasid_pa, | 519 | return xp_remote_memcpy(nasid_mask, (void *)part_nasid_pa, |
529 | xp_sizeof_nasid_mask); | 520 | xpc_sizeof_nasid_mask); |
530 | } | 521 | } |