summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2008-07-24 02:42:13 +0300
committerDaniel Stone <daniel@fooishbar.org>2008-07-24 02:42:13 +0300
commitb74927c3844bc2650d95f604fe782d95ade067f1 (patch)
tree096c5d99afb7466c1dec2c03c43f70af6b150345
parent8c0518379089d230060e9ff672ba5eba34198325 (diff)
Remove ioport
I don't know why we would possibly be shipping this.
-rw-r--r--configure.ac1
-rw-r--r--hw/xfree86/utils/Makefile.am1
-rw-r--r--hw/xfree86/utils/ioport/Makefile.am58
-rw-r--r--hw/xfree86/utils/ioport/ioport.c491
4 files changed, 0 insertions, 551 deletions
diff --git a/configure.ac b/configure.ac
index 20e8b3a76..9007f5aeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1888,7 +1888,6 @@ hw/xfree86/xf8_16bpp/Makefile
1888hw/xfree86/utils/Makefile 1888hw/xfree86/utils/Makefile
1889hw/xfree86/utils/cvt/Makefile 1889hw/xfree86/utils/cvt/Makefile
1890hw/xfree86/utils/gtf/Makefile 1890hw/xfree86/utils/gtf/Makefile
1891hw/xfree86/utils/ioport/Makefile
1892hw/xfree86/utils/xorgcfg/Makefile 1891hw/xfree86/utils/xorgcfg/Makefile
1893hw/dmx/config/Makefile 1892hw/dmx/config/Makefile
1894hw/dmx/doc/Makefile 1893hw/dmx/doc/Makefile
diff --git a/hw/xfree86/utils/Makefile.am b/hw/xfree86/utils/Makefile.am
index a96638688..655c447b7 100644
--- a/hw/xfree86/utils/Makefile.am
+++ b/hw/xfree86/utils/Makefile.am
@@ -1,5 +1,4 @@
1SUBDIRS = \ 1SUBDIRS = \
2 gtf \ 2 gtf \
3 cvt \ 3 cvt \
4 ioport \
5 xorgcfg 4 xorgcfg
diff --git a/hw/xfree86/utils/ioport/Makefile.am b/hw/xfree86/utils/ioport/Makefile.am
deleted file mode 100644
index 12f861372..000000000
--- a/hw/xfree86/utils/ioport/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
1# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2#
3# Permission is hereby granted, free of charge, to any person obtaining a
4# copy of this software and associated documentation files (the
5# "Software"), to deal in the Software without restriction, including
6# without limitation the rights to use, copy, modify, merge, publish,
7# distribute, and/or sell copies of the Software, and to permit persons
8# to whom the Software is furnished to do so, provided that the above
9# copyright notice(s) and this permission notice appear in all copies of
10# the Software and that both the above copyright notice(s) and this
11# permission notice appear in supporting documentation.
12#
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
16# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
17# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
18# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
19# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22#
23# Except as contained in this notice, the name of a copyright holder
24# shall not be used in advertising or otherwise to promote the sale, use
25# or other dealings in this Software without prior written authorization
26# of the copyright holder.
27#
28
29bin_PROGRAMS = ioport
30
31XFREE86_SRCDIR = $(top_srcdir)/hw/xfree86
32DUMMYLIB_SRCDIR = $(XFREE86_SRCDIR)/dummylib
33
34INCLUDES = $(XORG_INCS) -I$(DUMMYLIB_SRCDIR)
35
36ioport_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
37ioport_LDADD = \
38 ../../os-support/libxorgos.la \
39 ../../dummylib/libdummy-nonserver.a \
40 ${UTILS_SYS_LIBS} ${PCIACCESS_LIBS}
41
42
43ioport_SOURCES = \
44 ioport.c
45
46ioport_PROGRAM_LINKS = inb inw inl outb outw outl
47
48all-local:
49 @for i in $(ioport_PROGRAM_LINKS); do (set -x; \
50 rm -f $$i; $(LN_S) ioport $$i); \
51 done
52
53install-exec-hook:
54 @for i in $(ioport_PROGRAM_LINKS); do (set -x; \
55 rm -f $(DESTDIR)$(bindir)/$$i; \
56 (cd $(DESTDIR)$(bindir); $(LN_S) ioport $$i)); \
57 done
58
diff --git a/hw/xfree86/utils/ioport/ioport.c b/hw/xfree86/utils/ioport/ioport.c
deleted file mode 100644
index 737043462..000000000
--- a/hw/xfree86/utils/ioport/ioport.c
+++ /dev/null
@@ -1,491 +0,0 @@
1/*
2 * Copyright 2002 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of Marc Aurele La France not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. Marc Aurele La France makes no representations
11 * about the suitability of this software for any purpose. It is provided
12 * "as-is" without express or implied warranty.
13 *
14 * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
16 * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#include "compiler.h"
24#include "xf86_OSproc.h"
25
26#include <errno.h>
27
28static char *MyName;
29static int Port = -1, Index = -1;
30static unsigned int Value;
31
32static void
33inb_usage
34(
35#ifdef __STDC__
36 void
37#endif
38)
39{
40 fprintf(stderr, "inb [-i <index>] <port>\n");
41}
42
43static void
44inw_usage
45(
46#ifdef __STDC__
47 void
48#endif
49)
50{
51 fprintf(stderr, "inw [-i <index>] <port>\n");
52}
53
54static void
55inl_usage
56(
57#ifdef __STDC__
58 void
59#endif
60)
61{
62 fprintf(stderr, "inl [-i <index>] <port>\n");
63}
64
65
66static void
67outb_usage
68(
69#ifdef __STDC__
70 void
71#endif
72)
73{
74 fprintf(stderr, "outb [-i <index>] <port> <value>\n");
75}
76
77static void
78outw_usage
79(
80#ifdef __STDC__
81 void
82#endif
83)
84{
85 fprintf(stderr, "outw [-i <index>] <port> <value>\n");
86}
87
88static void
89outl_usage
90(
91#ifdef __STDC__
92 void
93#endif
94)
95{
96 fprintf(stderr, "outl [-i <index>] <port> <value>\n");
97}
98
99static int
100#ifdef __STDC__
101parse_number
102(
103 const char *String,
104 void (* Usage)(void),
105 unsigned int Maximum)
106#else
107parse_number(String, Usage, Maximum)
108 const char *String;
109 void (* Usage)();
110 unsigned int Maximum;
111#endif
112{
113 char *BadString = (char *)0;
114 unsigned int Number = strtoul(String, &BadString, 0);
115 if ((Number > Maximum) || errno ||
116 (BadString && *BadString))
117 {
118 (*Usage)();
119 exit(1);
120 }
121
122 return (Number);
123}
124
125static void
126#ifdef __STDC__
127input_parse
128(
129 int argc,
130 char **argv,
131 void (* Usage)(void))
132#else
133input_parse(argc, argv, Usage)
134 int argc;
135 char **argv;
136 void (* Usage)();
137#endif
138{
139 if ((argc < 2) || (argc > 4))
140 {
141 (*Usage)();
142 exit(1);
143 }
144
145 for(; (++argv, --argc); )
146 {
147 if ((Index < 0) &&
148 (argv[0][0] == '-') &&
149 (argv[0][1] == 'i'))
150 {
151 if ((++argv[0], *(++argv[0])) || (++argv, --argc))
152 Index = parse_number(argv[0], Usage, 0xFFU);
153 else
154 {
155 (*Usage)();
156 exit(1);
157 }
158 }
159 else if (Port < 0)
160 {
161 Port = parse_number(argv[0], Usage, 0xFFFFU);
162 }
163 else
164 {
165 (*Usage)();
166 exit(1);
167 }
168 }
169}
170
171static void
172#ifdef __STDC__
173output_parse
174(
175 int argc,
176 char **argv,
177 void (* Usage)(void),
178 unsigned int Maximum
179)
180#else
181output_parse(argc, argv, Usage, Maximum)
182 int argc;
183 char **argv;
184 void (* Usage)();
185 unsigned int Maximum;
186#endif
187{
188 char ValueSpecified = 0;
189
190 if ((argc < 3) || (argc > 5))
191 {
192 (*Usage)();
193 exit(1);
194 }
195
196 for (; (++argv, --argc); )
197 {
198 if ((Index < 0) &&
199 (argv[0][0] == '-') &&
200 (argv[0][1] == 'i'))
201 {
202 if ((++argv[0], *(++argv[0])) || (++argv, --argc))
203 Index = parse_number(argv[0], Usage, 0xFFU);
204 else
205 {
206 (*Usage)();
207 exit(1);
208 }
209 }
210 else if (Port < 0)
211 {
212 Port = parse_number(argv[0], Usage, 0xFFFFU);
213 }
214 else if (!ValueSpecified)
215 {
216 Value = parse_number(argv[0], Usage, Maximum);
217 ValueSpecified = 1;
218 }
219 else
220 {
221 (*Usage)();
222 exit(1);
223 }
224 }
225
226 if (!ValueSpecified)
227 {
228 (*Usage)();
229 exit(1);
230 }
231}
232
233static void
234#ifdef __STDC__
235do_inb
236(
237 int argc,
238 char **argv
239)
240#else
241do_inb(argc, argv)
242 int argc;
243 char **argv;
244#endif
245{
246 input_parse(argc, argv, inb_usage);
247
248 xf86EnableIO();
249
250 if (Index >= 0)
251 {
252 if (Port == 0x03C0U)
253 { /* Attribute Controller is different */
254 unsigned short gens1;
255
256 gens1 = ((inb(0x03CCU) & 0x01U) << 5) + 0x03BA;
257 (void) inb(gens1);
258 Index = (Index & 0x1FU) | 0x20U;
259 }
260 outb(Port, Index);
261 Port++;
262 }
263 Value = inb(Port);
264
265 xf86DisableIO();
266
267 printf("0x%02X\n", Value);
268}
269
270static void
271#ifdef __STDC__
272do_inw
273(
274 int argc,
275 char **argv
276)
277#else
278do_inw(argc, argv)
279 int argc;
280 char **argv;
281#endif
282{
283 input_parse(argc, argv, inw_usage);
284
285 xf86EnableIO();
286
287 if (Index >= 0)
288 {
289 outb(Port, Index);
290 Port++;
291 }
292 Value = inw(Port);
293
294 xf86DisableIO();
295
296 printf("0x%04X\n", Value);
297}
298
299static void
300#ifdef __STDC__
301do_inl
302(
303 int argc,
304 char **argv
305)
306#else
307do_inl(argc, argv)
308 int argc;
309 char **argv;
310#endif
311{
312 input_parse(argc, argv, inl_usage);
313
314 xf86EnableIO();
315
316 if (Index >= 0)
317 {
318 outb(Port, Index);
319 Port++;
320 }
321 Value = inl(Port);
322
323 xf86DisableIO();
324
325 printf("0x%08X\n", Value);
326}
327
328static void
329#ifdef __STDC__
330do_outb
331(
332 int argc,
333 char **argv
334)
335#else
336do_outb(argc, argv)
337 int argc;
338 char **argv;
339#endif
340{
341 output_parse(argc, argv, outb_usage, 0xFFU);
342
343 xf86EnableIO();
344
345 if (Index >= 0)
346 {
347 if (Port == 0x03C0U)
348 { /* Attribute controller is different */
349 unsigned short gens1;
350
351 gens1 = ((inb(0x03CCU) & 0x01U) << 5) + 0x03BA;
352 (void) inb(gens1);
353 outb(0x03C0U, (Index & 0x1FU) | 0x20U);
354 }
355 else
356 {
357 outb(Port, Index);
358 Port++;
359 }
360 }
361 outb(Port, Value);
362
363 xf86DisableIO();
364
365}
366
367static void
368#ifdef __STDC__
369do_outw
370(
371 int argc,
372 char **argv
373)
374#else
375do_outw(argc, argv)
376 int argc;
377 char **argv;
378#endif
379{
380 output_parse(argc, argv, outw_usage, 0xFFFFU);
381
382 xf86EnableIO();
383
384 if (Index >= 0)
385 {
386 outb(Port, Index);
387 Port++;
388 }
389 outw(Port, Value);
390
391 xf86DisableIO();
392
393}
394
395static void
396#ifdef __STDC__
397do_outl
398(
399 int argc,
400 char **argv
401)
402#else
403do_outl(argc, argv)
404 int argc;
405 char **argv;
406#endif
407{
408 output_parse(argc, argv, outl_usage, 0xFFFFFFFFU);
409
410 xf86EnableIO();
411
412 if (Index >= 0)
413 {
414 outb(Port, Index);
415 Port++;
416 }
417 outl(Port, Value);
418
419 xf86DisableIO();
420
421}
422
423static void
424usage
425(
426#ifdef __STDC__
427 void
428#endif
429)
430{
431 inb_usage();
432 inw_usage();
433 inl_usage();
434 outb_usage();
435 outw_usage();
436 outl_usage();
437 exit(1);
438}
439
440int
441#ifdef __STDC__
442main
443(
444 int argc,
445 char **argv
446)
447#else
448main(argc, argv)
449 int argc;
450 char **argv;
451#endif
452{
453 struct
454 {
455 char *Name;
456#ifdef __STDC__
457 void (* Function)(int, char **);
458#else
459 void (* Function)();
460#endif
461 }
462 *Function_Entry, Function_Table[] =
463 {
464 {"inb", do_inb},
465 {"inw", do_inw},
466 {"inl", do_inl},
467 {"outb", do_outb},
468 {"outw", do_outw},
469 {"outl", do_outl},
470#ifdef __STDC__
471 {(char *)0, (void (*)(int, char **))usage}
472#else
473 {(char *)0, usage}
474#endif
475 };
476
477 /* Get name by which we were invoked */
478 for (MyName = argv[0]; argv[0][0]; )
479 if (*(argv[0]++) == '/')
480 MyName = argv[0];
481
482 /* Look up name in table and call corresponding function */
483 for (Function_Entry = Function_Table;
484 Function_Entry->Name &&
485 strcmp(MyName, Function_Entry->Name);
486 Function_Entry++);
487 (*Function_Entry->Function)(argc, argv);
488
489 return (0);
490}
491