| @@ -1,20 +1,20 @@ | | | @@ -1,20 +1,20 @@ |
1 | $NetBSD: patch-aj,v 1.3 2007/04/28 03:42:31 christos Exp $ | | 1 | $NetBSD: patch-aj,v 1.4 2008/05/08 20:03:03 christos Exp $ |
2 | | | 2 | |
3 | --- /dev/null 2007-04-27 23:20:36.000000000 -0400 | | 3 | --- /dev/null 2008-05-08 16:01:35.000000000 -0400 |
4 | +++ netbsd/ioctlent.sh 2007-04-27 23:27:49.000000000 -0400 | | 4 | +++ netbsd/ioctlent.sh 2008-05-08 15:54:29.000000000 -0400 |
5 | @@ -0,0 +1,123 @@ | | 5 | @@ -0,0 +1,125 @@ |
6 | +#!/bin/sh | | 6 | +#!/bin/sh |
7 | +# $NetBSD: patch-aj,v 1.3 2007/04/28 03:42:31 christos Exp $ | | 7 | +# $NetBSD: patch-aj,v 1.4 2008/05/08 20:03:03 christos Exp $ |
8 | +# | | 8 | +# |
9 | +# Copyright (c) 1994 | | 9 | +# Copyright (c) 1994 |
10 | +# The Regents of the University of California. All rights reserved. | | 10 | +# The Regents of the University of California. All rights reserved. |
11 | +# | | 11 | +# |
12 | +# Redistribution and use in source and binary forms, with or without | | 12 | +# Redistribution and use in source and binary forms, with or without |
13 | +# modification, are permitted provided that the following conditions | | 13 | +# modification, are permitted provided that the following conditions |
14 | +# are met: | | 14 | +# are met: |
15 | +# 1. Redistributions of source code must retain the above copyright | | 15 | +# 1. Redistributions of source code must retain the above copyright |
16 | +# notice, this list of conditions and the following disclaimer. | | 16 | +# notice, this list of conditions and the following disclaimer. |
17 | +# 2. Redistributions in binary form must reproduce the above copyright | | 17 | +# 2. Redistributions in binary form must reproduce the above copyright |
18 | +# notice, this list of conditions and the following disclaimer in the | | 18 | +# notice, this list of conditions and the following disclaimer in the |
19 | +# documentation and/or other materials provided with the distribution. | | 19 | +# documentation and/or other materials provided with the distribution. |
20 | +# 3. All advertising materials mentioning features or use of this software | | 20 | +# 3. All advertising materials mentioning features or use of this software |
| @@ -37,26 +37,28 @@ $NetBSD: patch-aj,v 1.3 2007/04/28 03:42 | | | @@ -37,26 +37,28 @@ $NetBSD: patch-aj,v 1.3 2007/04/28 03:42 |
37 | +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 37 | +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
38 | +# SUCH DAMAGE. | | 38 | +# SUCH DAMAGE. |
39 | +# | | 39 | +# |
40 | +# @(#)mkioctls 8.2 (Berkeley) 4/28/95 | | 40 | +# @(#)mkioctls 8.2 (Berkeley) 4/28/95 |
41 | +# | | 41 | +# |
42 | +( | | 42 | +( |
43 | +#echo "#define const" # XXX: timepps lossage | | 43 | +#echo "#define const" # XXX: timepps lossage |
44 | +echo "#include <stdio.h>" | | 44 | +echo "#include <stdio.h>" |
45 | +echo "struct ap_control { int _xxx; };" # XXX: ip_nat.h lossage | | 45 | +echo "struct ap_control { int _xxx; };" # XXX: ip_nat.h lossage |
46 | +echo "#define COMPAT_43" | | 46 | +echo "#define COMPAT_43" |
47 | +echo "struct lwp;" | | 47 | +echo "struct lwp;" |
48 | +echo "struct videomemory_t { int _xxx; };" # XXX arm video lossage | | 48 | +echo "struct videomemory_t { int _xxx; };" # XXX arm video lossage |
49 | +echo "typedef struct videomemory_t videomemory_t;" # XXX arm video lossage | | 49 | +echo "typedef struct videomemory_t videomemory_t;" # XXX arm video lossage |
| | | 50 | +echo "typedef int domid_t;" # XEN lossage |
| | | 51 | + |
50 | +echo "#include <sys/types.h>" | | 52 | +echo "#include <sys/types.h>" |
51 | +echo "#include <sys/param.h>" | | 53 | +echo "#include <sys/param.h>" |
52 | +echo "#include <sys/disk.h>" | | 54 | +echo "#include <sys/disk.h>" |
53 | +echo "#include <sys/dkbad.h>" | | 55 | +echo "#include <sys/dkbad.h>" |
54 | +echo "#include <sys/mount.h>" | | 56 | +echo "#include <sys/mount.h>" |
55 | +echo "#include <sys/termios.h>" | | 57 | +echo "#include <sys/termios.h>" |
56 | +echo "#include <sys/disklabel.h>" | | 58 | +echo "#include <sys/disklabel.h>" |
57 | +echo "#include <net/if.h>" | | 59 | +echo "#include <net/if.h>" |
58 | +echo "#include <net/route.h>" | | 60 | +echo "#include <net/route.h>" |
59 | +echo "#include <net/ppp_defs.h>" | | 61 | +echo "#include <net/ppp_defs.h>" |
60 | +echo "#include <netinet/in.h>" | | 62 | +echo "#include <netinet/in.h>" |
61 | +echo "#include <netinet/in_systm.h>" | | 63 | +echo "#include <netinet/in_systm.h>" |
62 | +echo "#include <netinet/ip.h>" | | 64 | +echo "#include <netinet/ip.h>" |
| @@ -87,27 +89,27 @@ $NetBSD: patch-aj,v 1.3 2007/04/28 03:42 | | | @@ -87,27 +89,27 @@ $NetBSD: patch-aj,v 1.3 2007/04/28 03:42 |
87 | + keep["KBDSTPMAT"] = 1; # Same as LMREADY, pcvt is gone so ok. | | 89 | + keep["KBDSTPMAT"] = 1; # Same as LMREADY, pcvt is gone so ok. |
88 | + | | 90 | + |
89 | + print "" | | 91 | + print "" |
90 | + print "struct ioctlent {\n" | | 92 | + print "struct ioctlent {\n" |
91 | + print "\t const char *file;\n" | | 93 | + print "\t const char *file;\n" |
92 | + print "\t const char *name;\n" | | 94 | + print "\t const char *name;\n" |
93 | + print "\t int number;\n" | | 95 | + print "\t int number;\n" |
94 | + print "};\n" | | 96 | + print "};\n" |
95 | + print "const struct ioctlent ioctlent0[] = " | | 97 | + print "const struct ioctlent ioctlent0[] = " |
96 | + print "{" | | 98 | + print "{" |
97 | + print "" | | 99 | + print "" |
98 | + file = ""; | | 100 | + file = ""; |
99 | +} | | 101 | +} |
100 | +/^#[ ]*define[ ]*[A-Z]*[ ]*_IO/ { | | 102 | +/^#[ ]*define[ ]*[A-Z]*[ ]*_IO[RW]\(/ { |
101 | + | | 103 | + |
102 | + # find where the name starts | | 104 | + # find where the name starts |
103 | + for (i = 1; i <= NF; i++) | | 105 | + for (i = 1; i <= NF; i++) |
104 | + if ($i ~ /define/) | | 106 | + if ($i ~ /define/) |
105 | + break; | | 107 | + break; |
106 | + ++i; | | 108 | + ++i; |
107 | + printf("/* %s [%s] */\n", $0, $i); | | 109 | + printf("/* %s [%s] */\n", $0, $i); |
108 | + # | | 110 | + # |
109 | + if ($i ~ /^[A-Z0-9a-z_]*$/) { | | 111 | + if ($i ~ /^[A-Z0-9a-z_]*$/) { |
110 | + if (keep[$i] != 1) { | | 112 | + if (keep[$i] != 1) { |
111 | + printf("\t{ \"?\", \"%s\", %s },\n", $i, $i); | | 113 | + printf("\t{ \"?\", \"%s\", %s },\n", $i, $i); |
112 | + keep[$i] = 1; | | 114 | + keep[$i] = 1; |
113 | + } | | 115 | + } |