summaryrefslogtreecommitdiff
path: root/open_issues/dde/137784
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-05 14:50:57 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-05 14:50:57 +0100
commit3b6491bff3a456868ea8c2ccfbd3328d272e8543 (patch)
tree9709b6e2b20e3cba3e88be29b37a8c8796bc8cf7 /open_issues/dde/137784
parentad0f2aa843232649166e0252e28b96c1736c5082 (diff)
parente640b97228bd1214a4dc37ac9d79a704acd40c0c (diff)
Merge branch 'master' of flubber:~hurd-web/hurd-web
Diffstat (limited to 'open_issues/dde/137784')
-rw-r--r--open_issues/dde/13778443
1 files changed, 43 insertions, 0 deletions
diff --git a/open_issues/dde/137784 b/open_issues/dde/137784
new file mode 100644
index 00000000..1529465b
--- /dev/null
+++ b/open_issues/dde/137784
@@ -0,0 +1,43 @@
+diff --git a/libdde_linux26/lib/src/arch/l4/cli_sti.c b/libdde_linux26/lib/src/arch/l4/cli_sti.c
+index 051f259..6a8c460 100644
+--- a/libdde_linux26/lib/src/arch/l4/cli_sti.c
++++ b/libdde_linux26/lib/src/arch/l4/cli_sti.c
+@@ -4,6 +4,8 @@
+
+ /* IRQ lock reference counter */
+ static atomic_t _refcnt = ATOMIC_INIT(0);
++/* Refcnt value at which unlocking the cli_lock (it's not always 0) */
++static int unlock_refcnt;
+ static ddekit_lock_t cli_lock;
+
+ /* Check whether IRQs are currently disabled.
+@@ -57,9 +59,6 @@ void fake_local_irq_restore(unsigned long flags)
+ /* Store the current flags state.
+ *
+ * This is done by returning the current refcnt.
+- *
+- * XXX: Up to now, flags was always 0 at this point and
+- * I assume that this is always the case. Prove?
+ */
+ unsigned long __raw_local_save_flags(void)
+ {
+@@ -82,7 +81,7 @@ void raw_local_irq_restore(unsigned long flags)
+ {
+ Assert(cli_lock != NULL);
+ atomic_set(&_refcnt, flags);
+- if (flags == 0)
++ if (flags == unlock_refcnt)
+ ddekit_lock_unlock(&cli_lock);
+ }
+
+@@ -95,7 +94,9 @@ void raw_local_irq_disable(void)
+ if (cli_lock == NULL)
+ ddekit_lock_init_unlocked(&cli_lock);
+
+- nested_lock(cli_lock);
++ if (nested_lock(cli_lock))
++ /* Tell the corresponding restorer to release cli_lock */
++ unlock_refcnt = atomic_read(&_refcnt);
+ atomic_inc(&_refcnt);
+ }
+