]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - ipc/sem.c
Apply preempt_rt patch-4.9-rt1.patch.xz
[zynq/linux.git] / ipc / sem.c
index 10b94bc59d4a5ffaa85a89152ac02a1f806db054..b8360eaacc7adaddc3a005bdd586dcd174314ed6 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -712,6 +712,13 @@ undo:
 static void wake_up_sem_queue_prepare(struct list_head *pt,
                                struct sem_queue *q, int error)
 {
+#ifdef CONFIG_PREEMPT_RT_BASE
+       struct task_struct *p = q->sleeper;
+       get_task_struct(p);
+       q->status = error;
+       wake_up_process(p);
+       put_task_struct(p);
+#else
        if (list_empty(pt)) {
                /*
                 * Hold preempt off so that we don't get preempted and have the
@@ -723,6 +730,7 @@ static void wake_up_sem_queue_prepare(struct list_head *pt,
        q->pid = error;
 
        list_add_tail(&q->list, pt);
+#endif
 }
 
 /**
@@ -736,6 +744,7 @@ static void wake_up_sem_queue_prepare(struct list_head *pt,
  */
 static void wake_up_sem_queue_do(struct list_head *pt)
 {
+#ifndef CONFIG_PREEMPT_RT_BASE
        struct sem_queue *q, *t;
        int did_something;
 
@@ -748,6 +757,7 @@ static void wake_up_sem_queue_do(struct list_head *pt)
        }
        if (did_something)
                preempt_enable();
+#endif
 }
 
 static void unlink_queue(struct sem_array *sma, struct sem_queue *q)