summaryrefslogtreecommitdiff
path: root/debian/patches/libports_interrupt_lookup.patch
blob: 1dc291bebcc7ef7830a270d40a345662e43c5901 (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
92
93
94
95
96
97
diff --git a/hurd/hurd_types.defs b/hurd/hurd_types.defs
index 6060fa4..129a68c 100644
--- a/hurd/hurd_types.defs
+++ b/hurd/hurd_types.defs
@@ -168,6 +168,18 @@ destructor: EXEC_STARTUP_DESTRUCTOR
 #endif
 ;
 
+type interrupt_t = mach_port_copy_send_t
+#ifdef INTERRUPT_INTRAN
+intran: INTERRUPT_INTRAN
+#endif
+#ifdef INTERRUPT_OUTTRAN
+outtran: INTERRUPT_OUTTRAN
+#endif
+#ifdef INTERRUPT_DESTRUCTOR
+destructor: INTERRUPT_DESTRUCTOR
+#endif
+;
+
 
 type proccoll_t = mach_port_copy_send_t;
 
diff --git a/hurd/interrupt.defs b/hurd/interrupt.defs
index cc3ad1e..9981aed 100644
--- a/hurd/interrupt.defs
+++ b/hurd/interrupt.defs
@@ -23,10 +23,14 @@ subsystem interrupt 33000;
 
 #include <hurd/hurd_types.defs>
 
+#ifdef INTERRUPT_IMPORTS
+INTERRUPT_IMPORTS
+#endif
+
 /* Cause a pending request on this object to immediately return.  The
    exact semantics are dependent on the specific object.  */
 
 routine
-interrupt_operation (object: mach_port_t;
+interrupt_operation (object: interrupt_t;
 		     waittime timeout: natural_t;
 		     msgseqno seqno: mach_port_seqno_t);
diff --git a/libports/interrupt-operation.c b/libports/interrupt-operation.c
index 19c0edf..943bd4f 100644
--- a/libports/interrupt-operation.c
+++ b/libports/interrupt-operation.c
@@ -24,10 +24,9 @@
 /* Cause a pending request on this object to immediately return.  The
    exact semantics are dependent on the specific object.  */
 kern_return_t
-ports_S_interrupt_operation (mach_port_t port,
+ports_S_interrupt_operation (struct port_info *pi,
 			     mach_port_seqno_t seqno)
 {
-  struct port_info *pi = ports_lookup_port (0, port, 0);
   if (!pi)
     return EOPNOTSUPP;
   pthread_mutex_lock (&_ports_lock);
@@ -35,6 +34,5 @@ ports_S_interrupt_operation (mach_port_t port,
     pi->cancel_threshold = seqno;
   pthread_mutex_unlock (&_ports_lock);
   ports_interrupt_rpcs (pi);
-  ports_port_deref (pi);
   return 0;
 }
diff --git a/libports/mig-mutate.h b/libports/mig-mutate.h
index f692236..4c011b6 100644
--- a/libports/mig-mutate.h
+++ b/libports/mig-mutate.h
@@ -23,3 +23,10 @@
   end_using_port_info (port_info_t)
 #define NOTIFY_IMPORTS						\
   import "libports/mig-decls.h";
+
+#define INTERRUPT_INTRAN					\
+  port_info_t begin_using_port_info_port (mach_port_t)
+#define INTERRUPT_DESTRUCTOR					\
+  end_using_port_info (port_info_t)
+#define INTERRUPT_IMPORTS					\
+  import "libports/mig-decls.h";
diff --git a/libports/ports.h b/libports/ports.h
index 47d4607..7f13124 100644
--- a/libports/ports.h
+++ b/libports/ports.h
@@ -398,11 +398,6 @@ extern kern_return_t
  ports_do_mach_notify_port_destroyed (struct port_info *pi, mach_port_t name);
 extern kern_return_t
  ports_do_mach_notify_send_once (struct port_info *pi);
-
-/* A default interrupt server */
-int ports_interrupt_server (mach_msg_header_t *, mach_msg_header_t *);
-extern kern_return_t ports_S_interrupt_operation (mach_port_t,
-						  mach_port_seqno_t);
 
 /* Private data */
 extern pthread_mutex_t _ports_lock;