No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / prep / isa / isabeep.c
blob1693131a23a168479753a389f46bf1a5b1f24e24
1 /* $NetBSD: isabeep.c,v 1.8.26.1 2007/05/10 15:46:07 garbled 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.
30 #include <sys/cdefs.h>
31 __KERNEL_RCSID(0, "$NetBSD: isabeep.c,v 1.8.26.1 2007/05/10 15:46:07 garbled Exp $");
33 #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
35 #include <sys/types.h>
36 #include <sys/param.h>
37 #include <sys/time.h>
38 #include <sys/systm.h>
39 #include <sys/errno.h>
40 #include <sys/device.h>
41 #include <uvm/uvm_extern.h>
43 #include <dev/isa/isavar.h>
45 #include "pcppi.h"
46 #if NPCPPI > 0
47 #include <dev/isa/pcppivar.h>
49 int isabeepmatch(struct device *, struct cfdata *, void *);
50 void isabeepattach(struct device *, struct device *, void *);
52 CFATTACH_DECL(isabeep, sizeof(struct device),
53 isabeepmatch, isabeepattach, NULL, NULL);
55 static int ppi_attached;
56 static pcppi_tag_t ppicookie;
58 int
59 isabeepmatch(struct device *parent, struct cfdata *match, void *aux)
61 return (!ppi_attached);
64 void
65 isabeepattach(struct device *parent, struct device *self, void *aux)
67 aprint_normal("\n");
69 ppicookie = ((struct pcppi_attach_args *)aux)->pa_cookie;
70 ppi_attached = 1;
72 #endif
74 void
75 isabeep(int pitch, int period)
77 #if NPCPPI > 0
78 if (ppi_attached)
79 pcppi_bell(ppicookie, pitch, period, 0);
80 #endif