Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / alpha / isa / isa_machdep.c
blob7d5cd2bdebf3b8b821bf0c83e35df0e9375b37b4
1 /* $NetBSD: isa_machdep.c,v 1.17 2009/03/14 15:35:59 dsl Exp $ */
3 /*
4 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved.
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
31 * Machine-specific functions for ISA autoconfiguration.
34 #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
36 __KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.17 2009/03/14 15:35:59 dsl Exp $");
38 #include <sys/types.h>
39 #include <sys/param.h>
40 #include <sys/time.h>
41 #include <sys/systm.h>
42 #include <sys/errno.h>
43 #include <sys/device.h>
45 #include <uvm/uvm_extern.h>
47 #include <dev/isa/isavar.h>
49 #include "vga_isa.h"
50 #if NVGA_ISA
51 #include <dev/ic/mc6845reg.h>
52 #include <dev/ic/pcdisplayvar.h>
53 #include <dev/isa/vga_isavar.h>
54 #endif
56 #include "pcppi.h"
57 #if (NPCPPI > 0)
58 #include <dev/isa/pcppivar.h>
60 int isabeepmatch(struct device *, struct cfdata *, void *);
61 void isabeepattach(struct device *, struct device *, void *);
63 CFATTACH_DECL(isabeep, sizeof(struct device),
64 isabeepmatch, isabeepattach, NULL, NULL);
66 static int ppi_attached;
67 static pcppi_tag_t ppicookie;
68 #endif /* PCPPI */
70 int
71 isa_display_console(bus_space_tag_t iot, bus_space_tag_t memt)
73 int res = ENXIO;
74 #if NVGA_ISA
75 res = vga_isa_cnattach(iot, memt);
76 if (!res)
77 return(0);
78 #endif
79 return(res);
82 #if (NPCPPI > 0)
83 int
84 isabeepmatch(struct device *parent, struct cfdata *match, void *aux)
86 return (!ppi_attached);
89 void
90 isabeepattach(struct device *parent, struct device *self, void *aux)
92 printf("\n");
94 ppicookie = ((struct pcppi_attach_args *)aux)->pa_cookie;
95 ppi_attached = 1;
97 #endif
99 void
100 isabeep(int pitch, int period)
102 #if (NPCPPI > 0)
103 if (ppi_attached)
104 pcppi_bell(ppicookie, pitch, period, 0);
105 #endif