grf.c revision 1.9 1 /* $NetBSD: grf.c,v 1.9 1998/06/30 11:59:10 msaitoh Exp $ */
2
3 /*
4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1990, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 * This product includes software developed by the University of
23 * California, Berkeley and its contributors.
24 * 4. Neither the name of the University nor the names of its contributors
25 * may be used to endorse or promote products derived from this software
26 * without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE.
39 *
40 * from: Utah $Hdr: grf.c 1.36 93/08/13$
41 *
42 * @(#)grf.c 8.4 (Berkeley) 1/12/94
43 */
44
45 /*
46 * Graphics display driver for the X68K machines.
47 * This is the hardware-independent portion of the driver.
48 * Hardware access is through the machine dependent grf switch routines.
49 */
50
51 #include "opt_uvm.h"
52 #include "opt_compat_hpux.h"
53
54 #include <sys/param.h>
55 #include <sys/systm.h>
56 #include <sys/device.h>
57 #include <sys/proc.h>
58 #include <sys/ioctl.h>
59 #include <sys/file.h>
60 #include <sys/malloc.h>
61 #include <sys/vnode.h>
62 #include <sys/mman.h>
63 #include <sys/poll.h>
64 #include <sys/conf.h>
65
66 #include <x68k/dev/grfioctl.h>
67 #include <x68k/dev/grfvar.h>
68 #include <x68k/dev/itevar.h>
69
70 #include <machine/cpu.h>
71
72 #ifdef COMPAT_HPUX
73 #include <compat/hpux/hpux.h>
74 extern struct emul emul_hpux;
75 #endif
76
77 #include <vm/vm.h>
78 #include <vm/vm_kern.h>
79 #include <vm/vm_page.h>
80 #include <vm/vm_pager.h>
81
82 #if defined(UVM)
83 #include <uvm/uvm.h>
84 #endif
85
86 #include <miscfs/specfs/specdev.h>
87
88 #include "ite.h"
89 #if NITE == 0
90 #define iteon(u,f)
91 #define iteoff(u,f)
92 #define ite_reinit(u)
93 #endif
94
95 #ifdef DEBUG
96 int grfdebug = 0;
97 #define GDB_DEVNO 0x01
98 #define GDB_MMAP 0x02
99 #define GDB_IOMAP 0x04
100 #define GDB_LOCK 0x08
101 #endif
102
103 cdev_decl(grf);
104 int grfon __P((dev_t));
105 int grfoff __P((dev_t));
106 int grfaddr __P((struct grf_softc *, int));
107 int grfmap __P((dev_t, caddr_t *, struct proc *));
108 int grfunmap __P((dev_t, caddr_t, struct proc *));
109
110 extern struct cfdriver grf_cd;
111
112 /*ARGSUSED*/
113 int
114 grfopen(dev, flags, mode, p)
115 dev_t dev;
116 int flags, mode;
117 struct proc *p;
118 {
119 int unit = GRFUNIT(dev);
120 register struct grf_softc *gp;
121 int error = 0;
122
123 if (unit >= grf_cd.cd_ndevs ||
124 (gp = grf_cd.cd_devs[unit]) == NULL ||
125 (gp->g_flags & GF_ALIVE) == 0)
126 return (ENXIO);
127
128 if ((gp->g_flags & (GF_OPEN|GF_EXCLUDE)) == (GF_OPEN|GF_EXCLUDE))
129 return(EBUSY);
130 #ifdef COMPAT_HPUX
131 /*
132 * XXX: cannot handle both HPUX and BSD processes at the same time
133 */
134 if (p->p_emul == &emul_hpux)
135 if (gp->g_flags & GF_BSDOPEN)
136 return(EBUSY);
137 else
138 gp->g_flags |= GF_HPUXOPEN;
139 else
140 if (gp->g_flags & GF_HPUXOPEN)
141 return(EBUSY);
142 else
143 gp->g_flags |= GF_BSDOPEN;
144 #endif
145 /*
146 * First open.
147 * XXX: always put in graphics mode.
148 */
149 error = 0;
150 if ((gp->g_flags & GF_OPEN) == 0) {
151 gp->g_flags |= GF_OPEN;
152 error = grfon(dev);
153 }
154 return(error);
155 }
156
157 /*ARGSUSED*/
158 int
159 grfclose(dev, flags, mode, p)
160 dev_t dev;
161 int flags, mode;
162 struct proc *p;
163 {
164 register struct grf_softc *gp = grf_cd.cd_devs[GRFUNIT(dev)];
165
166 if ((gp->g_flags & GF_ALIVE) == 0)
167 return (ENXIO);
168
169 (void) grfoff(dev);
170 #ifdef COMPAT_HPUX
171 (void) grfunlock(gp);
172 #endif
173 gp->g_flags &= GF_ALIVE;
174 return(0);
175 }
176
177 /*ARGSUSED*/
178 int
179 grfioctl(dev, cmd, data, flag, p)
180 dev_t dev;
181 u_long cmd;
182 caddr_t data;
183 int flag;
184 struct proc *p;
185 {
186 int unit = GRFUNIT(dev);
187 register struct grf_softc *gp = grf_cd.cd_devs[unit];
188 int error;
189
190 if ((gp->g_flags & GF_ALIVE) == 0)
191 return (ENXIO);
192
193 #ifdef COMPAT_HPUX
194 if (p->p_emul == &emul_hpux)
195 return(hpuxgrfioctl(dev, cmd, data, flag, p));
196 #endif
197 error = 0;
198 switch (cmd) {
199
200 case GRFIOCGINFO:
201 bcopy((caddr_t)&gp->g_display, data, sizeof(struct grfinfo));
202 break;
203
204 case GRFIOCON:
205 error = grfon(dev);
206 break;
207
208 case GRFIOCOFF:
209 error = grfoff(dev);
210 break;
211
212 case GRFIOCMAP:
213 error = grfmap(dev, (caddr_t *)data, p);
214 break;
215
216 case GRFIOCUNMAP:
217 error = grfunmap(dev, *(caddr_t *)data, p);
218 break;
219
220 case GRFSETVMODE:
221 error = (*gp->g_sw->gd_mode)(gp, GM_GRFSETVMODE, data);
222 if (error == 0)
223 ite_reinit(unit);
224 break;
225
226 default:
227 error = EINVAL;
228 break;
229
230 }
231 return(error);
232 }
233
234 /*ARGSUSED*/
235 int
236 grfpoll(dev, events, p)
237 dev_t dev;
238 int events;
239 struct proc *p;
240 {
241
242 return (events & (POLLOUT | POLLWRNORM));
243 }
244
245 /*ARGSUSED*/
246 int
247 grfmmap(dev, off, prot)
248 dev_t dev;
249 int off, prot;
250 {
251
252 return (grfaddr(grf_cd.cd_devs[GRFUNIT(dev)], off));
253 }
254
255 int
256 grfon(dev)
257 dev_t dev;
258 {
259 int unit = GRFUNIT(dev);
260 struct grf_softc *gp = grf_cd.cd_devs[unit];
261
262 /*
263 * XXX: iteoff call relies on devices being in same order
264 * as ITEs and the fact that iteoff only uses the minor part
265 * of the dev arg.
266 */
267 iteoff(unit, 2);
268 return((*gp->g_sw->gd_mode)(gp,
269 (dev&GRFOVDEV) ? GM_GRFOVON : GM_GRFON,
270 (caddr_t)0));
271 }
272
273 int
274 grfoff(dev)
275 dev_t dev;
276 {
277 int unit = GRFUNIT(dev);
278 struct grf_softc *gp = grf_cd.cd_devs[unit];
279 int error;
280
281 (void) grfunmap(dev, (caddr_t)0, curproc);
282 error = (*gp->g_sw->gd_mode)(gp,
283 (dev&GRFOVDEV) ? GM_GRFOVOFF : GM_GRFOFF,
284 (caddr_t)0);
285 /* XXX: see comment for iteoff above */
286 iteon(unit, 2);
287 return(error);
288 }
289
290 int
291 grfaddr(gp, off)
292 struct grf_softc *gp;
293 register int off;
294 {
295 register struct grfinfo *gi = &gp->g_display;
296
297 /* control registers */
298 if (off >= 0 && off < gi->gd_regsize)
299 return(((u_int)gi->gd_regaddr + off) >> PGSHIFT);
300
301 /* frame buffer */
302 if (off >= gi->gd_regsize && off < gi->gd_regsize+gi->gd_fbsize) {
303 off -= gi->gd_regsize;
304 return(((u_int)gi->gd_fbaddr + off) >> PGSHIFT);
305 }
306 /* bogus */
307 return(-1);
308 }
309
310 /*
311 * HP-UX compatibility routines
312 */
313 #ifdef COMPAT_HPUX
314
315 /*ARGSUSED*/
316 int
317 hpuxgrfioctl(dev, cmd, data, flag, p)
318 dev_t dev;
319 int cmd;
320 caddr_t data;
321 int flag;
322 struct proc *p;
323 {
324 register struct grf_softc *gp = grf_cd.cd_devs[GRFUNIT(dev)];
325 int error;
326
327 error = 0;
328 switch (cmd) {
329
330 case GCID:
331 *(int *)data = gp->g_display.gd_id;
332 break;
333
334 case GCON:
335 error = grfon(dev);
336 break;
337
338 case GCOFF:
339 error = grfoff(dev);
340 break;
341
342 case GCLOCK:
343 error = grflock(gp, 1);
344 break;
345
346 case GCUNLOCK:
347 error = grfunlock(gp);
348 break;
349
350 case GCAON:
351 case GCAOFF:
352 break;
353
354 /* GCSTATIC is implied by our implementation */
355 case GCSTATIC_CMAP:
356 case GCVARIABLE_CMAP:
357 break;
358
359 /* map in control regs and frame buffer */
360 case GCMAP:
361 error = grfmap(dev, (caddr_t *)data, p);
362 break;
363
364 case GCUNMAP:
365 error = grfunmap(dev, *(caddr_t *)data, p);
366 /* XXX: HP-UX uses GCUNMAP to get rid of GCSLOT memory */
367 if (error)
368 error = grflckunmmap(dev, *(caddr_t *)data);
369 break;
370
371 case GCSLOT:
372 {
373 struct grf_slot *sp = (struct grf_slot *)data;
374
375 sp->slot = grffindpid(gp);
376 if (sp->slot) {
377 error = grflckmmap(dev, (caddr_t *)&sp->addr);
378 if (error && gp->g_pid) {
379 free((caddr_t)gp->g_pid, M_DEVBUF);
380 gp->g_pid = NULL;
381 }
382 } else
383 error = EINVAL; /* XXX */
384 break;
385 }
386
387 case GCDESCRIBE:
388 error = (*gp->g_sw->gd_mode)(gp, GM_DESCRIBE, data);
389 break;
390
391 /*
392 * XXX: only used right now to map in rbox control registers
393 * Will be replaced in the future with a real IOMAP interface.
394 */
395 case IOMAPMAP:
396 error = iommap(dev, (caddr_t *)data);
397 #if 0
398 /*
399 * It may not be worth kludging this (using p_devtmp) to
400 * make this work. It was an undocumented side-effect
401 * in HP-UX that the mapped address was the return value
402 * of the ioctl. The only thing I remember that counted
403 * on this behavior was the rbox X10 server.
404 */
405 if (!error)
406 u.u_r.r_val1 = *(int *)data; /* XXX: this sux */
407 #endif
408 break;
409
410 case IOMAPUNMAP:
411 error = iounmmap(dev, *(caddr_t *)data);
412 break;
413
414 default:
415 error = EINVAL;
416 break;
417 }
418 return(error);
419 }
420
421 int
422 grflock(gp, block)
423 register struct grf_softc *gp;
424 int block;
425 {
426 struct proc *p = curproc; /* XXX */
427 int error;
428 extern char devioc[];
429
430 #ifdef DEBUG
431 if (grfdebug & GDB_LOCK)
432 printf("grflock(%d): flags %x lockpid %x\n",
433 p->p_pid, gp->g_flags,
434 gp->g_lockp ? gp->g_lockp->p_pid : -1);
435 #endif
436 if (gp->g_pid) {
437 #ifdef DEBUG
438 if (grfdebug & GDB_LOCK)
439 printf(" lockpslot %d lockslot %d lock[lockslot] %d\n",
440 gp->g_lock->gl_lockslot, gp->g_lockpslot,
441 gp->g_lock->gl_locks[gp->g_lockpslot]);
442 #endif
443 gp->g_lock->gl_lockslot = 0;
444 if (gp->g_lock->gl_locks[gp->g_lockpslot] == 0) {
445 gp->g_lockp = NULL;
446 gp->g_lockpslot = 0;
447 }
448 }
449 if (gp->g_lockp) {
450 if (gp->g_lockp == p)
451 return(EBUSY);
452 if (!block)
453 return(OEAGAIN);
454 do {
455 gp->g_flags |= GF_WANTED;
456 if ((error = tsleep((caddr_t)&gp->g_flags,
457 (PZERO+1) | PCATCH, devioc, 0)))
458 return (error);
459 } while (gp->g_lockp);
460 }
461 gp->g_lockp = p;
462 if (gp->g_pid) {
463 int slot = grffindpid(gp);
464
465 #ifdef DEBUG
466 if (grfdebug & GDB_LOCK)
467 printf(" slot %d\n", slot);
468 #endif
469 gp->g_lockpslot = gp->g_lock->gl_lockslot = slot;
470 gp->g_lock->gl_locks[slot] = 1;
471 }
472 return(0);
473 }
474
475 int
476 grfunlock(gp)
477 register struct grf_softc *gp;
478 {
479 #ifdef DEBUG
480 if (grfdebug & GDB_LOCK)
481 printf("grfunlock(%d): flags %x lockpid %d\n",
482 curproc->p_pid, gp->g_flags,
483 gp->g_lockp ? gp->g_lockp->p_pid : -1);
484 #endif
485 if (gp->g_lockp != curproc)
486 return(EBUSY);
487 if (gp->g_pid) {
488 #ifdef DEBUG
489 if (grfdebug & GDB_LOCK)
490 printf(" lockpslot %d lockslot %d lock[lockslot] %d\n",
491 gp->g_lock->gl_lockslot, gp->g_lockpslot,
492 gp->g_lock->gl_locks[gp->g_lockpslot]);
493 #endif
494 gp->g_lock->gl_locks[gp->g_lockpslot] = 0;
495 gp->g_lockpslot = gp->g_lock->gl_lockslot = 0;
496 }
497 if (gp->g_flags & GF_WANTED) {
498 wakeup((caddr_t)&gp->g_flags);
499 gp->g_flags &= ~GF_WANTED;
500 }
501 gp->g_lockp = NULL;
502 return(0);
503 }
504
505 /*
506 * Convert a BSD style minor devno to HPUX style.
507 * We cannot just create HPUX style nodes as they require 24 bits
508 * of minor device number and we only have 8.
509 * XXX: This may give the wrong result for remote stats of other
510 * machines where device 10 exists.
511 */
512 int
513 grfdevno(dev)
514 dev_t dev;
515 {
516 int unit = GRFUNIT(dev);
517 struct grf_softc *gp;
518 int newdev;
519
520 if (unit >= grf_cd.cd_ndevs ||
521 (gp = grf_cd.cd_devs[unit]) == NULL ||
522 (gp->g_flags&GF_ALIVE) == 0)
523 return(bsdtohpuxdev(dev));
524 /* magic major number */
525 newdev = 12 << 24;
526 /* now construct minor number */
527 if (gp->g_display.gd_regaddr != (caddr_t)GRFIADDR) {
528 int sc = patosc(gp->g_display.gd_regaddr);
529 newdev |= (sc << 16) | 0x200;
530 }
531 if (dev & GRFIMDEV)
532 newdev |= 0x02;
533 else if (dev & GRFOVDEV)
534 newdev |= 0x01;
535 #ifdef DEBUG
536 if (grfdebug & GDB_DEVNO)
537 printf("grfdevno: dev %x newdev %x\n", dev, newdev);
538 #endif
539 return(newdev);
540 }
541
542 #endif /* COMPAT_HPUX */
543
544 int
545 grfmap(dev, addrp, p)
546 dev_t dev;
547 caddr_t *addrp;
548 struct proc *p;
549 {
550 struct grf_softc *gp = grf_cd.cd_devs[GRFUNIT(dev)];
551 int len, error;
552 struct vnode vn;
553 struct specinfo si;
554 int flags;
555
556 #ifdef DEBUG
557 if (grfdebug & GDB_MMAP)
558 printf("grfmap(%d): addr %p\n", p->p_pid, *addrp);
559 #endif
560 len = gp->g_display.gd_regsize + gp->g_display.gd_fbsize;
561 flags = MAP_SHARED;
562 if (*addrp)
563 flags |= MAP_FIXED;
564 else
565 *addrp = (caddr_t)0x1000000; /* XXX */
566 vn.v_type = VCHR; /* XXX */
567 vn.v_specinfo = &si; /* XXX */
568 vn.v_rdev = dev; /* XXX */
569 #if defined(UVM)
570 error = uvm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *)addrp,
571 (vm_size_t)len, VM_PROT_ALL, VM_PROT_ALL,
572 flags, (caddr_t)&vn, 0);
573 #else
574 error = vm_mmap(&p->p_vmspace->vm_map, (vm_offset_t *)addrp,
575 (vm_size_t)len, VM_PROT_ALL, VM_PROT_ALL,
576 flags, (caddr_t)&vn, 0);
577 #endif
578 if (error == 0)
579 (void) (*gp->g_sw->gd_mode)(gp, GM_MAP, *addrp);
580 return(error);
581 }
582
583 int
584 grfunmap(dev, addr, p)
585 dev_t dev;
586 caddr_t addr;
587 struct proc *p;
588 {
589 struct grf_softc *gp = grf_cd.cd_devs[GRFUNIT(dev)];
590 vm_size_t size;
591 int rv;
592
593 #ifdef DEBUG
594 if (grfdebug & GDB_MMAP)
595 printf("grfunmap(%d): dev %x addr %p\n", p->p_pid, dev, addr);
596 #endif
597 if (addr == 0)
598 return(EINVAL); /* XXX: how do we deal with this? */
599 (void) (*gp->g_sw->gd_mode)(gp, GM_UNMAP, 0);
600 size = round_page(gp->g_display.gd_regsize + gp->g_display.gd_fbsize);
601 #if defined(UVM)
602 rv = uvm_unmap(&p->p_vmspace->vm_map, (vm_offset_t)addr,
603 (vm_offset_t)addr + size, FALSE);
604 #else
605 rv = vm_deallocate(&p->p_vmspace->vm_map, (vm_offset_t)addr, size);
606 #endif
607 return(rv == KERN_SUCCESS ? 0 : EINVAL);
608 }
609
610 #ifdef COMPAT_HPUX
611 int
612 iommap(dev, addrp)
613 dev_t dev;
614 caddr_t *addrp;
615 {
616
617 #ifdef DEBUG
618 if (grfdebug & (GDB_MMAP|GDB_IOMAP))
619 printf("iommap(%d): addr %p\n", curproc->p_pid, *addrp);
620 #endif
621 return(EINVAL);
622 }
623
624 int
625 iounmmap(dev, addr)
626 dev_t dev;
627 caddr_t addr;
628 {
629 #ifdef DEBUG
630 int unit = minor(dev);
631
632 if (grfdebug & (GDB_MMAP|GDB_IOMAP))
633 printf("iounmmap(%d): id %d addr %p\n",
634 curproc->p_pid, unit, addr);
635 #endif
636 return(0);
637 }
638
639 /*
640 * Processes involved in framebuffer mapping via GCSLOT are recorded in
641 * an array of pids. The first element is used to record the last slot used
642 * (for faster lookups). The remaining elements record up to GRFMAXLCK-1
643 * process ids. Returns a slot number between 1 and GRFMAXLCK or 0 if no
644 * slot is available.
645 */
646 int
647 grffindpid(gp)
648 struct grf_softc *gp;
649 {
650 register short pid, *sp;
651 register int i, limit;
652 int ni;
653
654 if (gp->g_pid == NULL) {
655 gp->g_pid = (short *)
656 malloc(GRFMAXLCK * sizeof(short), M_DEVBUF, M_WAITOK);
657 bzero((caddr_t)gp->g_pid, GRFMAXLCK * sizeof(short));
658 }
659 pid = curproc->p_pid;
660 ni = limit = gp->g_pid[0];
661 for (i = 1, sp = &gp->g_pid[1]; i <= limit; i++, sp++) {
662 if (*sp == pid)
663 goto done;
664 if (*sp == 0)
665 ni = i;
666 }
667 i = ni;
668 if (i < limit) {
669 gp->g_pid[i] = pid;
670 goto done;
671 }
672 if (++i == GRFMAXLCK)
673 return(0);
674 gp->g_pid[0] = i;
675 gp->g_pid[i] = pid;
676 done:
677 #ifdef DEBUG
678 if (grfdebug & GDB_LOCK)
679 printf("grffindpid(%d): slot %d of %d\n",
680 pid, i, gp->g_pid[0]);
681 #endif
682 return(i);
683 }
684
685 void
686 grfrmpid(gp)
687 struct grf_softc *gp;
688 {
689 register short pid, *sp;
690 register int limit, i;
691 int mi;
692
693 if (gp->g_pid == NULL || (limit = gp->g_pid[0]) == 0)
694 return;
695 pid = curproc->p_pid;
696 limit = gp->g_pid[0];
697 mi = 0;
698 for (i = 1, sp = &gp->g_pid[1]; i <= limit; i++, sp++) {
699 if (*sp == pid)
700 *sp = 0;
701 else if (*sp)
702 mi = i;
703 }
704 i = mi;
705 if (i < limit)
706 gp->g_pid[0] = i;
707 #ifdef DEBUG
708 if (grfdebug & GDB_LOCK)
709 printf("grfrmpid(%d): slot %d of %d\n",
710 pid, sp-gp->g_pid, gp->g_pid[0]);
711 #endif
712 }
713
714 int
715 grflckmmap(dev, addrp)
716 dev_t dev;
717 caddr_t *addrp;
718 {
719 #ifdef DEBUG
720 struct proc *p = curproc; /* XXX */
721
722 if (grfdebug & (GDB_MMAP|GDB_LOCK))
723 printf("grflckmmap(%d): addr %p\n",
724 p->p_pid, *addrp);
725 #endif
726 return(EINVAL);
727 }
728
729 int
730 grflckunmmap(dev, addr)
731 dev_t dev;
732 caddr_t addr;
733 {
734 #ifdef DEBUG
735 int unit = minor(dev);
736
737 if (grfdebug & (GDB_MMAP|GDB_LOCK))
738 printf("grflckunmmap(%d): id %d addr %p\n",
739 curproc->p_pid, unit, addr);
740 #endif
741 return(EINVAL);
742 }
743 #endif /* COMPAT_HPUX */
744