Date: Mon, 14 Apr 2008 16:43:57 GMT From: Andrew Thompson <thompsa@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 140032 for review Message-ID: <200804141643.m3EGhvej029610@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=140032 Change 140032 by thompsa@thompsa_burger on 2008/04/14 16:43:57 IFC Affected files ... .. //depot/projects/vap/lib/libthr/thread/thr_rwlock.c#4 integrate .. //depot/projects/vap/sbin/geom/class/part/geom_part.c#3 integrate .. //depot/projects/vap/sys/amd64/include/clock.h#6 integrate .. //depot/projects/vap/sys/amd64/isa/clock.c#8 integrate .. //depot/projects/vap/sys/conf/files.amd64#9 integrate .. //depot/projects/vap/sys/conf/files.i386#9 integrate .. //depot/projects/vap/sys/dev/acpi_support/acpi_ibm.c#6 integrate .. //depot/projects/vap/sys/dev/fb/vga.c#7 integrate .. //depot/projects/vap/sys/dev/nvram/nvram.c#3 integrate .. //depot/projects/vap/sys/dev/pci/pcivar.h#6 integrate .. //depot/projects/vap/sys/dev/sound/pci/hda/hdac.c#4 integrate .. //depot/projects/vap/sys/fs/smbfs/smbfs_vnops.c#7 integrate .. //depot/projects/vap/sys/geom/part/g_part.c#5 integrate .. //depot/projects/vap/sys/geom/part/g_part.h#6 integrate .. //depot/projects/vap/sys/geom/part/g_part_gpt.c#4 integrate .. //depot/projects/vap/sys/geom/part/g_part_if.m#3 integrate .. //depot/projects/vap/sys/geom/part/g_part_mbr.c#6 integrate .. //depot/projects/vap/sys/geom/part/g_part_pc98.c#2 integrate .. //depot/projects/vap/sys/i386/conf/GENERIC.hints#7 integrate .. //depot/projects/vap/sys/i386/include/clock.h#7 integrate .. //depot/projects/vap/sys/i386/isa/clock.c#8 integrate .. //depot/projects/vap/sys/isa/atrtc.c#1 branch .. //depot/projects/vap/sys/isa/rtc.h#3 integrate .. //depot/projects/vap/sys/kern/kern_lock.c#13 integrate .. //depot/projects/vap/sys/kern/subr_clock.c#5 integrate .. //depot/projects/vap/sys/kern/subr_witness.c#11 integrate .. //depot/projects/vap/sys/kern/uipc_shm.c#4 integrate .. //depot/projects/vap/sys/mips/compile/.cvsignore#1 branch .. //depot/projects/vap/sys/mips/conf/ADM5120#1 branch .. //depot/projects/vap/sys/mips/conf/ADM5120.hints#1 branch .. //depot/projects/vap/sys/mips/conf/IDT#1 branch .. //depot/projects/vap/sys/mips/conf/IDT.hints#1 branch .. //depot/projects/vap/sys/mips/conf/MALTA#1 branch .. //depot/projects/vap/sys/mips/conf/MALTA.hints#1 branch .. //depot/projects/vap/sys/mips/conf/QEMU#1 branch .. //depot/projects/vap/sys/mips/conf/SENTRY5#1 branch .. //depot/projects/vap/sys/mips/conf/SENTRY5.hints#1 branch .. //depot/projects/vap/sys/mips/include/_bus.h#1 branch .. //depot/projects/vap/sys/mips/include/_bus_octeon.h#1 branch .. //depot/projects/vap/sys/mips/include/_inttypes.h#1 branch .. //depot/projects/vap/sys/mips/include/_limits.h#1 branch .. //depot/projects/vap/sys/mips/include/_stdint.h#1 branch .. //depot/projects/vap/sys/mips/include/_types.h#1 branch .. //depot/projects/vap/sys/mips/include/am29lv081b.h#1 branch .. //depot/projects/vap/sys/mips/include/archtype.h#1 branch .. //depot/projects/vap/sys/mips/include/asm.h#1 branch .. //depot/projects/vap/sys/mips/include/asmacros.h#1 branch .. //depot/projects/vap/sys/mips/include/atomic.h#1 branch .. //depot/projects/vap/sys/mips/include/bootinfo.h#1 branch .. //depot/projects/vap/sys/mips/include/bswap.h#1 branch .. //depot/projects/vap/sys/mips/include/bus.h#1 branch .. //depot/projects/vap/sys/mips/include/bus_dma.h#1 branch .. //depot/projects/vap/sys/mips/include/bus_octeon.h#1 branch .. //depot/projects/vap/sys/mips/include/cache.h#1 branch .. //depot/projects/vap/sys/mips/include/cache_mipsNN.h#1 branch .. //depot/projects/vap/sys/mips/include/cache_r4k.h#1 branch .. //depot/projects/vap/sys/mips/include/clock.h#1 branch .. //depot/projects/vap/sys/mips/include/clockvar.h#1 branch .. //depot/projects/vap/sys/mips/include/cp0.h#1 branch .. //depot/projects/vap/sys/mips/include/cpu.h#1 branch .. //depot/projects/vap/sys/mips/include/cpufunc.h#1 branch .. //depot/projects/vap/sys/mips/include/cpuinfo.h#1 branch .. //depot/projects/vap/sys/mips/include/cpuregs.h#1 branch .. //depot/projects/vap/sys/mips/include/cputypes.h#1 branch .. //depot/projects/vap/sys/mips/include/db_machdep.h#1 branch .. //depot/projects/vap/sys/mips/include/defs.h#1 branch .. //depot/projects/vap/sys/mips/include/elf.h#1 branch .. //depot/projects/vap/sys/mips/include/endian.h#1 branch .. //depot/projects/vap/sys/mips/include/exec.h#1 branch .. //depot/projects/vap/sys/mips/include/float.h#1 branch .. //depot/projects/vap/sys/mips/include/floatingpoint.h#1 branch .. //depot/projects/vap/sys/mips/include/fpu.h#1 branch .. //depot/projects/vap/sys/mips/include/frame.h#1 branch .. //depot/projects/vap/sys/mips/include/gdb_machdep.h#1 branch .. //depot/projects/vap/sys/mips/include/hwfunc.h#1 branch .. //depot/projects/vap/sys/mips/include/ieee.h#1 branch .. //depot/projects/vap/sys/mips/include/ieeefp.h#1 branch .. //depot/projects/vap/sys/mips/include/in_cksum.h#1 branch .. //depot/projects/vap/sys/mips/include/intr.h#1 branch .. //depot/projects/vap/sys/mips/include/intr_machdep.h#1 branch .. //depot/projects/vap/sys/mips/include/iodev.h#1 branch .. //depot/projects/vap/sys/mips/include/kdb.h#1 branch .. //depot/projects/vap/sys/mips/include/limits.h#1 branch .. //depot/projects/vap/sys/mips/include/locore.h#1 branch .. //depot/projects/vap/sys/mips/include/md_var.h#1 branch .. //depot/projects/vap/sys/mips/include/memdev.h#1 branch .. //depot/projects/vap/sys/mips/include/metadata.h#1 branch .. //depot/projects/vap/sys/mips/include/minidump.h#1 branch .. //depot/projects/vap/sys/mips/include/mips_opcode.h#1 branch .. //depot/projects/vap/sys/mips/include/mp_watchdog.h#1 branch .. //depot/projects/vap/sys/mips/include/mutex.h#1 branch .. //depot/projects/vap/sys/mips/include/ns16550.h#1 branch .. //depot/projects/vap/sys/mips/include/param.h#1 branch .. //depot/projects/vap/sys/mips/include/pcb.h#1 branch .. //depot/projects/vap/sys/mips/include/pcb_ext.h#1 branch .. //depot/projects/vap/sys/mips/include/pci_cfgreg.h#1 branch .. //depot/projects/vap/sys/mips/include/pcpu.h#1 branch .. //depot/projects/vap/sys/mips/include/pltfm.h#1 branch .. //depot/projects/vap/sys/mips/include/pmap.h#1 branch .. //depot/projects/vap/sys/mips/include/pmc_mdep.h#1 branch .. //depot/projects/vap/sys/mips/include/ppireg.h#1 branch .. //depot/projects/vap/sys/mips/include/proc.h#1 branch .. //depot/projects/vap/sys/mips/include/profile.h#1 branch .. //depot/projects/vap/sys/mips/include/psl.h#1 branch .. //depot/projects/vap/sys/mips/include/pte.h#1 branch .. //depot/projects/vap/sys/mips/include/ptrace.h#1 branch .. //depot/projects/vap/sys/mips/include/queue.h#1 branch .. //depot/projects/vap/sys/mips/include/reg.h#1 branch .. //depot/projects/vap/sys/mips/include/regdef.h#1 branch .. //depot/projects/vap/sys/mips/include/regnum.h#1 branch .. //depot/projects/vap/sys/mips/include/reloc.h#1 branch .. //depot/projects/vap/sys/mips/include/resource.h#1 branch .. //depot/projects/vap/sys/mips/include/rm7000.h#1 branch .. //depot/projects/vap/sys/mips/include/runq.h#1 branch .. //depot/projects/vap/sys/mips/include/segments.h#1 branch .. //depot/projects/vap/sys/mips/include/setjmp.h#1 branch .. //depot/projects/vap/sys/mips/include/sf_buf.h#1 branch .. //depot/projects/vap/sys/mips/include/sigframe.h#1 branch .. //depot/projects/vap/sys/mips/include/signal.h#1 branch .. //depot/projects/vap/sys/mips/include/smp.h#1 branch .. //depot/projects/vap/sys/mips/include/stdarg.h#1 branch .. //depot/projects/vap/sys/mips/include/sysarch.h#1 branch .. //depot/projects/vap/sys/mips/include/timerreg.h#1 branch .. //depot/projects/vap/sys/mips/include/trap.h#1 branch .. //depot/projects/vap/sys/mips/include/ucontext.h#1 branch .. //depot/projects/vap/sys/mips/include/varargs.h#1 branch .. //depot/projects/vap/sys/mips/include/vmparam.h#1 branch .. //depot/projects/vap/sys/mips/mips/autoconf.c#1 branch .. //depot/projects/vap/sys/mips/mips/busdma_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/cache.c#1 branch .. //depot/projects/vap/sys/mips/mips/cache_mipsNN.c#1 branch .. //depot/projects/vap/sys/mips/mips/copystr.S#1 branch .. //depot/projects/vap/sys/mips/mips/cpu.c#1 branch .. //depot/projects/vap/sys/mips/mips/db_disasm.c#1 branch .. //depot/projects/vap/sys/mips/mips/db_interface.c#1 branch .. //depot/projects/vap/sys/mips/mips/db_trace.c#1 branch .. //depot/projects/vap/sys/mips/mips/dump_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/elf_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/exception.S#1 branch .. //depot/projects/vap/sys/mips/mips/fp.S#1 branch .. //depot/projects/vap/sys/mips/mips/gdb_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/genassym.c#1 branch .. //depot/projects/vap/sys/mips/mips/in_cksum.c#1 branch .. //depot/projects/vap/sys/mips/mips/intr_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/locore.S#1 branch .. //depot/projects/vap/sys/mips/mips/machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/mainbus.c#1 branch .. //depot/projects/vap/sys/mips/mips/mem.c#1 branch .. //depot/projects/vap/sys/mips/mips/mips_subr.c#1 branch .. //depot/projects/vap/sys/mips/mips/mp_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/nexus.c#1 branch .. //depot/projects/vap/sys/mips/mips/pm_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/pmap.c#1 branch .. //depot/projects/vap/sys/mips/mips/psraccess.S#1 branch .. //depot/projects/vap/sys/mips/mips/stack_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/support.S#1 branch .. //depot/projects/vap/sys/mips/mips/swtch.S#1 branch .. //depot/projects/vap/sys/mips/mips/tick.c#1 branch .. //depot/projects/vap/sys/mips/mips/tlb.S#1 branch .. //depot/projects/vap/sys/mips/mips/trap.c#1 branch .. //depot/projects/vap/sys/mips/mips/uio_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips/vm_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/adm5120_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/adm5120reg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/admpci.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/console.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/files.adm5120#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/if_admsw.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/if_admswreg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/if_admswvar.h#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/obio.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/obiovar.h#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/std.adm5120#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/uart_bus_adm5120.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/uart_cpu_adm5120.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/uart_dev_adm5120.c#1 branch .. //depot/projects/vap/sys/mips/mips32/adm5120/uart_dev_adm5120.h#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/files.idt#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/idt_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/idtpci.c#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/idtreg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/if_kr.c#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/if_krreg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/obio.c#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/obiovar.h#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/std.idt#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/uart_bus_rc32434.c#1 branch .. //depot/projects/vap/sys/mips/mips32/idt/uart_cpu_rc32434.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/files.malta#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/gt.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/gt_pci.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/gtreg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/gtvar.h#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/malta_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/maltareg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/obio.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/obiovar.h#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/std.malta#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/uart_bus_maltausart.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/uart_cpu_maltausart.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/yamon.c#1 branch .. //depot/projects/vap/sys/mips/mips32/malta/yamon.h#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/files.sentry5#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/obio.c#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/obiovar.h#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/s5_machdep.c#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/s5reg.h#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/siba_cc.c#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/siba_mips.c#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/siba_sdram.c#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/uart_bus_sbusart.c#1 branch .. //depot/projects/vap/sys/mips/mips32/sentry5/uart_cpu_sbusart.c#1 branch .. //depot/projects/vap/sys/modules/Makefile#20 integrate .. //depot/projects/vap/sys/modules/k8temp/Makefile#1 branch .. //depot/projects/vap/sys/net/radix.c#5 integrate .. //depot/projects/vap/sys/net/radix.h#3 integrate .. //depot/projects/vap/sys/net/radix_mpath.c#1 branch .. //depot/projects/vap/sys/net/radix_mpath.h#1 branch .. //depot/projects/vap/sys/net/route.c#7 integrate .. //depot/projects/vap/sys/net/route.h#6 integrate .. //depot/projects/vap/sys/net/rtsock.c#7 integrate .. //depot/projects/vap/sys/netinet/in_proto.c#6 integrate .. //depot/projects/vap/sys/netinet/ip_output.c#8 integrate .. //depot/projects/vap/sys/netinet6/in6_proto.c#7 integrate .. //depot/projects/vap/sys/netinet6/in6_src.c#7 integrate .. //depot/projects/vap/sys/netinet6/nd6_nbr.c#7 integrate .. //depot/projects/vap/sys/pc98/cbus/clock.c#4 integrate .. //depot/projects/vap/sys/pc98/conf/GENERIC.hints#6 integrate .. //depot/projects/vap/sys/powerpc/booke/clock.c#3 integrate .. //depot/projects/vap/sys/powerpc/conf/MPC85XX#2 integrate .. //depot/projects/vap/sys/security/audit/audit.c#8 integrate .. //depot/projects/vap/sys/security/audit/audit_arg.c#5 integrate .. //depot/projects/vap/sys/security/audit/audit_bsm.c#5 integrate .. //depot/projects/vap/sys/security/audit/audit_bsm_klib.c#6 integrate .. //depot/projects/vap/sys/security/audit/audit_bsm_token.c#3 integrate .. //depot/projects/vap/sys/security/audit/audit_pipe.c#4 integrate .. //depot/projects/vap/sys/security/audit/audit_syscalls.c#5 integrate .. //depot/projects/vap/sys/security/audit/audit_trigger.c#4 integrate .. //depot/projects/vap/sys/security/audit/audit_worker.c#7 integrate .. //depot/projects/vap/sys/security/mac/mac_framework.h#4 integrate .. //depot/projects/vap/sys/security/mac/mac_internal.h#5 integrate .. //depot/projects/vap/sys/security/mac/mac_policy.h#4 integrate .. //depot/projects/vap/sys/sys/lock.h#7 integrate Differences ... ==== //depot/projects/vap/lib/libthr/thread/thr_rwlock.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libthr/thread/thr_rwlock.c,v 1.14 2008/04/02 04:32:31 davidxu Exp $ + * $FreeBSD: src/lib/libthr/thread/thr_rwlock.c,v 1.15 2008/04/14 08:08:40 davidxu Exp $ */ #include <errno.h> @@ -32,7 +32,6 @@ #include "namespace.h" #include <pthread.h> -#include <pthread_np.h> #include "un-namespace.h" #include "thr_private.h" ==== //depot/projects/vap/sbin/geom/class/part/geom_part.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.4 2007/11/04 00:32:53 marcel Exp $"); +__FBSDID("$FreeBSD: src/sbin/geom/class/part/geom_part.c,v 1.5 2008/04/13 19:54:54 marcel Exp $"); #include <stdio.h> #include <stdint.h> @@ -39,6 +39,7 @@ #include <paths.h> #include <errno.h> #include <assert.h> +#include <sys/stat.h> #include "core/geom.h" #include "misc/subr.h" @@ -55,7 +56,8 @@ static char optional[] = ""; static char flags[] = "C"; -static void gpart_show(struct gctl_req *, unsigned); +static void gpart_bootcode(struct gctl_req *, unsigned int); +static void gpart_show(struct gctl_req *, unsigned int); struct g_command PUBSYM(class_commands)[] = { { "add", 0, NULL, { @@ -66,7 +68,13 @@ { 'l', "label", optional, G_TYPE_STRING }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, - "geom", NULL, + "geom", NULL + }, + { "bootcode", 0, gpart_bootcode, { + { 'b', "bootcode", NULL, G_TYPE_STRING }, + { 'f', "flags", flags, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "geom", NULL }, { "commit", 0, NULL, G_NULL_OPTS, "geom", NULL }, { "create", 0, NULL, { @@ -241,7 +249,7 @@ } static void -gpart_show(struct gctl_req *req, unsigned fl __unused) +gpart_show(struct gctl_req *req, unsigned int fl __unused) { struct gmesh mesh; struct gclass *classp; @@ -277,3 +285,39 @@ } geom_deletetree(&mesh); } + +static void +gpart_bootcode(struct gctl_req *req, unsigned int fl __unused) +{ + struct stat sb; + const char *bootfile; + void *code; + int error, fd, size; + + bootfile = gctl_get_ascii(req, "bootcode"); + if (bootfile == NULL) + errx(EXIT_FAILURE, "Missing bootfile argument"); + + error = stat(bootfile, &sb); + if (error) + errx(EXIT_FAILURE, "%s: not found", bootfile); + if (!S_ISREG(sb.st_mode)) + errx(EXIT_FAILURE, "%s: not a regular file", bootfile); + if (sb.st_size >= 1024*1024) + errx(EXIT_FAILURE, "%s: file too big", bootfile); + + size = sb.st_size; + + fd = open(bootfile, O_RDONLY); + if (fd == -1) + errx(EXIT_FAILURE, "%s: unable to open", bootfile); + code = malloc(size); + if (code == NULL) + errx(EXIT_FAILURE, "out of memory"); + if (read(fd, code, size) != size) + errx(EXIT_FAILURE, "%s: unable to read", bootfile); + close(fd); + + gctl_change_param(req, "bootcode", size, code); + gctl_issue(req); +} ==== //depot/projects/vap/sys/amd64/include/clock.h#6 (text+ko) ==== @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $FreeBSD: src/sys/amd64/include/clock.h,v 1.58 2008/03/26 20:09:18 phk Exp $ + * $FreeBSD: src/sys/amd64/include/clock.h,v 1.59 2008/04/14 07:59:59 phk Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -27,8 +27,6 @@ * Driver to clock driver interface. */ -int rtcin(int reg); -void writertc(int reg, unsigned char val); void init_TSC(void); void init_TSC_tc(void); ==== //depot/projects/vap/sys/amd64/isa/clock.c#8 (text+ko) ==== @@ -33,19 +33,12 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.241 2008/03/26 22:11:59 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.242 2008/04/14 07:59:59 phk Exp $"); /* * Routines to handle clock hardware. */ -/* - * inittodr, settodr and support routines written - * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at> - * - * reintroduced and updated by Chris Stenton <chris@gnome.co.uk> 8/10/94 - */ - #include "opt_clock.h" #include "opt_isa.h" @@ -62,7 +55,6 @@ #include <sys/module.h> #include <sys/sched.h> #include <sys/sysctl.h> -#include <sys/cons.h> #include <machine/clock.h> #include <machine/cpu.h> @@ -78,13 +70,6 @@ #include <isa/isavar.h> #endif -/* - * 32-bit time_t's can't reach leap years before 1904 or after 2036, so we - * can use a simple formula for leap years. - */ -#define LEAPYEAR(y) (((u_int)(y) % 4 == 0) ? 1 : 0) -#define DAYSPERYEAR (31+28+31+30+31+30+31+31+30+31+30+31) - #define TIMER_DIV(x) ((i8254_freq + (x) / 2) / (x)) int clkintr_pending; @@ -98,20 +83,14 @@ TUNABLE_INT("hw.i8254.freq", &i8254_freq); int i8254_max_count; static int i8254_real_max_count; -#define RTC_LOCK mtx_lock_spin(&clock_lock) -#define RTC_UNLOCK mtx_unlock_spin(&clock_lock) -static struct mtx clock_lock; -static const u_char daysinmonth[] = {31,28,31,30,31,30,31,31,30,31,30,31}; +struct mtx clock_lock; static struct intsrc *i8254_intsrc; static u_int32_t i8254_lastcount; static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; static int using_lapic_timer; -static int rtc_reg = -1; -static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; -static u_char rtc_statusb = RTCSB_24HR; /* Values for timerX_state: */ #define RELEASED 0 @@ -239,19 +218,6 @@ return(flag ? FILTER_HANDLED : FILTER_STRAY); } -#include "opt_ddb.h" -#ifdef DDB -#include <ddb/ddb.h> - -DB_SHOW_COMMAND(rtc, rtc) -{ - printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", - rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), - rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), - rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); -} -#endif /* DDB */ - static int getit(void) { @@ -386,50 +352,6 @@ #endif } -/* - * RTC support routines - */ - -int -rtcin(reg) - int reg; -{ - u_char val; - - RTC_LOCK; - if (rtc_reg != reg) { - inb(0x84); - outb(IO_RTC, reg); - rtc_reg = reg; - inb(0x84); - } - val = inb(IO_RTC + 1); - RTC_UNLOCK; - return (val); -} - -void -writertc(int reg, u_char val) -{ - - RTC_LOCK; - if (rtc_reg != reg) { - inb(0x84); - outb(IO_RTC, reg); - rtc_reg = reg; - inb(0x84); - } - outb(IO_RTC + 1, val); - inb(0x84); - RTC_UNLOCK; -} - -static __inline int -readrtc(int port) -{ - return(bcd2bin(rtcin(port))); -} - static void set_i8254_freq(u_int freq, int intr_freq) { @@ -468,8 +390,7 @@ startrtclock() { - writertc(RTC_STATUSA, rtc_statusa); - writertc(RTC_STATUSB, RTCSB_24HR); + atrtc_start(); set_i8254_freq(i8254_freq, hz); tc_init(&i8254_timecounter); @@ -478,140 +399,6 @@ } /* - * Initialize the time of day register, based on the time base which is, e.g. - * from a filesystem. - */ -void -inittodr(time_t base) -{ - unsigned long sec, days; - int year, month; - int y, m, s; - struct timespec ts; - - if (base) { - s = splclock(); - ts.tv_sec = base; - ts.tv_nsec = 0; - tc_setclock(&ts); - splx(s); - } - - /* Look if we have a RTC present and the time is valid */ - if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) - goto wrong_time; - - /* wait for time update to complete */ - /* If RTCSA_TUP is zero, we have at least 244us before next update */ - s = splhigh(); - while (rtcin(RTC_STATUSA) & RTCSA_TUP) { - splx(s); - s = splhigh(); - } - - days = 0; -#ifdef USE_RTC_CENTURY - year = readrtc(RTC_YEAR) + readrtc(RTC_CENTURY) * 100; -#else - year = readrtc(RTC_YEAR) + 1900; - if (year < 1970) - year += 100; -#endif - if (year < 1970) { - splx(s); - goto wrong_time; - } - month = readrtc(RTC_MONTH); - for (m = 1; m < month; m++) - days += daysinmonth[m-1]; - if ((month > 2) && LEAPYEAR(year)) - days ++; - days += readrtc(RTC_DAY) - 1; - for (y = 1970; y < year; y++) - days += DAYSPERYEAR + LEAPYEAR(y); - sec = ((( days * 24 + - readrtc(RTC_HRS)) * 60 + - readrtc(RTC_MIN)) * 60 + - readrtc(RTC_SEC)); - /* sec now contains the number of seconds, since Jan 1 1970, - in the local time zone */ - - sec += utc_offset(); - - y = time_second - sec; - if (y <= -2 || y >= 2) { - /* badly off, adjust it */ - ts.tv_sec = sec; - ts.tv_nsec = 0; - tc_setclock(&ts); - } - splx(s); - return; - -wrong_time: - printf("Invalid time in clock: check and reset the date!\n"); -} - -/* - * Write system time back to RTC - */ -void -resettodr() -{ - unsigned long tm; - int y, m, s; - - if (disable_rtc_set) - return; - - s = splclock(); - tm = time_second; - splx(s); - - /* Disable RTC updates and interrupts. */ - writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); - - /* Calculate local time to put in RTC */ - - tm -= utc_offset(); - - writertc(RTC_SEC, bin2bcd(tm%60)); tm /= 60; /* Write back Seconds */ - writertc(RTC_MIN, bin2bcd(tm%60)); tm /= 60; /* Write back Minutes */ - writertc(RTC_HRS, bin2bcd(tm%24)); tm /= 24; /* Write back Hours */ - - /* We have now the days since 01-01-1970 in tm */ - writertc(RTC_WDAY, (tm + 4) % 7 + 1); /* Write back Weekday */ - for (y = 1970, m = DAYSPERYEAR + LEAPYEAR(y); - tm >= m; - y++, m = DAYSPERYEAR + LEAPYEAR(y)) - tm -= m; - - /* Now we have the years in y and the day-of-the-year in tm */ - writertc(RTC_YEAR, bin2bcd(y%100)); /* Write back Year */ -#ifdef USE_RTC_CENTURY - writertc(RTC_CENTURY, bin2bcd(y/100)); /* ... and Century */ -#endif - for (m = 0; ; m++) { - int ml; - - ml = daysinmonth[m]; - if (m == 1 && LEAPYEAR(y)) - ml++; - if (tm < ml) - break; - tm -= ml; - } - - writertc(RTC_MONTH, bin2bcd(m + 1)); /* Write back Month */ - writertc(RTC_DAY, bin2bcd(tm + 1)); /* Write back Month Day */ - - /* Reenable RTC updates and interrupts. */ - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); -} - - -/* * Start both clocks running. */ void @@ -627,8 +414,8 @@ * timecounter to user a simpler algorithm. */ if (!using_lapic_timer) { - intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, - INTR_TYPE_CLK, NULL); + intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, + NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = @@ -641,8 +428,7 @@ } /* Initialize RTC. */ - writertc(RTC_STATUSA, rtc_statusa); - writertc(RTC_STATUSB, RTCSB_24HR); + atrtc_start(); /* * If the separate statistics clock hasn't been explicility disabled @@ -653,19 +439,18 @@ if (!statclock_disable && !using_lapic_timer) { diag = rtcin(RTC_DIAG); if (diag != 0) - printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); + printf("RTC BIOS diagnostic error %b\n", + diag, RTCDG_BITS); /* Setting stathz to nonzero early helps avoid races. */ stathz = RTC_NOPROFRATE; profhz = RTC_PROFRATE; /* Enable periodic interrupts from the RTC. */ - rtc_statusb |= RTCSB_PINTR; - intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL, + intr_add_handler("rtc", 8, + (driver_filter_t *)rtcintr, NULL, NULL, INTR_TYPE_CLK, NULL); - - writertc(RTC_STATUSB, rtc_statusb); - rtcin(RTC_INTR); + atrtc_enable_intr(); } init_TSC_tc(); @@ -677,8 +462,7 @@ if (using_lapic_timer) return; - rtc_statusa = RTCSA_DIVIDER | RTCSA_PROF; - writertc(RTC_STATUSA, rtc_statusa); + atrtc_rate(RTCSA_PROF); psdiv = pscnt = psratio; } @@ -688,8 +472,7 @@ if (using_lapic_timer) return; - rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; - writertc(RTC_STATUSA, rtc_statusa); + atrtc_rate(RTCSA_NOPROF); psdiv = pscnt = 1; } @@ -738,7 +521,8 @@ count = i8254_max_count - ((high << 8) | low); if (count < i8254_lastcount || (!i8254_ticked && (clkintr_pending || - ((count < 20 || (!(rflags & PSL_I) && count < i8254_max_count / 2u)) && + ((count < 20 || (!(rflags & PSL_I) && + count < i8254_max_count / 2u)) && i8254_pending != NULL && i8254_pending(i8254_intsrc))))) { i8254_ticked = 1; i8254_offset += i8254_max_count; @@ -751,11 +535,10 @@ #ifdef DEV_ISA /* - * Attach to the ISA PnP descriptors for the timer and realtime clock. + * Attach to the ISA PnP descriptors for the timer */ static struct isa_pnp_id attimer_ids[] = { { 0x0001d041 /* PNP0100 */, "AT timer" }, - { 0x000bd041 /* PNP0B00 */, "AT realtime clock" }, { 0 } }; @@ -764,7 +547,8 @@ { int result; - if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, attimer_ids)) <= 0) + result = ISA_PNP_PROBE(device_get_parent(dev), dev, attimer_ids); + if (result <= 0) device_quiet(dev); return(result); } @@ -781,8 +565,8 @@ DEVMETHOD(device_attach, attimer_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX stop statclock? */ - DEVMETHOD(device_resume, bus_generic_resume), /* XXX restart statclock? */ + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), { 0, 0 } }; ==== //depot/projects/vap/sys/conf/files.amd64#9 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.119 2008/04/12 14:20:22 rpaulo Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.120 2008/04/14 07:59:59 phk Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -207,9 +207,12 @@ dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_amd64.c optional uart dev/wpi/if_wpi.c optional wpi +isa/atrtc.c standard isa/syscons_isa.c optional sc isa/vga_isa.c optional vga +kern/clock_if.m standard kern/link_elf_obj.c standard +kern/subr_rtc.c standard # # IA32 binary support # ==== //depot/projects/vap/sys/conf/files.i386#9 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.593 2008/04/12 20:46:06 phk Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.594 2008/04/14 07:59:59 phk Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -443,6 +443,7 @@ i4b/layer1/itjc/i4b_itjc_l1.c optional itjc i4b/layer1/itjc/i4b_itjc_l1fsm.c optional itjc # +isa/atrtc.c standard isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/clock_if.m standard ==== //depot/projects/vap/sys/dev/acpi_support/acpi_ibm.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_ibm.c,v 1.15 2007/10/25 17:30:18 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpi_support/acpi_ibm.c,v 1.16 2008/04/14 08:00:00 phk Exp $"); /* * Driver for extra ACPI-controlled gadgets found on IBM ThinkPad laptops. @@ -48,7 +48,7 @@ #include <dev/acpica/acpivar.h> #include <dev/led/led.h> #include <sys/sysctl.h> -#include <machine/clock.h> +#include <isa/rtc.h> #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("IBM") ==== //depot/projects/vap/sys/dev/fb/vga.c#7 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fb/vga.c,v 1.37 2007/12/29 23:26:55 wkoszek Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fb/vga.c,v 1.38 2008/04/14 08:00:00 phk Exp $"); #include "opt_vga.h" #include "opt_fb.h" @@ -154,7 +154,7 @@ /* LOW-LEVEL */ -#include <machine/clock.h> +#include <isa/rtc.h> #ifdef __i386__ #include <machine/pc/vesa.h> #endif ==== //depot/projects/vap/sys/dev/nvram/nvram.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/nvram/nvram.c,v 1.1 2007/10/26 03:23:53 peter Exp $ + * $FreeBSD: src/sys/dev/nvram/nvram.c,v 1.2 2008/04/14 08:00:00 phk Exp $ */ #include <sys/param.h> @@ -35,7 +35,6 @@ #include <sys/uio.h> #include <sys/module.h> -#include <machine/clock.h> #include <isa/rtc.h> /* ==== //depot/projects/vap/sys/dev/pci/pcivar.h#6 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.80 2007/09/30 11:05:15 marius Exp $ + * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.81 2008/04/12 20:26:07 phk Exp $ * */ @@ -238,7 +238,7 @@ PCI_IVAR_CACHELNSZ, PCI_IVAR_MINGNT, PCI_IVAR_MAXLAT, - PCI_IVAR_LATTIMER, + PCI_IVAR_LATTIMER }; /* ==== //depot/projects/vap/sys/dev/sound/pci/hda/hdac.c#4 (text+ko) ==== @@ -81,10 +81,10 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20071129_0050" +#define HDA_DRV_TEST_REV "20080412_0051" #define HDA_WIDGET_PARSER_REV 1 -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.51 2007/12/13 15:48:45 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/hda/hdac.c,v 1.52 2008/04/12 15:07:32 ariff Exp $"); #define HDA_BOOTVERBOSE(stmt) do { \ if (bootverbose != 0 || snd_verbose > 3) { \ @@ -102,6 +102,12 @@ #define hdac_lockassert(sc) snd_mtxassert((sc)->lock) #define hdac_lockowned(sc) mtx_owned((sc)->lock) +#undef HDAC_MSI_ENABLED +#if __FreeBSD_version >= 700026 || \ + (__FreeBSD_version < 700000 && __FreeBSD_version >= 602106) +#define HDAC_MSI_ENABLED 1 +#endif + #define HDA_FLAG_MATCH(fl, v) (((fl) & (v)) == (v)) #define HDA_DEV_MATCH(fl, v) ((fl) == (v) || \ (fl) == 0xffffffff || \ @@ -188,6 +194,7 @@ /* Dell */ #define DELL_VENDORID 0x1028 #define DELL_D820_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01cc) +#define DELL_V1500_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x0228) #define DELL_I1300_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01c9) #define DELL_XPSM1210_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01d7) #define DELL_OPLX745_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01da) @@ -208,19 +215,20 @@ /* Asus */ #define ASUS_VENDORID 0x1043 -#define ASUS_M5200_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1993) +#define ASUS_A8X_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1153) #define ASUS_U5F_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1263) -#define ASUS_A8JC_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1153) -#define ASUS_P1AH2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) +#define ASUS_W6F_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1263) #define ASUS_A7M_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1323) +#define ASUS_F3JC_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1338) +#define ASUS_G2K_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1339) #define ASUS_A7T_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x13c2) -#define ASUS_W6F_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1263) #define ASUS_W2J_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1971) -#define ASUS_F3JC_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1338) +#define ASUS_M5200_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1993) +#define ASUS_P1AH2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) +#define ASUS_M2NPVMX_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) #define ASUS_M2V_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81e7) +#define ASUS_P5BWD_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81ec) #define ASUS_M2N_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x8234) -#define ASUS_M2NPVMX_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) -#define ASUS_P5BWD_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81ec) #define ASUS_A8NVMCSM_SUBVENDOR HDA_MODEL_CONSTRUCT(NVIDIA, 0xcb84) #define ASUS_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0xffff) @@ -548,6 +556,7 @@ #define HDA_CODEC_STAC922XD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681) #define HDA_CODEC_STAC9227 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7618) #define HDA_CODEC_STAC9271D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7627) +#define HDA_CODEC_STAC9205 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a0) #define HDA_CODEC_STACXXXX HDA_CODEC_CONSTRUCT(SIGMATEL, 0xffff) /* @@ -610,6 +619,7 @@ { HDA_CODEC_STAC922XD, "Sigmatel STAC9220D/9223D" }, { HDA_CODEC_STAC9227, "Sigmatel STAC9227" }, { HDA_CODEC_STAC9271D, "Sigmatel STAC9271D" }, + { HDA_CODEC_STAC9205, "Sigmatel STAC9205" }, { HDA_CODEC_CXVENICE, "Conexant Venice" }, { HDA_CODEC_CXWAIKIKI, "Conexant Waikiki" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, @@ -676,6 +686,8 @@ 0, 0, -1, 13, { 14, -1 }, -1 }, { DELL_OPLX745_SUBVENDOR, HDA_CODEC_AD1983, HDAC_HP_SWITCH_CTL, 0, 0, -1, 6, { 5, 7, -1 }, -1 }, + { DELL_V1500_SUBVENDOR, HDA_CODEC_STAC9205, HDAC_HP_SWITCH_CTRL, >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804141643.m3EGhvej029610>