diff --git a/games/morse/Makefile b/games/morse/Makefile index 44b20bab668b..92d11214760b 100644 --- a/games/morse/Makefile +++ b/games/morse/Makefile @@ -1,11 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ PROG= morse MAN= morse.6 -.if ${MACHINE_ARCH} == "i386" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" CFLAGS += -DSPEAKER=\"/dev/speaker\" .endif .include diff --git a/games/morse/morse.c b/games/morse/morse.c index eb9e4d4b7d24..87f97dccd5de 100644 --- a/games/morse/morse.c +++ b/games/morse/morse.c @@ -1,584 +1,584 @@ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Taught to send *real* morse by Lyndon Nerenberg (VE7TCP/VE6BBM) * */ #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93"; #endif static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ #include #include #include #include #include #include #include #include #include #include #include #ifdef SPEAKER -#include +#include #endif struct morsetab { char inchar; char *morse; }; static const struct morsetab mtab[] = { /* letters */ {'a', ".-"}, {'b', "-..."}, {'c', "-.-."}, {'d', "-.."}, {'e', "."}, {'f', "..-."}, {'g', "--."}, {'h', "...."}, {'i', ".."}, {'j', ".---"}, {'k', "-.-"}, {'l', ".-.."}, {'m', "--"}, {'n', "-."}, {'o', "---"}, {'p', ".--."}, {'q', "--.-"}, {'r', ".-."}, {'s', "..."}, {'t', "-"}, {'u', "..-"}, {'v', "...-"}, {'w', ".--"}, {'x', "-..-"}, {'y', "-.--"}, {'z', "--.."}, /* digits */ {'0', "-----"}, {'1', ".----"}, {'2', "..---"}, {'3', "...--"}, {'4', "....-"}, {'5', "....."}, {'6', "-...."}, {'7', "--..."}, {'8', "---.."}, {'9', "----."}, /* punctuation */ {',', "--..--"}, {'.', ".-.-.-"}, {'"', ".-..-."}, {'!', "..--."}, {'?', "..--.."}, {'/', "-..-."}, {'-', "-....-"}, {'=', "-...-"}, /* BT */ {':', "---..."}, {';', "-.-.-."}, {'(', "-.--."}, /* KN */ {')', "-.--.-"}, {'$', "...-..-"}, {'+', ".-.-."}, /* AR */ {'@', ".--.-."}, /* AC */ /* prosigns without already assigned values */ {'#', ".-..."}, /* AS */ {'&', "...-.-"}, /* SK */ {'*', "...-."}, /* VE */ {'%', "-...-.-"}, /* BK */ {'\0', ""} }; static const struct morsetab iso8859_1tab[] = { {'á', ".--.-"}, {'à', ".--.-"}, {'â', ".--.-"}, {'ä', ".-.-"}, {'ç', "-.-.."}, {'é', "..-.."}, {'è', "..-.."}, {'ê', "-..-."}, {'ö', "---."}, {'ü', "..--"}, {'\0', ""} }; static const struct morsetab iso8859_7tab[] = { /* * The greek alphabet; you'll need an 8859-7 font in order * to see the actual characters. * This table does not implement: * - the special sequences for the seven diphthongs, * - the punctuation differences. * Implementing these features would introduce too many * special-cases in the program's main loop. * The diphtong sequences are: * alpha iota .-.- * alpha upsilon ..-- * epsilon upsilon ---. * eta upsilon ...- * omikron iota ---.. * omikron upsilon ..- * upsilon iota .--- * The different punctuation symbols are: * ; ..-.- * ! --..-- */ {'á', ".-"}, /* alpha */ {'Ü', ".-"}, /* alpha with acute */ {'â', "-..."}, /* beta */ {'ã', "--."}, /* gamma */ {'ä', "-.."}, /* delta */ {'å', "."}, /* epsilon */ {'Ý', "."}, /* epsilon with acute */ {'æ', "--.."}, /* zeta */ {'ç', "...."}, /* eta */ {'Þ', "...."}, /* eta with acute */ {'è', "-.-."}, /* theta */ {'é', ".."}, /* iota */ {'ß', ".."}, /* iota with acute */ {'ú', ".."}, /* iota with diairesis */ {'À', ".."}, /* iota with acute and diairesis */ {'ê', "-.-"}, /* kappa */ {'ë', ".-.."}, /* lamda */ {'ì', "--"}, /* mu */ {'í', "-."}, /* nu */ {'î', "-..-"}, /* xi */ {'ï', "---"}, /* omicron */ {'ü', "---"}, /* omicron with acute */ {'ð', ".--."}, /* pi */ {'ñ', ".-."}, /* rho */ {'ó', "..."}, /* sigma */ {'ò', "..."}, /* final sigma */ {'ô', "-"}, /* tau */ {'õ', "-.--"}, /* upsilon */ {'ý', "-.--"}, /* upsilon with acute */ {'û', "-.--"}, /* upsilon and diairesis */ {'à', "-.--"}, /* upsilon with acute and diairesis */ {'ö', "..-."}, /* phi */ {'÷', "----"}, /* chi */ {'ø', "--.-"}, /* psi */ {'ù', ".--"}, /* omega */ {'þ', ".--"}, /* omega with acute */ {'\0', ""} }; static const struct morsetab koi8rtab[] = { /* * the cyrillic alphabet; you'll need a KOI8R font in order * to see the actual characters */ {'Á', ".-"}, /* a */ {'Â', "-..."}, /* be */ {'×', ".--"}, /* ve */ {'Ç', "--."}, /* ge */ {'Ä', "-.."}, /* de */ {'Å', "."}, /* ye */ {'£', "."}, /* yo, the same as ye */ {'Ö', "...-"}, /* she */ {'Ú', "--.."}, /* ze */ {'É', ".."}, /* i */ {'Ê', ".---"}, /* i kratkoye */ {'Ë', "-.-"}, /* ka */ {'Ì', ".-.."}, /* el */ {'Í', "--"}, /* em */ {'Î', "-."}, /* en */ {'Ï', "---"}, /* o */ {'Ð', ".--."}, /* pe */ {'Ò', ".-."}, /* er */ {'Ó', "..."}, /* es */ {'Ô', "-"}, /* te */ {'Õ', "..-"}, /* u */ {'Æ', "..-."}, /* ef */ {'È', "...."}, /* kha */ {'Ã', "-.-."}, /* ce */ {'Þ', "---."}, /* che */ {'Û', "----"}, /* sha */ {'Ý', "--.-"}, /* shcha */ {'Ù', "-.--"}, /* yi */ {'Ø', "-..-"}, /* myakhkij znak */ {'Ü', "..-.."}, /* ae */ {'À', "..--"}, /* yu */ {'Ñ', ".-.-"}, /* ya */ {'\0', ""} }; void show(const char *), play(const char *), morse(char); void ttyout(const char *); void sighandler(int); #define GETOPTOPTS "c:d:ef:lsw:" #define USAGE \ "usage: morse [-els] [-d device] [-w speed] [-c speed] [-f frequency] [string ...]\n" static int pflag, lflag, sflag, eflag; static int wpm = 20; /* effective words per minute */ static int cpm; /* effective words per minute between * characters */ #define FREQUENCY 600 static int freq = FREQUENCY; static char *device; /* for tty-controlled generator */ #define DASH_LEN 3 #define CHAR_SPACE 3 #define WORD_SPACE (7 - CHAR_SPACE - 1) static float dot_clock; static float cdot_clock; int spkr, line; struct termios otty, ntty; int olflags; #ifdef SPEAKER tone_t sound; #undef GETOPTOPTS #define GETOPTOPTS "c:d:ef:lpsw:" #undef USAGE #define USAGE \ "usage: morse [-elps] [-d device] [-w speed] [-c speed] [-f frequency] [string ...]\n" #endif static const struct morsetab *hightab; int main(int argc, char **argv) { int ch, lflags; char *p, *codeset; while ((ch = getopt(argc, argv, GETOPTOPTS)) != -1) switch ((char) ch) { case 'c': cpm = atoi(optarg); break; case 'd': device = optarg; break; case 'e': eflag = 1; setvbuf(stdout, 0, _IONBF, 0); break; case 'f': freq = atoi(optarg); break; case 'l': lflag = 1; break; #ifdef SPEAKER case 'p': pflag = 1; break; #endif case 's': sflag = 1; break; case 'w': wpm = atoi(optarg); break; case '?': default: fputs(USAGE, stderr); exit(1); } if (sflag && lflag) { fputs("morse: only one of -l and -s allowed\n", stderr); exit(1); } if ((pflag || device) && (sflag || lflag)) { fputs("morse: only one of -p, -d and -l, -s allowed\n", stderr); exit(1); } if (cpm == 0) cpm = wpm; if ((pflag || device) && ((wpm < 1) || (wpm > 60) || (cpm < 1) || (cpm > 60))) { fputs("morse: insane speed\n", stderr); exit(1); } if ((pflag || device) && (freq == 0)) freq = FREQUENCY; #ifdef SPEAKER if (pflag) { if ((spkr = open(SPEAKER, O_WRONLY, 0)) == -1) { perror(SPEAKER); exit(1); } } else #endif if (device) { if ((line = open(device, O_WRONLY | O_NONBLOCK)) == -1) { perror("open tty line"); exit(1); } if (tcgetattr(line, &otty) == -1) { perror("tcgetattr() failed"); exit(1); } ntty = otty; ntty.c_cflag |= CLOCAL; tcsetattr(line, TCSANOW, &ntty); lflags = fcntl(line, F_GETFL); lflags &= ~O_NONBLOCK; fcntl(line, F_SETFL, &lflags); ioctl(line, TIOCMGET, &lflags); lflags &= ~TIOCM_RTS; olflags = lflags; ioctl(line, TIOCMSET, &lflags); (void)signal(SIGHUP, sighandler); (void)signal(SIGINT, sighandler); (void)signal(SIGQUIT, sighandler); (void)signal(SIGTERM, sighandler); } if (pflag || device) { dot_clock = wpm / 2.4; /* dots/sec */ dot_clock = 1 / dot_clock; /* duration of a dot */ dot_clock = dot_clock / 2; /* dot_clock runs at twice */ /* the dot rate */ dot_clock = dot_clock * 100; /* scale for ioctl */ cdot_clock = cpm / 2.4; /* dots/sec */ cdot_clock = 1 / cdot_clock; /* duration of a dot */ cdot_clock = cdot_clock / 2; /* dot_clock runs at twice */ /* the dot rate */ cdot_clock = cdot_clock * 100; /* scale for ioctl */ } argc -= optind; argv += optind; if (setlocale(LC_CTYPE, "") != NULL && *(codeset = nl_langinfo(CODESET)) != '\0') { if (strcmp(codeset, "KOI8-R") == 0) hightab = koi8rtab; else if (strcmp(codeset, "ISO8859-1") == 0 || strcmp(codeset, "ISO8859-15") == 0) hightab = iso8859_1tab; else if (strcmp(codeset, "ISO8859-7") == 0) hightab = iso8859_7tab; } if (lflag) printf("m"); if (*argv) { do { for (p = *argv; *p; ++p) { if (eflag) putchar(*p); morse(*p); } if (eflag) putchar(' '); morse(' '); } while (*++argv); } else { while ((ch = getchar()) != EOF) { if (eflag) putchar(ch); morse(ch); } } if (device) tcsetattr(line, TCSANOW, &otty); exit(0); } void morse(char c) { const struct morsetab *m; if (isalpha((unsigned char)c)) c = tolower((unsigned char)c); if ((c == '\r') || (c == '\n')) c = ' '; if (c == ' ') { if (pflag) play(" "); else if (device) ttyout(" "); else if (lflag) printf("\n"); else show(""); return; } for (m = ((unsigned char)c < 0x80? mtab: hightab); m != NULL && m->inchar != '\0'; m++) { if (m->inchar == c) { if (pflag) { play(m->morse); } else if (device) { ttyout(m->morse); } else show(m->morse); } } } void show(const char *s) { if (lflag) { printf("%s ", s); } else if (sflag) { printf(" %s\n", s); } else { for (; *s; ++s) printf(" %s", *s == '.' ? "dit" : "dah"); printf("\n"); } } void play(const char *s) { #ifdef SPEAKER const char *c; for (c = s; *c != '\0'; c++) { switch (*c) { case '.': sound.frequency = freq; sound.duration = dot_clock; break; case '-': sound.frequency = freq; sound.duration = dot_clock * DASH_LEN; break; case ' ': sound.frequency = 0; sound.duration = cdot_clock * WORD_SPACE; break; default: sound.duration = 0; } if (sound.duration) { if (ioctl(spkr, SPKRTONE, &sound) == -1) { perror("ioctl play"); exit(1); } } sound.frequency = 0; sound.duration = dot_clock; if (ioctl(spkr, SPKRTONE, &sound) == -1) { perror("ioctl rest"); exit(1); } } sound.frequency = 0; sound.duration = cdot_clock * CHAR_SPACE; ioctl(spkr, SPKRTONE, &sound); #endif } void ttyout(const char *s) { const char *c; int duration, on, lflags; for (c = s; *c != '\0'; c++) { switch (*c) { case '.': on = 1; duration = dot_clock; break; case '-': on = 1; duration = dot_clock * DASH_LEN; break; case ' ': on = 0; duration = cdot_clock * WORD_SPACE; break; default: on = 0; duration = 0; } if (on) { ioctl(line, TIOCMGET, &lflags); lflags |= TIOCM_RTS; ioctl(line, TIOCMSET, &lflags); } duration *= 10000; if (duration) usleep(duration); ioctl(line, TIOCMGET, &lflags); lflags &= ~TIOCM_RTS; ioctl(line, TIOCMSET, &lflags); duration = dot_clock * 10000; usleep(duration); } duration = cdot_clock * CHAR_SPACE * 10000; usleep(duration); } void sighandler(int signo) { ioctl(line, TIOCMSET, &olflags); tcsetattr(line, TCSANOW, &otty); signal(signo, SIG_DFL); (void)kill(getpid(), signo); } diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index b22b7ededf1a..d6e0d3db51d8 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -1,495 +1,499 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 # $FreeBSD$ MAN= aac.4 \ acpi.4 \ acpi_thermal.4 \ acpi_video.4 \ adv.4 \ adw.4 \ agp.4 \ aha.4 \ ahb.4 \ ahc.4 \ ahd.4 \ aio.4 \ altq.4 \ amd.4 \ amr.4 \ an.4 \ arcmsr.4 \ asr.4 \ ata.4 \ atapicam.4 \ ataraid.4 \ ath.4 \ ath_hal.4 \ atkbd.4 \ atkbdc.4 \ aue.4 \ awi.4 \ axe.4 \ bfe.4 \ bge.4 \ bktr.4 \ blackhole.4 \ bpf.4 \ bt.4 \ cardbus.4 \ carp.4 \ ccd.4 \ cd.4 \ cdce.4 \ ch.4 \ ciss.4 \ cm.4 \ cnw.4 \ cpufreq.4 \ crypto.4 \ cue.4 \ cy.4 \ da.4 \ dc.4 \ dcons.4 \ dcons_crom.4 \ ddb.4 \ de.4 \ devctl.4 \ digi.4 \ disc.4 \ divert.4 \ dpt.4 \ dummynet.4 \ ed.4 \ ef.4 \ ehci.4 \ em.4 \ en.4 \ esp.4 \ exca.4 \ faith.4 \ fast_ipsec.4 \ fatm.4 \ fd.4 \ fdc.4 \ firewire.4 \ fla.4 \ fpa.4 \ fwe.4 \ fwip.4 \ fwohci.4 \ fxp.4 \ gbde.4 \ gdb.4 \ gem.4 \ geom.4 \ gif.4 \ gre.4 \ harp.4 \ hatm.4 \ hfa.4 \ hifn.4 \ hme.4 \ hptmv.4 \ hwpmc.4 \ ichsmb.4 \ icmp.4 \ icmp6.4 \ ida.4 \ idt.4 \ ieee80211.4 \ if_bridge.4 \ ifmib.4 \ iic.4 \ iicbb.4 \ iicbus.4 \ iicsmb.4 \ iir.4 \ inet.4 \ inet6.4 \ intpm.4 \ intro.4 \ ip.4 \ ip6.4 \ ipfirewall.4 \ ips.4 \ ipsec.4 \ ipw.4 \ isp.4 \ ispfw.4 \ iwi.4 \ ixgb.4 \ joy.4 \ kame.4 \ kbdmux.4 \ keyboard.4 \ kld.4 \ ktr.4 \ kue.4 \ led.4 \ lge.4 \ lmc.4 \ lo.4 \ lp.4 \ lpbb.4 \ lpt.4 \ mac.4 \ mac_biba.4 \ mac_bsdextended.4 \ mac_ifoff.4 \ mac_lomac.4 \ mac_mls.4 \ mac_none.4 \ mac_partition.4 \ mac_portacl.4 \ mac_seeotheruids.4 \ mac_stub.4 \ mac_test.4 \ md.4 \ mem.4 \ meteor.4 \ miibus.4 \ mlx.4 \ mly.4 \ mn.4 \ mouse.4 \ mpt.4 \ mtio.4 \ multicast.4 \ my.4 \ natm.4 \ natmip.4 \ ncr.4 \ ncv.4 \ netgraph.4 \ netintro.4 \ ng_async.4 \ ng_atm.4 \ ngatmbase.4 \ ng_atmllc.4 \ ng_atmpif.4 \ ng_bluetooth.4 \ ng_bpf.4 \ ng_bridge.4 \ ng_bt3c.4 \ ng_btsocket.4 \ ng_ccatm.4 \ ng_cisco.4 \ ng_device.4 \ nge.4 \ ng_echo.4 \ ng_eiface.4 \ ng_etf.4 \ ng_ether.4 \ ng_fec.4 \ ng_frame_relay.4 \ ng_gif.4 \ ng_gif_demux.4 \ ng_h4.4 \ ng_hci.4 \ ng_hole.4 \ ng_hub.4 \ ng_iface.4 \ ng_ipfw.4 \ ng_ip_input.4 \ ng_ksocket.4 \ ng_l2cap.4 \ ng_l2tp.4 \ ng_lmi.4 \ ng_mppc.4 \ ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ ng_ppp.4 \ ng_pppoe.4 \ ng_pptpgre.4 \ ng_rfc1490.4 \ ng_socket.4 \ ng_source.4 \ ng_split.4 \ ng_sppp.4 \ ng_sscfu.4 \ ng_sscop.4 \ ng_tcpmss.4 \ ng_tee.4 \ ng_tty.4 \ ng_ubt.4 \ ng_UI.4 \ ng_uni.4 \ ng_vjc.4 \ ng_vlan.4 \ nmdm.4 \ nsp.4 \ null.4 \ ${_nve.4} \ ohci.4 \ oldcard.4 \ orm.4 \ pass.4 \ patm.4 \ pccard.4 \ pccbb.4 \ pci.4 \ pcic.4 \ pcm.4 \ pcn.4 \ pcvt.4 \ pim.4 \ polling.4 \ ppbus.4 \ ppc.4 \ ppi.4 \ ppp.4 \ psm.4 \ pst.4 \ pt.4 \ pty.4 \ puc.4 \ ral.4 \ random.4 \ rc.4 \ re.4 \ rl.4 \ rndtest.4 \ route.4 \ rp.4 \ rue.4 \ sa.4 \ sab.4 \ safe.4 \ sbp.4 \ sbp_targ.4 \ sbsh.4 \ sched_4bsd.4 \ sched_ule.4 \ screen.4 \ scsi.4 \ sem.4 \ ses.4 \ sf.4 \ si.4 \ sio.4 \ sis.4 \ sk.4 \ sl.4 \ smb.4 \ smbus.4 \ smp.4 \ sn.4 \ snd_ad1816.4 \ snd_als4000.4 \ snd_cmi.4 \ snd_cs4281.4 \ snd_csa.4 \ snd_ds1.4 \ snd_emu10k1.4 \ snd_es137x.4 \ snd_ess.4 \ snd_fm801.4 \ snd_gusc.4 \ snd_ich.4 \ snd_maestro.4 \ snd_maestro3.4 \ snd_mss.4 \ snd_neomagic.4 \ snd_sbc.4 \ snd_solo.4 \ snd_t4dwave.4 \ snd_uaudio.4 \ snd_via8233.4 \ snd_via82c686.4 \ snd_vibes.4 \ snp.4 \ spic.4 \ + ${_spkr.4} \ splash.4 \ sppp.4 \ ste.4 \ stf.4 \ stg.4 \ sym.4 \ syncache.4 \ syncer.4 \ syscons.4 \ sysmouse.4 \ tap.4 \ targ.4 \ tcp.4 \ tdfx.4 \ termios.4 \ ti.4 \ tl.4 \ trm.4 \ tty.4 \ tun.4 \ twa.4 \ twe.4 \ tx.4 \ txp.4 \ uart.4 \ ubsa.4 \ ubsec.4 \ ubser.4 \ ubtbcmfw.4 \ ucom.4 \ ucycom.4 \ udav.4 \ udbp.4 \ udp.4 \ ufm.4 \ uftdi.4 \ ugen.4 \ uhci.4 \ uhid.4 \ uhidev.4 \ ukbd.4 \ ulpt.4 \ umass.4 \ umct.4 \ umodem.4 \ ums.4 \ unix.4 \ uplcom.4 \ ural.4 \ urio.4 \ usb.4 \ uscanner.4 \ utopia.4 \ uvisor.4 \ uvscom.4 \ vga.4 \ vge.4 \ vinum.4 \ vkbd.4 \ vlan.4 \ vpo.4 \ vr.4 \ watchdog.4 \ wb.4 \ wi.4 \ witness.4 \ wlan.4 \ wlan_acl.4 \ wlan_ccmp.4 \ wlan_tkip.4 \ wlan_wep.4 \ wlan_xauth.4 \ worm.4 \ xe.4 \ xl.4 \ xpt.4 \ zero.4 MLINKS= agp.4 agpgart.4 MLINKS+=altq.4 ALTQ.4 MLINKS+=an.4 if_an.4 MLINKS+=ata.4 acd.4 \ ata.4 ad.4 \ ata.4 afd.4 \ ata.4 ast.4 MLINKS+=aue.4 if_aue.4 MLINKS+=awi.4 if_awi.4 MLINKS+=axe.4 if_axe.4 MLINKS+=bfe.4 if_bfe.4 MLINKS+=bge.4 if_bge.4 MLINKS+=bktr.4 brooktree.4 MLINKS+=cnw.4 if_cnw.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 MLINKS+=ed.4 if_ed.4 MLINKS+=ef.4 if_ef.4 MLINKS+=em.4 if_em.4 MLINKS+=en.4 if_en.4 MLINKS+=faith.4 if_faith.4 MLINKS+=fatm.4 if_fatm.4 MLINKS+=fd.4 stderr.4 \ fd.4 stdin.4 \ fd.4 stdout.4 MLINKS+=firewire.4 ieee1394.4 MLINKS+=fpa.4 fea.4 MLINKS+=fwe.4 if_fwe.4 MLINKS+=fwip.4 if_fwip.4 MLINKS+=fxp.4 if_fxp.4 MLINKS+=gem.4 if_gem.4 MLINKS+=geom.4 GEOM.4 MLINKS+=gif.4 if_gif.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 MLINKS+=idt.4 if_idt.4 MLINKS+=if_bridge.4 bridge.4 MLINKS+=ip.4 rawip.4 MLINKS+=ipfirewall.4 ipaccounting.4 \ ipfirewall.4 ipacct.4 \ ipfirewall.4 ipfw.4 MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 MLINKS+=kue.4 if_kue.4 MLINKS+=lge.4 if_lge.4 MLINKS+=lo.4 loop.4 MLINKS+=lp.4 plip.4 MLINKS+=md.4 vn.4 MLINKS+=mem.4 kmem.4 MLINKS+=mn.4 if_mn.4 MLINKS+=my.4 if_my.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=nge.4 if_nge.4 MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=oldcard.4 card.4 MLINKS+=patm.4 if_patm.4 MLINKS+=pccbb.4 cbb.4 MLINKS+=pcm.4 snd.4 \ pcm.4 sound.4 MLINKS+=pcn.4 if_pcn.4 MLINKS+=pcvt.4 vt.4 MLINKS+=ppp.4 if_ppp.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 MLINKS+=rue.4 if_rue.4 MLINKS+=sbsh.4 if_sbsh.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ scsi.4 SCSI.4 MLINKS+=sf.4 if_sf.4 MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 MLINKS+=sl.4 if_sl.4 MLINKS+=smp.4 SMP.4 MLINKS+=sn.4 if_sn.4 +MLINKS+=${_spkr.4} ${_speaker.4} MLINKS+=splash.4 screensaver.4 MLINKS+=ste.4 if_ste.4 MLINKS+=stf.4 if_stf.4 MLINKS+=syncache.4 syncookies.4 MLINKS+=syscons.4 sc.4 MLINKS+=tap.4 if_tap.4 MLINKS+=ti.4 if_ti.4 MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 MLINKS+=udav.4 if_udav.4 MLINKS+=ural.4 if_ural.4 MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=wb.4 if_wb.4 MLINKS+=wi.4 if_wi.4 MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -_nve.4= nve.4 _if_nve.4= if_nve.4 +_nve.4= nve.4 +_spkr.4= spkr.4 +_speaker.4= speaker.4 .endif .if exists(${.CURDIR}/man4.${MACHINE_ARCH}) SUBDIR= man4.${MACHINE_ARCH} .endif .include diff --git a/share/man/man4/man4.i386/Makefile b/share/man/man4/man4.i386/Makefile index 43e85257e773..c5ca2d786c13 100644 --- a/share/man/man4/man4.i386/Makefile +++ b/share/man/man4/man4.i386/Makefile @@ -1,64 +1,62 @@ # $FreeBSD$ MAN= acpi_asus.4 \ acpi_fujitsu.4 \ acpi_ibm.4 \ acpi_panasonic.4 \ acpi_sony.4 \ acpi_toshiba.4 \ aic.4 \ alpm.4 \ amdpm.4 \ apm.4 \ ar.4 \ arl.4 \ cp.4 \ CPU_ELAN.4 \ cs.4 \ ct.4 \ ctau.4 \ cx.4 \ ep.4 \ ex.4 \ fe.4 \ ichwd.4 \ ie.4 \ io.4 \ linux.4 \ lnc.4 \ longrun.4 \ mcd.4 \ mse.4 \ ndis.4 \ npx.4 \ oltr.4 \ pae.4 \ pbio.4 \ pcf.4 \ perfmon.4 \ pnp.4 \ pnpbios.4 \ ray.4 \ sbni.4 \ scd.4 \ smapi.4 \ snc.4 \ - spkr.4 \ sr.4 \ streams.4 \ svr4.4 \ viapm.4 \ vpd.4 \ vx.4 \ wl.4 MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 MLINKS+=ndis.4 if_ndis.4 MLINKS+=oltr.4 if_oltr.4 MLINKS+=pae.4 PAE.4 MLINKS+=sbni.4 if_sbni.4 -MLINKS+=spkr.4 speaker.4 MANSUBDIR=/i386 .include diff --git a/share/man/man4/man4.i386/spkr.4 b/share/man/man4/man4.i386/spkr.4 deleted file mode 100644 index fc0ed99bb613..000000000000 --- a/share/man/man4/man4.i386/spkr.4 +++ /dev/null @@ -1,249 +0,0 @@ -.\" -.\" $FreeBSD$ -.\" -.Dd November 7, 1993 -.Dt SPKR 4 i386 -.Os -.Sh NAME -.Nm speaker , -.Nm spkr -.Nd console speaker device driver -.Sh SYNOPSIS -.Cd device speaker -.In machine/speaker.h -.Sh DESCRIPTION -The speaker device driver allows applications to control the PC console -speaker on an -.Tn IBM-PC Ns --compatible -machine running -.Fx . -.Pp -Only one process may have this device open at any given time; -.Xr open 2 -and -.Xr close 2 -are used to lock and relinquish it. -An attempt to open when -another process has the device locked will return -1 with an -.Er EBUSY -error -indication. -Writes to the device are interpreted as `play strings' in a -simple ASCII melody notation. -An -.Xr ioctl 2 -request -for tone generation at arbitrary -frequencies is also supported. -.Pp -Sound-generation does not monopolize the processor; in fact, the driver -spends most of its time sleeping while the PC hardware is emitting -tones. -Other processes may emit beeps while the driver is running. -.Pp -Applications may call -.Xr ioctl 2 -on a speaker file descriptor to control the -speaker driver directly; definitions for the -.Xr ioctl 2 -interface are in -.In machine/speaker.h . -The -.Li tone_t -structure used in these calls has two fields, -specifying a frequency (in Hz) and a duration (in 1/100ths of a second). -A frequency of zero is interpreted as a rest. -.Pp -At present there are two such -.Xr ioctl 2 -calls. -.Dv SPKRTONE -accepts a pointer to a -single tone structure as third argument and plays it. -.Dv SPKRTUNE -accepts a -pointer to the first of an array of tone structures and plays them in -continuous sequence; this array must be terminated by a final member with -a zero duration. -.Pp -The play-string language is modeled on the PLAY statement conventions of -.Tn IBM -Advanced BASIC 2.0. -The -.Li MB , -.Li MF , -and -.Li X -primitives of PLAY are not -useful in a timesharing environment and are omitted. -The `octave-tracking' -feature and the slur mark are new. -.Pp -There are 84 accessible notes numbered 1-84 in 7 octaves, each running from -C to B, numbered 0-6; the scale is equal-tempered A440 and octave 3 starts -with middle C. -By default, the play function emits half-second notes with the -last 1/16th second being `rest time'. -.Pp -Play strings are interpreted left to right as a series of play command groups; -letter case is ignored. -Play command groups are as follows: -.Bl -tag -width CDEFGABxx -.It Li CDEFGAB -Letters A through G cause the corresponding note to be played in the -current octave. -A note letter may optionally be followed by an -.Dq Em "accidental sign" , -one of # + or -; the first two of these cause it to be sharped one -half-tone, the last causes it to be flatted one half-tone. -It may -also be followed by a time value number and by sustain dots (see -below). -Time values are interpreted as for the L command below. -.It Ns Li O Sy n -If -.Sy n -is numeric, this sets the current octave. -.Sy n -may also be one of -.Li L -or -.Li N -to enable or disable octave-tracking (it is disabled by default). -When octave-tracking is on, interpretation of a pair of letter notes -will change octaves if necessary in order to make the smallest -possible jump between notes. -Thus ``olbc'' will be played as -``olb>c'', and ``olcb'' as ``olc, < and O[0123456]. -(The octave-locking -feature is not supported in -.Tn IBM -BASIC.) -.It Li > -Bump the current octave up one. -.It Li < -Drop the current octave down one. -.It Ns Li N Sy n -Play note -.Sy n , -.Sy n -being 1 to 84 or 0 for a rest of current time value. -May be followed by sustain dots. -.It Ns Li L Sy n -Sets the current time value for notes. -The default is -.Li L4 , -quarter or crotchet notes. -The lowest possible value is 1; values up -to 64 are accepted. -.Li L1 -sets whole notes, -.Li L2 -sets half notes, -.Li L4 -sets quarter notes, etc. -.It Ns Li P Sy n -Pause (rest), with -.Sy n -interpreted as for -.Li L Sy n . -May be followed by -sustain dots. -May also be written -.Li ~ . -.It Ns Li T Sy n -Sets the number of quarter notes per minute; default is 120. -Musical -names for common tempi are: -.Bd -literal -offset indent - Tempo Beats Per Minute -very slow Larghissimo - Largo 40-60 - Larghetto 60-66 - Grave - Lento - Adagio 66-76 -slow Adagietto - Andante 76-108 -medium Andantino - Moderato 108-120 -fast Allegretto - Allegro 120-168 - Vivace - Veloce - Presto 168-208 -very fast Prestissimo -.Ed -.It Li M[LNS] -Set articulation. -.Li MN -.Li ( N -for normal) is the default; the last 1/8th of -the note's value is rest time. -You can set -.Li ML -for legato (no rest space) or -.Li MS -for staccato (1/4 rest space). -.El -.Pp -Notes (that is, -.Li CDEFGAB -or -.Li N -command character groups) may be followed by -sustain dots. -Each dot causes the note's value to be lengthened by one-half -for each one. -Thus, a note dotted once is held for 3/2 of its undotted value; -dotted twice, it is held 9/4, and three times would give 27/8. -.Pp -A note and its sustain dots may also be followed by a slur mark (underscore). -This causes the normal micro-rest after the note to be filled in, slurring it -to the next one. -(The slur feature is not supported in -.Tn IBM -BASIC.) -.Pp -Whitespace in play strings is simply skipped and may be used to separate -melody sections. -.Sh FILES -.Bl -tag -width /dev/speakerxx -.It Pa /dev/speaker -speaker device file -.El -.Sh SEE ALSO -.Xr spkrtest 8 -.Sh HISTORY -The -.Nm -device appeared in -.Fx 1.0 . -.Sh AUTHORS -.An Eric S. Raymond Aq esr@snark.thyrsus.com -June 1990 -.Sh "PORTED BY" -.An Andrew A. Chernov Aq ache@astral.msk.su -.Sh BUGS -Due to roundoff in the pitch tables and slop in the tone-generation and timer -hardware (neither of which was designed for precision), neither pitch accuracy -nor timings will be mathematically exact. -There is no volume control. -.Pp -The action of two or more sustain dots does not reflect standard musical -notation, in which each dot adds half the value of the previous dot -modifier, not half the value of the note as modified. -Thus, a note dotted -once is held for 3/2 of its undotted value; dotted twice, it is held 7/4, -and three times would give 15/8. -The multiply-by-3/2 interpretation, -however, is specified in the -.Tn IBM -BASIC manual and has been retained for -compatibility. -.Pp -In play strings which are very long (longer than your system's physical I/O -blocks) note suffixes or numbers may occasionally be parsed incorrectly due -to crossing a block boundary. diff --git a/share/man/man4/spkr.4 b/share/man/man4/spkr.4 index fc0ed99bb613..1f39a1eec0ec 100644 --- a/share/man/man4/spkr.4 +++ b/share/man/man4/spkr.4 @@ -1,249 +1,249 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 1993 -.Dt SPKR 4 i386 +.Dd November 10, 2005 +.Dt SPKR 4 .Os .Sh NAME .Nm speaker , .Nm spkr .Nd console speaker device driver .Sh SYNOPSIS .Cd device speaker -.In machine/speaker.h +.In dev/speaker/speaker.h .Sh DESCRIPTION The speaker device driver allows applications to control the PC console speaker on an .Tn IBM-PC Ns --compatible machine running .Fx . .Pp Only one process may have this device open at any given time; .Xr open 2 and .Xr close 2 are used to lock and relinquish it. An attempt to open when another process has the device locked will return -1 with an .Er EBUSY error indication. Writes to the device are interpreted as `play strings' in a simple ASCII melody notation. An .Xr ioctl 2 request for tone generation at arbitrary frequencies is also supported. .Pp Sound-generation does not monopolize the processor; in fact, the driver spends most of its time sleeping while the PC hardware is emitting tones. Other processes may emit beeps while the driver is running. .Pp Applications may call .Xr ioctl 2 on a speaker file descriptor to control the speaker driver directly; definitions for the .Xr ioctl 2 interface are in -.In machine/speaker.h . +.In dev/speaker/speaker.h . The .Li tone_t structure used in these calls has two fields, specifying a frequency (in Hz) and a duration (in 1/100ths of a second). A frequency of zero is interpreted as a rest. .Pp At present there are two such .Xr ioctl 2 calls. .Dv SPKRTONE accepts a pointer to a single tone structure as third argument and plays it. .Dv SPKRTUNE accepts a pointer to the first of an array of tone structures and plays them in continuous sequence; this array must be terminated by a final member with a zero duration. .Pp The play-string language is modeled on the PLAY statement conventions of .Tn IBM Advanced BASIC 2.0. The .Li MB , .Li MF , and .Li X primitives of PLAY are not useful in a timesharing environment and are omitted. The `octave-tracking' feature and the slur mark are new. .Pp There are 84 accessible notes numbered 1-84 in 7 octaves, each running from C to B, numbered 0-6; the scale is equal-tempered A440 and octave 3 starts with middle C. By default, the play function emits half-second notes with the last 1/16th second being `rest time'. .Pp Play strings are interpreted left to right as a series of play command groups; letter case is ignored. Play command groups are as follows: .Bl -tag -width CDEFGABxx .It Li CDEFGAB Letters A through G cause the corresponding note to be played in the current octave. A note letter may optionally be followed by an .Dq Em "accidental sign" , one of # + or -; the first two of these cause it to be sharped one half-tone, the last causes it to be flatted one half-tone. It may also be followed by a time value number and by sustain dots (see below). Time values are interpreted as for the L command below. .It Ns Li O Sy n If .Sy n is numeric, this sets the current octave. .Sy n may also be one of .Li L or .Li N to enable or disable octave-tracking (it is disabled by default). When octave-tracking is on, interpretation of a pair of letter notes will change octaves if necessary in order to make the smallest possible jump between notes. Thus ``olbc'' will be played as ``olb>c'', and ``olcb'' as ``olc, < and O[0123456]. (The octave-locking feature is not supported in .Tn IBM BASIC.) .It Li > Bump the current octave up one. .It Li < Drop the current octave down one. .It Ns Li N Sy n Play note .Sy n , .Sy n being 1 to 84 or 0 for a rest of current time value. May be followed by sustain dots. .It Ns Li L Sy n Sets the current time value for notes. The default is .Li L4 , quarter or crotchet notes. The lowest possible value is 1; values up to 64 are accepted. .Li L1 sets whole notes, .Li L2 sets half notes, .Li L4 sets quarter notes, etc. .It Ns Li P Sy n Pause (rest), with .Sy n interpreted as for .Li L Sy n . May be followed by sustain dots. May also be written .Li ~ . .It Ns Li T Sy n Sets the number of quarter notes per minute; default is 120. Musical names for common tempi are: .Bd -literal -offset indent Tempo Beats Per Minute very slow Larghissimo Largo 40-60 Larghetto 60-66 Grave Lento Adagio 66-76 slow Adagietto Andante 76-108 medium Andantino Moderato 108-120 fast Allegretto Allegro 120-168 Vivace Veloce Presto 168-208 very fast Prestissimo .Ed .It Li M[LNS] Set articulation. .Li MN .Li ( N for normal) is the default; the last 1/8th of the note's value is rest time. You can set .Li ML for legato (no rest space) or .Li MS for staccato (1/4 rest space). .El .Pp Notes (that is, .Li CDEFGAB or .Li N command character groups) may be followed by sustain dots. Each dot causes the note's value to be lengthened by one-half for each one. Thus, a note dotted once is held for 3/2 of its undotted value; dotted twice, it is held 9/4, and three times would give 27/8. .Pp A note and its sustain dots may also be followed by a slur mark (underscore). This causes the normal micro-rest after the note to be filled in, slurring it to the next one. (The slur feature is not supported in .Tn IBM BASIC.) .Pp Whitespace in play strings is simply skipped and may be used to separate melody sections. .Sh FILES .Bl -tag -width /dev/speakerxx .It Pa /dev/speaker speaker device file .El .Sh SEE ALSO .Xr spkrtest 8 .Sh HISTORY The .Nm device appeared in .Fx 1.0 . .Sh AUTHORS .An Eric S. Raymond Aq esr@snark.thyrsus.com June 1990 .Sh "PORTED BY" .An Andrew A. Chernov Aq ache@astral.msk.su .Sh BUGS Due to roundoff in the pitch tables and slop in the tone-generation and timer hardware (neither of which was designed for precision), neither pitch accuracy nor timings will be mathematically exact. There is no volume control. .Pp The action of two or more sustain dots does not reflect standard musical notation, in which each dot adds half the value of the previous dot modifier, not half the value of the note as modified. Thus, a note dotted once is held for 3/2 of its undotted value; dotted twice, it is held 7/4, and three times would give 15/8. The multiply-by-3/2 interpretation, however, is specified in the .Tn IBM BASIC manual and has been retained for compatibility. .Pp In play strings which are very long (longer than your system's physical I/O blocks) note suffixes or numbers may occasionally be parsed incorrectly due to crossing a block boundary. diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index ee8aaf8c082b..8f1566d72388 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -1,558 +1,561 @@ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # # $FreeBSD$ # # # This directive is mandatory; it defines the architecture to be # configured for; in this case, the AMD64 family based machines. # machine amd64 # # We want LINT to cover profiling as well. profile 2 ##################################################################### # SMP OPTIONS: # # Notes: # # IPI_PREEMPTION instructs the kernel to preempt threads running on other # CPUS if needed. Relies on the PREEMPTION option # Optional: options IPI_PREEMPTION device atpic # Optional legacy pic support device mptable # Optional MPSPEC mptable support # # Watchdog routines. # options MP_WATCHDOG # # Debugging options. # options STOP_NMI # Stop CPUS using NMI instead of IPI ##################################################################### # CPU OPTIONS # # You must specify at least one CPU (the one you intend to run on); # deleting the specification for CPUs you don't need to use may make # parts of the system run faster. # cpu HAMMER # aka K8, aka Opteron & Athlon64 # # Options for CPU features. # # # PERFMON causes the driver for Pentium/Pentium Pro performance counters # to be compiled. See perfmon(4) for more information. # #XXX#options PERFMON ##################################################################### # NETWORKING OPTIONS # # DEVICE_POLLING adds support for mixed interrupt-polling handling # of network device drivers, which has significant benefits in terms # of robustness to overloads and responsivity, as well as permitting # accurate scheduling of the CPU time between kernel network processing # and other activities. The drawback is a moderate (up to 1/HZ seconds) # potential increase in response times. # It is strongly recommended to use HZ=1000 or 2000 with DEVICE_POLLING # to achieve smoother behaviour. # Additionally, you can enable/disable polling at runtime with help of # the ifconfig(8) utility, and select the CPU fraction reserved to # userland with the sysctl variable kern.polling.user_frac # (default 50, range 0..100). # # Not all device drivers support this mode of operation at the time of # this writing. See polling(4) for more details. options DEVICE_POLLING ##################################################################### # CLOCK OPTIONS # The following options are used for debugging clock behavior only, and # should not be used for production systems. # CLK_CALIBRATION_LOOP causes clock calibration to be run in a loop at # startup until the user presses a key. (The i8254 clock is always # calibrated relative to the RTC (mc146818a) and this option causes the # calibration to be repeated.) options CLK_CALIBRATION_LOOP # CLK_USE_I8254_CALIBRATION causes the calibrated frequency of the i8254 # clock to actually be used. options CLK_USE_I8254_CALIBRATION ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS +device speaker #Play IBM BASIC-style noises out your speaker +hint.speaker.0.at="isa" +hint.speaker.0.port="0x61" device gzip #Exec gzipped a.out's. REQUIRES COMPAT_AOUT! ##################################################################### # HARDWARE BUS CONFIGURATION # # ISA bus # device isa # # Options for `isa': # # AUTO_EOI_1 enables the `automatic EOI' feature for the master 8259A # interrupt controller. This saves about 0.7-1.25 usec for each interrupt. # This option breaks suspend/resume on some portables. # # AUTO_EOI_2 enables the `automatic EOI' feature for the slave 8259A # interrupt controller. This saves about 0.7-1.25 usec for each interrupt. # Automatic EOI is documented not to work for for the slave with the # original i8259A, but it works for some clones and some integrated # versions. # # MAXMEM specifies the amount of RAM on the machine; if this is not # specified, FreeBSD will first read the amount of memory from the CMOS # RAM, so the amount of memory will initially be limited to 64MB or 16MB # depending on the BIOS. If the BIOS reports 64MB, a memory probe will # then attempt to detect the installed amount of RAM. If this probe # fails to detect >64MB RAM you will have to use the MAXMEM option. # The amount is in kilobytes, so for a machine with 128MB of RAM, it would # be 131072 (128 * 1024). # # BROKEN_KEYBOARD_RESET disables the use of the keyboard controller to # reset the CPU for reboot. This is needed on some systems with broken # keyboard controllers. options AUTO_EOI_1 #options AUTO_EOI_2 options MAXMEM=(128*1024) #options BROKEN_KEYBOARD_RESET # # PCI bus & PCI options: # device pci # # AGP GART support device agp ##################################################################### # HARDWARE DEVICE CONFIGURATION # # Optional devices: # # 3Dfx Voodoo Graphics, Voodoo II /dev/3dfx CDEV support. This will create # the /dev/3dfx0 device to work with glide implementations. This should get # linked to /dev/3dfx and /dev/voodoo. Note that this is not the same as # the tdfx DRI module from XFree86 and is completely unrelated. # # To enable Linuxulator support, one must also include COMPAT_LINUX in the # config as well, or you will not have the dependencies. The other option # is to load both as modules. device tdfx # Enable 3Dfx Voodoo support #XXX#options TDFX_LINUX # Enable Linuxulator support # # ACPI support using the Intel ACPI Component Architecture reference # implementation. # # ACPI_DEBUG enables the use of the debug.acpi.level and debug.acpi.layer # kernel environment variables to select initial debugging levels for the # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). # # ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op. # # ACPICA_PEDANTIC enables strict checking of AML. Our default is to # relax these checks to allow code generated by the Microsoft compiler # to still execute. # # Note that building ACPI into the kernel is deprecated; the module is # normally loaded automatically by the loader. device acpi options ACPI_DEBUG #!options ACPI_NO_SEMAPHORES #!options ACPICA_PEDANTIC # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq # Direct Rendering modules for 3D acceleration. device drm # DRM core module required by DRM drivers device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL device mgadrm # AGP Matrox G200, G400, G450, G550 device r128drm # ATI Rage 128 device radeondrm # ATI Radeon device sisdrm # SiS 300/305, 540, 630 device tdfxdrm # 3dfx Voodoo 3/4/5 and Banshee options DRM_DEBUG # Include debug printfs (slow) # # Network interfaces: # # ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # HP PC Lan+, various PC Card devices (refer to etc/defaults/pccard.conf) # (requires miibus) # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 and # Am79C960) # nve: nVidia nForce MCP on-board Ethernet Networking device ed options ED_3C503 options ED_HPP options ED_SIC #XXX# still calls MD i386 kvtop function instead of vtophys etc #XXX#device lnc device nve # nVidia nForce MCP on-board Ethernet Networking device ath device ath_hal # Atheros HAL (includes binary component) #device ath_rate_amrr # AMRR rate control for ath driver #device ath_rate_onoe # Onoe rate control for ath driver device ath_rate_sample # SampleRate rate control for the ath driver #device wlan # 802.11 layer # #XXX this stores pointers in a 32bit field that is defined by the hardware #device pst # # Areca 11xx and 12xx series of SATA II RAID controllers. # CAM is required. # device arcmsr # Areca SATA II RAID # # 3ware 9000 series PATA/SATA RAID controller driver and options. # The driver is implemented as a SIM, and so, needs the CAM infrastructure. # options TWA_DEBUG # 0-10; 10 prints the most messages. options TWA_FLASH_FIRMWARE # firmware image bundled when defined. device twa # 3ware 9000 series PATA/SATA RAID # # SCSI host adapters: # # ncv: NCR 53C500 based SCSI host adapters. # nsp: Workbit Ninja SCSI-3 based PC Card SCSI host adapters. # stg: TMC 18C30, 18C50 based SCSI host adapters. device ncv device nsp device stg # # Adaptec FSA RAID controllers, including integrated DELL controllers, # the Dell PERC 2/QC and the HP NetRAID-4M device aac device aacp # SCSI Passthrough interface (optional, CAM required) # # Highpoint RocketRAID 182x. This is really just software RAID on a # Marvell SATA chip. device hptmv # # IBM (now Adaptec) ServeRAID controllers device ips # # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # device safe # SafeNet 1141 options SAFE_DEBUG # enable debugging support: hw.safe.debug options SAFE_RNDTEST # enable rndtest support ##################################################################### # # Miscellaneous hardware: # # smbios: DMI/SMBIOS entry point # vpd: Vital Product Data kernel interface # cy: Cyclades serial driver # digi: Digiboard driver # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. # The Rev 1 host cards use a 64K chunk, on a 32K boundary. # The Rev 2 host cards use a 32K chunk, on a 32K boundary. # The cards can use an IRQ of 11, 12 or 15. device cy options CY_PCI_FASTINTR # Use with cy_pci unless irq is shared device digi # BIOS & FEP/OS components of device digi. device digi_CX device digi_CX_PCI device digi_EPCX device digi_EPCX_PCI device digi_Xe device digi_Xem device digi_Xr # Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) device pbio hint.pbio.0.at="isa" hint.pbio.0.port="0x360" device smbios device vpd # HOT1 Xilinx 6200 card (http://www.vcc.com/) device xrpu # # Laptop/Notebook options: # # # I2C Bus # # # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer # device ichwd #--------------------------------------------------------------------------- # ISDN4BSD # # See /usr/share/examples/isdn/ROADMAP for an introduction to isdn4bsd. # # i4b passive ISDN cards support contains the following hardware drivers: # # isic - Siemens/Infineon ISDN ISAC/HSCX/IPAC chipset driver # iwic - Winbond W6692 PCI bus ISDN S/T interface controller # ifpi - AVM Fritz!Card PCI driver # ifpi2 - AVM Fritz!Card PCI version 2 driver # itjc - Siemens ISAC / TJNet Tiger300/320 chipset # # i4b active ISDN cards support contains the following hardware drivers: # # iavc - AVM B1 PCI, AVM B1 ISA, AVM T1 # # Note that the ``options'' (if given) and ``device'' lines must BOTH # be uncommented to enable support for a given card ! # # In addition to a hardware driver (and probably an option) the mandatory # ISDN protocol stack devices and the mandatory support device must be # enabled as well as one or more devices from the optional devices section. # #--------------------------------------------------------------------------- # isic driver (Siemens/Infineon chipsets) # #XXX#device isic # # PCI bus Cards: # -------------- # # ELSA MicroLink ISDN/PCI (same as ELSA QuickStep 1000pro PCI) options ELSA_QS1PCI # #--------------------------------------------------------------------------- # ifpi2 driver for AVM Fritz!Card PCI version 2 # # AVM Fritz!Card PCI version 2 #XXX#device ifpi2 # #--------------------------------------------------------------------------- # iwic driver for Winbond W6692 chipset # # ASUSCOM P-IN100-ST-D (and other Winbond W6692 based cards) #XXX#device iwic # #--------------------------------------------------------------------------- # itjc driver for Siemens ISAC / TJNet Tiger300/320 chipset # # Traverse Technologies NETjet-S # Teles PCI-TJ #XXX#device itjc # #--------------------------------------------------------------------------- # iavc driver (AVM active cards, needs i4bcapi driver!) # #XXX#device iavc # #--------------------------------------------------------------------------- # ISDN Protocol Stack - mandatory for all hardware drivers # # Q.921 / layer 2 - i4b passive cards D channel handling #XXX#device i4bq921 # # Q.931 / layer 3 - i4b passive cards D channel handling #XXX#device i4bq931 # # layer 4 - i4b common passive and active card handling #XXX#device i4b # #--------------------------------------------------------------------------- # ISDN devices - mandatory for all hardware drivers # # userland driver to do ISDN tracing (for passive cards only) #XXX#device i4btrc #XXX#options NI4BTRC=4 # # userland driver to control the whole thing #XXX#device i4bctl # #--------------------------------------------------------------------------- # ISDN devices - optional # # userland driver for access to raw B channel #XXX#device i4brbch #XXX#options NI4BRBCH=4 # # userland driver for telephony #XXX#device i4btel #XXX#options NI4BTEL=2 # # network driver for IP over raw HDLC ISDN #XXX#device i4bipr #XXX#options NI4BIPR=4 # enable VJ header compression detection for ipr i/f options IPR_VJ # enable logging of the first n IP packets to isdnd (n=32 here) options IPR_LOG=32 # # network driver for sync PPP over ISDN; requires an equivalent # number of sppp device to be configured #XXX#device i4bisppp #XXX#options NI4BISPPP=4 # # B-channel interface to the netgraph subsystem #XXX#device i4bing #XXX#options NI4BING=2 # # CAPI driver needed for active ISDN cards (see iavc driver above) #XXX#device i4bcapi # #--------------------------------------------------------------------------- # # System Management Bus (SMB) # options ENABLE_ALART # Control alarm on Intel intpm driver # # Set the number of PV entries per process. Increasing this can # stop panics related to heavy use of shared memory. However, that can # (combined with large amounts of physical memory) cause panics at # boot time due the kernel running out of VM space. # # If you're tweaking this, you might also want to increase the sysctls # "vm.v_free_min", "vm.v_free_reserved", and "vm.v_free_target". # # The value below is the one more than the default. # options PMAP_SHPGPERPROC=201 ##################################################################### # ABI Emulation #XXX keep these here for now and reactivate when support for emulating #XXX these 32 bit binaries is added. # Enable 32-bit runtime support for FreeBSD/i386 binaries. options COMPAT_IA32 # Enable iBCS2 runtime support for SCO and ISC binaries #XXX#options IBCS2 # Emulate spx device for client side of SVR3 local X interface #XXX#options SPX_HACK # Enable Linux ABI emulation #XXX#options COMPAT_LINUX # Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_IA32) options COMPAT_LINUX32 # Enable the linux-like proc filesystem support (requires COMPAT_LINUX32 # and PSEUDOFS) options LINPROCFS # # SysVR4 ABI emulation # # The svr4 ABI emulator can be statically compiled into the kernel or loaded as # a KLD module. # The STREAMS network emulation code can also be compiled statically or as a # module. If loaded as a module, it must be loaded before the svr4 module # (the /usr/sbin/svr4 script does this for you). If compiling statically, # the `streams' device must be configured into any kernel which also # specifies COMPAT_SVR4. It is possible to have a statically-configured # STREAMS device and a dynamically loadable svr4 emulator; the /usr/sbin/svr4 # script understands that it doesn't need to load the `streams' module under # those circumstances. # Caveat: At this time, `options KTRACE' is required for the svr4 emulator # (whether static or dynamic). # #XXX#options COMPAT_SVR4 # build emulator statically #XXX#options DEBUG_SVR4 # enable verbose debugging #XXX#device streams # STREAMS network driver (required for svr4). ##################################################################### # VM OPTIONS # KSTACK_PAGES is the number of memory pages to assign to the kernel # stack of each thread. options KSTACK_PAGES=3 ##################################################################### # More undocumented options for linting. # Note that documenting these are not considered an affront. options FB_INSTALL_CDEV # install a CDEV entry in /dev options KBDIO_DEBUG=2 options KBD_MAXRETRY=4 options KBD_MAXWAIT=6 options KBD_RESETDELAY=201 options PSM_DEBUG=1 options TIMER_FREQ=((14318182+6)/12) options VM_KMEM_SIZE options VM_KMEM_SIZE_MAX options VM_KMEM_SIZE_SCALE # The I/O device device io diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index d2ed8d7603ea..eb742e35b943 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -1,252 +1,253 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # # $FreeBSD$ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. # # linux32_genassym.o optional compat_linux32 \ dependency "$S/amd64/linux32/linux32_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "linux32_genassym.o" # linux32_assym.h optional compat_linux32 \ dependency "$S/kern/genassym.sh linux32_genassym.o" \ compile-with "sh $S/kern/genassym.sh linux32_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "linux32_assym.h" # ia32_genassym.o standard \ dependency "$S/compat/ia32/ia32_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "ia32_genassym.o" # ia32_assym.h standard \ dependency "$S/kern/genassym.sh ia32_genassym.o" \ compile-with "env NM='${NM}' sh $S/kern/genassym.sh ia32_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "ia32_assym.h" # font.h optional sc_dflt_font \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # hal.o optional ath_hal \ dependency "$S/contrib/dev/ath/public/x86_64-elf.hal.o.uu" \ compile-with "uudecode < $S/contrib/dev/ath/public/x86_64-elf.hal.o.uu" \ no-implicit-rule opt_ah.h optional ath_hal \ dependency "$S/contrib/dev/ath/public/x86_64-elf.opt_ah.h" \ compile-with "cp $S/contrib/dev/ath/public/x86_64-elf.opt_ah.h opt_ah.h" \ no-obj no-implicit-rule before-depend \ clean "opt_ah.h" # nvenetlib.o optional nve pci \ dependency "$S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu" \ compile-with "uudecode $S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \ no-implicit-rule # os+%DIKED-nve.h optional nve pci \ dependency "$S/contrib/dev/nve/os.h" \ compile-with "sed -e 's/^.*#include.*phy\.h.*$$//' $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \ no-implicit-rule no-obj before-depend \ clean "os+%DIKED-nve.h" # hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ no-implicit-rule # amd64/acpica/OsdEnvironment.c optional acpi amd64/acpica/acpi_machdep.c optional acpi amd64/acpica/acpi_wakeup.c optional acpi amd64/acpica/madt.c optional acpi amd64/amd64/amd64_mem.c optional mem #amd64/amd64/apic_vector.S standard amd64/amd64/atomic.c standard amd64/amd64/autoconf.c standard amd64/amd64/bios.c standard amd64/amd64/busdma_machdep.c standard amd64/amd64/cpu_switch.S standard amd64/amd64/db_disasm.c optional ddb amd64/amd64/db_interface.c optional ddb amd64/amd64/db_trace.c optional ddb amd64/amd64/dump_machdep.c standard amd64/amd64/elf_machdep.c standard amd64/amd64/exception.S standard amd64/amd64/fpu.c standard amd64/amd64/gdb_machdep.c optional gdb amd64/amd64/identcpu.c standard amd64/amd64/in_cksum.c optional inet amd64/amd64/initcpu.c standard amd64/amd64/intr_machdep.c standard amd64/amd64/io.c optional io amd64/amd64/io_apic.c standard amd64/amd64/legacy.c standard amd64/amd64/local_apic.c standard amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard amd64/amd64/mem.c optional mem amd64/amd64/mp_machdep.c optional smp amd64/amd64/mp_watchdog.c optional mp_watchdog smp amd64/amd64/mpboot.S optional smp amd64/amd64/mptable.c optional mptable amd64/amd64/mptable_pci.c optional mptable pci amd64/amd64/nexus.c standard amd64/amd64/pmap.c standard amd64/amd64/prof_machdep.c optional profiling-routine amd64/amd64/sigtramp.S standard amd64/amd64/support.S standard amd64/amd64/sys_machdep.c standard amd64/amd64/trap.c standard amd64/amd64/tsc.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard amd64/isa/atpic.c optional atpic isa #amd64/isa/atpic_vector.S optional atpic isa amd64/isa/clock.c standard amd64/isa/elcr.c standard amd64/isa/isa.c standard amd64/isa/isa_dma.c standard amd64/isa/nmi.c standard amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/blowfish/bf_enc.c optional crypto crypto/blowfish/bf_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional crypto crypto/des/des_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional netsmbcrypto dev/acpica/acpi_if.m standard dev/arcmsr/arcmsr.c optional arcmsr pci dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc dev/atkbdc/atkbdc.c optional atkbdc dev/atkbdc/atkbdc_isa.c optional atkbdc isa dev/atkbdc/atkbdc_subr.c optional atkbdc dev/atkbdc/psm.c optional psm atkbdc # There are no systems with isa slots, so all ed isa entries should go.. dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb dev/fb/fb.c optional vga dev/fb/splash.c optional splash dev/fb/vga.c optional vga dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus dev/if_ndis/if_ndis_pci.c optional ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb dev/io/iodev.c optional io dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/kbd/kbd.c optional atkbd dev/kbd/kbd.c optional sc dev/kbd/kbd.c optional ukbd dev/mem/memutil.c optional mem dev/nve/if_nve.c optional nve pci dev/ppc/ppc.c optional ppc dev/ppc/ppc_puc.c optional ppc puc dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa +dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm-dumb.c optional sc dev/syscons/scterm-sc.c optional sc dev/syscons/scterm.c optional sc dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvidctl.c optional sc dev/syscons/scvtb.c optional sc dev/syscons/syscons.c optional sc dev/syscons/sysmouse.c optional sc dev/uart/uart_cpu_amd64.c optional uart geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_mbr.c standard geom/geom_mbr_enc.c standard isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/link_elf_obj.c standard pci/agp_amd64.c optional agp pci/agp_intel.c optional agp # # IA32 binary support # #amd64/ia32/ia32_exception.S optional compat_ia32 amd64/ia32/ia32_reg.c optional compat_ia32 amd64/ia32/ia32_signal.c optional compat_ia32 amd64/ia32/ia32_sigtramp.S optional compat_ia32 amd64/ia32/ia32_syscall.c optional compat_ia32 compat/freebsd32/freebsd32_misc.c optional compat_ia32 compat/freebsd32/freebsd32_syscalls.c optional compat_ia32 compat/freebsd32/freebsd32_sysent.c optional compat_ia32 compat/ia32/ia32_sysvec.c optional compat_ia32 kern/imgact_elf32.c optional compat_ia32 # # Linux/i386 binary support # amd64/linux32/linux32_dummy.c optional compat_linux32 amd64/linux32/linux32_locore.s optional compat_linux32 \ dependency "linux32_assym.h" amd64/linux32/linux32_machdep.c optional compat_linux32 amd64/linux32/linux32_sysent.c optional compat_linux32 amd64/linux32/linux32_sysvec.c optional compat_linux32 compat/linux/linux_file.c optional compat_linux32 compat/linux/linux_getcwd.c optional compat_linux32 compat/linux/linux_ioctl.c optional compat_linux32 compat/linux/linux_ipc.c optional compat_linux32 compat/linux/linux_mib.c optional compat_linux32 compat/linux/linux_misc.c optional compat_linux32 compat/linux/linux_signal.c optional compat_linux32 compat/linux/linux_socket.c optional compat_linux32 compat/linux/linux_stats.c optional compat_linux32 compat/linux/linux_sysctl.c optional compat_linux32 compat/linux/linux_uid16.c optional compat_linux32 compat/linux/linux_util.c optional compat_linux32 # # Windows NDIS driver support # compat/ndis/kern_ndis.c optional ndisapi pci compat/ndis/kern_windrv.c optional ndisapi pci compat/ndis/subr_hal.c optional ndisapi pci compat/ndis/subr_ndis.c optional ndisapi pci compat/ndis/subr_ntoskrnl.c optional ndisapi pci compat/ndis/subr_pe.c optional ndisapi pci compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx64_wrap.S optional ndisapi pci i386/bios/smbios.c optional smbios i386/bios/vpd.c optional vpd i386/cpufreq/powernow.c optional cpufreq i386/cpufreq/est.c optional cpufreq i386/cpufreq/p4tcc.c optional cpufreq diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index f5de557f27a2..770066d1dacb 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -1,468 +1,468 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # # $FreeBSD$ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. # linux_genassym.o optional compat_linux \ dependency "$S/i386/linux/linux_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "linux_genassym.o" # linux_assym.h optional compat_linux \ dependency "$S/kern/genassym.sh linux_genassym.o" \ compile-with "sh $S/kern/genassym.sh linux_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "linux_assym.h" # svr4_genassym.o optional compat_svr4 \ dependency "$S/i386/svr4/svr4_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "svr4_genassym.o" # svr4_assym.h optional compat_svr4 \ dependency "$S/kern/genassym.sh svr4_genassym.o" \ compile-with "sh $S/kern/genassym.sh svr4_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "svr4_assym.h" # font.h optional sc_dflt_font \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'static u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'static u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'static u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # trlld.o optional oltr \ dependency "$S/contrib/dev/oltr/i386-elf.trlld.o.uu" \ compile-with "uudecode < $S/contrib/dev/oltr/i386-elf.trlld.o.uu" \ no-implicit-rule # hal.o optional ath_hal \ dependency "$S/contrib/dev/ath/public/i386-elf.hal.o.uu" \ compile-with "uudecode < $S/contrib/dev/ath/public/i386-elf.hal.o.uu" \ no-implicit-rule opt_ah.h optional ath_hal \ dependency "$S/contrib/dev/ath/public/i386-elf.opt_ah.h" \ compile-with "cp $S/contrib/dev/ath/public/i386-elf.opt_ah.h opt_ah.h" \ no-obj no-implicit-rule before-depend \ clean "opt_ah.h" # nvenetlib.o optional nve pci \ dependency "$S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu" \ compile-with "uudecode $S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \ no-implicit-rule # os+%DIKED-nve.h optional nve pci \ dependency "$S/contrib/dev/nve/os.h" \ compile-with "sed -e 's/^.*#include.*phy\.h.*$$//' $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \ no-implicit-rule no-obj before-depend \ clean "os+%DIKED-nve.h" # hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/i386-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \ no-implicit-rule # # compat/linux/linux_file.c optional compat_linux compat/linux/linux_getcwd.c optional compat_linux compat/linux/linux_ioctl.c optional compat_linux compat/linux/linux_ipc.c optional compat_linux compat/linux/linux_mib.c optional compat_linux compat/linux/linux_misc.c optional compat_linux compat/linux/linux_signal.c optional compat_linux compat/linux/linux_socket.c optional compat_linux compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/ndis/kern_ndis.c optional ndisapi pci compat/ndis/kern_windrv.c optional ndisapi pci compat/ndis/subr_hal.c optional ndisapi pci compat/ndis/subr_ndis.c optional ndisapi pci compat/ndis/subr_ntoskrnl.c optional ndisapi pci compat/ndis/subr_pe.c optional ndisapi pci compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx32_wrap.S optional ndisapi pci compat/pecoff/imgact_pecoff.c optional pecoff_support compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 compat/svr4/svr4_ioctl.c optional compat_svr4 compat/svr4/svr4_ipc.c optional compat_svr4 compat/svr4/svr4_misc.c optional compat_svr4 compat/svr4/svr4_resource.c optional compat_svr4 compat/svr4/svr4_signal.c optional compat_svr4 compat/svr4/svr4_socket.c optional compat_svr4 compat/svr4/svr4_sockio.c optional compat_svr4 compat/svr4/svr4_stat.c optional compat_svr4 compat/svr4/svr4_stream.c optional compat_svr4 compat/svr4/svr4_syscallnames.c optional compat_svr4 compat/svr4/svr4_sysent.c optional compat_svr4 compat/svr4/svr4_sysvec.c optional compat_svr4 compat/svr4/svr4_termios.c optional compat_svr4 compat/svr4/svr4_ttold.c optional compat_svr4 contrib/dev/oltr/if_oltr.c optional oltr contrib/dev/oltr/if_oltr_isa.c optional oltr isa contrib/dev/oltr/if_oltr_pci.c optional oltr pci contrib/dev/oltr/trlldbm.c optional oltr contrib/dev/oltr/trlldhm.c optional oltr contrib/dev/oltr/trlldmac.c optional oltr bf_enc.o optional ipsec ipsec_esp \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule crypto/des/arch/i386/des_enc.S optional ipsec ipsec_esp crypto/des/arch/i386/des_enc.S optional netsmbcrypto bf_enc.o optional crypto \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule crypto/des/arch/i386/des_enc.S optional crypto crypto/des/des_ecb.c optional crypto crypto/des/des_setkey.c optional crypto crypto/via/padlock.c optional padlock dev/advansys/adv_isa.c optional adv isa dev/aic/aic_isa.c optional aic isa dev/arcmsr/arcmsr.c optional arcmsr pci dev/ar/if_ar.c optional ar dev/ar/if_ar_isa.c optional ar isa dev/ar/if_ar_pci.c optional ar pci dev/arl/if_arl.c optional arl dev/arl/if_arl_isa.c optional arl isa dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc dev/atkbdc/atkbdc.c optional atkbdc dev/atkbdc/atkbdc_isa.c optional atkbdc isa dev/atkbdc/atkbdc_subr.c optional atkbdc dev/atkbdc/psm.c optional psm atkbdc dev/cm/if_cm_isa.c optional cm isa dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp dev/ctau/ctau.c optional ctau dev/ctau/ctddk.c optional ctau dev/ctau/if_ct.c optional ctau dev/cx/csigma.c optional cx dev/cx/cxddk.c optional cx dev/cx/if_cx.c optional cx dev/ed/if_ed_3c503.c optional ed isa ed_3c503 dev/ed/if_ed_isa.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic dev/fb/fb.c optional fb dev/fb/fb.c optional vga dev/fb/splash.c optional splash dev/fb/vga.c optional vga dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard dev/fe/if_fe_isa.c optional fe isa dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_pentium.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard dev/if_ndis/if_ndis_pci.c optional ndis cardbus dev/if_ndis/if_ndis_pci.c optional ndis pci dev/if_ndis/if_ndis_usb.c optional ndis usb dev/io/iodev.c optional io dev/kbd/kbd.c optional atkbd dev/kbd/kbd.c optional sc dev/kbd/kbd.c optional ukbd dev/kbd/kbd.c optional vt dev/lnc/if_lnc_isa.c optional lnc isa dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nve/if_nve.c optional nve pci dev/pcf/pcf_isa.c optional pcf dev/ppc/ppc.c optional ppc dev/ppc/ppc_puc.c optional ppc puc pci dev/random/nehemiah.c optional random dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa +dev/speaker/spkr.c optional speaker dev/sr/if_sr_isa.c optional sr isa dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm.c optional sc dev/syscons/scterm-dumb.c optional sc dev/syscons/scterm-sc.c optional sc dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvidctl.c optional sc dev/syscons/scvtb.c optional sc dev/syscons/syscons.c optional sc dev/syscons/sysmouse.c optional sc dev/uart/uart_cpu_i386.c optional uart geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_mbr.c standard geom/geom_mbr_enc.c standard dev/acpica/acpi_if.m standard i386/acpica/OsdEnvironment.c optional acpi i386/acpica/acpi_machdep.c optional acpi i386/acpica/acpi_wakeup.c optional acpi acpi_wakecode.h optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S" \ compile-with "${MAKE} -f $S/i386/acpica/Makefile MAKESRCPATH=$S/i386/acpica" \ no-obj no-implicit-rule before-depend \ clean "acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin" # i386/acpica/madt.c optional acpi apic i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi i386/bios/smbios.c optional smbios i386/bios/vpd.c optional vpd i386/cpufreq/est.c optional cpufreq i386/cpufreq/p4tcc.c optional cpufreq i386/cpufreq/powernow.c optional cpufreq i386/cpufreq/smist.c optional cpufreq #i386/i386/apic_vector.s optional apic i386/i386/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" i386/i386/autoconf.c standard i386/i386/bios.c standard i386/i386/bioscall.s standard i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb i386/i386/dump_machdep.c standard i386/i386/elan-mmcr.c optional cpu_elan i386/i386/elan-mmcr.c optional cpu_soekris i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode i386/i386/i686_mem.c optional mem i386/i386/identcpu.c standard i386/i386/in_cksum.c optional inet i386/i386/initcpu.c standard i386/i386/intr_machdep.c standard i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard i386/i386/local_apic.c optional apic i386/i386/locore.s standard no-obj i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard i386/i386/mem.c optional mem i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mp_watchdog.c optional mp_watchdog smp i386/i386/mpboot.s optional smp i386/i386/mptable.c optional apic i386/i386/mptable_pci.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/perfmon.c optional perfmon profiling-routine i386/i386/pmap.c standard i386/i386/ptrace_machdep.c standard i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard i386/i386/trap.c standard i386/i386/tsc.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard i386/ibcs2/ibcs2_errno.c optional ibcs2 i386/ibcs2/ibcs2_fcntl.c optional ibcs2 i386/ibcs2/ibcs2_ioctl.c optional ibcs2 i386/ibcs2/ibcs2_ipc.c optional ibcs2 i386/ibcs2/ibcs2_isc.c optional ibcs2 i386/ibcs2/ibcs2_isc_sysent.c optional ibcs2 i386/ibcs2/ibcs2_misc.c optional ibcs2 i386/ibcs2/ibcs2_msg.c optional ibcs2 i386/ibcs2/ibcs2_other.c optional ibcs2 i386/ibcs2/ibcs2_signal.c optional ibcs2 i386/ibcs2/ibcs2_socksys.c optional ibcs2 i386/ibcs2/ibcs2_stat.c optional ibcs2 i386/ibcs2/ibcs2_sysent.c optional ibcs2 i386/ibcs2/ibcs2_sysi86.c optional ibcs2 i386/ibcs2/ibcs2_sysvec.c optional ibcs2 i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/isa/atpic.c standard #i386/isa/atpic_vector.s standard i386/isa/clock.c standard i386/isa/elcr.c standard i386/isa/elink.c optional ep i386/isa/elink.c optional ie i386/isa/isa.c optional isa i386/isa/isa_dma.c optional isa i386/isa/nmi.c standard i386/isa/npx.c optional npx i386/isa/pcvt/pcvt_drv.c optional vt i386/isa/pcvt/pcvt_ext.c optional vt i386/isa/pcvt/pcvt_kbd.c optional vt i386/isa/pcvt/pcvt_out.c optional vt i386/isa/pcvt/pcvt_sup.c optional vt i386/isa/pcvt/pcvt_vtf.c optional vt i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine i386/isa/spic.c optional spic -i386/isa/spkr.c optional speaker i386/isa/vesa.c optional vga vesa i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_locore.s optional compat_linux \ dependency "linux_assym.h" i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ dependency "svr4_assym.h" \ warning "COMPAT_SVR4 is broken and should be avoided" i386/svr4/svr4_machdep.c optional compat_svr4 # # isdn4bsd, needed for isic | iwic | ifpi | ifpi2 | ihfc | ifpnp | itjc # i4b/layer1/i4b_hdlc.c optional itjc i4b/layer1/i4b_hdlc.c optional ihfc i4b/layer1/i4b_l1dmux.c optional isic i4b/layer1/i4b_l1lib.c optional isic i4b/layer1/i4b_l1dmux.c optional iwic i4b/layer1/i4b_l1lib.c optional iwic i4b/layer1/i4b_l1dmux.c optional ifpi i4b/layer1/i4b_l1lib.c optional ifpi i4b/layer1/i4b_l1dmux.c optional ifpi2 i4b/layer1/i4b_l1lib.c optional ifpi2 i4b/layer1/i4b_l1dmux.c optional ihfc i4b/layer1/i4b_l1lib.c optional ihfc i4b/layer1/i4b_l1dmux.c optional ifpnp i4b/layer1/i4b_l1lib.c optional ifpnp i4b/layer1/i4b_l1dmux.c optional itjc i4b/layer1/i4b_l1lib.c optional itjc # # isdn4bsd, isic # i4b/layer1/isic/i4b_asuscom_ipac.c optional isic i4b/layer1/isic/i4b_avm_a1.c optional isic i4b/layer1/isic/i4b_bchan.c optional isic i4b/layer1/isic/i4b_ctx_s0P.c optional isic i4b/layer1/isic/i4b_drn_ngo.c optional isic i4b/layer1/isic/i4b_dynalink.c optional isic i4b/layer1/isic/i4b_elsa_qs1i.c optional isic i4b/layer1/isic/i4b_elsa_qs1p.c optional isic pci i4b/layer1/isic/i4b_elsa_pcc16.c optional isic i4b/layer1/isic/i4b_hscx.c optional isic i4b/layer1/isic/i4b_isac.c optional isic i4b/layer1/isic/i4b_isic.c optional isic i4b/layer1/isic/i4b_isic_isa.c optional isic i4b/layer1/isic/i4b_isic_pnp.c optional isic i4b/layer1/isic/i4b_itk_ix1.c optional isic i4b/layer1/isic/i4b_l1.c optional isic i4b/layer1/isic/i4b_l1fsm.c optional isic i4b/layer1/isic/i4b_siemens_isurf.c optional isic i4b/layer1/isic/i4b_sws.c optional isic i4b/layer1/isic/i4b_tel_s016.c optional isic i4b/layer1/isic/i4b_tel_s0163.c optional isic i4b/layer1/isic/i4b_tel_s08.c optional isic i4b/layer1/isic/i4b_usr_sti.c optional isic i4b/layer1/isic/i4b_diva.c optional isic # # isdn4bsd, iwic # i4b/layer1/iwic/i4b_iwic_pci.c optional iwic pci i4b/layer1/iwic/i4b_iwic_dchan.c optional iwic pci i4b/layer1/iwic/i4b_iwic_bchan.c optional iwic pci i4b/layer1/iwic/i4b_iwic_fsm.c optional iwic pci i4b/layer1/iwic/i4b_iwic_l1if.c optional iwic pci # # isdn4bsd, ifpi # i4b/layer1/ifpi/i4b_ifpi_pci.c optional ifpi pci i4b/layer1/ifpi/i4b_ifpi_isac.c optional ifpi pci i4b/layer1/ifpi/i4b_ifpi_l1.c optional ifpi pci i4b/layer1/ifpi/i4b_ifpi_l1fsm.c optional ifpi pci # # isdn4bsd, ifpi2 # i4b/layer1/ifpi2/i4b_ifpi2_pci.c optional ifpi2 pci i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c optional ifpi2 pci i4b/layer1/ifpi2/i4b_ifpi2_l1.c optional ifpi2 pci i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c optional ifpi2 pci # # isdn4bsd, ifpnp # i4b/layer1/ifpnp/i4b_ifpnp_avm.c optional ifpnp i4b/layer1/ifpnp/i4b_ifpnp_isac.c optional ifpnp i4b/layer1/ifpnp/i4b_ifpnp_l1.c optional ifpnp i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c optional ifpnp # # isdn4bsd, ihfc # i4b/layer1/ihfc/i4b_ihfc_l1if.c optional ihfc i4b/layer1/ihfc/i4b_ihfc_pnp.c optional ihfc i4b/layer1/ihfc/i4b_ihfc_drv.c optional ihfc # # isdn4bsd, itjc # i4b/layer1/itjc/i4b_itjc_pci.c optional itjc i4b/layer1/itjc/i4b_itjc_isac.c optional itjc i4b/layer1/itjc/i4b_itjc_l1.c optional itjc i4b/layer1/itjc/i4b_itjc_l1fsm.c optional itjc # isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip libkern/divdi3.c standard libkern/ffsl.c standard libkern/flsl.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard pci/agp_ali.c optional agp pci/agp_amd.c optional agp pci/agp_amd64.c optional agp pci/agp_ati.c optional agp pci/agp_i810.c optional agp pci/agp_intel.c optional agp pci/agp_nvidia.c optional agp pci/agp_sis.c optional agp pci/agp_via.c optional agp i386/xbox/xbox.c optional xbox i386/xbox/xboxfb.c optional xboxfb dev/fb/boot_font.c optional xboxfb i386/xbox/pic16l.s optional xbox diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98 index 41024b1f4195..06a9e1a74fe7 100644 --- a/sys/conf/files.pc98 +++ b/sys/conf/files.pc98 @@ -1,360 +1,360 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # # modified for PC-9801/PC-9821 # # $FreeBSD$ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. # linux_genassym.o optional compat_linux \ dependency "$S/i386/linux/linux_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "linux_genassym.o" # linux_assym.h optional compat_linux \ dependency "$S/kern/genassym.sh linux_genassym.o" \ compile-with "sh $S/kern/genassym.sh linux_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "linux_assym.h" # svr4_genassym.o optional compat_svr4 \ dependency "$S/i386/svr4/svr4_genassym.c" \ compile-with "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}" \ no-obj no-implicit-rule \ clean "svr4_genassym.o" # svr4_assym.h optional compat_svr4 \ dependency "$S/kern/genassym.sh svr4_genassym.o" \ compile-with "sh $S/kern/genassym.sh svr4_genassym.o > ${.TARGET}" \ no-obj no-implicit-rule before-depend \ clean "svr4_assym.h" # ukbdmap.h optional ukbd_dflt_keymap \ compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # trlld.o optional oltr \ dependency "$S/contrib/dev/oltr/i386-elf.trlld.o.uu" \ compile-with "uudecode < $S/contrib/dev/oltr/i386-elf.trlld.o.uu" \ no-implicit-rule # compat/linux/linux_file.c optional compat_linux compat/linux/linux_getcwd.c optional compat_linux compat/linux/linux_ioctl.c optional compat_linux compat/linux/linux_ipc.c optional compat_linux compat/linux/linux_mib.c optional compat_linux compat/linux/linux_misc.c optional compat_linux compat/linux/linux_signal.c optional compat_linux compat/linux/linux_socket.c optional compat_linux compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/pecoff/imgact_pecoff.c optional pecoff_support compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 compat/svr4/svr4_ioctl.c optional compat_svr4 compat/svr4/svr4_ipc.c optional compat_svr4 compat/svr4/svr4_misc.c optional compat_svr4 compat/svr4/svr4_resource.c optional compat_svr4 compat/svr4/svr4_signal.c optional compat_svr4 compat/svr4/svr4_socket.c optional compat_svr4 compat/svr4/svr4_sockio.c optional compat_svr4 compat/svr4/svr4_stat.c optional compat_svr4 compat/svr4/svr4_stream.c optional compat_svr4 compat/svr4/svr4_syscallnames.c optional compat_svr4 compat/svr4/svr4_sysent.c optional compat_svr4 compat/svr4/svr4_sysvec.c optional compat_svr4 compat/svr4/svr4_termios.c optional compat_svr4 compat/svr4/svr4_ttold.c optional compat_svr4 contrib/dev/oltr/if_oltr.c optional oltr contrib/dev/oltr/if_oltr_pci.c optional oltr pci contrib/dev/oltr/trlldbm.c optional oltr contrib/dev/oltr/trlldhm.c optional oltr contrib/dev/oltr/trlldmac.c optional oltr bf_enc.o optional ipsec ipsec_esp \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule crypto/des/arch/i386/des_enc.S optional ipsec ipsec_esp crypto/des/arch/i386/des_enc.S optional netsmbcrypto bf_enc.o optional crypto \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule crypto/des/arch/i386/des_enc.S optional crypto crypto/des/des_ecb.c optional crypto crypto/des/des_setkey.c optional crypto dev/aic/aic_cbus.c optional aic isa dev/ar/if_ar.c optional ar dev/ar/if_ar_pci.c optional ar pci dev/cp/cpddk.c optional cp dev/cp/if_cp.c optional cp dev/ct/bshw_machdep.c optional ct dev/ct/ct.c optional ct dev/ct/ct_isa.c optional ct isa dev/ed/if_ed_cbus.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/fb/fb.c optional fb dev/fb/fb.c optional gdc dev/fb/splash.c optional splash dev/fe/if_fe_cbus.c optional fe isa dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_pentium.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd dev/kbd/kbd.c optional sc dev/kbd/kbd.c optional ukbd dev/lnc/if_lnc_cbus.c optional lnc isa dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa dev/ppc/ppc_puc.c optional ppc puc pci dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_pci.c optional sbni pci dev/snc/dp83932.c optional snc dev/snc/dp83932subr.c optional snc dev/snc/if_snc.c optional snc dev/snc/if_snc_cbus.c optional snc isa dev/snc/if_snc_pccard.c optional snc pccard +dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm.c optional sc dev/syscons/scterm-dumb.c optional sc dev/syscons/scvidctl.c optional sc dev/syscons/syscons.c optional sc dev/syscons/sysmouse.c optional sc dev/uart/uart_cpu_pc98.c optional uart geom/geom_bsd.c standard geom/geom_bsd_enc.c standard geom/geom_pc98.c standard geom/geom_pc98_enc.c standard i386/bios/apm.c optional apm #i386/i386/apic_vector.s optional apic i386/i386/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" i386/i386/autoconf.c standard i386/i386/bios.c standard i386/i386/bioscall.s standard i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb i386/i386/db_interface.c optional ddb i386/i386/db_trace.c optional ddb i386/i386/dump_machdep.c standard i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/i686_mem.c optional mem i386/i386/identcpu.c standard i386/i386/in_cksum.c optional inet i386/i386/initcpu.c standard i386/i386/intr_machdep.c standard i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem i386/i386/legacy.c standard i386/i386/local_apic.c optional apic i386/i386/locore.s standard no-obj i386/i386/mem.c optional mem i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mp_watchdog.c optional mp_watchdog smp i386/i386/mpboot.s optional smp i386/i386/mptable.c optional apic i386/i386/mptable_pci.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon i386/i386/perfmon.c optional perfmon profiling-routine i386/i386/pmap.c standard i386/i386/ptrace_machdep.c standard i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard i386/i386/trap.c standard i386/i386/tsc.c standard i386/i386/uio_machdep.c standard i386/i386/vm86.c standard i386/i386/vm_machdep.c standard i386/ibcs2/ibcs2_errno.c optional ibcs2 i386/ibcs2/ibcs2_fcntl.c optional ibcs2 i386/ibcs2/ibcs2_ioctl.c optional ibcs2 i386/ibcs2/ibcs2_ipc.c optional ibcs2 i386/ibcs2/ibcs2_isc.c optional ibcs2 i386/ibcs2/ibcs2_isc_sysent.c optional ibcs2 i386/ibcs2/ibcs2_misc.c optional ibcs2 i386/ibcs2/ibcs2_msg.c optional ibcs2 i386/ibcs2/ibcs2_other.c optional ibcs2 i386/ibcs2/ibcs2_signal.c optional ibcs2 i386/ibcs2/ibcs2_socksys.c optional ibcs2 i386/ibcs2/ibcs2_stat.c optional ibcs2 i386/ibcs2/ibcs2_sysent.c optional ibcs2 i386/ibcs2/ibcs2_sysi86.c optional ibcs2 i386/ibcs2/ibcs2_sysvec.c optional ibcs2 i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/isa/atpic.c standard #i386/isa/atpic_vector.s standard i386/isa/elink.c optional ep i386/isa/elink.c optional ie i386/isa/isa.c optional isa i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine -i386/isa/spkr.c optional speaker i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_locore.s optional compat_linux \ dependency "linux_assym.h" i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ dependency "svr4_assym.h" \ warning "COMPAT_SVR4 is broken and should be avoided" i386/svr4/svr4_machdep.c optional compat_svr4 # # isdn4bsd, needed for isic | iwic | ifpi | ifpi2 | ihfc | ifpnp | itjc # i4b/layer1/i4b_hdlc.c optional itjc i4b/layer1/i4b_hdlc.c optional ihfc i4b/layer1/i4b_l1dmux.c optional isic i4b/layer1/i4b_l1lib.c optional isic i4b/layer1/i4b_l1dmux.c optional iwic i4b/layer1/i4b_l1lib.c optional iwic i4b/layer1/i4b_l1dmux.c optional ifpi i4b/layer1/i4b_l1lib.c optional ifpi i4b/layer1/i4b_l1dmux.c optional ifpi2 i4b/layer1/i4b_l1lib.c optional ifpi2 i4b/layer1/i4b_l1dmux.c optional ihfc i4b/layer1/i4b_l1lib.c optional ihfc i4b/layer1/i4b_l1dmux.c optional ifpnp i4b/layer1/i4b_l1lib.c optional ifpnp i4b/layer1/i4b_l1dmux.c optional itjc i4b/layer1/i4b_l1lib.c optional itjc # # isdn4bsd, isic # i4b/layer1/isic/i4b_asuscom_ipac.c optional isic i4b/layer1/isic/i4b_avm_a1.c optional isic i4b/layer1/isic/i4b_bchan.c optional isic i4b/layer1/isic/i4b_ctx_s0P.c optional isic i4b/layer1/isic/i4b_drn_ngo.c optional isic i4b/layer1/isic/i4b_dynalink.c optional isic i4b/layer1/isic/i4b_elsa_qs1i.c optional isic i4b/layer1/isic/i4b_elsa_qs1p.c optional isic pci i4b/layer1/isic/i4b_elsa_pcc16.c optional isic i4b/layer1/isic/i4b_hscx.c optional isic i4b/layer1/isic/i4b_isac.c optional isic i4b/layer1/isic/i4b_isic.c optional isic i4b/layer1/isic/i4b_isic_isa.c optional isic i4b/layer1/isic/i4b_isic_pnp.c optional isic i4b/layer1/isic/i4b_itk_ix1.c optional isic i4b/layer1/isic/i4b_l1.c optional isic i4b/layer1/isic/i4b_l1fsm.c optional isic i4b/layer1/isic/i4b_siemens_isurf.c optional isic i4b/layer1/isic/i4b_sws.c optional isic i4b/layer1/isic/i4b_tel_s016.c optional isic i4b/layer1/isic/i4b_tel_s0163.c optional isic i4b/layer1/isic/i4b_tel_s08.c optional isic i4b/layer1/isic/i4b_usr_sti.c optional isic i4b/layer1/isic/i4b_diva.c optional isic # # isdn4bsd, iwic # i4b/layer1/iwic/i4b_iwic_pci.c optional iwic pci i4b/layer1/iwic/i4b_iwic_dchan.c optional iwic pci i4b/layer1/iwic/i4b_iwic_bchan.c optional iwic pci i4b/layer1/iwic/i4b_iwic_fsm.c optional iwic pci i4b/layer1/iwic/i4b_iwic_l1if.c optional iwic pci # # isdn4bsd, ifpi # i4b/layer1/ifpi/i4b_ifpi_pci.c optional ifpi pci i4b/layer1/ifpi/i4b_ifpi_isac.c optional ifpi pci i4b/layer1/ifpi/i4b_ifpi_l1.c optional ifpi pci i4b/layer1/ifpi/i4b_ifpi_l1fsm.c optional ifpi pci # # isdn4bsd, ifpi2 # i4b/layer1/ifpi2/i4b_ifpi2_pci.c optional ifpi2 pci i4b/layer1/ifpi2/i4b_ifpi2_isacsx.c optional ifpi2 pci i4b/layer1/ifpi2/i4b_ifpi2_l1.c optional ifpi2 pci i4b/layer1/ifpi2/i4b_ifpi2_l1fsm.c optional ifpi2 pci # # isdn4bsd, ifpnp # i4b/layer1/ifpnp/i4b_ifpnp_avm.c optional ifpnp i4b/layer1/ifpnp/i4b_ifpnp_isac.c optional ifpnp i4b/layer1/ifpnp/i4b_ifpnp_l1.c optional ifpnp i4b/layer1/ifpnp/i4b_ifpnp_l1fsm.c optional ifpnp # # isdn4bsd, ihfc # i4b/layer1/ihfc/i4b_ihfc_l1if.c optional ihfc i4b/layer1/ihfc/i4b_ihfc_pnp.c optional ihfc i4b/layer1/ihfc/i4b_ihfc_drv.c optional ihfc # # isdn4bsd, itjc # i4b/layer1/itjc/i4b_itjc_pci.c optional itjc i4b/layer1/itjc/i4b_itjc_isac.c optional itjc i4b/layer1/itjc/i4b_itjc_l1.c optional itjc i4b/layer1/itjc/i4b_itjc_l1fsm.c optional itjc # kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip libkern/divdi3.c standard libkern/ffsl.c standard libkern/flsl.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard pc98/apm/apm_bioscall.S optional apm pc98/cbus/cbus_dma.c optional isa pc98/cbus/clock.c standard pc98/cbus/fdc.c optional fdc pc98/cbus/fdc_cbus.c optional fdc isa pc98/cbus/gdc.c optional gdc pc98/cbus/nmi.c standard pc98/cbus/olpt.c optional olpt pc98/cbus/pckbd.c optional pckbd pc98/cbus/pmc.c optional pmc pc98/cbus/ppc.c optional ppc pc98/cbus/scgdcrndr.c optional sc gdc pc98/cbus/scterm-sck.c optional sc pc98/cbus/scvtb.c optional sc pc98/cbus/sio.c optional sio pc98/cbus/sio_cbus.c optional sio isa pc98/cbus/syscons_cbus.c optional sc pc98/pc98/busio.s standard pc98/pc98/busiosubr.c standard pc98/pc98/canbepm.c optional canbepm pc98/pc98/canbus.c optional canbus pc98/pc98/canbus_if.m optional canbus pc98/pc98/machdep.c standard pc98/pc98/pc98_machdep.c standard pci/agp_ali.c optional agp pci/agp_amd.c optional agp pci/agp_i810.c optional agp pci/agp_intel.c optional agp pci/agp_nvidia.c optional agp pci/agp_sis.c optional agp pci/agp_via.c optional agp diff --git a/sys/dev/speaker/speaker.h b/sys/dev/speaker/speaker.h index 6b1f0211e516..9e195c3f0d8b 100644 --- a/sys/dev/speaker/speaker.h +++ b/sys/dev/speaker/speaker.h @@ -1,29 +1,29 @@ /* * speaker.h -- interface definitions for speaker ioctl() * * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 * modified for FreeBSD by Andrew A. Chernov * * $FreeBSD$ */ -#ifndef _MACHINE_SPEAKER_H_ -#define _MACHINE_SPEAKER_H_ +#ifndef _DEV_SPEAKER_SPEAKER_H_ +#define _DEV_SPEAKER_SPEAKER_H_ #include #define SPKRTONE _IOW('S', 1, tone_t) /* emit tone */ #define SPKRTUNE _IO('S', 2) /* emit tone sequence*/ typedef struct { int frequency; /* in hertz */ int duration; /* in 1/100ths of a second */ } tone_t; /* * Strings written to the speaker device are interpreted as tunes and played; * see the spkr(4) man page for details. */ -#endif /* !_MACHINE_SPEAKER_H_ */ +#endif /* !_DEV_SPEAKER_SPEAKER_H_ */ diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index d265e7c4f0a9..bad65c15eff0 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -1,656 +1,656 @@ /*- * spkr.c -- device driver for console speaker * * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 * modified for FreeBSD by Andrew A. Chernov * modified for PC98 by Kakefuda */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include -#include #include #include +#include static d_open_t spkropen; static d_close_t spkrclose; static d_write_t spkrwrite; static d_ioctl_t spkrioctl; static struct cdevsw spkr_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, .d_open = spkropen, .d_close = spkrclose, .d_write = spkrwrite, .d_ioctl = spkrioctl, .d_name = "spkr", }; static MALLOC_DEFINE(M_SPKR, "spkr", "Speaker buffer"); /**************** MACHINE DEPENDENT PART STARTS HERE ************************* * * This section defines a function tone() which causes a tone of given * frequency and duration from the ISA console speaker. * Another function endtone() is defined to force sound off, and there is * also a rest() entry point to do pauses. * * Audible sound is generated using the Programmable Interval Timer (PIT) and * Programmable Peripheral Interface (PPI) attached to the ISA speaker. The * PPI controls whether sound is passed through at all; the PIT's channel 2 is * used to generate clicks (a square wave) of whatever frequency is desired. */ #ifdef PC98 #define SPKR_DESC "PC98 speaker" #else #define SPKR_DESC "PC speaker" #endif #define SPKRPRI PSOCK static char endtone, endrest; static void tone(unsigned int thz, unsigned int ticks); static void rest(int ticks); static void playinit(void); static void playtone(int pitch, int value, int sustain); static void playstring(char *cp, size_t slen); /* emit tone of frequency thz for given number of ticks */ static void tone(thz, ticks) unsigned int thz, ticks; { unsigned int divisor; int sps; if (thz <= 0) return; divisor = timer_freq / thz; #ifdef DEBUG (void) printf("tone: thz=%d ticks=%d\n", thz, ticks); #endif /* DEBUG */ /* set timer to generate clicks at given frequency in Hertz */ sps = splclock(); if (timer_spkr_acquire()) { /* enter list of waiting procs ??? */ splx(sps); return; } splx(sps); disable_intr(); spkr_set_pitch(divisor); enable_intr(); /* turn the speaker on */ ppi_spkr_on(); /* * Set timeout to endtone function, then give up the timeslice. * This is so other processes can execute while the tone is being * emitted. */ if (ticks > 0) tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", ticks); ppi_spkr_off(); sps = splclock(); timer_spkr_release(); splx(sps); } /* rest for given number of ticks */ static void rest(ticks) int ticks; { /* * Set timeout to endrest function, then give up the timeslice. * This is so other processes can execute while the rest is being * waited out. */ #ifdef DEBUG (void) printf("rest: %d\n", ticks); #endif /* DEBUG */ if (ticks > 0) tsleep(&endrest, SPKRPRI | PCATCH, "spkrrs", ticks); } /**************** PLAY STRING INTERPRETER BEGINS HERE ********************** * * Play string interpretation is modelled on IBM BASIC 2.0's PLAY statement; * M[LNS] are missing; the ~ synonym and the _ slur mark and the octave- * tracking facility are added. * Requires tone(), rest(), and endtone(). String play is not interruptible * except possibly at physical block boundaries. */ typedef int bool; #define TRUE 1 #define FALSE 0 #define dtoi(c) ((c) - '0') static int octave; /* currently selected octave */ static int whole; /* whole-note time at current tempo, in ticks */ static int value; /* whole divisor for note time, quarter note = 1 */ static int fill; /* controls spacing of notes */ static bool octtrack; /* octave-tracking on? */ static bool octprefix; /* override current octave-tracking state? */ /* * Magic number avoidance... */ #define SECS_PER_MIN 60 /* seconds per minute */ #define WHOLE_NOTE 4 /* quarter notes per whole note */ #define MIN_VALUE 64 /* the most we can divide a note by */ #define DFLT_VALUE 4 /* default value (quarter-note) */ #define FILLTIME 8 /* for articulation, break note in parts */ #define STACCATO 6 /* 6/8 = 3/4 of note is filled */ #define NORMAL 7 /* 7/8ths of note interval is filled */ #define LEGATO 8 /* all of note interval is filled */ #define DFLT_OCTAVE 4 /* default octave */ #define MIN_TEMPO 32 /* minimum tempo */ #define DFLT_TEMPO 120 /* default tempo */ #define MAX_TEMPO 255 /* max tempo */ #define NUM_MULT 3 /* numerator of dot multiplier */ #define DENOM_MULT 2 /* denominator of dot multiplier */ /* letter to half-tone: A B C D E F G */ static int notetab[8] = {9, 11, 0, 2, 4, 5, 7}; /* * This is the American Standard A440 Equal-Tempered scale with frequencies * rounded to nearest integer. Thank Goddess for the good ol' CRC Handbook... * our octave 0 is standard octave 2. */ #define OCTAVE_NOTES 12 /* semitones per octave */ static int pitchtab[] = { /* C C# D D# E F F# G G# A A# B*/ /* 0 */ 65, 69, 73, 78, 82, 87, 93, 98, 103, 110, 117, 123, /* 1 */ 131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247, /* 2 */ 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, /* 3 */ 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988, /* 4 */ 1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1975, /* 5 */ 2093, 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 3520, 3729, 3951, /* 6 */ 4186, 4435, 4698, 4978, 5274, 5588, 5920, 6272, 6644, 7040, 7459, 7902, }; static void playinit() { octave = DFLT_OCTAVE; whole = (hz * SECS_PER_MIN * WHOLE_NOTE) / DFLT_TEMPO; fill = NORMAL; value = DFLT_VALUE; octtrack = FALSE; octprefix = TRUE; /* act as though there was an initial O(n) */ } /* play tone of proper duration for current rhythm signature */ static void playtone(pitch, value, sustain) int pitch, value, sustain; { register int sound, silence, snum = 1, sdenom = 1; /* this weirdness avoids floating-point arithmetic */ for (; sustain; sustain--) { /* See the BUGS section in the man page for discussion */ snum *= NUM_MULT; sdenom *= DENOM_MULT; } if (value == 0 || sdenom == 0) return; if (pitch == -1) rest(whole * snum / (value * sdenom)); else { sound = (whole * snum) / (value * sdenom) - (whole * (FILLTIME - fill)) / (value * FILLTIME); silence = whole * (FILLTIME-fill) * snum / (FILLTIME * value * sdenom); #ifdef DEBUG (void) printf("playtone: pitch %d for %d ticks, rest for %d ticks\n", pitch, sound, silence); #endif /* DEBUG */ tone(pitchtab[pitch], sound); if (fill != LEGATO) rest(silence); } } /* interpret and play an item from a notation string */ static void playstring(cp, slen) char *cp; size_t slen; { int pitch, oldfill, lastpitch = OCTAVE_NOTES * DFLT_OCTAVE; #define GETNUM(cp, v) for(v=0; isdigit(cp[1]) && slen > 0; ) \ {v = v * 10 + (*++cp - '0'); slen--;} for (; slen--; cp++) { int sustain, timeval, tempo; register char c = toupper(*cp); #ifdef DEBUG (void) printf("playstring: %c (%x)\n", c, c); #endif /* DEBUG */ switch (c) { case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': /* compute pitch */ pitch = notetab[c - 'A'] + octave * OCTAVE_NOTES; /* this may be followed by an accidental sign */ if (cp[1] == '#' || cp[1] == '+') { ++pitch; ++cp; slen--; } else if (cp[1] == '-') { --pitch; ++cp; slen--; } /* * If octave-tracking mode is on, and there has been no octave- * setting prefix, find the version of the current letter note * closest to the last regardless of octave. */ if (octtrack && !octprefix) { if (abs(pitch-lastpitch) > abs(pitch+OCTAVE_NOTES-lastpitch)) { ++octave; pitch += OCTAVE_NOTES; } if (abs(pitch-lastpitch) > abs((pitch-OCTAVE_NOTES)-lastpitch)) { --octave; pitch -= OCTAVE_NOTES; } } octprefix = FALSE; lastpitch = pitch; /* ...which may in turn be followed by an override time value */ GETNUM(cp, timeval); if (timeval <= 0 || timeval > MIN_VALUE) timeval = value; /* ...and/or sustain dots */ for (sustain = 0; cp[1] == '.'; cp++) { slen--; sustain++; } /* ...and/or a slur mark */ oldfill = fill; if (cp[1] == '_') { fill = LEGATO; ++cp; slen--; } /* time to emit the actual tone */ playtone(pitch, timeval, sustain); fill = oldfill; break; case 'O': if (cp[1] == 'N' || cp[1] == 'n') { octprefix = octtrack = FALSE; ++cp; slen--; } else if (cp[1] == 'L' || cp[1] == 'l') { octtrack = TRUE; ++cp; slen--; } else { GETNUM(cp, octave); if (octave >= sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES) octave = DFLT_OCTAVE; octprefix = TRUE; } break; case '>': if (octave < sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES - 1) octave++; octprefix = TRUE; break; case '<': if (octave > 0) octave--; octprefix = TRUE; break; case 'N': GETNUM(cp, pitch); for (sustain = 0; cp[1] == '.'; cp++) { slen--; sustain++; } oldfill = fill; if (cp[1] == '_') { fill = LEGATO; ++cp; slen--; } playtone(pitch - 1, value, sustain); fill = oldfill; break; case 'L': GETNUM(cp, value); if (value <= 0 || value > MIN_VALUE) value = DFLT_VALUE; break; case 'P': case '~': /* this may be followed by an override time value */ GETNUM(cp, timeval); if (timeval <= 0 || timeval > MIN_VALUE) timeval = value; for (sustain = 0; cp[1] == '.'; cp++) { slen--; sustain++; } playtone(-1, timeval, sustain); break; case 'T': GETNUM(cp, tempo); if (tempo < MIN_TEMPO || tempo > MAX_TEMPO) tempo = DFLT_TEMPO; whole = (hz * SECS_PER_MIN * WHOLE_NOTE) / tempo; break; case 'M': if (cp[1] == 'N' || cp[1] == 'n') { fill = NORMAL; ++cp; slen--; } else if (cp[1] == 'L' || cp[1] == 'l') { fill = LEGATO; ++cp; slen--; } else if (cp[1] == 'S' || cp[1] == 's') { fill = STACCATO; ++cp; slen--; } break; } } } /******************* UNIX DRIVER HOOKS BEGIN HERE ************************** * * This section implements driver hooks to run playstring() and the tone(), * endtone(), and rest() functions defined above. */ static int spkr_active = FALSE; /* exclusion flag */ static char *spkr_inbuf; /* incoming buf */ static int spkropen(dev, flags, fmt, td) struct cdev *dev; int flags; int fmt; struct thread *td; { #ifdef DEBUG (void) printf("spkropen: entering with dev = %s\n", devtoname(dev)); #endif /* DEBUG */ if (minor(dev) != 0) return(ENXIO); else if (spkr_active) return(EBUSY); else { #ifdef DEBUG (void) printf("spkropen: about to perform play initialization\n"); #endif /* DEBUG */ playinit(); spkr_inbuf = malloc(DEV_BSIZE, M_SPKR, M_WAITOK); spkr_active = TRUE; return(0); } } static int spkrwrite(dev, uio, ioflag) struct cdev *dev; struct uio *uio; int ioflag; { #ifdef DEBUG printf("spkrwrite: entering with dev = %s, count = %d\n", devtoname(dev), uio->uio_resid); #endif /* DEBUG */ if (minor(dev) != 0) return(ENXIO); else if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */ return(E2BIG); else { unsigned n; char *cp; int error; n = uio->uio_resid; cp = spkr_inbuf; error = uiomove(cp, n, uio); if (!error) { cp[n] = '\0'; playstring(cp, n); } return(error); } } static int spkrclose(dev, flags, fmt, td) struct cdev *dev; int flags; int fmt; struct thread *td; { #ifdef DEBUG (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); #endif /* DEBUG */ if (minor(dev) != 0) return(ENXIO); else { wakeup(&endtone); wakeup(&endrest); free(spkr_inbuf, M_SPKR); spkr_active = FALSE; return(0); } } static int spkrioctl(dev, cmd, cmdarg, flags, td) struct cdev *dev; unsigned long cmd; caddr_t cmdarg; int flags; struct thread *td; { #ifdef DEBUG (void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n", devtoname(dev), cmd); #endif /* DEBUG */ if (minor(dev) != 0) return(ENXIO); else if (cmd == SPKRTONE) { tone_t *tp = (tone_t *)cmdarg; if (tp->frequency == 0) rest(tp->duration); else tone(tp->frequency, tp->duration); return 0; } else if (cmd == SPKRTUNE) { tone_t *tp = (tone_t *)(*(caddr_t *)cmdarg); tone_t ttp; int error; for (; ; tp++) { error = copyin(tp, &ttp, sizeof(tone_t)); if (error) return(error); if (ttp.duration == 0) break; if (ttp.frequency == 0) rest(ttp.duration); else tone(ttp.frequency, ttp.duration); } return(0); } return(EINVAL); } /* * Install placeholder to claim the resources owned by the * AT tone generator. */ static struct isa_pnp_id speaker_ids[] = { #ifndef PC98 { 0x0008d041 /* PNP0800 */, SPKR_DESC }, #endif { 0 } }; static struct cdev *speaker_dev; static int speaker_probe(device_t dev) { int error; error = ISA_PNP_PROBE(device_get_parent(dev), dev, speaker_ids); /* PnP match */ if (error == 0) return (0); /* No match */ if (error == ENXIO) return (ENXIO); /* Not configured by hints. */ if (strncmp(device_get_name(dev), "speaker", 9)) return (ENXIO); device_set_desc(dev, SPKR_DESC); return (0); } static int speaker_attach(device_t dev) { if (speaker_dev) { device_printf(dev, "Already attached!\n"); return (ENXIO); } speaker_dev = make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "speaker"); return (0); } static int speaker_detach(device_t dev) { destroy_dev(speaker_dev); return (0); } static device_method_t speaker_methods[] = { /* Device interface */ DEVMETHOD(device_probe, speaker_probe), DEVMETHOD(device_attach, speaker_attach), DEVMETHOD(device_detach, speaker_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; static driver_t speaker_driver = { "speaker", speaker_methods, 1, /* no softc */ }; static devclass_t speaker_devclass; DRIVER_MODULE(speaker, isa, speaker_driver, speaker_devclass, 0, 0); #ifndef PC98 DRIVER_MODULE(speaker, acpi, speaker_driver, speaker_devclass, 0, 0); #endif /* spkr.c ends here */ diff --git a/sys/i386/include/speaker.h b/sys/i386/include/speaker.h index 6b1f0211e516..2950b4760feb 100644 --- a/sys/i386/include/speaker.h +++ b/sys/i386/include/speaker.h @@ -1,29 +1,16 @@ /* - * speaker.h -- interface definitions for speaker ioctl() - * - * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 - * modified for FreeBSD by Andrew A. Chernov - * * $FreeBSD$ */ #ifndef _MACHINE_SPEAKER_H_ #define _MACHINE_SPEAKER_H_ -#include +#include -#define SPKRTONE _IOW('S', 1, tone_t) /* emit tone */ -#define SPKRTUNE _IO('S', 2) /* emit tone sequence*/ +#ifdef __CC_SUPPORTS_WARNING +#warning "machine/speaker.h is deprecated. Include dev/speaker/speaker.h instead." +#endif -typedef struct -{ - int frequency; /* in hertz */ - int duration; /* in 1/100ths of a second */ -} tone_t; - -/* - * Strings written to the speaker device are interpreted as tunes and played; - * see the spkr(4) man page for details. - */ +#include #endif /* !_MACHINE_SPEAKER_H_ */ diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c deleted file mode 100644 index d265e7c4f0a9..000000000000 --- a/sys/i386/isa/spkr.c +++ /dev/null @@ -1,656 +0,0 @@ -/*- - * spkr.c -- device driver for console speaker - * - * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 - * modified for FreeBSD by Andrew A. Chernov - * modified for PC98 by Kakefuda - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static d_open_t spkropen; -static d_close_t spkrclose; -static d_write_t spkrwrite; -static d_ioctl_t spkrioctl; - -static struct cdevsw spkr_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, - .d_open = spkropen, - .d_close = spkrclose, - .d_write = spkrwrite, - .d_ioctl = spkrioctl, - .d_name = "spkr", -}; - -static MALLOC_DEFINE(M_SPKR, "spkr", "Speaker buffer"); - -/**************** MACHINE DEPENDENT PART STARTS HERE ************************* - * - * This section defines a function tone() which causes a tone of given - * frequency and duration from the ISA console speaker. - * Another function endtone() is defined to force sound off, and there is - * also a rest() entry point to do pauses. - * - * Audible sound is generated using the Programmable Interval Timer (PIT) and - * Programmable Peripheral Interface (PPI) attached to the ISA speaker. The - * PPI controls whether sound is passed through at all; the PIT's channel 2 is - * used to generate clicks (a square wave) of whatever frequency is desired. - */ - -#ifdef PC98 -#define SPKR_DESC "PC98 speaker" -#else -#define SPKR_DESC "PC speaker" -#endif - -#define SPKRPRI PSOCK -static char endtone, endrest; - -static void tone(unsigned int thz, unsigned int ticks); -static void rest(int ticks); -static void playinit(void); -static void playtone(int pitch, int value, int sustain); -static void playstring(char *cp, size_t slen); - -/* emit tone of frequency thz for given number of ticks */ -static void -tone(thz, ticks) - unsigned int thz, ticks; -{ - unsigned int divisor; - int sps; - - if (thz <= 0) - return; - - divisor = timer_freq / thz; - -#ifdef DEBUG - (void) printf("tone: thz=%d ticks=%d\n", thz, ticks); -#endif /* DEBUG */ - - /* set timer to generate clicks at given frequency in Hertz */ - sps = splclock(); - - if (timer_spkr_acquire()) { - /* enter list of waiting procs ??? */ - splx(sps); - return; - } - splx(sps); - disable_intr(); - spkr_set_pitch(divisor); - enable_intr(); - - /* turn the speaker on */ - ppi_spkr_on(); - - /* - * Set timeout to endtone function, then give up the timeslice. - * This is so other processes can execute while the tone is being - * emitted. - */ - if (ticks > 0) - tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", ticks); - ppi_spkr_off(); - sps = splclock(); - timer_spkr_release(); - splx(sps); -} - -/* rest for given number of ticks */ -static void -rest(ticks) - int ticks; -{ - /* - * Set timeout to endrest function, then give up the timeslice. - * This is so other processes can execute while the rest is being - * waited out. - */ -#ifdef DEBUG - (void) printf("rest: %d\n", ticks); -#endif /* DEBUG */ - if (ticks > 0) - tsleep(&endrest, SPKRPRI | PCATCH, "spkrrs", ticks); -} - -/**************** PLAY STRING INTERPRETER BEGINS HERE ********************** - * - * Play string interpretation is modelled on IBM BASIC 2.0's PLAY statement; - * M[LNS] are missing; the ~ synonym and the _ slur mark and the octave- - * tracking facility are added. - * Requires tone(), rest(), and endtone(). String play is not interruptible - * except possibly at physical block boundaries. - */ - -typedef int bool; -#define TRUE 1 -#define FALSE 0 - -#define dtoi(c) ((c) - '0') - -static int octave; /* currently selected octave */ -static int whole; /* whole-note time at current tempo, in ticks */ -static int value; /* whole divisor for note time, quarter note = 1 */ -static int fill; /* controls spacing of notes */ -static bool octtrack; /* octave-tracking on? */ -static bool octprefix; /* override current octave-tracking state? */ - -/* - * Magic number avoidance... - */ -#define SECS_PER_MIN 60 /* seconds per minute */ -#define WHOLE_NOTE 4 /* quarter notes per whole note */ -#define MIN_VALUE 64 /* the most we can divide a note by */ -#define DFLT_VALUE 4 /* default value (quarter-note) */ -#define FILLTIME 8 /* for articulation, break note in parts */ -#define STACCATO 6 /* 6/8 = 3/4 of note is filled */ -#define NORMAL 7 /* 7/8ths of note interval is filled */ -#define LEGATO 8 /* all of note interval is filled */ -#define DFLT_OCTAVE 4 /* default octave */ -#define MIN_TEMPO 32 /* minimum tempo */ -#define DFLT_TEMPO 120 /* default tempo */ -#define MAX_TEMPO 255 /* max tempo */ -#define NUM_MULT 3 /* numerator of dot multiplier */ -#define DENOM_MULT 2 /* denominator of dot multiplier */ - -/* letter to half-tone: A B C D E F G */ -static int notetab[8] = {9, 11, 0, 2, 4, 5, 7}; - -/* - * This is the American Standard A440 Equal-Tempered scale with frequencies - * rounded to nearest integer. Thank Goddess for the good ol' CRC Handbook... - * our octave 0 is standard octave 2. - */ -#define OCTAVE_NOTES 12 /* semitones per octave */ -static int pitchtab[] = -{ -/* C C# D D# E F F# G G# A A# B*/ -/* 0 */ 65, 69, 73, 78, 82, 87, 93, 98, 103, 110, 117, 123, -/* 1 */ 131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247, -/* 2 */ 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, -/* 3 */ 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988, -/* 4 */ 1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1975, -/* 5 */ 2093, 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 3520, 3729, 3951, -/* 6 */ 4186, 4435, 4698, 4978, 5274, 5588, 5920, 6272, 6644, 7040, 7459, 7902, -}; - -static void -playinit() -{ - octave = DFLT_OCTAVE; - whole = (hz * SECS_PER_MIN * WHOLE_NOTE) / DFLT_TEMPO; - fill = NORMAL; - value = DFLT_VALUE; - octtrack = FALSE; - octprefix = TRUE; /* act as though there was an initial O(n) */ -} - -/* play tone of proper duration for current rhythm signature */ -static void -playtone(pitch, value, sustain) - int pitch, value, sustain; -{ - register int sound, silence, snum = 1, sdenom = 1; - - /* this weirdness avoids floating-point arithmetic */ - for (; sustain; sustain--) - { - /* See the BUGS section in the man page for discussion */ - snum *= NUM_MULT; - sdenom *= DENOM_MULT; - } - - if (value == 0 || sdenom == 0) - return; - - if (pitch == -1) - rest(whole * snum / (value * sdenom)); - else - { - sound = (whole * snum) / (value * sdenom) - - (whole * (FILLTIME - fill)) / (value * FILLTIME); - silence = whole * (FILLTIME-fill) * snum / (FILLTIME * value * sdenom); - -#ifdef DEBUG - (void) printf("playtone: pitch %d for %d ticks, rest for %d ticks\n", - pitch, sound, silence); -#endif /* DEBUG */ - - tone(pitchtab[pitch], sound); - if (fill != LEGATO) - rest(silence); - } -} - -/* interpret and play an item from a notation string */ -static void -playstring(cp, slen) - char *cp; - size_t slen; -{ - int pitch, oldfill, lastpitch = OCTAVE_NOTES * DFLT_OCTAVE; - -#define GETNUM(cp, v) for(v=0; isdigit(cp[1]) && slen > 0; ) \ - {v = v * 10 + (*++cp - '0'); slen--;} - for (; slen--; cp++) - { - int sustain, timeval, tempo; - register char c = toupper(*cp); - -#ifdef DEBUG - (void) printf("playstring: %c (%x)\n", c, c); -#endif /* DEBUG */ - - switch (c) - { - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': - - /* compute pitch */ - pitch = notetab[c - 'A'] + octave * OCTAVE_NOTES; - - /* this may be followed by an accidental sign */ - if (cp[1] == '#' || cp[1] == '+') - { - ++pitch; - ++cp; - slen--; - } - else if (cp[1] == '-') - { - --pitch; - ++cp; - slen--; - } - - /* - * If octave-tracking mode is on, and there has been no octave- - * setting prefix, find the version of the current letter note - * closest to the last regardless of octave. - */ - if (octtrack && !octprefix) - { - if (abs(pitch-lastpitch) > abs(pitch+OCTAVE_NOTES-lastpitch)) - { - ++octave; - pitch += OCTAVE_NOTES; - } - - if (abs(pitch-lastpitch) > abs((pitch-OCTAVE_NOTES)-lastpitch)) - { - --octave; - pitch -= OCTAVE_NOTES; - } - } - octprefix = FALSE; - lastpitch = pitch; - - /* ...which may in turn be followed by an override time value */ - GETNUM(cp, timeval); - if (timeval <= 0 || timeval > MIN_VALUE) - timeval = value; - - /* ...and/or sustain dots */ - for (sustain = 0; cp[1] == '.'; cp++) - { - slen--; - sustain++; - } - - /* ...and/or a slur mark */ - oldfill = fill; - if (cp[1] == '_') - { - fill = LEGATO; - ++cp; - slen--; - } - - /* time to emit the actual tone */ - playtone(pitch, timeval, sustain); - - fill = oldfill; - break; - - case 'O': - if (cp[1] == 'N' || cp[1] == 'n') - { - octprefix = octtrack = FALSE; - ++cp; - slen--; - } - else if (cp[1] == 'L' || cp[1] == 'l') - { - octtrack = TRUE; - ++cp; - slen--; - } - else - { - GETNUM(cp, octave); - if (octave >= sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES) - octave = DFLT_OCTAVE; - octprefix = TRUE; - } - break; - - case '>': - if (octave < sizeof(pitchtab) / sizeof(pitchtab[0]) / OCTAVE_NOTES - 1) - octave++; - octprefix = TRUE; - break; - - case '<': - if (octave > 0) - octave--; - octprefix = TRUE; - break; - - case 'N': - GETNUM(cp, pitch); - for (sustain = 0; cp[1] == '.'; cp++) - { - slen--; - sustain++; - } - oldfill = fill; - if (cp[1] == '_') - { - fill = LEGATO; - ++cp; - slen--; - } - playtone(pitch - 1, value, sustain); - fill = oldfill; - break; - - case 'L': - GETNUM(cp, value); - if (value <= 0 || value > MIN_VALUE) - value = DFLT_VALUE; - break; - - case 'P': - case '~': - /* this may be followed by an override time value */ - GETNUM(cp, timeval); - if (timeval <= 0 || timeval > MIN_VALUE) - timeval = value; - for (sustain = 0; cp[1] == '.'; cp++) - { - slen--; - sustain++; - } - playtone(-1, timeval, sustain); - break; - - case 'T': - GETNUM(cp, tempo); - if (tempo < MIN_TEMPO || tempo > MAX_TEMPO) - tempo = DFLT_TEMPO; - whole = (hz * SECS_PER_MIN * WHOLE_NOTE) / tempo; - break; - - case 'M': - if (cp[1] == 'N' || cp[1] == 'n') - { - fill = NORMAL; - ++cp; - slen--; - } - else if (cp[1] == 'L' || cp[1] == 'l') - { - fill = LEGATO; - ++cp; - slen--; - } - else if (cp[1] == 'S' || cp[1] == 's') - { - fill = STACCATO; - ++cp; - slen--; - } - break; - } - } -} - -/******************* UNIX DRIVER HOOKS BEGIN HERE ************************** - * - * This section implements driver hooks to run playstring() and the tone(), - * endtone(), and rest() functions defined above. - */ - -static int spkr_active = FALSE; /* exclusion flag */ -static char *spkr_inbuf; /* incoming buf */ - -static int -spkropen(dev, flags, fmt, td) - struct cdev *dev; - int flags; - int fmt; - struct thread *td; -{ -#ifdef DEBUG - (void) printf("spkropen: entering with dev = %s\n", devtoname(dev)); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else if (spkr_active) - return(EBUSY); - else - { -#ifdef DEBUG - (void) printf("spkropen: about to perform play initialization\n"); -#endif /* DEBUG */ - playinit(); - spkr_inbuf = malloc(DEV_BSIZE, M_SPKR, M_WAITOK); - spkr_active = TRUE; - return(0); - } -} - -static int -spkrwrite(dev, uio, ioflag) - struct cdev *dev; - struct uio *uio; - int ioflag; -{ -#ifdef DEBUG - printf("spkrwrite: entering with dev = %s, count = %d\n", - devtoname(dev), uio->uio_resid); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */ - return(E2BIG); - else - { - unsigned n; - char *cp; - int error; - - n = uio->uio_resid; - cp = spkr_inbuf; - error = uiomove(cp, n, uio); - if (!error) { - cp[n] = '\0'; - playstring(cp, n); - } - return(error); - } -} - -static int -spkrclose(dev, flags, fmt, td) - struct cdev *dev; - int flags; - int fmt; - struct thread *td; -{ -#ifdef DEBUG - (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else - { - wakeup(&endtone); - wakeup(&endrest); - free(spkr_inbuf, M_SPKR); - spkr_active = FALSE; - return(0); - } -} - -static int -spkrioctl(dev, cmd, cmdarg, flags, td) - struct cdev *dev; - unsigned long cmd; - caddr_t cmdarg; - int flags; - struct thread *td; -{ -#ifdef DEBUG - (void) printf("spkrioctl: entering with dev = %s, cmd = %lx\n", - devtoname(dev), cmd); -#endif /* DEBUG */ - - if (minor(dev) != 0) - return(ENXIO); - else if (cmd == SPKRTONE) - { - tone_t *tp = (tone_t *)cmdarg; - - if (tp->frequency == 0) - rest(tp->duration); - else - tone(tp->frequency, tp->duration); - return 0; - } - else if (cmd == SPKRTUNE) - { - tone_t *tp = (tone_t *)(*(caddr_t *)cmdarg); - tone_t ttp; - int error; - - for (; ; tp++) { - error = copyin(tp, &ttp, sizeof(tone_t)); - if (error) - return(error); - if (ttp.duration == 0) - break; - if (ttp.frequency == 0) - rest(ttp.duration); - else - tone(ttp.frequency, ttp.duration); - } - return(0); - } - return(EINVAL); -} - -/* - * Install placeholder to claim the resources owned by the - * AT tone generator. - */ -static struct isa_pnp_id speaker_ids[] = { -#ifndef PC98 - { 0x0008d041 /* PNP0800 */, SPKR_DESC }, -#endif - { 0 } -}; - -static struct cdev *speaker_dev; - -static int -speaker_probe(device_t dev) -{ - int error; - - error = ISA_PNP_PROBE(device_get_parent(dev), dev, speaker_ids); - - /* PnP match */ - if (error == 0) - return (0); - - /* No match */ - if (error == ENXIO) - return (ENXIO); - - /* Not configured by hints. */ - if (strncmp(device_get_name(dev), "speaker", 9)) - return (ENXIO); - - device_set_desc(dev, SPKR_DESC); - - return (0); -} - -static int -speaker_attach(device_t dev) -{ - - if (speaker_dev) { - device_printf(dev, "Already attached!\n"); - return (ENXIO); - } - - speaker_dev = make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "speaker"); - return (0); -} - -static int -speaker_detach(device_t dev) -{ - destroy_dev(speaker_dev); - return (0); -} - -static device_method_t speaker_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, speaker_probe), - DEVMETHOD(device_attach, speaker_attach), - DEVMETHOD(device_detach, speaker_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - { 0, 0 } -}; - -static driver_t speaker_driver = { - "speaker", - speaker_methods, - 1, /* no softc */ -}; - -static devclass_t speaker_devclass; - -DRIVER_MODULE(speaker, isa, speaker_driver, speaker_devclass, 0, 0); -#ifndef PC98 -DRIVER_MODULE(speaker, acpi, speaker_driver, speaker_devclass, 0, 0); -#endif - -/* spkr.c ends here */ diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 41dd04fb2990..c11405f65e15 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -1,521 +1,522 @@ # $FreeBSD$ # oldcard -- specialized use for debugging only. # owi -- totally unsupported for debugging only. SUBDIR= ${_3dfx} \ ${_aac} \ accf_data \ accf_http \ ${_acpi} \ ${_agp} \ aha \ ${_ahb} \ ${_aic} \ aic7xxx \ aio \ ${_amd} \ amr \ an \ ${_aout} \ ${_apm} \ ${_ar} \ ${_arcmsr} \ ${_arcnet} \ ${_arl} \ ${_asr} \ ata \ ath \ ${_ath_hal} \ ath_rate_amrr \ ath_rate_onoe \ ath_rate_sample \ aue \ ${_auxio} \ ${_awi} \ axe \ bfe \ bge \ ${_bios} \ ${_bktr} \ cam \ ${_canbepm} \ ${_canbus} \ ${_cardbus} \ ${_cbb} \ cd9660 \ cd9660_iconv \ cdce \ ${_ciss} \ ${_cm} \ coda \ coda5 \ ${_coff} \ ${_cp} \ ${_cpufreq} \ ${_crypto} \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ cue \ ${_cx} \ dc \ dcons \ dcons_crom \ de \ ${_digi} \ ${_dpt} \ ${_drm} \ dummynet \ ${_ed} \ ${_elink} \ ${_em} \ en \ ${_ep} \ ${_ex} \ ${_exca} \ ${_ext2fs} \ fatm \ fdc \ fdescfs \ ${_fe} \ firewire \ fxp \ ${_gem} \ geom \ harp \ hatm \ ${_hfa} \ hifn \ hme \ ${_hptmv} \ hwpmc \ ${_i2c} \ ${_ibcs2} \ ${_ichwd} \ ${_ida} \ ${_idt} \ ${_ie} \ if_bridge \ if_disc \ if_ef \ if_faith \ if_gif \ if_gre \ ${_if_ndis} \ if_ppp \ if_sl \ if_stf \ if_tap \ if_tun \ if_vlan \ ${_iir} \ ${_io} \ ip6fw \ ipdivert \ ${_ipfilter} \ ipfw \ ip_mroute_mod \ ${_ips} \ ipw \ isp \ ispfw \ iwi \ joy \ kbdmux \ kue \ lge \ libalias \ libiconv \ libmbpool \ libmchain \ ${_linprocfs} \ ${_linux} \ lmc \ ${_lnc} \ lpt \ mac_biba \ mac_bsdextended \ mac_ifoff \ mac_lomac \ mac_mls \ mac_none \ mac_partition \ mac_portacl \ mac_seeotheruids \ mac_stub \ mac_test \ mcd \ md \ mem \ mii \ mlx \ ${_mly} \ mpt \ msdosfs \ msdosfs_iconv \ ${_mse} \ my \ ${_ncp} \ ${_ncv} \ ${_ndis} \ netgraph \ nfsclient \ nfsserver \ nge \ nmdm \ ${_nsp} \ ntfs \ ntfs_iconv \ nullfs \ ${_nve} \ ${_nwfs} \ ${_oltr} \ ${_osf1} \ ${_padlock} \ patm \ ${_pccard} \ ${_pcfclock} \ pcn \ ${_pecoff} \ ${_pf} \ plip \ ${_pmc} \ portalfs \ ppbus \ ppi \ pps \ procfs \ pseudofs \ ${_pst} \ ${_puc} \ ral \ ${_random} \ ${_ray} \ rc \ rc4 \ re \ reiserfs \ rl \ rp \ rue \ ${_s3} \ ${_safe} \ ${_sbni} \ sbsh \ scd \ ${_scsi_low} \ sf \ ${_sio} \ sis \ sk \ ${_smbfs} \ sn \ ${_snc} \ snp \ ${_sound} \ ${_speaker} \ ${_splash} \ ${_sppp} \ ${_sr} \ ste \ ${_stg} \ ${_streams} \ sym \ ${_syscons} \ sysvipc \ ti \ tl \ trm \ ${_twa} \ twe \ tx \ txp \ ${_uart} \ ubsa \ ubsec \ ubser \ ucom \ ucycom \ udav \ udbp \ udf \ udf_iconv \ ufm \ ${_ufs} \ uftdi \ ugen \ uhid \ ukbd \ ulpt \ umass \ umct \ umodem \ ums \ unionfs \ uplcom \ ural \ urio \ usb \ uscanner \ utopia \ uvisor \ uvscom \ ${_vesa} \ vge \ vkbd \ ${_vpo} \ vr \ vx \ wb \ ${_wi} \ wlan \ wlan_acl \ wlan_ccmp \ wlan_tkip \ wlan_wep \ wlan_xauth \ ${_xe} \ xl .if ${MACHINE_ARCH} != "powerpc" _syscons= syscons _uart= uart _vpo= vpo .endif .if defined(ALL_MODULES) _ufs= ufs .endif .if !defined(NO_CRYPT) || defined(ALL_MODULES) .if exists(${.CURDIR}/../opencrypto) _crypto= crypto _cryptodev= cryptodev .endif .if exists(${.CURDIR}/../crypto) _random= random .endif .endif .if !defined(NO_IPFILTER) || defined(ALL_MODULES) _ipfilter= ipfilter .endif .if !defined(NO_PF) || defined(ALL_MODULES) _pf= pf .endif .if ${MACHINE_ARCH} == "i386" # XXX some of these can move to the general case when de-i386'ed # XXX some of these can move now, but are untested on other architectures. _3dfx= 3dfx _agp= agp _aic= aic _amd= amd _aout= aout _apm= apm _ar= ar _arcnet= arcnet _ath_hal= ath_hal _awi= awi _bktr= bktr _cardbus= cardbus _cbb= cbb _coff= coff _cp= cp _cpufreq= cpufreq _digi= digi _drm= drm _ed= ed _elink= elink _em= em _ep= ep _exca= exca _ext2fs= ext2fs _fe= fe _hfa= hfa _i2c= i2c _ibcs2= ibcs2 _ie= ie _if_ndis= if_ndis _io= io _linprocfs= linprocfs _linux= linux _lnc= lnc _mse= mse _ncp= ncp _ncv= ncv _ndis= ndis _nsp= nsp _nwfs= nwfs _oltr= oltr _pccard= pccard _pcfclock= pcfclock _pecoff= pecoff _pst= pst _puc= puc _ray= ray _safe= safe _sbni= sbni _scsi_low= scsi_low _sio= sio _smbfs= smbfs _sound= sound _speaker= speaker _splash= splash _sppp= sppp _sr= sr _stg= stg _streams= streams _wi= wi _xe= xe .if ${MACHINE} == "i386" _aac= aac _acpi= acpi _ahb= ahb _arcmsr= arcmsr _arl= arl _asr= asr _bios= bios _ciss= ciss _cm= cm _cs= cs _ctau= ctau _cx= cx _dpt= dpt _ex= ex _hptmv= hptmv _ichwd= ichwd _ida= ida _idt= idt _iir= iir _ips= ips _mly= mly _nve= nve .if !defined(NO_CRYPT) || defined(ALL_MODULES) .if exists(${.CURDIR}/../crypto/via) _padlock= padlock .endif .endif _s3= s3 _twa= twa _vesa= vesa .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus _pmc= pmc _snc= snc .endif .endif .if ${MACHINE_ARCH} == "alpha" _agp= agp _ahb= ahb _ext2fs= ext2fs _linprocfs= linprocfs _linux= linux _osf1= osf1 _sound= sound _sppp= sppp .endif .if ${MACHINE_ARCH} == "amd64" _aac= aac #_acpi= acpi # doesn't work on amd64 yet _agp= agp _arcmsr= arcmsr _ath_hal= ath_hal _ciss= ciss _cpufreq= cpufreq _digi= digi _drm= drm _em= em _ext2fs= ext2fs _hptmv= hptmv _i2c= i2c _ichwd= ichwd _ida= ida _if_ndis= if_ndis _iir= iir _io= io _ips= ips #_lnc= lnc _mly= mly _ndis= ndis _nve= nve _safe= safe _scsi_low= scsi_low _smbfs= smbfs _sound= sound +_speaker= speaker _sppp= sppp _twa= twa .endif .if ${MACHINE_ARCH} == "ia64" # Modules not enabled on ia64 (as compared to i386) include: # aac acpi aout apm atspeaker drm ibcs2 linprocfs linux ncv # nsp oltr pecoff s3 sbni stg vesa # acpi is not enabled because it is broken as a module on ia64 _aic= aic #_ar= ar not 64-bit clean _arcnet= arcnet _asr= asr _bktr= bktr _cardbus= cardbus _cbb= cbb _ciss= ciss _cm= cm _coff= coff _cpufreq= cpufreq _em= em _ep= ep _exca= exca _fe= fe _hfa= hfa _iir= iir _mly= mly _pccard= pccard _scsi_low= scsi_low _smbfs= smbfs _sound= sound _splash= splash _sppp= sppp #_sr= sr not 64bit clean _streams= streams _wi= wi _xe= xe .endif .if ${MACHINE_ARCH} == "powerpc" _gem= gem _smbfs= smbfs .endif .if ${MACHINE_ARCH} == "sparc64" _auxio= auxio _em= em _gem= gem _i2c= i2c _sound= sound .endif .if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) SUBDIR=${MODULES_OVERRIDE} .endif .for reject in ${WITHOUT_MODULES} SUBDIR:= ${SUBDIR:N${reject}} .endfor # Calling kldxref(8) for each module is expensive. .if !defined(NO_XREF) .MAKEFLAGS+= -DNO_XREF afterinstall: @if type kldxref >/dev/null 2>&1; then \ ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \ kldxref ${DESTDIR}${KMODDIR}; \ fi .endif .include diff --git a/sys/modules/speaker/Makefile b/sys/modules/speaker/Makefile index 69267d522b3e..1a4c5ac163a4 100644 --- a/sys/modules/speaker/Makefile +++ b/sys/modules/speaker/Makefile @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../i386/isa +.PATH: ${.CURDIR}/../../dev/speaker KMOD= speaker SRCS= spkr.c SRCS+= bus_if.h device_if.h isa_if.h .include