diff options
author | Robin Holt <holt@sgi.com> | 2009-04-13 17:40:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-13 18:04:33 -0400 |
commit | a7665b0a380585fbd70a2275f3120c6086e0c92d (patch) | |
tree | 01465e3d7a8bc917084e9a47789f3508c38307cf /drivers/misc/sgi-xp/xpc_partition.c | |
parent | efdd06ed181a88a11e612238c1ac04668e665395 (diff) |
sgi-xpc: clean up numerous globals
Introduce xpc_arch_ops and eliminate numerous individual global definitions.
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: 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 | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index 6722f6fe4dc7..65877bc5edaa 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -70,6 +70,9 @@ xpc_get_rsvd_page_pa(int nasid) | |||
70 | size_t buf_len = 0; | 70 | size_t buf_len = 0; |
71 | void *buf = buf; | 71 | void *buf = buf; |
72 | void *buf_base = NULL; | 72 | void *buf_base = NULL; |
73 | enum xp_retval (*get_partition_rsvd_page_pa) | ||
74 | (void *, u64 *, unsigned long *, size_t *) = | ||
75 | xpc_arch_ops.get_partition_rsvd_page_pa; | ||
73 | 76 | ||
74 | while (1) { | 77 | while (1) { |
75 | 78 | ||
@@ -79,8 +82,7 @@ xpc_get_rsvd_page_pa(int nasid) | |||
79 | * ??? function or have two versions? Rename rp_pa for UV to | 82 | * ??? function or have two versions? Rename rp_pa for UV to |
80 | * ??? rp_gpa? | 83 | * ??? rp_gpa? |
81 | */ | 84 | */ |
82 | ret = xpc_get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, | 85 | ret = get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, &len); |
83 | &len); | ||
84 | 86 | ||
85 | dev_dbg(xpc_part, "SAL returned with ret=%d, cookie=0x%016lx, " | 87 | dev_dbg(xpc_part, "SAL returned with ret=%d, cookie=0x%016lx, " |
86 | "address=0x%016lx, len=0x%016lx\n", ret, | 88 | "address=0x%016lx, len=0x%016lx\n", ret, |
@@ -172,7 +174,7 @@ xpc_setup_rsvd_page(void) | |||
172 | xpc_part_nasids = XPC_RP_PART_NASIDS(rp); | 174 | xpc_part_nasids = XPC_RP_PART_NASIDS(rp); |
173 | xpc_mach_nasids = XPC_RP_MACH_NASIDS(rp); | 175 | xpc_mach_nasids = XPC_RP_MACH_NASIDS(rp); |
174 | 176 | ||
175 | ret = xpc_setup_rsvd_page_sn(rp); | 177 | ret = xpc_arch_ops.setup_rsvd_page(rp); |
176 | if (ret != 0) | 178 | if (ret != 0) |
177 | return ret; | 179 | return ret; |
178 | 180 | ||
@@ -264,7 +266,7 @@ xpc_partition_disengaged(struct xpc_partition *part) | |||
264 | short partid = XPC_PARTID(part); | 266 | short partid = XPC_PARTID(part); |
265 | int disengaged; | 267 | int disengaged; |
266 | 268 | ||
267 | disengaged = !xpc_partition_engaged(partid); | 269 | disengaged = !xpc_arch_ops.partition_engaged(partid); |
268 | if (part->disengage_timeout) { | 270 | if (part->disengage_timeout) { |
269 | if (!disengaged) { | 271 | if (!disengaged) { |
270 | if (time_is_after_jiffies(part->disengage_timeout)) { | 272 | if (time_is_after_jiffies(part->disengage_timeout)) { |
@@ -280,7 +282,7 @@ xpc_partition_disengaged(struct xpc_partition *part) | |||
280 | dev_info(xpc_part, "deactivate request to remote " | 282 | dev_info(xpc_part, "deactivate request to remote " |
281 | "partition %d timed out\n", partid); | 283 | "partition %d timed out\n", partid); |
282 | xpc_disengage_timedout = 1; | 284 | xpc_disengage_timedout = 1; |
283 | xpc_assume_partition_disengaged(partid); | 285 | xpc_arch_ops.assume_partition_disengaged(partid); |
284 | disengaged = 1; | 286 | disengaged = 1; |
285 | } | 287 | } |
286 | part->disengage_timeout = 0; | 288 | part->disengage_timeout = 0; |
@@ -294,7 +296,7 @@ xpc_partition_disengaged(struct xpc_partition *part) | |||
294 | if (part->act_state != XPC_P_AS_INACTIVE) | 296 | if (part->act_state != XPC_P_AS_INACTIVE) |
295 | xpc_wakeup_channel_mgr(part); | 297 | xpc_wakeup_channel_mgr(part); |
296 | 298 | ||
297 | xpc_cancel_partition_deactivation_request(part); | 299 | xpc_arch_ops.cancel_partition_deactivation_request(part); |
298 | } | 300 | } |
299 | return disengaged; | 301 | return disengaged; |
300 | } | 302 | } |
@@ -339,7 +341,7 @@ xpc_deactivate_partition(const int line, struct xpc_partition *part, | |||
339 | spin_unlock_irqrestore(&part->act_lock, irq_flags); | 341 | spin_unlock_irqrestore(&part->act_lock, irq_flags); |
340 | if (reason == xpReactivating) { | 342 | if (reason == xpReactivating) { |
341 | /* we interrupt ourselves to reactivate partition */ | 343 | /* we interrupt ourselves to reactivate partition */ |
342 | xpc_request_partition_reactivation(part); | 344 | xpc_arch_ops.request_partition_reactivation(part); |
343 | } | 345 | } |
344 | return; | 346 | return; |
345 | } | 347 | } |
@@ -358,7 +360,7 @@ xpc_deactivate_partition(const int line, struct xpc_partition *part, | |||
358 | spin_unlock_irqrestore(&part->act_lock, irq_flags); | 360 | spin_unlock_irqrestore(&part->act_lock, irq_flags); |
359 | 361 | ||
360 | /* ask remote partition to deactivate with regard to us */ | 362 | /* ask remote partition to deactivate with regard to us */ |
361 | xpc_request_partition_deactivation(part); | 363 | xpc_arch_ops.request_partition_deactivation(part); |
362 | 364 | ||
363 | /* set a timelimit on the disengage phase of the deactivation request */ | 365 | /* set a timelimit on the disengage phase of the deactivation request */ |
364 | part->disengage_timeout = jiffies + (xpc_disengage_timelimit * HZ); | 366 | part->disengage_timeout = jiffies + (xpc_disengage_timelimit * HZ); |
@@ -496,7 +498,7 @@ xpc_discovery(void) | |||
496 | continue; | 498 | continue; |
497 | } | 499 | } |
498 | 500 | ||
499 | xpc_request_partition_activation(remote_rp, | 501 | xpc_arch_ops.request_partition_activation(remote_rp, |
500 | remote_rp_pa, nasid); | 502 | remote_rp_pa, nasid); |
501 | } | 503 | } |
502 | } | 504 | } |