aboutsummaryrefslogtreecommitdiff
path: root/arch/ia64/sn/kernel/xp_main.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-17 12:52:21 -0500
committerTony Luck <tony.luck@intel.com>2006-01-17 13:53:24 -0800
commitf9e505a9a03df5acace6e758c8d12982635a1c64 (patch)
treec336b36fd18dd1fc1f316cb55ad52c67da2ffd8a /arch/ia64/sn/kernel/xp_main.c
parentac354a899b91239aac4d5893fc4288bc400e82b4 (diff)
[IA64-SGI] sn2 mutex conversion
Migrate sn2 code to use mutex and completion events rather than semaphores. Signed-off-by: Jes Sorensen <jes@sgi.com> Acked-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn/kernel/xp_main.c')
-rw-r--r--arch/ia64/sn/kernel/xp_main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/ia64/sn/kernel/xp_main.c b/arch/ia64/sn/kernel/xp_main.c
index 3be52a34c80..b7ea46645e1 100644
--- a/arch/ia64/sn/kernel/xp_main.c
+++ b/arch/ia64/sn/kernel/xp_main.c
@@ -19,6 +19,7 @@
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <asm/sn/intr.h>
#include <asm/sn/sn_sal.h>
#include <asm/sn/xp.h>
@@ -136,13 +137,13 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
registration = &xpc_registrations[ch_number];
- if (down_interruptible(&registration->sema) != 0) {
+ if (mutex_lock_interruptible(&registration->mutex) != 0) {
return xpcInterrupted;
}
/* if XPC_CHANNEL_REGISTERED(ch_number) */
if (registration->func != NULL) {
- up(&registration->sema);
+ mutex_unlock(&registration->mutex);
return xpcAlreadyRegistered;
}
@@ -154,7 +155,7 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size,
registration->key = key;
registration->func = func;
- up(&registration->sema);
+ mutex_unlock(&registration->mutex);
xpc_interface.connect(ch_number);
@@ -190,11 +191,11 @@ xpc_disconnect(int ch_number)
* figured XPC's users will just turn around and call xpc_disconnect()
* again anyways, so we might as well wait, if need be.
*/
- down(&registration->sema);
+ mutex_lock(&registration->mutex);
/* if !XPC_CHANNEL_REGISTERED(ch_number) */
if (registration->func == NULL) {
- up(&registration->sema);
+ mutex_unlock(&registration->mutex);
return;
}
@@ -208,7 +209,7 @@ xpc_disconnect(int ch_number)
xpc_interface.disconnect(ch_number);
- up(&registration->sema);
+ mutex_unlock(&registration->mutex);
return;
}
@@ -250,9 +251,9 @@ xp_init(void)
xp_nofault_PIOR_target = SH1_IPI_ACCESS;
}
- /* initialize the connection registration semaphores */
+ /* initialize the connection registration mutex */
for (ch_number = 0; ch_number < XPC_NCHANNELS; ch_number++) {
- sema_init(&xpc_registrations[ch_number].sema, 1); /* mutex */
+ mutex_init(&xpc_registrations[ch_number].mutex);
}
return 0;