diff options
author | Justus Winter <justus@gnupg.org> | 2016-02-26 20:05:54 +0100 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2016-02-26 20:05:54 +0100 |
commit | aec143ca7170bb138027d6471da3e203435e87d3 (patch) | |
tree | 91a06e6927f80ca444711f8be2b6b6bcab7b2a1e /debian/patches/700010-Fix-infinite-loop-with-cli-if-netdde-is-killed-with-.patch | |
parent | 08282a8e85fb6c3d20f4be0bd7b1583ef7ff1bee (diff) |
add patch series
Diffstat (limited to 'debian/patches/700010-Fix-infinite-loop-with-cli-if-netdde-is-killed-with-.patch')
-rw-r--r-- | debian/patches/700010-Fix-infinite-loop-with-cli-if-netdde-is-killed-with-.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/debian/patches/700010-Fix-infinite-loop-with-cli-if-netdde-is-killed-with-.patch b/debian/patches/700010-Fix-infinite-loop-with-cli-if-netdde-is-killed-with-.patch new file mode 100644 index 0000000..cbf3b02 --- /dev/null +++ b/debian/patches/700010-Fix-infinite-loop-with-cli-if-netdde-is-killed-with-.patch @@ -0,0 +1,76 @@ +From 23ffabdd5b4e62340454884bf1e85c925bcf509b Mon Sep 17 00:00:00 2001 +From: Justus Winter <justus@gnupg.org> +Date: Fri, 26 Feb 2016 16:01:46 +0100 +Subject: [PATCH gnumach 10/15] Fix infinite loop with cli if netdde is killed + with pending irqs + +--- + device/intr.c | 38 +++++++++++++++++--------------------- + 1 file changed, 17 insertions(+), 21 deletions(-) + +diff --git a/device/intr.c b/device/intr.c +index a061d5e..39408ea 100644 +--- a/device/intr.c ++++ b/device/intr.c +@@ -28,8 +28,6 @@ struct intr_entry + typedef struct intr_entry *intr_entry_t; + + static queue_head_t intr_queue; +-/* The total number of unprocessed interrupts. */ +-static int tot_num_intr; + + /* This function can only be used in the interrupt handler. */ + boolean_t +@@ -37,7 +35,6 @@ queue_intr (struct intr_entry *e) + { + cli (); + e->interrupts++; +- tot_num_intr++; + sti (); + + thread_wakeup ((event_t) &intr_thread); +@@ -251,24 +248,23 @@ intr_thread () + assert_wait ((event_t) &intr_thread, FALSE); + cli (); + +- while (tot_num_intr) +- queue_iterate (&intr_queue, e, struct intr_entry *, chain) +- if (e->interrupts) +- { +- line = e->line; +- dest = e->dest; +- e->interrupts--; +- tot_num_intr--; +- +- sti (); +- deliver_intr (line, dest); +- cli (); +- +- /* We cannot assume that e still exists at this point +- because we released the lock. Hence we restart the +- iteration. */ +- break; +- } ++ restart: ++ queue_iterate (&intr_queue, e, struct intr_entry *, chain) ++ if (e->interrupts) ++ { ++ line = e->line; ++ dest = e->dest; ++ e->interrupts--; ++ ++ sti (); ++ deliver_intr (line, dest); ++ cli (); ++ ++ /* We cannot assume that e still exists at this point ++ because we released the lock. Hence we restart the ++ iteration. */ ++ goto restart; ++ } + + sti (); + thread_block (thread_no_continuation); +-- +2.1.4 + |