aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn M. Calandrino <jmc@jupiter-cs.cs.unc.edu>2007-04-18 00:38:57 -0400
committerJohn M. Calandrino <jmc@jupiter-cs.cs.unc.edu>2007-04-18 00:38:57 -0400
commit4838ef57bb645fcf41c0a33b3c08ea97680e4307 (patch)
tree1f158c7e46ecf89e77a5b834d14c39b53507a955 /include
parent2079fe2e162a13929631e5ef00992e0c0d09f614 (diff)
Added stubs for modifying "semaphore" priority, in order to facilitate
priority inheritance. Also fixed a few bugs. Many files were modified, as the PI semaphores were are implementing replicate much of the original Linux semaphore implementation with minor changes, often causing a cascade of changes as functions were chased down and changed in several files.
Diffstat (limited to 'include')
-rw-r--r--include/linux/rt_param.h15
-rw-r--r--include/linux/wait.h2
2 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/rt_param.h b/include/linux/rt_param.h
index c5c0452314..d79b100052 100644
--- a/include/linux/rt_param.h
+++ b/include/linux/rt_param.h
@@ -5,6 +5,8 @@
5#ifndef _LINUX_RT_PARAM_H_ 5#ifndef _LINUX_RT_PARAM_H_
6#define _LINUX_RT_PARAM_H_ 6#define _LINUX_RT_PARAM_H_
7 7
8#include <linux/wait.h>
9
8typedef unsigned long jiffie_t; 10typedef unsigned long jiffie_t;
9 11
10/* different types of clients */ 12/* different types of clients */
@@ -115,7 +117,7 @@ memset(&(t)->rt_param,0, sizeof(struct task_rt_param))
115 (t)->rt_param.times.exec_time)) 117 (t)->rt_param.times.exec_time))
116 118
117 119
118/* real-time comparisn macros */ 120/* real-time comparison macros */
119#define earlier_deadline(a, b) (time_before(\ 121#define earlier_deadline(a, b) (time_before(\
120 (a)->rt_param.times.deadline,\ 122 (a)->rt_param.times.deadline,\
121 (b)->rt_param.times.deadline)) 123 (b)->rt_param.times.deadline))
@@ -123,4 +125,15 @@ memset(&(t)->rt_param,0, sizeof(struct task_rt_param))
123 (a)->rt_param.times.release,\ 125 (a)->rt_param.times.release,\
124 (b)->rt_param.times.release)) 126 (b)->rt_param.times.release))
125 127
128/* definition of lowest semaphore priority */
129#define LOWEST_SEM_PRIO 200 /* TODO: change to meaningful prio value */
130
131/* struct for semaphore with priority inheritance */
132struct pi_semaphore {
133 atomic_t count;
134 int sleepers;
135 wait_queue_head_t wait;
136 jiffie_t sem_prio; /* priority of task holding the semaphore resource */
137};
138
126#endif 139#endif
diff --git a/include/linux/wait.h b/include/linux/wait.h
index e820d00e13..c7e96b6b59 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -161,6 +161,8 @@ wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
161#define wake_up_locked(x) __wake_up_locked((x), TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE) 161#define wake_up_locked(x) __wake_up_locked((x), TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
162#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, 1) 162#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, 1)
163 163
164#define pi_wake_up(x) __pi_wake_up(x, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1, NULL)
165
164#define __wait_event(wq, condition) \ 166#define __wait_event(wq, condition) \
165do { \ 167do { \
166 DEFINE_WAIT(__wait); \ 168 DEFINE_WAIT(__wait); \