diff options
author | John M. Calandrino <jmc@jupiter-cs.cs.unc.edu> | 2007-04-23 20:44:22 -0400 |
---|---|---|
committer | John M. Calandrino <jmc@jupiter-cs.cs.unc.edu> | 2007-04-23 20:44:22 -0400 |
commit | 68de03e4f3d6ab361b50b7b44264bb802ca0a54d (patch) | |
tree | 8ab25491f34130c6a4878a3eee92717ac249f0ad /arch | |
parent | 7c071e2f42c301ebf73c9b8e63ad7ecd1d1a1d8e (diff) |
Converting spinlocks to queuelocks in my code, and also fixing stubs... in
process...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/pi_sem_syscalls.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/sem_syscalls.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/arch/i386/kernel/pi_sem_syscalls.c b/arch/i386/kernel/pi_sem_syscalls.c index f7a66da110..04584a12fb 100644 --- a/arch/i386/kernel/pi_sem_syscalls.c +++ b/arch/i386/kernel/pi_sem_syscalls.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/wait.h> | 10 | #include <linux/wait.h> |
11 | #include <linux/queuelock.h> | ||
11 | 12 | ||
12 | #define MAX_PI_SEMAPHORES 256 | 13 | #define MAX_PI_SEMAPHORES 256 |
13 | 14 | ||
@@ -110,14 +111,14 @@ asmlinkage long sys_pi_sema_free(pi_sema_id sem_id) | |||
110 | struct list_head *tmp, *next; | 111 | struct list_head *tmp, *next; |
111 | unsigned long flags; | 112 | unsigned long flags; |
112 | 113 | ||
113 | spin_lock_irqsave(&pi_sems[sem_id].wait.lock, flags); | 114 | queue_lock_irqsave(&pi_sems[sem_id].wait.lock, flags); |
114 | list_for_each_safe(tmp, next, &pi_sems[sem_id].wait.task_list) { | 115 | list_for_each_safe(tmp, next, &pi_sems[sem_id].wait.task_list) { |
115 | wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); | 116 | wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); |
116 | list_del(tmp); | 117 | list_del(tmp); |
117 | curr->func(curr, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, | 118 | curr->func(curr, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, |
118 | 0, NULL); | 119 | 0, NULL); |
119 | } | 120 | } |
120 | spin_unlock_irqrestore(&pi_sems[sem_id].wait.lock, flags); | 121 | queue_unlock_irqrestore(&pi_sems[sem_id].wait.lock, flags); |
121 | pi_sems[sem_id].used = 0; | 122 | pi_sems[sem_id].used = 0; |
122 | 123 | ||
123 | return 0; | 124 | return 0; |
diff --git a/arch/i386/kernel/sem_syscalls.c b/arch/i386/kernel/sem_syscalls.c index 2bdbc5fd96..03713f41e6 100644 --- a/arch/i386/kernel/sem_syscalls.c +++ b/arch/i386/kernel/sem_syscalls.c | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <asm/semaphore.h> | 7 | #include <asm/semaphore.h> |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/queuelock.h> | ||
9 | 10 | ||
10 | #define MAX_SEMAPHORES 256 | 11 | #define MAX_SEMAPHORES 256 |
11 | 12 | ||
@@ -63,14 +64,14 @@ asmlinkage long sys_sema_free(sema_id sem_id) | |||
63 | struct list_head *tmp, *next; | 64 | struct list_head *tmp, *next; |
64 | unsigned long flags; | 65 | unsigned long flags; |
65 | 66 | ||
66 | spin_lock_irqsave(&sems[sem_id].wait.lock, flags); | 67 | queue_lock_irqsave(&sems[sem_id].wait.lock, flags); |
67 | list_for_each_safe(tmp, next, &sems[sem_id].wait.task_list) { | 68 | list_for_each_safe(tmp, next, &sems[sem_id].wait.task_list) { |
68 | wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); | 69 | wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list); |
69 | list_del(tmp); | 70 | list_del(tmp); |
70 | curr->func(curr, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, | 71 | curr->func(curr, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, |
71 | 0, NULL); | 72 | 0, NULL); |
72 | } | 73 | } |
73 | spin_unlock_irqrestore(&sems[sem_id].wait.lock, flags); | 74 | queue_unlock_irqrestore(&sems[sem_id].wait.lock, flags); |
74 | sems[sem_id].used = 0; | 75 | sems[sem_id].used = 0; |
75 | 76 | ||
76 | return 0; | 77 | return 0; |