Sun Dec 17 15:56:35 1995 Miles Bader <miles@gnu.ai.mit.edu>
[glibc.git] / hurd / intr-rpc.awk
blob9dbcd6f8e2ea37da80a5fdba05d8fc2057d6a527
1 # Icky intimate knowledge of MiG output.
3 BEGIN \
5 nprotolines=0; proto=0;
6 args=""; echo=1; isintr=0;
7 intrcall = "__hurd_intr_rpc_" call;
8 print "#include <hurd/signal.h>";
11 $NF == intrcall { isintr=1; }
13 NF == 1 && $1 == ")" { proto=0; }
14 proto \
16 protolines[nprotolines++] = $0;
17 arg = $NF;
18 if (substr(arg, 1, 1) == "*")
19 arg = substr(arg, 2, length(arg)-1);
20 args = args arg;
22 NF == 1 && $1 == "(" { proto=1; }
24 NF == 3 && $1 == "InP->Head.msgh_request_port" \
25 { portarg = substr($3, 1, length($3)-1); }
27 { print $0; }
29 END \
31 if (isintr)
33 print "\n\n/* User-callable interrupt-handling stub. */";
34 print "kern_return_t __" call;
35 print "(";
36 for (i = 0; i < nprotolines; ++i)
37 print protolines[i];
38 print ")";
39 print "{";
40 print " return HURD_EINTR_RPC (" portarg ", " \
41 intrcall "(" args "));";
42 print "}";
44 print "weak_alias (__" call ", " call ")"