diff options
Diffstat (limited to 'sys/dev/microcode')
-rw-r--r-- | sys/dev/microcode/neomagic/Makefile | 23 | ||||
-rw-r--r-- | sys/dev/microcode/neomagic/build.c | 45 | ||||
-rw-r--r-- | sys/dev/microcode/neomagic/neo-coeff.h | 4 | ||||
-rw-r--r-- | sys/dev/microcode/neomagic/neo-license | 27 |
4 files changed, 97 insertions, 2 deletions
diff --git a/sys/dev/microcode/neomagic/Makefile b/sys/dev/microcode/neomagic/Makefile new file mode 100644 index 00000000000..6f762f25781 --- /dev/null +++ b/sys/dev/microcode/neomagic/Makefile @@ -0,0 +1,23 @@ +# $OpenBSD: Makefile,v 1.1 2004/11/22 04:29:06 deraadt Exp $ + +NOPROG= +NOMAN= + +.if (${MACHINE} == "i386") + +FIRM= neo-coefficients + +CLEANFILES+= ${FIRM} build + +all: build + ${.OBJDIR}/build + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${FIRM} ${DESTDIR}/etc/firmware + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${.CURDIR}/neo-license ${DESTDIR}/etc/firmware +.endif + +.include <bsd.prog.mk> + diff --git a/sys/dev/microcode/neomagic/build.c b/sys/dev/microcode/neomagic/build.c new file mode 100644 index 00000000000..8b76aa39502 --- /dev/null +++ b/sys/dev/microcode/neomagic/build.c @@ -0,0 +1,45 @@ +/* $OpenBSD: build.c,v 1.1 2004/11/22 04:29:06 deraadt Exp $ */ + +/* + * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#include <sys/types.h> +#include <fcntl.h> +#include <dev/pci/neoreg.h> + +#include "neo-coeff.h" + +#define FILENAME "neo-coefficients" + +int +main(int argc, char *argv[]) +{ + struct neo_firmware nf; + int fd, i; + + fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (fd == -1) + err(1, FILENAME); + + bcopy(coefficientSizes, &nf.coefficientSizes, + sizeof nf.coefficientSizes); + bcopy(coefficients, &nf.coefficients, + sizeof nf.coefficients); + + write(fd, &nf, sizeof nf); + printf("created %s length %d\n", FILENAME, sizeof nf); + close(fd); + return (0); +} diff --git a/sys/dev/microcode/neomagic/neo-coeff.h b/sys/dev/microcode/neomagic/neo-coeff.h index adcb5811df8..fb5f77b6e59 100644 --- a/sys/dev/microcode/neomagic/neo-coeff.h +++ b/sys/dev/microcode/neomagic/neo-coeff.h @@ -1,4 +1,4 @@ -/* $OpenBSD: neo-coeff.h,v 1.1 2001/06/18 19:27:19 deraadt Exp $ */ +/* $OpenBSD: neo-coeff.h,v 1.2 2004/11/22 04:29:06 deraadt Exp $ */ /* * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> @@ -4630,7 +4630,7 @@ static const char coefficients[NM_TOTAL_COEFF_COUNT * 4] = { }; static const u_int16_t -coefficientSizes[] = { +coefficientSizes[NM_COEFF_SIZES] = { /* Playback */ 0x00C0, 0x5000, 0x0060, 0x2800, 0x0040, 0x0060, 0x1400, 0x0000, /* Record */ diff --git a/sys/dev/microcode/neomagic/neo-license b/sys/dev/microcode/neomagic/neo-license new file mode 100644 index 00000000000..0946695c97d --- /dev/null +++ b/sys/dev/microcode/neomagic/neo-license @@ -0,0 +1,27 @@ + * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk> + * All rights reserved. + * + * Derived from the public domain Linux driver + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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, WHETHERIN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF + * SUCH DAMAGE. + +This license applies to the neo-coefficient file. |