summaryrefslogtreecommitdiff
path: root/debian/patches/700002-Disable-disabling-the-irq-via-device_intr_enable.patch
blob: d3ceaba1834ce61b1e6bb077bc947f109a1997b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
From f7c2f4ba69c3ae7df8fddcc2969e2c21e109dbd1 Mon Sep 17 00:00:00 2001
From: Justus Winter <justus@gnupg.org>
Date: Thu, 25 Feb 2016 18:56:43 +0100
Subject: [PATCH gnumach 2/9] Disable disabling the irq via device_intr_enable

---
 device/ds_routines.c           |  9 ++++-----
 device/intr.c                  |  3 ++-
 include/mach/experimental.defs | 22 +++++++++++++++-------
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/device/ds_routines.c b/device/ds_routines.c
index 4f6b345..9d399ee 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -1844,11 +1844,10 @@ experimental_device_intr_enable(ipc_port_t master_port, int line, char status)
   if (master_port != master_device_port)
     return D_INVALID_OPERATION;
 
-  if (status)
-    /* TODO: better name for generic-to-arch-specific call */
-    enable_irq (line);
-  else
-    disable_irq (line);
+  if (! status)
+    return D_INVALID_OPERATION;
+
+  enable_irq (line);
   return 0;
 #endif	/* MACH_XEN */
 }
diff --git a/device/intr.c b/device/intr.c
index 6fca328..02e0bab 100644
--- a/device/intr.c
+++ b/device/intr.c
@@ -35,11 +35,12 @@ search_intr (int line, ipc_port_t dest)
   return NULL;
 }
 
+void intr_thread (void);
+
 /* This function can only be used in the interrupt handler. */
 void
 queue_intr (int line, ipc_port_t dest)
 {
-  extern void intr_thread ();
   struct intr_entry *e;
   
   cli ();
diff --git a/include/mach/experimental.defs b/include/mach/experimental.defs
index ca1eb92..11c51d6 100644
--- a/include/mach/experimental.defs
+++ b/include/mach/experimental.defs
@@ -52,19 +52,27 @@ routine device_intr_register(
 	in	flags		: int;
 	in	receive_port	: mach_port_send_t
 	);
+/* JW: It doesn't look safe to pass flags through.  dde sets
+ * SA_SHIRQ.
+ *
+ * ID seems unused.  dde hands in 0.
+ */
 
 /*
- *	enable/disable the specified line.
+ *	enable the specified line.
+ */
+/* Is the disable part actually used at all? -- No.  */
+/* AIUI, the kernel IRQ handler should always disable the line; and
+ * the userspace driver only has to reenable it, after acknowledging
+ * and handling the interrupt...
+ *
+ * -- Indeed, and we should change the interface so that the irq is
+ *    also re-enabled if the driver crashes.
  */
-/* XXX: Naming a function taht can disable something "xxx_enable" is confusing. */
-/* Is the disable part actually used at all? AIUI, the kernel IRQ handler
-should always disable the line; and the userspace driver only has to
-reenable it, after acknowledging and handling the interrupt...
-*/
 routine device_intr_enable(
 		master_port	: mach_port_t;
 		line		: int;
-		status		: char);
+		status		: char /* MUST be true-ish */);
 
 /*
  *	This routine is created for allocating DMA buffers.
-- 
2.1.4