diff options
author | John M. Calandrino <jmc@jupiter-cs.cs.unc.edu> | 2007-04-26 00:27:16 -0400 |
---|---|---|
committer | John M. Calandrino <jmc@jupiter-cs.cs.unc.edu> | 2007-04-26 00:27:16 -0400 |
commit | ac6d4bcecb73712b0eeeabd6acb0ac2465aa39dd (patch) | |
tree | 5c570ea766a8c3b5d7267b9b1b96d16a9ca9ab1b /arch | |
parent | a57fb73d6bcfd35774dc69ad5856a9c470b22df7 (diff) |
Changed task registration in SRP semaphores so that a pid is used rather
than a pointer to a task_struct. This eliminates the need to define the
task_struct struct in user space, and also makes the system call cleaner.
Required lookup of the task in the new system call.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/srp_sem_syscalls.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/i386/kernel/srp_sem_syscalls.c b/arch/i386/kernel/srp_sem_syscalls.c index 639f5821eb..24436a9bc8 100644 --- a/arch/i386/kernel/srp_sem_syscalls.c +++ b/arch/i386/kernel/srp_sem_syscalls.c | |||
@@ -113,14 +113,23 @@ asmlinkage long sys_srp_up(srp_sema_id sem_id) | |||
113 | * ceiling! (The ceiling would be meaningless anyway, as the SRP | 113 | * ceiling! (The ceiling would be meaningless anyway, as the SRP |
114 | * breaks without this a priori knowledge.) | 114 | * breaks without this a priori knowledge.) |
115 | */ | 115 | */ |
116 | asmlinkage long sys_reg_task_srp_sem(srp_sema_id sem_id, | 116 | asmlinkage long sys_reg_task_srp_sem(srp_sema_id sem_id, pid_t t_pid) |
117 | struct task_struct *t) | ||
118 | { | 117 | { |
119 | unsigned long flags; | 118 | unsigned long flags; |
119 | struct pid *task_pid; | ||
120 | struct task_struct *t; | ||
120 | 121 | ||
121 | if (sem_id < 0 || sem_id >= MAX_SRP_SEMAPHORES) | 122 | if (sem_id < 0 || sem_id >= MAX_SRP_SEMAPHORES) |
122 | return -EINVAL; | 123 | return -EINVAL; |
123 | 124 | ||
125 | task_pid = find_get_pid(t_pid); | ||
126 | if (!task_pid) | ||
127 | return -EINVAL; | ||
128 | |||
129 | t = get_pid_task(task_pid, PIDTYPE_PID); | ||
130 | if (!t) | ||
131 | return -EINVAL; | ||
132 | |||
124 | queue_lock_irqsave(&srp_lock, flags); | 133 | queue_lock_irqsave(&srp_lock, flags); |
125 | if (srp_higher_prio(t, srp_sems[sem_id].pc_task)) | 134 | if (srp_higher_prio(t, srp_sems[sem_id].pc_task)) |
126 | srp_sems[sem_id].pc_task = t; | 135 | srp_sems[sem_id].pc_task = t; |