CVS commit: src/sys/arch/evbarm/rpi
Module Name:src Committed By: skrll Date: Tue Apr 1 06:55:29 UTC 2014 Modified Files: src/sys/arch/evbarm/rpi: rpi_machdep.c rpi_start.S rpi_vcmbox.c Log Message: Trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/rpi/rpi_machdep.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/rpi/rpi_start.S cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/rpi/rpi_vcmbox.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/rpi/rpi_machdep.c diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.39 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.40 --- src/sys/arch/evbarm/rpi/rpi_machdep.c:1.39 Tue Dec 10 16:30:36 2013 +++ src/sys/arch/evbarm/rpi/rpi_machdep.c Tue Apr 1 06:55:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rpi_machdep.c,v 1.39 2013/12/10 16:30:36 joerg Exp $ */ +/* $NetBSD: rpi_machdep.c,v 1.40 2014/04/01 06:55:29 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rpi_machdep.c,v 1.39 2013/12/10 16:30:36 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: rpi_machdep.c,v 1.40 2014/04/01 06:55:29 skrll Exp $); #include opt_evbarm_boardtype.h #include opt_ddb.h @@ -380,20 +380,20 @@ rpi_bootparams(void) bcm2835_mbox_write(iot, ioh, BCMMBOX_CHANPM, ( #if (NSDHC 0) - (1 VCPM_POWER_SDCARD) | + (1 VCPM_POWER_SDCARD) | #endif #if (NPLCOM 0) (1 VCPM_POWER_UART0) | #endif #if (NBCMDWCTWO 0) - (1 VCPM_POWER_USB) | + (1 VCPM_POWER_USB) | #endif #if (NBSCIIC 0) - (1 VCPM_POWER_I2C0) | (1 VCPM_POWER_I2C1) | + (1 VCPM_POWER_I2C0) | (1 VCPM_POWER_I2C1) | /* (1 VCPM_POWER_I2C2) | */ #endif #if (NBCMSPI 0) - (1 VCPM_POWER_SPI) | + (1 VCPM_POWER_SPI) | #endif 0) 4); @@ -645,7 +645,7 @@ rpi_fb_get_edid_mode(uint32_t *pwidth, u uint8_t edid_data[1024]; uint32_t res; int error; - + error = bcmmbox_request(BCMMBOX_CHANARM2VC, vb_edid, sizeof(vb_edid), res); if (error) { @@ -688,7 +688,7 @@ rpi_fb_init(prop_dictionary_t dict) uint32_t width = 0, height = 0; uint32_t res; char *ptr; - int integer; + int integer; int error; if (get_bootconf_option(boot_args, fb, Index: src/sys/arch/evbarm/rpi/rpi_start.S diff -u src/sys/arch/evbarm/rpi/rpi_start.S:1.8 src/sys/arch/evbarm/rpi/rpi_start.S:1.9 --- src/sys/arch/evbarm/rpi/rpi_start.S:1.8 Tue Nov 12 17:14:39 2013 +++ src/sys/arch/evbarm/rpi/rpi_start.S Tue Apr 1 06:55:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rpi_start.S,v 1.8 2013/11/12 17:14:39 skrll Exp $ */ +/* $NetBSD: rpi_start.S,v 1.9 2014/04/01 06:55:29 skrll Exp $ */ /* * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. @@ -87,11 +87,11 @@ #include arm/armreg.h #include assym.h -RCSID($NetBSD: rpi_start.S,v 1.8 2013/11/12 17:14:39 skrll Exp $) +RCSID($NetBSD: rpi_start.S,v 1.9 2014/04/01 06:55:29 skrll Exp $) /* - * Workaround Erratum 411920 - * + * Workaround Erratum 411920 + * * - value of arg 'reg' Should Be Zero */ #define Invalidate_I_cache(reg) \ @@ -230,12 +230,12 @@ _C_LABEL(rpi_start): ldr r1, Lcontrol_set orr r0, r0, r1 ldr lr, Lstart - + .align 5 @ turn mmu on! mov r0, r0 mcr p15, 0, r0, c1, c0, 0 - + /* * Ensure that the coprocessor has finished turning on the MMU. */ @@ -258,7 +258,7 @@ Ll1_s_frame: Ltemp_l1_table: /* Put the temporary L1 translation table just below the kernel. */ .word 0x4000 - + Lstart: .word start /* Index: src/sys/arch/evbarm/rpi/rpi_vcmbox.c diff -u src/sys/arch/evbarm/rpi/rpi_vcmbox.c:1.2 src/sys/arch/evbarm/rpi/rpi_vcmbox.c:1.3 --- src/sys/arch/evbarm/rpi/rpi_vcmbox.c:1.2 Mon Jan 7 22:32:24 2013 +++ src/sys/arch/evbarm/rpi/rpi_vcmbox.c Tue Apr 1 06:55:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rpi_vcmbox.c,v 1.2 2013/01/07 22:32:24 jmcneill Exp $ */ +/* $NetBSD: rpi_vcmbox.c,v 1.3 2014/04/01 06:55:29 skrll Exp $ */ /*- * Copyright (c) 2013 Jared D. McNeill jmcne...@invisible.ca @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rpi_vcmbox.c,v 1.2 2013/01/07 22:32:24 jmcneill Exp $); +__KERNEL_RCSID(0, $NetBSD: rpi_vcmbox.c,v 1.3 2014/04/01 06:55:29 skrll Exp $); #include sys/param.h #include sys/types.h @@ -264,7 +264,7 @@ vcmbox_cpufreq_init(struct vcmbox_softc error = sysctl_createv(sc-sc_log, 0, freqnode, node, CTLFLAG_READWRITE, CTLTYPE_INT, target, NULL, vcmbox_cpufreq_sysctl_helper, 0, (void *)sc, 0, - CTL_CREATE, CTL_EOL); + CTL_CREATE, CTL_EOL); if (error) goto sysctl_failed; sc-sc_node_target = node-sysctl_num; @@ -272,7 +272,7 @@ vcmbox_cpufreq_init(struct vcmbox_softc error = sysctl_createv(sc-sc_log, 0, freqnode, node, 0, CTLTYPE_INT, current, NULL, vcmbox_cpufreq_sysctl_helper, 0, (void *)sc, 0, - CTL_CREATE, CTL_EOL); + CTL_CREATE, CTL_EOL); if (error) goto
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: dsl Date: Tue Apr 1 07:16:18 UTC 2014 Modified Files: src/sys/arch/x86/x86: x86_machdep.c Log Message: Revert most of the machdep sysctls to 32bit To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/arch/x86/x86/x86_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.63 src/sys/arch/x86/x86/x86_machdep.c:1.64 --- src/sys/arch/x86/x86/x86_machdep.c:1.63 Sun Feb 23 22:38:40 2014 +++ src/sys/arch/x86/x86/x86_machdep.c Tue Apr 1 07:16:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.63 2014/02/23 22:38:40 dsl Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.64 2014/04/01 07:16:18 dsl Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: x86_machdep.c,v 1.63 2014/02/23 22:38:40 dsl Exp $); +__KERNEL_RCSID(0, $NetBSD: x86_machdep.c,v 1.64 2014/04/01 07:16:18 dsl Exp $); #include opt_modular.h #include opt_physmem.h @@ -1056,12 +1056,12 @@ sysctl_machdep_diskinfo(SYSCTLFN_ARGS) } static void -const_sysctl(struct sysctllog **clog, const char *name, u_quad_t value, int tag) +const_sysctl(struct sysctllog **clog, const char *name, int type, +u_quad_t value, int tag) { - sysctl_createv(clog, 0, NULL, NULL, + (sysctl_createv)(clog, 0, NULL, NULL, CTLFLAG_PERMANENT | CTLFLAG_IMMEDIATE, - CTLTYPE_QUAD, name, NULL, - NULL, value, NULL, 0, + type, name, NULL, NULL, value, NULL, 0, CTL_MACHDEP, tag, CTL_EOL); } @@ -1115,17 +1115,26 @@ SYSCTL_SETUP(sysctl_machdep_setup, sysc CTL_MACHDEP, CTL_CREATE, CTL_EOL); /* None of these can ever change once the system has booted */ - const_sysctl(clog, fpu_present, i386_fpu_present, CPU_FPU_PRESENT); - const_sysctl(clog, osfxsr, i386_use_fxsave, CPU_OSFXSR); - const_sysctl(clog, sse, i386_has_sse, CPU_SSE); - const_sysctl(clog, sse2, i386_has_sse2, CPU_SSE2); - - const_sysctl(clog, fpu_save, x86_fpu_save, CTL_CREATE); - const_sysctl(clog, fpu_save_size, x86_fpu_save_size, CTL_CREATE); - const_sysctl(clog, xsave_features, x86_xsave_features, CTL_CREATE); + const_sysctl(clog, fpu_present, CTLTYPE_INT, i386_fpu_present, + CPU_FPU_PRESENT); + const_sysctl(clog, osfxsr, CTLTYPE_INT, i386_use_fxsave, + CPU_OSFXSR); + const_sysctl(clog, sse, CTLTYPE_INT, i386_has_sse, + CPU_SSE); + const_sysctl(clog, sse2, CTLTYPE_INT, i386_has_sse2, + CPU_SSE2); + + const_sysctl(clog, fpu_save, CTLTYPE_INT, x86_fpu_save, + CTL_CREATE); + const_sysctl(clog, fpu_save_size, CTLTYPE_INT, x86_fpu_save_size, + CTL_CREATE); + const_sysctl(clog, xsave_features, CTLTYPE_QUAD, x86_xsave_features, + CTL_CREATE); #ifndef XEN - const_sysctl(clog, biosbasemem, biosbasemem, CPU_BIOSBASEMEM); - const_sysctl(clog, biosextmem, biosextmem, CPU_BIOSEXTMEM); + const_sysctl(clog, biosbasemem, CTLTYPE_INT, biosbasemem, + CPU_BIOSBASEMEM); + const_sysctl(clog, biosextmem, CTLTYPE_INT, biosextmem, + CPU_BIOSEXTMEM); #endif }
CVS commit: src/sys/arch/sgimips/include
Module Name:src Committed By: ozaki-r Date: Tue Apr 1 12:57:46 UTC 2014 Modified Files: src/sys/arch/sgimips/include: pci_machdep.h Log Message: Add a missing comma To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sgimips/include/pci_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sgimips/include/pci_machdep.h diff -u src/sys/arch/sgimips/include/pci_machdep.h:1.12 src/sys/arch/sgimips/include/pci_machdep.h:1.13 --- src/sys/arch/sgimips/include/pci_machdep.h:1.12 Sat Mar 29 19:28:30 2014 +++ src/sys/arch/sgimips/include/pci_machdep.h Tue Apr 1 12:57:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.12 2014/03/29 19:28:30 christos Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.13 2014/04/01 12:57:46 ozaki-r Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -93,7 +93,7 @@ void pci_conf_write(pci_chipset_tag_t, int pci_conf_hook(pci_chipset_tag_t, int, int, int, pcireg_t); int pci_intr_map(const struct pci_attach_args *, pci_intr_handle_t *); -const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t, char * +const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t, char *, size_t); const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t); void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
CVS commit: src/sys
Module Name:src Committed By: pooka Date: Tue Apr 1 13:11:44 UTC 2014 Modified Files: src/sys/netinet: ip_flow.c src/sys/netinet6: ip6_flow.c Log Message: Wrap ipflow_create() ip6flow_create() in kernel lock. Prevents the interrupt side on another core from seeing the situation while the ipflow is being modified. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/netinet/ip_flow.c cvs rdiff -u -r1.21 -r1.22 src/sys/netinet6/ip6_flow.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet/ip_flow.c diff -u src/sys/netinet/ip_flow.c:1.62 src/sys/netinet/ip_flow.c:1.63 --- src/sys/netinet/ip_flow.c:1.62 Wed Mar 19 10:54:20 2014 +++ src/sys/netinet/ip_flow.c Tue Apr 1 13:11:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_flow.c,v 1.62 2014/03/19 10:54:20 liamjfoy Exp $ */ +/* $NetBSD: ip_flow.c,v 1.63 2014/04/01 13:11:44 pooka Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ip_flow.c,v 1.62 2014/03/19 10:54:20 liamjfoy Exp $); +__KERNEL_RCSID(0, $NetBSD: ip_flow.c,v 1.63 2014/04/01 13:11:44 pooka Exp $); #include sys/param.h #include sys/systm.h @@ -423,6 +423,9 @@ ipflow_create(const struct route *ro, st */ if (ip_maxflows == 0 || ip-ip_p == IPPROTO_ICMP) return; + + KERNEL_LOCK(1, NULL); + /* * See if an existing flow struct exists. If so remove it from it's * list and free the old route. If not, try to malloc a new one @@ -437,7 +440,7 @@ ipflow_create(const struct route *ro, st ipf = pool_get(ipflow_pool, PR_NOWAIT); splx(s); if (ipf == NULL) -return; +goto out; ipflow_inuse++; } memset(ipf, 0, sizeof(*ipf)); @@ -467,6 +470,9 @@ ipflow_create(const struct route *ro, st s = splnet(); IPFLOW_INSERT(ipflowtable[hash], ipf); splx(s); + + out: + KERNEL_UNLOCK_ONE(NULL); } int Index: src/sys/netinet6/ip6_flow.c diff -u src/sys/netinet6/ip6_flow.c:1.21 src/sys/netinet6/ip6_flow.c:1.22 --- src/sys/netinet6/ip6_flow.c:1.21 Thu May 23 16:49:46 2013 +++ src/sys/netinet6/ip6_flow.c Tue Apr 1 13:11:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ip6_flow.c,v 1.21 2013/05/23 16:49:46 msaitoh Exp $ */ +/* $NetBSD: ip6_flow.c,v 1.22 2014/04/01 13:11:44 pooka Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ip6_flow.c,v 1.21 2013/05/23 16:49:46 msaitoh Exp $); +__KERNEL_RCSID(0, $NetBSD: ip6_flow.c,v 1.22 2014/04/01 13:11:44 pooka Exp $); #include sys/param.h #include sys/systm.h @@ -463,6 +463,8 @@ ip6flow_create(const struct route *ro, s if (ip6_maxflows == 0 || ip6-ip6_nxt == IPPROTO_IPV6_ICMP) return; + KERNEL_LOCK(1, NULL); + /* * See if an existing flow exists. If so: * - Remove the flow @@ -481,7 +483,7 @@ ip6flow_create(const struct route *ro, s } else { ip6f = pool_get(ip6flow_pool, PR_NOWAIT); if (ip6f == NULL) -return; +goto out; ip6flow_inuse++; } memset(ip6f, 0, sizeof(*ip6f)); @@ -513,6 +515,9 @@ ip6flow_create(const struct route *ro, s s = splnet(); IP6FLOW_INSERT(ip6flowtable[hash], ip6f); splx(s); + + out: + KERNEL_UNLOCK_ONE(NULL); } /*
CVS commit: src/distrib/playstation2
Module Name:src Committed By: martin Date: Tue Apr 1 14:06:38 UTC 2014 Modified Files: src/distrib/playstation2: Makefile Log Message: Do not set MDSET_RELEASEDIR - need to revisit To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/distrib/playstation2/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/playstation2/Makefile diff -u src/distrib/playstation2/Makefile:1.15 src/distrib/playstation2/Makefile:1.16 --- src/distrib/playstation2/Makefile:1.15 Mon Mar 31 11:25:47 2014 +++ src/distrib/playstation2/Makefile Tue Apr 1 14:06:38 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2014/03/31 11:25:47 martin Exp $ +# $NetBSD: Makefile,v 1.16 2014/04/01 14:06:38 martin Exp $ .include bsd.own.mk .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib @@ -7,7 +7,9 @@ MINIROOTDIR!= cd ${.CURDIR}/../miniroot MINIROOT= ${MINIROOTDIR}/miniroot.fs MDSETTARGETS= RAMDISK ${MINIROOT} netbsd -MDSET_RELEASEDIR= installation + +# ??? +# MDSET_RELEASEDIR= installation .include ${DISTRIBDIR}/common/Makefile.mdset
CVS commit: src/sys/arch/playstation2/include
Module Name:src Committed By: martin Date: Tue Apr 1 14:08:50 UTC 2014 Modified Files: src/sys/arch/playstation2/include: param.h Log Message: Rearrange order of includes To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/playstation2/include/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/playstation2/include/param.h diff -u src/sys/arch/playstation2/include/param.h:1.9 src/sys/arch/playstation2/include/param.h:1.10 --- src/sys/arch/playstation2/include/param.h:1.9 Mon Mar 31 11:41:01 2014 +++ src/sys/arch/playstation2/include/param.h Tue Apr 1 14:08:50 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.9 2014/03/31 11:41:01 martin Exp $ */ +/* $NetBSD: param.h,v 1.10 2014/04/01 14:08:50 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -71,11 +71,11 @@ #ifndef _PLAYSTATION2_PARAM_H_ #define _PLAYSTATION2_PARAM_H_ -#include mips/mips_param.h - #define _MACHINE playstation2 #define MACHINE playstation2 +#include mips/mips_param.h + #define DEV_BSIZE 512 #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ #define BLKDEV_IOSIZE 2048
CVS commit: src/sys/arch/playstation2/include
Module Name:src Committed By: martin Date: Tue Apr 1 14:09:15 UTC 2014 Modified Files: src/sys/arch/playstation2/include: disklabel.h Log Message: Seems we use MBR labels To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/playstation2/include/disklabel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/playstation2/include/disklabel.h diff -u src/sys/arch/playstation2/include/disklabel.h:1.9 src/sys/arch/playstation2/include/disklabel.h:1.10 --- src/sys/arch/playstation2/include/disklabel.h:1.9 Mon Mar 31 11:25:49 2014 +++ src/sys/arch/playstation2/include/disklabel.h Tue Apr 1 14:09:14 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.h,v 1.9 2014/03/31 11:25:49 martin Exp $ */ +/* $NetBSD: disklabel.h,v 1.10 2014/04/01 14:09:14 martin Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -33,6 +33,7 @@ #ifndef _PLAYSTATION2_DISKLABEL_H_ #define _PLAYSTATION2_DISKLABEL_H_ +#define LABELUSESMBR 1 /* use MBR partitionning */ #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ #define MAXPARTITIONS 16 /* number of partitions */
CVS commit: src/sys/ufs/ffs
Module Name:src Committed By: christos Date: Tue Apr 1 14:28:17 UTC 2014 Modified Files: src/sys/ufs/ffs: ffs_vfsops.c Log Message: Check for bread errors before we do the size check. Otherwise we de-reference NULL... To generate a diff of this commit: cvs rdiff -u -r1.295 -r1.296 src/sys/ufs/ffs/ffs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/ufs/ffs/ffs_vfsops.c diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.295 src/sys/ufs/ffs/ffs_vfsops.c:1.296 --- src/sys/ufs/ffs/ffs_vfsops.c:1.295 Sun Mar 23 11:21:16 2014 +++ src/sys/ufs/ffs/ffs_vfsops.c Tue Apr 1 10:28:17 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vfsops.c,v 1.295 2014/03/23 15:21:16 hannken Exp $ */ +/* $NetBSD: ffs_vfsops.c,v 1.296 2014/04/01 14:28:17 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.295 2014/03/23 15:21:16 hannken Exp $); +__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.296 2014/04/01 14:28:17 christos Exp $); #if defined(_KERNEL_OPT) #include opt_ffs.h @@ -1125,14 +1125,14 @@ ffs_mountfs(struct vnode *devvp, struct */ if (!ronly) { - error = bread(devvp, FFS_FSBTODB(fs, fs-fs_size - 1), fs-fs_fsize, - cred, 0, bp); - if (bp-b_bcount != fs-fs_fsize) - error = EINVAL; + error = bread(devvp, FFS_FSBTODB(fs, fs-fs_size - 1), + fs-fs_fsize, cred, 0, bp); if (error) { bset = BC_INVAL; goto out; } + if (bp-b_bcount != fs-fs_fsize) + error = EINVAL; brelse(bp, BC_INVAL); bp = NULL; }
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Tue Apr 1 14:55:20 UTC 2014 Modified Files: src/sys/external/bsd/drm2/include/linux: completion.h Log Message: Add some more Linux completion operations. Adapted from a patch by nick@. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/include/linux/completion.h diff -u src/sys/external/bsd/drm2/include/linux/completion.h:1.2 src/sys/external/bsd/drm2/include/linux/completion.h:1.3 --- src/sys/external/bsd/drm2/include/linux/completion.h:1.2 Tue Mar 18 18:20:43 2014 +++ src/sys/external/bsd/drm2/include/linux/completion.h Tue Apr 1 14:55:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: completion.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $ */ +/* $NetBSD: completion.h,v 1.3 2014/04/01 14:55:20 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -146,6 +146,17 @@ INIT_COMPLETION_blorp(struct completion mutex_exit(completion-c_lock); } +static inline void +_completion_claim(struct completion *completion) +{ + + KASSERT(mutex_owned(completion-c_lock)); + if (completion-c_done 0) + completion-c_done--; + else + KASSERT(completion-c_done == -1); +} + /* * Wait interruptibly with a timeout for someone to call complete or * complete_all. @@ -175,13 +186,8 @@ wait_for_completion_interruptible_timeou start = now; } - /* Claim a completion if it's not open season. */ - if (completion-c_done 0) - completion-c_done--; - else - KASSERT(completion-c_done == -1); - /* Success! */ + _completion_claim(completion); error = 0; out: mutex_exit(completion-c_lock); @@ -195,4 +201,66 @@ out: mutex_exit(completion-c_lock); } } +/* + * Wait interruptibly for someone to call complete or complete_all. + */ +static inline int +wait_for_completion_interruptible(struct completion *completion) +{ + int error; + + mutex_enter(completion-c_lock); + + /* Wait until c_done is nonzero. */ + while (completion-c_done == 0) { + error = cv_wait_sig(completion-c_cv, completion-c_lock); + if (error) + goto out; + } + + /* Success! */ + _completion_claim(completion); + error = 0; + +out: mutex_exit(completion-c_lock); + if ((error == EINTR) || (error == ERESTART)) + error = -ERESTARTSYS; + return error; +} + +/* + * Wait uninterruptibly, except by SIGKILL, for someone to call + * complete or complete_all. + * + * XXX In this implementation, any signal will actually wake us, not + * just SIGKILL. + */ +static inline int +wait_for_completion_killable(struct completion *completion) +{ + + return wait_for_completion_interruptible(completion); +} + +/* + * Try to claim a completion immediately. Return true on success, false + * if it would block. + */ +static inline bool +try_wait_for_completion(struct completion *completion) +{ + bool ok; + + mutex_enter(completion-c_lock); + if (completion-c_done == 0) { + ok = false; + } else { + _completion_claim(completion); + ok = true; + } + mutex_exit(completion-c_lock); + + return ok; +} + #endif /* _LINUX_COMPLETION_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Tue Apr 1 14:57:58 UTC 2014 Modified Files: src/sys/external/bsd/common/include/linux: kernel.h Log Message: Merge changes from drm2 linux/kernel.h to common linux/kernel.h. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/kernel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/kernel.h diff -u src/sys/external/bsd/common/include/linux/kernel.h:1.1 src/sys/external/bsd/common/include/linux/kernel.h:1.2 --- src/sys/external/bsd/common/include/linux/kernel.h:1.1 Thu Sep 5 15:28:07 2013 +++ src/sys/external/bsd/common/include/linux/kernel.h Tue Apr 1 14:57:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.1 2013/09/05 15:28:07 skrll Exp $ */ +/* $NetBSD: kernel.h,v 1.2 2014/04/01 14:57:58 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -44,13 +44,24 @@ #define barrier() __insn_barrier() #define unlikely(X) __predict_false(X) -#define uninitialized_var(x) x +/* + * XXX Linux kludge to work around GCC uninitialized variable warning. + * Linux does `x = x', which is bollocks. + */ +#define uninitialized_var(x) x = 0 /* XXX These will multiply evaluate their arguments. */ #define max_t(T, X, Y) MAX(X, Y) #define min_t(T, X, Y) MIN(X, Y) /* + * Rounding to nearest. + */ +#define DIV_ROUND_CLOSEST(N, D) \ + ((0 (N)) ? (((N) + ((D) / 2)) / (D))\ + : (((N) - ((D) / 2)) / (D))) + +/* * Rounding to what may or may not be powers of two. */ #define DIV_ROUND_UP(X, N) (((X) + (N) - 1) / (N)) @@ -102,4 +113,6 @@ abs64(int64_t x) return (x 0? (-x) : x); } +static int panic_timeout __unused = 0; + #endif /* _LINUX_KERNEL_H_ */
CVS commit: src/sys
Module Name:src Committed By: riastradh Date: Tue Apr 1 15:08:58 UTC 2014 Modified Files: src/sys/external/bsd/drm2/drm: files.drmkms src/sys/external/bsd/drm2/linux: files.drmkms_linux src/sys/modules/drmkms: Makefile.inc Log Message: Make drmkms find header files from sys/external/bsd/common. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/drm/files.drmkms cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/linux/files.drmkms_linux cvs rdiff -u -r1.2 -r1.3 src/sys/modules/drmkms/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/drm/files.drmkms diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.4 src/sys/external/bsd/drm2/drm/files.drmkms:1.5 --- src/sys/external/bsd/drm2/drm/files.drmkms:1.4 Mon Mar 31 13:38:44 2014 +++ src/sys/external/bsd/drm2/drm/files.drmkms Tue Apr 1 15:08:58 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files.drmkms,v 1.4 2014/03/31 13:38:44 riastradh Exp $ +# $NetBSD: files.drmkms,v 1.5 2014/04/01 15:08:58 riastradh Exp $ define drmkmsbus { } @@ -18,6 +18,7 @@ defflag opt_drmkms.h DRMKMS_DEBUG makeoptions drmkms CPPFLAGS+=-I$S/external/bsd/drm2/include makeoptions drmkms CPPFLAGS+=-I$S/external/bsd/drm2/dist/uapi makeoptions drmkms CPPFLAGS+=-I$S/external/bsd/drm2/dist/include +makeoptions drmkms CPPFLAGS+=-I$S/external/bsd/common/include makeoptions drmkms CWARNFLAGS.drm_crtc.c+=-Wno-shadow makeoptions drmkms CWARNFLAGS.drm_edid.c+=-Wno-shadow Index: src/sys/external/bsd/drm2/linux/files.drmkms_linux diff -u src/sys/external/bsd/drm2/linux/files.drmkms_linux:1.3 src/sys/external/bsd/drm2/linux/files.drmkms_linux:1.4 --- src/sys/external/bsd/drm2/linux/files.drmkms_linux:1.3 Mon Mar 31 13:38:44 2014 +++ src/sys/external/bsd/drm2/linux/files.drmkms_linux Tue Apr 1 15:08:58 2014 @@ -1,8 +1,9 @@ -# $NetBSD: files.drmkms_linux,v 1.3 2014/03/31 13:38:44 riastradh Exp $ +# $NetBSD: files.drmkms_linux,v 1.4 2014/04/01 15:08:58 riastradh Exp $ define drmkms_linux: i2cexec, i2c_bitbang makeoptions drmkms_linux CPPFLAGS+=-I$S/external/bsd/drm2/include +makeoptions drmkms_linux CPPFLAGS+=-I$S/external/bsd/common/include file external/bsd/drm2/linux/linux_gfp.c drmkms_linux file external/bsd/drm2/linux/linux_kmap.c drmkms_linux Index: src/sys/modules/drmkms/Makefile.inc diff -u src/sys/modules/drmkms/Makefile.inc:1.2 src/sys/modules/drmkms/Makefile.inc:1.3 --- src/sys/modules/drmkms/Makefile.inc:1.2 Tue Mar 18 18:20:43 2014 +++ src/sys/modules/drmkms/Makefile.inc Tue Apr 1 15:08:58 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.2 2014/03/18 18:20:43 riastradh Exp $ +# $NetBSD: Makefile.inc,v 1.3 2014/04/01 15:08:58 riastradh Exp $ # Common makefile cruft for drm2 code. @@ -8,6 +8,7 @@ CPPFLAGS+= -I${S}/external/bsd/drm2/include CPPFLAGS+= -I${S}/external/bsd/drm2/dist/uapi CPPFLAGS+= -I${S}/external/bsd/drm2/dist/include +CPPFLAGS+= -I${S}/external/bsd/common/include CPPFLAGS+= -D__KERNEL__ # XXX Is this the right place to set this?
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Tue Apr 1 15:10:23 UTC 2014 Removed Files: src/sys/external/bsd/drm2/include/linux: kernel.h list.h Log Message: kernel.h and list.h have already been moved to external/bsd/common. With apologies to future revision control systems for not making it clear this is effectively a rename. To generate a diff of this commit: cvs rdiff -u -r1.3 -r0 src/sys/external/bsd/drm2/include/linux/kernel.h cvs rdiff -u -r1.2 -r0 src/sys/external/bsd/drm2/include/linux/list.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd
Module Name:src Committed By: riastradh Date: Tue Apr 1 15:12:38 UTC 2014 Added Files: src/sys/external/bsd/common/include/linux: completion.h Removed Files: src/sys/external/bsd/drm2/include/linux: completion.h Log Message: Move linux/completion.h from drm2 to external/bsd/common. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/completion.h cvs rdiff -u -r1.3 -r0 src/sys/external/bsd/drm2/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/external/bsd/common/include/linux/completion.h diff -u /dev/null src/sys/external/bsd/common/include/linux/completion.h:1.1 --- /dev/null Tue Apr 1 15:12:38 2014 +++ src/sys/external/bsd/common/include/linux/completion.h Tue Apr 1 15:12:38 2014 @@ -0,0 +1,266 @@ +/* $NetBSD: completion.h,v 1.1 2014/04/01 15:12:38 riastradh Exp $ */ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Taylor R. Campbell. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +#ifndef _LINUX_COMPLETION_H_ +#define _LINUX_COMPLETION_H_ + +#include sys/types.h +#include sys/condvar.h +#include sys/mutex.h + +#include machine/limits.h + +#include linux/errno.h + +struct completion { + kmutex_t c_lock; + kcondvar_t c_cv; + + /* + * c_done is either + * + * . -1, meaning it's open season and we're done for good and + * nobody need wait any more; + * + * . 0, meaning nothing is done, so waiters must block; or + * + * . a positive integer, meaning that many waiters can + * proceed before further waiters must block. + * + * Negative values other than -1 are not allowed. + */ + int c_done; +}; + +/* + * Initialize a new completion object. + */ +static inline void +init_completion(struct completion *completion) +{ + + mutex_init(completion-c_lock, MUTEX_DEFAULT, IPL_NONE); + cv_init(completion-c_cv, lnxcmplt); + completion-c_done = 0; +} + +/* + * Destroy a completion object. + */ +static inline void +destroy_completion(struct completion *completion) +{ + KASSERT(!cv_has_waiters(completion-c_cv)); + cv_destroy(completion-c_cv); + mutex_destroy(completion-c_lock); +} + +/* + * Notify one waiter of completion, but not any future ones. + */ +static inline void +complete(struct completion *completion) +{ + + mutex_enter(completion-c_lock); + + /* If it's not open season, wake one waiter. */ + if (completion-c_done = 0) { + KASSERT(completion-c_done INT_MAX); /* XXX check */ + completion-c_done++; + cv_signal(completion-c_cv); + } else { + KASSERT(completion-c_done == -1); + } + + mutex_exit(completion-c_lock); +} + +/* + * Notify all waiters, present and future (until INIT_COMPLETION), of + * completion. + */ +static inline void +complete_all(struct completion *completion) +{ + + mutex_enter(completion-c_lock); + + /* If it's not open season, make it open season and wake everyone. */ + if (completion-c_done = 0) { + completion-c_done = -1; + cv_broadcast(completion-c_cv); + } else { + KASSERT(completion-c_done == -1); + } + + mutex_exit(completion-c_lock); +} + +/* + * Reverse the effect of complete_all so that subsequent waiters block + * until someone calls complete or complete_all. + * + * This operation is very different from its lowercase counterpart. + * + * For some reason this works on the completion object itself, not on a + * pointer thereto, so it must be a macro. + */ +#define INIT_COMPLETION(COMPLETION) INIT_COMPLETION_blorp((COMPLETION)) + +static inline void
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Tue Apr 1 15:19:37 UTC 2014 Modified Files: src/sys/external/bsd/common/include/linux: completion.h Log Message: Explicitly kassert the precondition c_done != 0 in _completion_claim. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/common/include/linux/completion.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/common/include/linux/completion.h diff -u src/sys/external/bsd/common/include/linux/completion.h:1.1 src/sys/external/bsd/common/include/linux/completion.h:1.2 --- src/sys/external/bsd/common/include/linux/completion.h:1.1 Tue Apr 1 15:12:38 2014 +++ src/sys/external/bsd/common/include/linux/completion.h Tue Apr 1 15:19:37 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: completion.h,v 1.1 2014/04/01 15:12:38 riastradh Exp $ */ +/* $NetBSD: completion.h,v 1.2 2014/04/01 15:19:37 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -151,6 +151,7 @@ _completion_claim(struct completion *com { KASSERT(mutex_owned(completion-c_lock)); + KASSERT(completion-c_done != 0); if (completion-c_done 0) completion-c_done--; else
CVS commit: src/sys/external/bsd/ipf/netinet
Module Name:src Committed By: christos Date: Tue Apr 1 15:19:29 UTC 2014 Modified Files: src/sys/external/bsd/ipf/netinet: ip_dstlist.c ip_nat6.c Log Message: Remove SCCS prefix from RCS string! To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/ipf/netinet/ip_dstlist.c \ src/sys/external/bsd/ipf/netinet/ip_nat6.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/ipf/netinet/ip_dstlist.c diff -u src/sys/external/bsd/ipf/netinet/ip_dstlist.c:1.6 src/sys/external/bsd/ipf/netinet/ip_dstlist.c:1.7 --- src/sys/external/bsd/ipf/netinet/ip_dstlist.c:1.6 Sat Sep 14 08:39:09 2013 +++ src/sys/external/bsd/ipf/netinet/ip_dstlist.c Tue Apr 1 11:19:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_dstlist.c,v 1.6 2013/09/14 12:39:09 joerg Exp $ */ +/* $NetBSD: ip_dstlist.c,v 1.7 2014/04/01 15:19:29 christos Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -72,7 +72,7 @@ struct file; # include md5.h #endif -__KERNEL_RCSID(0, @(#)Id: ip_dstlist.c,v 1.1.1.2 2012/07/22 13:45:11 darrenr Exp); +__KERNEL_RCSID(0, Id: ip_dstlist.c,v 1.1.1.2 2012/07/22 13:45:11 darrenr Exp); typedef struct ipf_dstl_softc_s { ippool_dst_t *dstlist[LOOKUP_POOL_SZ]; Index: src/sys/external/bsd/ipf/netinet/ip_nat6.c diff -u src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.6 src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.7 --- src/sys/external/bsd/ipf/netinet/ip_nat6.c:1.6 Sat Sep 14 08:39:09 2013 +++ src/sys/external/bsd/ipf/netinet/ip_nat6.c Tue Apr 1 11:19:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_nat6.c,v 1.6 2013/09/14 12:39:09 joerg Exp $ */ +/* $NetBSD: ip_nat6.c,v 1.7 2014/04/01 15:19:29 christos Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -109,7 +109,7 @@ extern struct ifnet vpnif; #undef SOCKADDR_IN #define SOCKADDR_IN struct sockaddr_in -__KERNEL_RCSID(0, @(#)Id: ip_nat6.c,v 1.1.1.2 2012/07/22 13:45:29 darrenr Exp); +__KERNEL_RCSID(0, Id: ip_nat6.c,v 1.1.1.2 2012/07/22 13:45:29 darrenr Exp); #ifdef USE_INET6 static struct hostmap *ipf_nat6_hostmap(ipf_nat_softc_t *, ipnat_t *,
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Tue Apr 1 15:28:52 UTC 2014 Modified Files: src/sys/external/bsd/drm2/include/linux: atomic.h Log Message: Fix volatile qualifiers in drm2 linux/atomic.h. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/atomic.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/include/linux/atomic.h diff -u src/sys/external/bsd/drm2/include/linux/atomic.h:1.2 src/sys/external/bsd/drm2/include/linux/atomic.h:1.3 --- src/sys/external/bsd/drm2/include/linux/atomic.h:1.2 Tue Mar 18 18:20:43 2014 +++ src/sys/external/bsd/drm2/include/linux/atomic.h Tue Apr 1 15:28:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $ */ +/* $NetBSD: atomic.h,v 1.3 2014/04/01 15:28:52 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -38,8 +38,8 @@ struct atomic { union { - int au_int; - unsigned int au_uint; + volatile int au_int; + volatile unsigned int au_uint; } a_u; }; @@ -50,7 +50,7 @@ typedef struct atomic atomic_t; static inline int atomic_read(atomic_t *atomic) { - return *(volatile int *)atomic-a_u.au_int; + return atomic-a_u.au_int; } static inline void
CVS commit: src/sys/dev/microcode/cyclades-z
Module Name:src Committed By: christos Date: Tue Apr 1 15:33:22 UTC 2014 Modified Files: src/sys/dev/microcode/cyclades-z: cyzfirm2h.c Log Message: - print ascii if debug - fold to 8 columns - don't exit with random values - change sccs magic in the generated header file To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/microcode/cyclades-z/cyzfirm2h.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/microcode/cyclades-z/cyzfirm2h.c diff -u src/sys/dev/microcode/cyclades-z/cyzfirm2h.c:1.11 src/sys/dev/microcode/cyclades-z/cyzfirm2h.c:1.12 --- src/sys/dev/microcode/cyclades-z/cyzfirm2h.c:1.11 Thu Mar 8 11:45:10 2012 +++ src/sys/dev/microcode/cyclades-z/cyzfirm2h.c Tue Apr 1 11:33:22 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cyzfirm2h.c,v 1.11 2012/03/08 16:45:10 jakllsch Exp $ */ +/* $NetBSD: cyzfirm2h.c,v 1.12 2014/04/01 15:33:22 christos Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: cyzfirm2h.c,v 1.11 2012/03/08 16:45:10 jakllsch Exp $); +__RCSID($NetBSD: cyzfirm2h.c,v 1.12 2014/04/01 15:33:22 christos Exp $); #include sys/types.h #include sys/mman.h @@ -51,7 +51,6 @@ __RCSID($NetBSD: cyzfirm2h.c,v 1.11 201 #include stdlib.h #include unistd.h -int main(int argc, char *argv[]); static void usage(void) __dead; int @@ -116,11 +115,24 @@ main(int argc, char *argv[]) while (in_len != 0) { if (i == 0) fprintf(out_file, \t); - fprintf(out_file, 0x%02x,, *in_ptr); + if (*in_ptr == '@' in_len 4 + memcmp(in_ptr, @(#), 4) == 0) + fprintf(out_file, 0x%02x,, '_'); + else + fprintf(out_file, 0x%02x,, *in_ptr); in_ptr++; in_len--; i++; - if (i == 10) { + if (i == 8) { +#ifdef DEBUG + size_t j; + fprintf(out_file, \t/* ); + for (j = 0; j 8; j++) { +unsigned char c = (in_ptr - 8)[j]; +fputc(isprint(c) ? c : '.', out_file); + } + fprintf(out_file, */); +#endif fprintf(out_file, \n); i = 0; } else if (in_len != 0) { @@ -130,6 +142,7 @@ main(int argc, char *argv[]) fprintf(out_file, \n};\n\n); fprintf(out_file, #endif /* _%s_ */\n, include_name); + return 0; } __dead static void
CVS commit: src/sys/dev/microcode/cyclades-z
Module Name:src Committed By: christos Date: Tue Apr 1 15:35:41 UTC 2014 Modified Files: src/sys/dev/microcode/cyclades-z: cyzfirm2h.c Log Message: avoid making too large diffs by restoring length in non-debugging mode to 10 To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/microcode/cyclades-z/cyzfirm2h.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/microcode/cyclades-z/cyzfirm2h.c diff -u src/sys/dev/microcode/cyclades-z/cyzfirm2h.c:1.12 src/sys/dev/microcode/cyclades-z/cyzfirm2h.c:1.13 --- src/sys/dev/microcode/cyclades-z/cyzfirm2h.c:1.12 Tue Apr 1 11:33:22 2014 +++ src/sys/dev/microcode/cyclades-z/cyzfirm2h.c Tue Apr 1 11:35:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cyzfirm2h.c,v 1.12 2014/04/01 15:33:22 christos Exp $ */ +/* $NetBSD: cyzfirm2h.c,v 1.13 2014/04/01 15:35:41 christos Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: cyzfirm2h.c,v 1.12 2014/04/01 15:33:22 christos Exp $); +__RCSID($NetBSD: cyzfirm2h.c,v 1.13 2014/04/01 15:35:41 christos Exp $); #include sys/types.h #include sys/mman.h @@ -52,6 +52,11 @@ __RCSID($NetBSD: cyzfirm2h.c,v 1.12 201 #include unistd.h static void usage(void) __dead; +#ifdef DEBUG +#define MAXLINE 8 +#else +#define MAXLINE 10 +#endif int main(int argc, char *argv[]) @@ -123,7 +128,7 @@ main(int argc, char *argv[]) in_ptr++; in_len--; i++; - if (i == 8) { + if (i == MAXLINE) { #ifdef DEBUG size_t j; fprintf(out_file, \t/* );
CVS commit: src/sys/dev/microcode/cyclades-z
Module Name:src Committed By: christos Date: Tue Apr 1 15:35:57 UTC 2014 Modified Files: src/sys/dev/microcode/cyclades-z: cyzfirm.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/microcode/cyclades-z/cyzfirm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/microcode/cyclades-z/cyzfirm.h diff -u src/sys/dev/microcode/cyclades-z/cyzfirm.h:1.6 src/sys/dev/microcode/cyclades-z/cyzfirm.h:1.7 --- src/sys/dev/microcode/cyclades-z/cyzfirm.h:1.6 Sun Dec 11 07:22:18 2005 +++ src/sys/dev/microcode/cyclades-z/cyzfirm.h Tue Apr 1 11:35:57 2014 @@ -1,10 +1,10 @@ -/* $NetBSD: cyzfirm.h,v 1.6 2005/12/11 12:22:18 christos Exp $ */ +/* $NetBSD: cyzfirm.h,v 1.7 2014/04/01 15:35:57 christos Exp $ */ /* * Firmware for Cyclades Z series multiport serial boards. * Automatically generated from: * - * ZLOGIC.CYZ + * zlogic.cyz */ #ifndef _CYZFIRM_H_ @@ -5611,12 +5611,12 @@ static const uint8_t cycladesz_firmware[ 0x00, 0x00, 0xf8, 0xff, 0x05, 0x3c, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0xc4, 0xac, 0x04, 0x00, 0xc5, 0xac, 0xf1, 0xff, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x28, 0x23, 0x29, 0x20, 0x43, + 0x00, 0x00, 0x00, 0x00, 0x5f, 0x28, 0x23, 0x29, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x43, 0x79, 0x63, 0x6c, 0x61, 0x64, 0x65, 0x73, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, 0x39, 0x39, 0x36, 0x2c, - 0x20, 0x31, 0x39, 0x39, 0x39, 0x00, 0x40, 0x28, 0x23, 0x29, + 0x20, 0x31, 0x39, 0x39, 0x39, 0x00, 0x5f, 0x28, 0x23, 0x29, 0x20, 0x5a, 0x46, 0x49, 0x52, 0x4d, 0x20, 0x43, 0x79, 0x63, 0x6c, 0x61, 0x64, 0x65, 0x73, 0x2d, 0x5a, 0x2f, 0x50, 0x43, 0x49, 0x20, 0x46, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, @@ -12794,12 +12794,12 @@ static const uint8_t cycladesz_firmware[ 0x00, 0x00, 0xf8, 0xff, 0x05, 0x3c, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0xc4, 0xac, 0x04, 0x00, 0xc5, 0xac, 0xf1, 0xff, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x28, 0x23, 0x29, 0x20, 0x43, + 0x00, 0x00, 0x00, 0x00, 0x5f, 0x28, 0x23, 0x29, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x43, 0x79, 0x63, 0x6c, 0x61, 0x64, 0x65, 0x73, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, 0x39, 0x39, 0x36, 0x2c, - 0x20, 0x31, 0x39, 0x39, 0x39, 0x00, 0x40, 0x28, 0x23, 0x29, + 0x20, 0x31, 0x39, 0x39, 0x39, 0x00, 0x5f, 0x28, 0x23, 0x29, 0x20, 0x5a, 0x46, 0x49, 0x52, 0x4d, 0x20, 0x43, 0x79, 0x63, 0x6c, 0x61, 0x64, 0x65, 0x73, 0x2d, 0x5a, 0x2f, 0x50, 0x43, 0x49, 0x20, 0x46, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65,
CVS commit: src/sys/external/bsd/gnu-efi
Module Name:src Committed By: jakllsch Date: Tue Apr 1 16:10:56 UTC 2014 Added Files: src/sys/external/bsd/gnu-efi: gnu-efi2netbsd Log Message: Add gnu-efi2netbsd script to help import the BSD-licensed parts of gnu-efi. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/gnu-efi/gnu-efi2netbsd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/external/bsd/gnu-efi/gnu-efi2netbsd diff -u /dev/null src/sys/external/bsd/gnu-efi/gnu-efi2netbsd:1.1 --- /dev/null Tue Apr 1 16:10:56 2014 +++ src/sys/external/bsd/gnu-efi/gnu-efi2netbsd Tue Apr 1 16:10:56 2014 @@ -0,0 +1,88 @@ +#! /bin/sh +# +# $NetBSD: gnu-efi2netbsd,v 1.1 2014/04/01 16:10:56 jakllsch Exp $ +# +# Copyright (c) 2011 The NetBSD Foundation, Inc. +# 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. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +# +# gnu-efi2netbsd: convert an gnu-efi source tree into a +# NetBSD gnu-efi source tree, under src/sys/external/bsd, +# +# Rough instructions for importing new gnu-efi release: +# +# $ cd /some/where/temporary +# $ tar xpfz /new/gnu-efi/release/tar/file +# $ sh /usr/src/sys/external/bsd/gnu-efi/gnu-efi2netbsd gnu-efi-x.y +# $ cd gnu-efi-x.y +# $ cvs -d cvs.netbsd.org:/cvsroot import -m Import gnu-efi-x.yz src/sys/external/bsd/gnu-efi/dist GNU_EFI gnu-efi-x_y_z +# - check makefiles to see if any extra sources have been added. +# - update distrib/sets if necessary. + +if [ $# -ne 1 ]; then echo gnu-efi2netbsd src; exit 1; fi + +r=$1 +case $r in + /*) + ;; + *) + r=`/bin/pwd`/$r + ;; +esac + +cd $r + +### Remove GPL components +rm -r $r/debian +rm $r/gnuefi/setjmp_*.S + +### Remove the $'s around RCS tags +cleantags $r + +### Add our NetBSD RCS Id +find $r -type f -and \( -name '*.[Sch]' -or -name '*.lds' \) -print | while read c; do + sed 1q $c | grep -q '\$NetBSD' || ( +echo /* \$NetBSD\$ */ /tmp/gnu-efi2n$$ +echo /tmp/gnu-efi2n$$ +cat $c /tmp/gnu-efi2n$$ +touch -r $c /tmp/gnu-efi2n$$ +mv /tmp/gnu-efi2n$$ $c echo added NetBSD RCS tag to $c + ) +done + +echo done + +### Clean up any CVS directories that might be around. +echo cleaning up CVS residue. +find $r -type d -name CVS -print | xargs rm -r +echo done + +### Fixing file and directory permissions. +echo Fixing file/directory permissions. +( + find $r -type f -print | xargs chmod u+rw,go+r + find $r -type d -print | xargs chmod u+rwx,go+rx +) +echo done + +exit 0
CVS import: src/sys/external/bsd/gnu-efi/dist
Module Name:src Committed By: jakllsch Date: Tue Apr 1 16:16:08 UTC 2014 Update of /cvsroot/src/sys/external/bsd/gnu-efi/dist In directory ivanova.netbsd.org:/tmp/cvs-serv6920 Log Message: Import gnu-efi-3.0u Status: Vendor Tag: GNU_EFI Release Tags: gnu-efi-3_0_u N src/sys/external/bsd/gnu-efi/dist/ChangeLog N src/sys/external/bsd/gnu-efi/dist/README.efilib N src/sys/external/bsd/gnu-efi/dist/README.elilo N src/sys/external/bsd/gnu-efi/dist/README.gnuefi N src/sys/external/bsd/gnu-efi/dist/Makefile N src/sys/external/bsd/gnu-efi/dist/Make.defaults N src/sys/external/bsd/gnu-efi/dist/Make.rules N src/sys/external/bsd/gnu-efi/dist/apps/Makefile N src/sys/external/bsd/gnu-efi/dist/apps/tpause.c N src/sys/external/bsd/gnu-efi/dist/apps/t3.c N src/sys/external/bsd/gnu-efi/dist/apps/route80h.c N src/sys/external/bsd/gnu-efi/dist/apps/t.c N src/sys/external/bsd/gnu-efi/dist/apps/trivial.S N src/sys/external/bsd/gnu-efi/dist/apps/modelist.c N src/sys/external/bsd/gnu-efi/dist/apps/t6.c N src/sys/external/bsd/gnu-efi/dist/apps/tcc.c N src/sys/external/bsd/gnu-efi/dist/apps/printenv.c N src/sys/external/bsd/gnu-efi/dist/apps/t5.c N src/sys/external/bsd/gnu-efi/dist/apps/t4.c N src/sys/external/bsd/gnu-efi/dist/apps/t7.c N src/sys/external/bsd/gnu-efi/dist/apps/t2.c N src/sys/external/bsd/gnu-efi/dist/lib/Makefile N src/sys/external/bsd/gnu-efi/dist/lib/init.c N src/sys/external/bsd/gnu-efi/dist/lib/hw.c N src/sys/external/bsd/gnu-efi/dist/lib/data.c N src/sys/external/bsd/gnu-efi/dist/lib/console.c N src/sys/external/bsd/gnu-efi/dist/lib/str.c N src/sys/external/bsd/gnu-efi/dist/lib/event.c N src/sys/external/bsd/gnu-efi/dist/lib/dpath.c N src/sys/external/bsd/gnu-efi/dist/lib/guid.c N src/sys/external/bsd/gnu-efi/dist/lib/crc.c N src/sys/external/bsd/gnu-efi/dist/lib/debug.c N src/sys/external/bsd/gnu-efi/dist/lib/misc.c N src/sys/external/bsd/gnu-efi/dist/lib/lib.h N src/sys/external/bsd/gnu-efi/dist/lib/smbios.c N src/sys/external/bsd/gnu-efi/dist/lib/lock.c N src/sys/external/bsd/gnu-efi/dist/lib/boxdraw.c N src/sys/external/bsd/gnu-efi/dist/lib/error.c N src/sys/external/bsd/gnu-efi/dist/lib/print.c N src/sys/external/bsd/gnu-efi/dist/lib/hand.c N src/sys/external/bsd/gnu-efi/dist/lib/sread.c N src/sys/external/bsd/gnu-efi/dist/lib/x86_64/math.c N src/sys/external/bsd/gnu-efi/dist/lib/x86_64/efi_stub.S N src/sys/external/bsd/gnu-efi/dist/lib/x86_64/initplat.c N src/sys/external/bsd/gnu-efi/dist/lib/x86_64/callwrap.c N src/sys/external/bsd/gnu-efi/dist/lib/ia64/math.c N src/sys/external/bsd/gnu-efi/dist/lib/ia64/palproc.S N src/sys/external/bsd/gnu-efi/dist/lib/ia64/initplat.c N src/sys/external/bsd/gnu-efi/dist/lib/ia64/salpal.c N src/sys/external/bsd/gnu-efi/dist/lib/ia64/palproc.h N src/sys/external/bsd/gnu-efi/dist/lib/ia32/math.c N src/sys/external/bsd/gnu-efi/dist/lib/ia32/efi_stub.S N src/sys/external/bsd/gnu-efi/dist/lib/ia32/initplat.c N src/sys/external/bsd/gnu-efi/dist/lib/runtime/rtlock.c N src/sys/external/bsd/gnu-efi/dist/lib/runtime/efirtlib.c N src/sys/external/bsd/gnu-efi/dist/lib/runtime/rtstr.c N src/sys/external/bsd/gnu-efi/dist/lib/runtime/rtdata.c N src/sys/external/bsd/gnu-efi/dist/lib/runtime/vm.c N src/sys/external/bsd/gnu-efi/dist/inc/inc.mak N src/sys/external/bsd/gnu-efi/dist/inc/makefile.hdr N src/sys/external/bsd/gnu-efi/dist/inc/Makefile N src/sys/external/bsd/gnu-efi/dist/inc/make.inf N src/sys/external/bsd/gnu-efi/dist/inc/efiip.h N src/sys/external/bsd/gnu-efi/dist/inc/eficon.h N src/sys/external/bsd/gnu-efi/dist/inc/efifs.h N src/sys/external/bsd/gnu-efi/dist/inc/efipciio.h N src/sys/external/bsd/gnu-efi/dist/inc/efiser.h N src/sys/external/bsd/gnu-efi/dist/inc/efigpt.h N src/sys/external/bsd/gnu-efi/dist/inc/efiprot.h N src/sys/external/bsd/gnu-efi/dist/inc/efidevp.h N src/sys/external/bsd/gnu-efi/dist/inc/efi_pxe.h N src/sys/external/bsd/gnu-efi/dist/inc/efitcp.h N src/sys/external/bsd/gnu-efi/dist/inc/efi.h N src/sys/external/bsd/gnu-efi/dist/inc/libsmbios.h N src/sys/external/bsd/gnu-efi/dist/inc/efi_nii.h N src/sys/external/bsd/gnu-efi/dist/inc/efipxebc.h N src/sys/external/bsd/gnu-efi/dist/inc/efilib.h N src/sys/external/bsd/gnu-efi/dist/inc/pci22.h N src/sys/external/bsd/gnu-efi/dist/inc/efiapi.h N src/sys/external/bsd/gnu-efi/dist/inc/efipart.h N src/sys/external/bsd/gnu-efi/dist/inc/efistdarg.h N src/sys/external/bsd/gnu-efi/dist/inc/efilink.h N src/sys/external/bsd/gnu-efi/dist/inc/efirtlib.h N src/sys/external/bsd/gnu-efi/dist/inc/efidebug.h N src/sys/external/bsd/gnu-efi/dist/inc/efidef.h N src/sys/external/bsd/gnu-efi/dist/inc/efierr.h N src/sys/external/bsd/gnu-efi/dist/inc/efiudp.h N src/sys/external/bsd/gnu-efi/dist/inc/efiui.h N src/sys/external/bsd/gnu-efi/dist/inc/efinet.h N src/sys/external/bsd/gnu-efi/dist/inc/romload.h N src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efilibplat.h N src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h N src/sys/external/bsd/gnu-efi/dist/inc/x86_64/pe.h N
CVS commit: src/sys/external/bsd/gnu-efi/dist/inc
Module Name:src Committed By: jakllsch Date: Tue Apr 1 16:22:45 UTC 2014 Modified Files: src/sys/external/bsd/gnu-efi/dist/inc/ia32: efibind.h src/sys/external/bsd/gnu-efi/dist/inc/ia64: efibind.h src/sys/external/bsd/gnu-efi/dist/inc/x86_64: efibind.h Log Message: Add NetBSD-specific adjustments to gnu-efi. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/sys/external/bsd/gnu-efi/dist/inc/ia32/efibind.h cvs rdiff -u -r1.1.1.1 -r1.2 \ src/sys/external/bsd/gnu-efi/dist/inc/ia64/efibind.h cvs rdiff -u -r1.1.1.1 -r1.2 \ src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/gnu-efi/dist/inc/ia32/efibind.h diff -u src/sys/external/bsd/gnu-efi/dist/inc/ia32/efibind.h:1.1.1.1 src/sys/external/bsd/gnu-efi/dist/inc/ia32/efibind.h:1.2 --- src/sys/external/bsd/gnu-efi/dist/inc/ia32/efibind.h:1.1.1.1 Tue Apr 1 16:16:07 2014 +++ src/sys/external/bsd/gnu-efi/dist/inc/ia32/efibind.h Tue Apr 1 16:22:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: efibind.h,v 1.1.1.1 2014/04/01 16:16:07 jakllsch Exp $ */ +/* $NetBSD: efibind.h,v 1.2 2014/04/01 16:22:45 jakllsch Exp $ */ /*++ @@ -77,6 +77,8 @@ Revision History typedef unsigned char uint8_t; typedef charint8_t; #endif +#elif defined(__NetBSD__) +#include sys/stdint.h #elif defined(__GNUC__) #include stdint.h #endif Index: src/sys/external/bsd/gnu-efi/dist/inc/ia64/efibind.h diff -u src/sys/external/bsd/gnu-efi/dist/inc/ia64/efibind.h:1.1.1.1 src/sys/external/bsd/gnu-efi/dist/inc/ia64/efibind.h:1.2 --- src/sys/external/bsd/gnu-efi/dist/inc/ia64/efibind.h:1.1.1.1 Tue Apr 1 16:16:07 2014 +++ src/sys/external/bsd/gnu-efi/dist/inc/ia64/efibind.h Tue Apr 1 16:22:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: efibind.h,v 1.1.1.1 2014/04/01 16:16:07 jakllsch Exp $ */ +/* $NetBSD: efibind.h,v 1.2 2014/04/01 16:22:45 jakllsch Exp $ */ /*++ @@ -64,6 +64,8 @@ Revision History typedef unsigned char uint8_t; typedef charint8_t; #endif +#elif defined(__NetBSD__) +#include sys/stdint.h #elif defined(__GNUC__) #include stdint.h #endif Index: src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h diff -u src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h:1.1.1.1 src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h:1.2 --- src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h:1.1.1.1 Tue Apr 1 16:16:07 2014 +++ src/sys/external/bsd/gnu-efi/dist/inc/x86_64/efibind.h Tue Apr 1 16:22:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: efibind.h,v 1.1.1.1 2014/04/01 16:16:07 jakllsch Exp $ */ +/* $NetBSD: efibind.h,v 1.2 2014/04/01 16:22:45 jakllsch Exp $ */ /*++ @@ -86,6 +86,8 @@ Revision History typedef unsigned char uint8_t; typedef charint8_t; #endif +#elif defined(__NetBSD__) +#include sys/stdint.h #elif defined(__GNUC__) #include stdint.h #endif
CVS commit: src/external/bsd/ntp/dist/libntp
Module Name:src Committed By: kardel Date: Tue Apr 1 17:34:44 UTC 2014 Modified Files: src/external/bsd/ntp/dist/libntp: atouint.c Log Message: remove stray 'return 0;' that effectively disabled atouint(). Hi Christos! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libntp/atouint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/ntp/dist/libntp/atouint.c diff -u src/external/bsd/ntp/dist/libntp/atouint.c:1.3 src/external/bsd/ntp/dist/libntp/atouint.c:1.4 --- src/external/bsd/ntp/dist/libntp/atouint.c:1.3 Sat Dec 28 03:20:13 2013 +++ src/external/bsd/ntp/dist/libntp/atouint.c Tue Apr 1 17:34:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: atouint.c,v 1.3 2013/12/28 03:20:13 christos Exp $ */ +/* $NetBSD: atouint.c,v 1.4 2014/04/01 17:34:44 kardel Exp $ */ #include config.h #include sys/types.h @@ -29,7 +29,6 @@ atouint( return 0; u = 0; - return 0; while ('\0' != *cp) { if (!isdigit((unsigned char)*cp)) return 0;
CVS commit: src/sys
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:47:36 UTC 2014 Modified Files: src/sys/conf: files src/sys/dev/acpi: files.acpi Added Files: src/sys/dev/acpi: apple_smc_acpi.c src/sys/dev/ic: apple_smc.c apple_smc.h apple_smc_fan.c apple_smc_temp.c apple_smcreg.h apple_smcvar.h src/sys/modules/apple_smc: Makefile apple_smc.ioconf Log Message: First draft of drivers for the Apple System Management Controller. Device interface derived by reading the Linux driver source code and http:///www.parhelia.ch/blog/statics/k3_keys.html as of 2012-12-05. Includes support for attaching fan and temperature sensors to sysmon. No accelerometer yet. Compile-tested only, based on some run-testing of experiments from userland. Module attachment is not quite finished, so it won't work yet. To generate a diff of this commit: cvs rdiff -u -r1.1087 -r1.1088 src/sys/conf/files cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/apple_smc_acpi.c cvs rdiff -u -r1.93 -r1.94 src/sys/dev/acpi/files.acpi cvs rdiff -u -r0 -r1.1 src/sys/dev/ic/apple_smc.c src/sys/dev/ic/apple_smc.h \ src/sys/dev/ic/apple_smc_fan.c src/sys/dev/ic/apple_smc_temp.c \ src/sys/dev/ic/apple_smcreg.h src/sys/dev/ic/apple_smcvar.h cvs rdiff -u -r0 -r1.1 src/sys/modules/apple_smc/Makefile \ src/sys/modules/apple_smc/apple_smc.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/files diff -u src/sys/conf/files:1.1087 src/sys/conf/files:1.1088 --- src/sys/conf/files:1.1087 Wed Mar 19 15:26:42 2014 +++ src/sys/conf/files Tue Apr 1 17:47:36 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1087 2014/03/19 15:26:42 nonaka Exp $ +# $NetBSD: files,v 1.1088 2014/04/01 17:47:36 riastradh Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20100430 @@ -1095,6 +1095,26 @@ file dev/ic/hpet.c hpet needs-flag device smsh: arp, ether, ifnet, mii file dev/ic/lan9118.c smsh +# Apple System Management Controller +# +device applesmc {} +file dev/ic/apple_smc.c applesmc + +# Apple SMC fan sensors and control +device applesmcfan: applesmc, sysmon_envsys +attach applesmcfan at applesmc with apple_smc_fan +file dev/ic/apple_smc_fan.c applesmcfan + +# Apple SMC temperature sensors +device applesmctemp: applesmc, sysmon_envsys +attach applesmctemp at applesmc with apple_smc_temp +file dev/ic/apple_smc_temp.c applesmctemp + +# Apple SMC accelerometer +#device applesmcaccel: applesmc, sysmon_envsys +#attach applesmcaccel at applesmc with apple_smc_accel +#file dev/ic/apple_smc_accel.c applesmcaccel + # DRM - Direct Rendering Infrastructure: dev/drm define drm {} include external/bsd/drm/conf/files.drm Index: src/sys/dev/acpi/files.acpi diff -u src/sys/dev/acpi/files.acpi:1.93 src/sys/dev/acpi/files.acpi:1.94 --- src/sys/dev/acpi/files.acpi:1.93 Sun Jan 22 06:44:28 2012 +++ src/sys/dev/acpi/files.acpi Tue Apr 1 17:47:36 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files.acpi,v 1.93 2012/01/22 06:44:28 christos Exp $ +# $NetBSD: files.acpi,v 1.94 2014/04/01 17:47:36 riastradh Exp $ include dev/acpi/acpica/files.acpica @@ -206,4 +206,8 @@ device fujhk: sysmon_power attach fujhk at acpinodebus file dev/acpi/fujhk_acpi.c fujhk +# Apple SMC +attach applesmc at acpinodebus with apple_smc_acpi +file dev/acpi/apple_smc_acpi.c apple_smc_acpi + include dev/acpi/wmi/files.wmi Added files: Index: src/sys/dev/acpi/apple_smc_acpi.c diff -u /dev/null src/sys/dev/acpi/apple_smc_acpi.c:1.1 --- /dev/null Tue Apr 1 17:47:36 2014 +++ src/sys/dev/acpi/apple_smc_acpi.c Tue Apr 1 17:47:36 2014 @@ -0,0 +1,145 @@ +/* $NetBSD: apple_smc_acpi.c,v 1.1 2014/04/01 17:47:36 riastradh Exp $ */ + +/* + * Apple System Management Controller: ACPI Attachment + */ + +/*- + * Copyright (c) 2013 Taylor R. Campbell + * 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. + * + * 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
CVS commit: src/sys
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:48:39 UTC 2014 Modified Files: src/sys/conf: files src/sys/dev/acpi: apple_smc_acpi.c src/sys/dev/ic: apple_smc.c apple_smc.h apple_smc_fan.c apple_smc_temp.c apple_smcvar.h src/sys/modules/apple_smc: Makefile Added Files: src/sys/modules/apple_smc_acpi: Makefile apple_smc_acpi.ioconf src/sys/modules/apple_smc_fan: Makefile apple_smc_fan.ioconf src/sys/modules/apple_smc_temp: Makefile apple_smc_temp.ioconf Log Message: Rework Apple SMC attachment goo and split into multiple modules. The four modules are apple_smc for the core functions, apple_smc_acpi for attachment at acpi, and apple_smc_fan apple_smc_temp for stuff on the SMC. Seems like there's a lot more bookkeeping necessary to maintain children of an applesmc device implemented by loadable modules. Maybe there's a better way I just haven't figured out yet. To generate a diff of this commit: cvs rdiff -u -r1.1088 -r1.1089 src/sys/conf/files cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/apple_smc_acpi.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/apple_smc.c \ src/sys/dev/ic/apple_smc.h src/sys/dev/ic/apple_smc_fan.c \ src/sys/dev/ic/apple_smc_temp.c src/sys/dev/ic/apple_smcvar.h cvs rdiff -u -r1.1 -r1.2 src/sys/modules/apple_smc/Makefile cvs rdiff -u -r0 -r1.1 src/sys/modules/apple_smc_acpi/Makefile \ src/sys/modules/apple_smc_acpi/apple_smc_acpi.ioconf cvs rdiff -u -r0 -r1.1 src/sys/modules/apple_smc_fan/Makefile \ src/sys/modules/apple_smc_fan/apple_smc_fan.ioconf cvs rdiff -u -r0 -r1.1 src/sys/modules/apple_smc_temp/Makefile \ src/sys/modules/apple_smc_temp/apple_smc_temp.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/files diff -u src/sys/conf/files:1.1088 src/sys/conf/files:1.1089 --- src/sys/conf/files:1.1088 Tue Apr 1 17:47:36 2014 +++ src/sys/conf/files Tue Apr 1 17:48:39 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1088 2014/04/01 17:47:36 riastradh Exp $ +# $NetBSD: files,v 1.1089 2014/04/01 17:48:39 riastradh Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20100430 @@ -1097,7 +1097,8 @@ file dev/ic/lan9118.c smsh # Apple System Management Controller # -device applesmc {} +define applesmcbus { } +device applesmc { }: applesmcbus file dev/ic/apple_smc.c applesmc # Apple SMC fan sensors and control @@ -1110,7 +,7 @@ device applesmctemp: applesmc, sysmon_en attach applesmctemp at applesmc with apple_smc_temp file dev/ic/apple_smc_temp.c applesmctemp -# Apple SMC accelerometer +# Apple SMC accelerometer (not yet implemented!) #device applesmcaccel: applesmc, sysmon_envsys #attach applesmcaccel at applesmc with apple_smc_accel #file dev/ic/apple_smc_accel.c applesmcaccel Index: src/sys/dev/acpi/apple_smc_acpi.c diff -u src/sys/dev/acpi/apple_smc_acpi.c:1.1 src/sys/dev/acpi/apple_smc_acpi.c:1.2 --- src/sys/dev/acpi/apple_smc_acpi.c:1.1 Tue Apr 1 17:47:36 2014 +++ src/sys/dev/acpi/apple_smc_acpi.c Tue Apr 1 17:48:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apple_smc_acpi.c,v 1.1 2014/04/01 17:47:36 riastradh Exp $ */ +/* $NetBSD: apple_smc_acpi.c,v 1.2 2014/04/01 17:48:39 riastradh Exp $ */ /* * Apple System Management Controller: ACPI Attachment @@ -31,10 +31,12 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: apple_smc_acpi.c,v 1.1 2014/04/01 17:47:36 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: apple_smc_acpi.c,v 1.2 2014/04/01 17:48:39 riastradh Exp $); #include sys/types.h #include sys/param.h +#include sys/bus.h +#include sys/module.h #include dev/acpi/acpireg.h #include dev/acpi/acpivar.h @@ -52,9 +54,16 @@ struct apple_smc_acpi_softc { static int apple_smc_acpi_match(device_t, cfdata_t, void *); static void apple_smc_acpi_attach(device_t, device_t, void *); static int apple_smc_acpi_detach(device_t, int); - -CFATTACH_DECL_NEW(apple_smc_acpi, sizeof(struct apple_smc_acpi_softc), -apple_smc_acpi_match, apple_smc_acpi_attach, apple_smc_acpi_detach, NULL); +static int apple_smc_acpi_rescan(device_t, const char *, const int *); +static void apple_smc_acpi_child_detached(device_t, device_t); + +CFATTACH_DECL2_NEW(apple_smc_acpi, sizeof(struct apple_smc_acpi_softc), +apple_smc_acpi_match, +apple_smc_acpi_attach, +apple_smc_acpi_detach, +NULL /* activate */, +apple_smc_acpi_rescan, +apple_smc_acpi_child_detached); static const char *const apple_smc_ids[] = { APP0001, @@ -143,3 +152,56 @@ apple_smc_acpi_detach(device_t self, int return 0; } + +static int +apple_smc_acpi_rescan(device_t self, const char *ifattr, const int *locs) +{ + struct apple_smc_acpi_softc *const sc = device_private(self); + + return apple_smc_rescan(sc-sc_smc, ifattr, locs); +} + +static void +apple_smc_acpi_child_detached(device_t self, device_t child) +{ + struct apple_smc_acpi_softc *const sc =
CVS commit: src/sys/dev/ic
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:48:52 UTC 2014 Modified Files: src/sys/dev/ic: apple_smc.c apple_smc.h apple_smc_fan.c apple_smc_temp.c apple_smcvar.h Log Message: Rework Apple SMC device attachment goo again. Less bookkeeping at the expense of iteration over all devices when rescanning applesmc. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/apple_smc.c \ src/sys/dev/ic/apple_smc.h src/sys/dev/ic/apple_smc_fan.c \ src/sys/dev/ic/apple_smc_temp.c src/sys/dev/ic/apple_smcvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/apple_smc.c diff -u src/sys/dev/ic/apple_smc.c:1.2 src/sys/dev/ic/apple_smc.c:1.3 --- src/sys/dev/ic/apple_smc.c:1.2 Tue Apr 1 17:48:39 2014 +++ src/sys/dev/ic/apple_smc.c Tue Apr 1 17:48:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apple_smc.c,v 1.2 2014/04/01 17:48:39 riastradh Exp $ */ +/* $NetBSD: apple_smc.c,v 1.3 2014/04/01 17:48:52 riastradh Exp $ */ /* * Apple System Management Controller @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: apple_smc.c,v 1.2 2014/04/01 17:48:39 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: apple_smc.c,v 1.3 2014/04/01 17:48:52 riastradh Exp $); #include sys/types.h #include sys/param.h @@ -43,7 +43,6 @@ __KERNEL_RCSID(0, $NetBSD: apple_smc.c, #include sys/kmem.h #include sys/module.h #include sys/mutex.h -#include sys/rbtree.h #include sys/rwlock.h #if 0 /* XXX sysctl */ #include sys/sysctl.h @@ -54,13 +53,10 @@ __KERNEL_RCSID(0, $NetBSD: apple_smc.c, #include dev/ic/apple_smcreg.h #include dev/ic/apple_smcvar.h +/* Must match the config(5) name. */ #define APPLE_SMC_BUS applesmcbus -static int apple_smc_dev_compare_nodes(void *, const void *, - const void *); -static int apple_smc_dev_compare_key(void *, const void *, const void *); -static int apple_smc_init(void); -static int apple_smc_fini(void); +static int apple_smc_search(device_t, cfdata_t, const int *, void *); static uint8_t apple_smc_bus_read_1(struct apple_smc_tag *, bus_size_t); static void apple_smc_bus_write_1(struct apple_smc_tag *, bus_size_t, uint8_t); @@ -75,156 +71,17 @@ static int apple_smc_input(struct apple_ static int apple_smc_output(struct apple_smc_tag *, uint8_t, const char *, const void *, uint8_t); -struct apple_smc_dev { - char asd_name[APPLE_SMC_DEVICE_NAME_SIZE]; - rb_node_t asd_node; - device_t asd_dev[]; -}; - -static int -apple_smc_dev_compare_nodes(void *context __unused, const void *va, -const void *vb) -{ - const struct apple_smc_dev *const a = va; - const struct apple_smc_dev *const b = vb; - - return strncmp(a-asd_name, b-asd_name, APPLE_SMC_DEVICE_NAME_SIZE); -} - -static int -apple_smc_dev_compare_key(void *context __unused, const void *vn, -const void *vk) -{ - const struct apple_smc_dev *const dev = vn; - const char *const key = vk; - - return strncmp(dev-asd_name, key, APPLE_SMC_DEVICE_NAME_SIZE); -} - -static krwlock_t apple_smc_registered_devices_lock; -static rb_tree_t apple_smc_registered_devices; -static unsigned int apple_smc_n_registered_devices; - -static const rb_tree_ops_t apple_smc_dev_tree_ops = { - .rbto_compare_nodes = apple_smc_dev_compare_nodes, - .rbto_compare_key = apple_smc_dev_compare_key, - .rbto_node_offset = offsetof(struct apple_smc_dev, asd_node), -}; - -static int -apple_smc_init(void) -{ - - rw_init(apple_smc_registered_devices_lock); - rb_tree_init(apple_smc_registered_devices, apple_smc_dev_tree_ops); - apple_smc_n_registered_devices = 0; - - /* Success! */ - return 0; -} - -static int -apple_smc_fini(void) -{ - - /* Refuse to unload if there remain any registered devices. */ - if (apple_smc_n_registered_devices) - return EBUSY; - - /* The tree should be empty in this case. */ - KASSERT(rb_tree_iterate(apple_smc_registered_devices, NULL, - RB_DIR_RIGHT) == NULL); - -#if 0/* XXX no rb_tree_destroy */ - rb_tree_destroy(apple_smc_registered_devices); -#endif - rw_destroy(apple_smc_registered_devices_lock); - - /* Success! */ - return 0; -} - -int -apple_smc_register_device(const char name[APPLE_SMC_DEVICE_NAME_SIZE]) -{ - int error; - - /* Paranoia about null termination. */ - KASSERT(name[strnlen(name, (sizeof(name) - 1))] == '\0'); - - /* Make a new record for the registration. */ - struct apple_smc_dev *const dev = - kmem_alloc(offsetof(struct apple_smc_dev, asd_dev[0]), KM_SLEEP); - (void)strlcpy(dev-asd_name, name, sizeof(dev-asd_name)); - - rw_enter(apple_smc_registered_devices_lock, RW_WRITER); - - /* Fail if there are too many. We really oughtn't get here. */ - if (apple_smc_n_registered_devices == UINT_MAX) { - error = ENOMEM; - goto out; - } - - /* Fail if the name is already registered. */ - struct apple_smc_dev *const collision = - rb_tree_insert_node(apple_smc_registered_devices, dev);
CVS commit: src/sys/dev/ic
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:49:05 UTC 2014 Modified Files: src/sys/dev/ic: apple_smc.c apple_smc_fan.c apple_smc_temp.c apple_smcvar.h Log Message: Polish the Apple SMC code with commentary and little fixes. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/apple_smc.c \ src/sys/dev/ic/apple_smc_fan.c src/sys/dev/ic/apple_smc_temp.c \ src/sys/dev/ic/apple_smcvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/apple_smc.c diff -u src/sys/dev/ic/apple_smc.c:1.3 src/sys/dev/ic/apple_smc.c:1.4 --- src/sys/dev/ic/apple_smc.c:1.3 Tue Apr 1 17:48:52 2014 +++ src/sys/dev/ic/apple_smc.c Tue Apr 1 17:49:05 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apple_smc.c,v 1.3 2014/04/01 17:48:52 riastradh Exp $ */ +/* $NetBSD: apple_smc.c,v 1.4 2014/04/01 17:49:05 riastradh Exp $ */ /* * Apple System Management Controller @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: apple_smc.c,v 1.3 2014/04/01 17:48:52 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: apple_smc.c,v 1.4 2014/04/01 17:49:05 riastradh Exp $); #include sys/types.h #include sys/param.h @@ -75,12 +75,12 @@ void apple_smc_attach(struct apple_smc_tag *smc) { - mutex_init(smc-smc_lock, MUTEX_DEFAULT, IPL_NONE); - + mutex_init(smc-smc_io_lock, MUTEX_DEFAULT, IPL_NONE); #if 0/* XXX sysctl */ apple_smc_sysctl_setup(smc); #endif + /* Attach any children. */ (void)apple_smc_rescan(smc, APPLE_SMC_BUS, NULL); } @@ -89,6 +89,7 @@ apple_smc_detach(struct apple_smc_tag *s { int error; + /* Fail if we can't detach all our children. */ error = config_detach_children(smc-smc_dev, flags); if (error) return error; @@ -96,6 +97,7 @@ apple_smc_detach(struct apple_smc_tag *s #if 0/* XXX sysctl */ sysctl_teardown(smc-smc_log); #endif + mutex_destroy(smc-smc_io_lock); return 0; } @@ -105,6 +107,7 @@ apple_smc_rescan(struct apple_smc_tag *s const int *locators) { + /* Let autoconf(9) do the work of finding new children. */ (void)config_search_loc(apple_smc_search, smc-smc_dev, APPLE_SMC_BUS, locators, smc); return 0; @@ -154,6 +157,7 @@ void apple_smc_child_detached(struct apple_smc_tag *smc __unused, device_t child __unused) { + /* We keep no books about our children. */ } static uint8_t @@ -181,8 +185,12 @@ apple_smc_read_data(struct apple_smc_tag uint8_t status; unsigned int i; - KASSERT(mutex_owned(smc-smc_lock)); + KASSERT(mutex_owned(smc-smc_io_lock)); + /* + * Wait until the status register says there's data to read and + * read it. + */ for (i = 0; i 100; i++) { status = apple_smc_bus_read_1(smc, APPLE_SMC_CSR); if (status APPLE_SMC_STATUS_READ_READY) { @@ -201,14 +209,20 @@ apple_smc_write(struct apple_smc_tag *sm uint8_t status; unsigned int i; - KASSERT(mutex_owned(smc-smc_lock)); + KASSERT(mutex_owned(smc-smc_io_lock)); + /* + * Write the byte and then wait until the status register says + * it has been accepted. + */ apple_smc_bus_write_1(smc, reg, byte); for (i = 0; i 100; i++) { status = apple_smc_bus_read_1(smc, APPLE_SMC_CSR); if (status APPLE_SMC_STATUS_WRITE_ACCEPTED) return 0; DELAY(100); + + /* Write again if it hasn't been acknowledged at all. */ if (!(status APPLE_SMC_STATUS_WRITE_PENDING)) apple_smc_bus_write_1(smc, reg, byte); } @@ -237,18 +251,21 @@ apple_smc_begin(struct apple_smc_tag *sm unsigned int i; int error; - KASSERT(mutex_owned(smc-smc_lock)); + KASSERT(mutex_owned(smc-smc_io_lock)); + /* Write the command first. */ error = apple_smc_write_cmd(smc, cmd); if (error) return error; + /* Write the key next. */ for (i = 0; i 4; i++) { error = apple_smc_write_data(smc, key[i]); if (error) return error; } + /* Finally, report how many bytes of data we want to send/receive. */ error = apple_smc_write_data(smc, size); if (error) return error; @@ -264,11 +281,15 @@ apple_smc_input(struct apple_smc_tag *sm uint8_t i; int error; - mutex_enter(smc-smc_lock); + /* Grab the SMC I/O lock. */ + mutex_enter(smc-smc_io_lock); + + /* Initiate the command with this key. */ error = apple_smc_begin(smc, cmd, key, size); if (error) goto out; + /* Read each byte of data in sequence. */ for (i = 0; i size; i++) { error = apple_smc_read_data(smc, bytes[i]); if (error) @@ -278,8 +299,7 @@ apple_smc_input(struct apple_smc_tag *sm /* Success! */ error = 0; -out: - mutex_exit(smc-smc_lock); +out: mutex_exit(smc-smc_io_lock); return error; } @@ -291,19 +311,25 @@ apple_smc_output(struct apple_smc_tag *s uint8_t i; int error; - mutex_enter(smc-smc_lock); + /* Grab the SMC I/O lock. */ + mutex_enter(smc-smc_io_lock); + + /* Initiate the command with this key. */ error = apple_smc_begin(smc, cmd, key, size); if
CVS commit: src/sys/dev/ic
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:49:17 UTC 2014 Modified Files: src/sys/dev/ic: apple_smc.c Log Message: Fix copypasta error in apple_smc_write_key_4: uint32_t, not uint16_t. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/apple_smc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/apple_smc.c diff -u src/sys/dev/ic/apple_smc.c:1.4 src/sys/dev/ic/apple_smc.c:1.5 --- src/sys/dev/ic/apple_smc.c:1.4 Tue Apr 1 17:49:05 2014 +++ src/sys/dev/ic/apple_smc.c Tue Apr 1 17:49:17 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apple_smc.c,v 1.4 2014/04/01 17:49:05 riastradh Exp $ */ +/* $NetBSD: apple_smc.c,v 1.5 2014/04/01 17:49:17 riastradh Exp $ */ /* * Apple System Management Controller @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: apple_smc.c,v 1.4 2014/04/01 17:49:05 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: apple_smc.c,v 1.5 2014/04/01 17:49:17 riastradh Exp $); #include sys/types.h #include sys/param.h @@ -607,7 +607,7 @@ apple_smc_write_key_4(struct apple_smc_t const struct apple_smc_key *key, uint32_t v) { /* Convert the quantity from host to big-endian byte order. */ - const uint16_t v_be = htobe32(v); + const uint32_t v_be = htobe32(v); /* Write the big-endian quantity to the hardware. */ return apple_smc_write_key(smc, key, v_be, 4);
CVS commit: src/sys/conf
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:49:30 UTC 2014 Modified Files: src/sys/conf: files Log Message: Fix apple_smc config in conf/files. To generate a diff of this commit: cvs rdiff -u -r1.1089 -r1.1090 src/sys/conf/files Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/files diff -u src/sys/conf/files:1.1089 src/sys/conf/files:1.1090 --- src/sys/conf/files:1.1089 Tue Apr 1 17:48:39 2014 +++ src/sys/conf/files Tue Apr 1 17:49:30 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1089 2014/04/01 17:48:39 riastradh Exp $ +# $NetBSD: files,v 1.1090 2014/04/01 17:49:30 riastradh Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20100430 @@ -1098,22 +1098,22 @@ file dev/ic/lan9118.c smsh # Apple System Management Controller # define applesmcbus { } -device applesmc { }: applesmcbus +device applesmc: applesmcbus file dev/ic/apple_smc.c applesmc # Apple SMC fan sensors and control -device applesmcfan: applesmc, sysmon_envsys -attach applesmcfan at applesmc with apple_smc_fan +device applesmcfan: applesmcbus, sysmon_envsys +attach applesmcfan at applesmcbus with apple_smc_fan file dev/ic/apple_smc_fan.c applesmcfan # Apple SMC temperature sensors -device applesmctemp: applesmc, sysmon_envsys -attach applesmctemp at applesmc with apple_smc_temp +device applesmctemp: applesmcbus, sysmon_envsys +attach applesmctemp at applesmcbus with apple_smc_temp file dev/ic/apple_smc_temp.c applesmctemp # Apple SMC accelerometer (not yet implemented!) -#device applesmcaccel: applesmc, sysmon_envsys -#attach applesmcaccel at applesmc with apple_smc_accel +#device applesmcaccel: applesmcbus, sysmon_envsys +#attach applesmcaccel at applesmcbus with apple_smc_accel #file dev/ic/apple_smc_accel.c applesmcaccel # DRM - Direct Rendering Infrastructure: dev/drm
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:49:40 UTC 2014 Modified Files: src/sys/dev/acpi: apple_smc_acpi.c Log Message: Fix unused variable warning in non-modular apple_smc build. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/apple_smc_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/acpi/apple_smc_acpi.c diff -u src/sys/dev/acpi/apple_smc_acpi.c:1.2 src/sys/dev/acpi/apple_smc_acpi.c:1.3 --- src/sys/dev/acpi/apple_smc_acpi.c:1.2 Tue Apr 1 17:48:39 2014 +++ src/sys/dev/acpi/apple_smc_acpi.c Tue Apr 1 17:49:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apple_smc_acpi.c,v 1.2 2014/04/01 17:48:39 riastradh Exp $ */ +/* $NetBSD: apple_smc_acpi.c,v 1.3 2014/04/01 17:49:40 riastradh Exp $ */ /* * Apple System Management Controller: ACPI Attachment @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: apple_smc_acpi.c,v 1.2 2014/04/01 17:48:39 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: apple_smc_acpi.c,v 1.3 2014/04/01 17:49:40 riastradh Exp $); #include sys/types.h #include sys/param.h @@ -178,7 +178,9 @@ MODULE(MODULE_CLASS_DRIVER, apple_smc_ac static int apple_smc_acpi_modcmd(modcmd_t cmd, void *arg __unused) { +#ifdef _MODULE int error; +#endif switch (cmd) { case MODULE_CMD_INIT:
CVS commit: src/sys/modules/apple_smc
Module Name:src Committed By: riastradh Date: Tue Apr 1 17:52:26 UTC 2014 Removed Files: src/sys/modules/apple_smc: apple_smc.ioconf Log Message: Remove vestigial modules/apple_smc/apple_smc.ioconf. To generate a diff of this commit: cvs rdiff -u -r1.1 -r0 src/sys/modules/apple_smc/apple_smc.ioconf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: matt Date: Tue Apr 1 18:00:42 UTC 2014 Modified Files: src/sys/arch/arm/arm32: fault.c Log Message: In prefetch_abort, call uvm_fault with VM_PROT_EXEC To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/arch/arm/arm32/fault.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm32/fault.c diff -u src/sys/arch/arm/arm32/fault.c:1.98 src/sys/arch/arm/arm32/fault.c:1.99 --- src/sys/arch/arm/arm32/fault.c:1.98 Wed Mar 5 06:27:41 2014 +++ src/sys/arch/arm/arm32/fault.c Tue Apr 1 18:00:42 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: fault.c,v 1.98 2014/03/05 06:27:41 matt Exp $ */ +/* $NetBSD: fault.c,v 1.99 2014/04/01 18:00:42 matt Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -81,7 +81,7 @@ #include opt_kgdb.h #include sys/types.h -__KERNEL_RCSID(0, $NetBSD: fault.c,v 1.98 2014/03/05 06:27:41 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: fault.c,v 1.99 2014/04/01 18:00:42 matt Exp $); #include sys/param.h #include sys/systm.h @@ -864,7 +864,7 @@ prefetch_abort_handler(trapframe_t *tf) #endif KASSERT(pcb-pcb_onfault == NULL); - error = uvm_fault(map, va, VM_PROT_READ); + error = uvm_fault(map, va, VM_PROT_READ|VM_PROT_EXECUTE); if (__predict_true(error == 0)) { UVMHIST_LOG (maphist, - uvm, 0, 0, 0, 0);
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: matt Date: Tue Apr 1 18:01:45 UTC 2014 Modified Files: src/sys/arch/arm/arm32: pmap.c Log Message: For ARM_MMU_EXTENDED, if the page being mapped asked for EXEC but is not EXEC, sync it. To generate a diff of this commit: cvs rdiff -u -r1.273 -r1.274 src/sys/arch/arm/arm32/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm32/pmap.c diff -u src/sys/arch/arm/arm32/pmap.c:1.273 src/sys/arch/arm/arm32/pmap.c:1.274 --- src/sys/arch/arm/arm32/pmap.c:1.273 Mon Mar 31 01:49:04 2014 +++ src/sys/arch/arm/arm32/pmap.c Tue Apr 1 18:01:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.273 2014/03/31 01:49:04 matt Exp $ */ +/* $NetBSD: pmap.c,v 1.274 2014/04/01 18:01:45 matt Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -216,7 +216,7 @@ #include arm/locore.h //#include arm/arm32/katelib.h -__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.273 2014/03/31 01:49:04 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.274 2014/04/01 18:01:45 matt Exp $); //#define PMAP_DEBUG #ifdef PMAP_DEBUG @@ -422,9 +422,9 @@ EVCNT_ATTACH_STATIC(pmap_ev_exec_cached) static struct evcnt pmap_ev_exec_synced = PMAP_EVCNT_INITIALIZER(exec pages synced); -#ifndef ARM_MMU_EXTENDED static struct evcnt pmap_ev_exec_synced_map = PMAP_EVCNT_INITIALIZER(exec pages synced (MP)); +#ifndef ARM_MMU_EXTENDED static struct evcnt pmap_ev_exec_synced_unmap = PMAP_EVCNT_INITIALIZER(exec pages synced (UM)); static struct evcnt pmap_ev_exec_synced_remap = @@ -436,8 +436,8 @@ static struct evcnt pmap_ev_exec_synced_ #endif EVCNT_ATTACH_STATIC(pmap_ev_exec_synced); -#ifndef ARM_MMU_EXTENDED EVCNT_ATTACH_STATIC(pmap_ev_exec_synced_map); +#ifndef ARM_MMU_EXTENDED EVCNT_ATTACH_STATIC(pmap_ev_exec_synced_unmap); EVCNT_ATTACH_STATIC(pmap_ev_exec_synced_remap); EVCNT_ATTACH_STATIC(pmap_ev_exec_synced_clearbit); @@ -3283,6 +3283,18 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_ UVMHIST_LOG(maphist, opte %#x npte %#x, opte, npte, 0, 0); +#if defined(ARM_MMU_EXTENDED) + /* + * If exec protection was requested but the page hasn't been synced, + * sync it now and allow execution from it. + */ + if ((nflags PVF_EXEC) (npte L2_XS_XN)) { + struct vm_page_md *md = VM_PAGE_TO_MD(pg); + npte = ~L2_XS_XN; + pmap_syncicache_page(md, pa); + PMAPCOUNT(exec_synced_map); + } +#endif /* * If this is just a wiring change, the two PTEs will be * identical, so there's no need to update the page table. @@ -3322,7 +3334,6 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_ #ifndef ARM_MMU_EXTENDED UVMHIST_LOG(maphist, is_cached %d cs 0x%08x\n, is_cached, pm-pm_cstate.cs_all, 0, 0); -#endif if (pg != NULL) { struct vm_page_md *md = VM_PAGE_TO_MD(pg); @@ -3331,6 +3342,7 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_ pmap_vac_me_harder(md, pa, pm, va); pmap_release_page_lock(md); } +#endif } #if defined(PMAP_CACHE_VIPT) defined(DIAGNOSTIC) if (pg) {
CVS commit: src/sbin/fdisk
Module Name:src Committed By: christos Date: Tue Apr 1 19:08:48 UTC 2014 Modified Files: src/sbin/fdisk: fdisk.c Log Message: default to something reasonable (like the interactive mode does) instead of 0 when -1 is specified for the start or size. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sbin/fdisk/fdisk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fdisk/fdisk.c diff -u src/sbin/fdisk/fdisk.c:1.147 src/sbin/fdisk/fdisk.c:1.148 --- src/sbin/fdisk/fdisk.c:1.147 Sun Mar 30 18:18:13 2014 +++ src/sbin/fdisk/fdisk.c Tue Apr 1 15:08:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: fdisk.c,v 1.147 2014/03/30 22:18:13 christos Exp $ */ +/* $NetBSD: fdisk.c,v 1.148 2014/04/01 19:08:48 christos Exp $ */ /* * Mach Operating System @@ -39,7 +39,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: fdisk.c,v 1.147 2014/03/30 22:18:13 christos Exp $); +__RCSID($NetBSD: fdisk.c,v 1.148 2014/04/01 19:08:48 christos Exp $); #endif /* not lint */ #define MBRPTYPENAMES @@ -1817,7 +1817,7 @@ check_overlap(int part, int sysid, daddr /* This is just a convention, not a requirement */ return Track zero is reserved for the BIOS; #endif - if (start + size disksectors) + if (start + size disksectors) return Partition exceeds size of disk; for (p = 0; p MBR_PART_COUNT; p++) { if (p == part || mboot.mbr_parts[p].mbrp_type == 0) @@ -2036,10 +2036,16 @@ change_part(int extended, int part, int } else { if (sysid == -1) sysid = partp-mbrp_type; - if (start == (daddr_t)0x) + if (start == (daddr_t)0x) { start = offset + le32toh(partp-mbrp_start); - if (size == (daddr_t)0x) +if (start == 0) + start = offset = ptn_0_offset; + } + if (size == (daddr_t)0x) { size = le32toh(partp-mbrp_size); +if (size == 0) + size = disksectors - start; + } } }
CVS commit: src/lib/libm
Module Name:src Committed By: christos Date: Tue Apr 1 19:12:37 UTC 2014 Modified Files: src/lib/libm: Makefile Log Message: add -g to LINTFLAGS To generate a diff of this commit: cvs rdiff -u -r1.155 -r1.156 src/lib/libm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/Makefile diff -u src/lib/libm/Makefile:1.155 src/lib/libm/Makefile:1.156 --- src/lib/libm/Makefile:1.155 Thu Mar 6 06:01:16 2014 +++ src/lib/libm/Makefile Tue Apr 1 15:12:37 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.155 2014/03/06 11:01:16 martin Exp $ +# $NetBSD: Makefile,v 1.156 2014/04/01 19:12:37 christos Exp $ # # @(#)Makefile 5.1beta 93/09/24 # @@ -47,6 +47,9 @@ USE_SHLIBDIR= yes # require this for the value of I387_LIBM from mk.conf, if set. .include bsd.own.mk +# compiler_rt uses typeof() and __extension__ +LINTFLAGS += -g + .if (${MACHINE_ARCH} == alpha) .PATH: ${.CURDIR}/arch/alpha ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: martin Date: Tue Apr 1 19:13:31 UTC 2014 Modified Files: src/distrib/sets/lists/comp: md.playstation2 Log Message: Add two missing include files To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/comp/md.playstation2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/md.playstation2 diff -u src/distrib/sets/lists/comp/md.playstation2:1.11 src/distrib/sets/lists/comp/md.playstation2:1.12 --- src/distrib/sets/lists/comp/md.playstation2:1.11 Mon Mar 31 11:25:48 2014 +++ src/distrib/sets/lists/comp/md.playstation2 Tue Apr 1 19:13:31 2014 @@ -1,4 +1,4 @@ -# $NetBSD: md.playstation2,v 1.11 2014/03/31 11:25:48 martin Exp $ +# $NetBSD: md.playstation2,v 1.12 2014/04/01 19:13:31 martin Exp $ ./usr/include/ieeefp.hcomp-c-include ./usr/include/playstation2 comp-c-include ./usr/include/playstation2/_G_config.h comp-obsolete obsolete @@ -30,6 +30,7 @@ ./usr/include/playstation2/locore.h comp-c-include ./usr/include/playstation2/math.h comp-c-include ./usr/include/playstation2/mcontext.h comp-c-include +./usr/include/playstation2/mutex.h comp-c-include ./usr/include/playstation2/mips_opcode.h comp-c-include ./usr/include/playstation2/param.h comp-c-include ./usr/include/playstation2/pcb.h comp-c-include @@ -44,6 +45,7 @@ ./usr/include/playstation2/regdef.h comp-c-include ./usr/include/playstation2/regnum.h comp-c-include ./usr/include/playstation2/reloc.h comp-c-include +./usr/include/playstation2/rwlock.h comp-c-include ./usr/include/playstation2/setjmp.h comp-c-include ./usr/include/playstation2/signal.h comp-c-include ./usr/include/playstation2/stdarg.h comp-c-include
CVS commit: src/crypto/external/bsd/heimdal/bin
Module Name:src Committed By: christos Date: Tue Apr 1 21:38:26 UTC 2014 Modified Files: src/crypto/external/bsd/heimdal/bin: Makefile Log Message: add kvno To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/bin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/heimdal/bin/Makefile diff -u src/crypto/external/bsd/heimdal/bin/Makefile:1.1 src/crypto/external/bsd/heimdal/bin/Makefile:1.2 --- src/crypto/external/bsd/heimdal/bin/Makefile:1.1 Wed Apr 13 15:16:44 2011 +++ src/crypto/external/bsd/heimdal/bin/Makefile Tue Apr 1 17:38:26 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:44 elric Exp $ +# $NetBSD: Makefile,v 1.2 2014/04/01 21:38:26 christos Exp $ .include bsd.own.mk @@ -14,6 +14,7 @@ SUBDIR = \ kinit \ kpasswd \ krb5-config \ + kvno \ string2key \ verify_krb5_conf
CVS commit: src/crypto/external/bsd/heimdal/bin/kvno
Module Name:src Committed By: christos Date: Tue Apr 1 21:38:44 UTC 2014 Added Files: src/crypto/external/bsd/heimdal/bin/kvno: Makefile kvno.1 Log Message: add glue and man To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/heimdal/bin/kvno/Makefile \ src/crypto/external/bsd/heimdal/bin/kvno/kvno.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/crypto/external/bsd/heimdal/bin/kvno/Makefile diff -u /dev/null src/crypto/external/bsd/heimdal/bin/kvno/Makefile:1.1 --- /dev/null Tue Apr 1 17:38:44 2014 +++ src/crypto/external/bsd/heimdal/bin/kvno/Makefile Tue Apr 1 17:38:44 2014 @@ -0,0 +1,27 @@ +# $NetBSD: Makefile,v 1.1 2014/04/01 21:38:44 christos Exp $ + +.include bsd.own.mk +.include ${.CURDIR}/../../Makefile.inc + +USE_FORT?= yes # cryptographic software + +.PATH: ${HEIMDIST}/kuser + +PROG= kvno + + +#HEIMSRCS= kcc-commands.in + +SRCS= kvno.c +MAN= kvno.1 + +CPPFLAGS+= -I${DESTDIR}/usr/include/krb5 +COPTS.kvno.c+= -Wno-deprecated-declarations + +LDADD+= -lkafs -lsl +LDADD+= -ledit -lterminfo +DPADD+= ${LIBKAFS} ${LIBSL} +DPADD+= ${LIBEDIT} ${LIBTERMINFO} + +.include ${HEIMBASE}/Makefile.rules.inc +.include bsd.prog.mk Index: src/crypto/external/bsd/heimdal/bin/kvno/kvno.1 diff -u /dev/null src/crypto/external/bsd/heimdal/bin/kvno/kvno.1:1.1 --- /dev/null Tue Apr 1 17:38:44 2014 +++ src/crypto/external/bsd/heimdal/bin/kvno/kvno.1 Tue Apr 1 17:38:44 2014 @@ -0,0 +1,59 @@ +.\ $NetBSD: kvno.1,v 1.1 2014/04/01 21:38:44 christos Exp $ +.\ +.Dd April 1, 2014 +.Dt KVNO 1 +.Os +.Sh NAME +.Nm kvno +.Nd print the key version numbers for Kerberos principals +.Sh SYNOPSIS +.Nm +.Oo Fl c cache \*(Ba Xo +.Fl -cache= Ns Ar cache +.Xc +.Oc +.Oo Fl e Ar enctype \*(Ba Xo +.Fl -enctype= Ns Ar enctype +.Xc +.Oc +.Oo Fl h \*(Ba Xo +.Fl -help +.Xc +.Oc +.Oo Fl k Ar keytabname \*(Ba Xo +.Fl -keytabname= Ns Ar keytabname +.Xc +.Oc +.Oo Fl q \*(Ba Xo +.Fl -quiet +.Xc +.Oc +.Oo Fl S Ar principal \*(Ba Xo +.Fl -server= Ns Ar principal +.Xc +.Oc +.Ar service +.Ar ... +.Sh DESCRIPTION +.Nm +obtains service tickets for the specified Kerberos principals and prints out +the version number of the each. +.Pp +Supported options: +.Bl -tag -width Ds +.It Fl c Ar cache , Fl -cache= Ns Ar cache +the credential cache to use. +.It Fl e Ar enctype , Fl -enctype= Ns Ar enctype +encryption type to use. +.It Fl k Ar keytabname , Fl -keytabname= Ns Ar keytabname +use the named file as a keytab file. +.It Fl q , Fl -quiet +suppress printing. +.It Fl S Ar principal , Fl -principal= Ns Ar principal +specify the service name used to obtain a principal. +.It Fl -help +print a help message. +.El +.Sh SEE ALSO +.Xr kinit 1 , +.Xr klist 1
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: christos Date: Tue Apr 1 21:40:47 UTC 2014 Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/debug: mi src/distrib/sets/lists/man: mi Log Message: add kvno To generate a diff of this commit: cvs rdiff -u -r1.1064 -r1.1065 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.1466 -r1.1467 src/distrib/sets/lists/man/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.1064 src/distrib/sets/lists/base/mi:1.1065 --- src/distrib/sets/lists/base/mi:1.1064 Mon Mar 31 07:25:48 2014 +++ src/distrib/sets/lists/base/mi Tue Apr 1 17:40:46 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1064 2014/03/31 11:25:48 martin Exp $ +# $NetBSD: mi,v 1.1065 2014/04/01 21:40:46 christos Exp $ # # Note: Don't delete entries from here - mark them as obsolete instead, # unless otherwise stated below. @@ -536,6 +536,7 @@ ./usr/bin/krb5-configbase-krb5-bin kerberos ./usr/bin/ktracebase-debug-bin ./usr/bin/ktrussbase-debug-bin +./usr/bin/kvno base-krb5-bin kerberos ./usr/bin/kyua base-kyua-bin kyua ./usr/bin/lam base-util-bin ./usr/bin/last base-util-bin Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.53 src/distrib/sets/lists/debug/mi:1.54 --- src/distrib/sets/lists/debug/mi:1.53 Thu Mar 13 21:05:57 2014 +++ src/distrib/sets/lists/debug/mi Tue Apr 1 17:40:46 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.53 2014/03/14 01:05:57 pooka Exp $ +# $NetBSD: mi,v 1.54 2014/04/01 21:40:46 christos Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib @@ -559,6 +559,7 @@ ./usr/libdata/debug/usr/bin/kpasswd.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/ktrace.debug comp-debug-debug debug ./usr/libdata/debug/usr/bin/ktruss.debug comp-debug-debug debug +./usr/libdata/debug/usr/bin/kvno.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/bin/kyua.debug comp-kyua-debug kyua,debug ./usr/libdata/debug/usr/bin/lam.debug comp-util-debug debug ./usr/libdata/debug/usr/bin/last.debug comp-util-debug debug Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1466 src/distrib/sets/lists/man/mi:1.1467 --- src/distrib/sets/lists/man/mi:1.1466 Tue Mar 25 05:52:55 2014 +++ src/distrib/sets/lists/man/mi Tue Apr 1 17:40:46 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1466 2014/03/25 09:52:55 ozaki-r Exp $ +# $NetBSD: mi,v 1.1467 2014/04/01 21:40:46 christos Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -242,6 +242,7 @@ ./usr/share/man/cat1/ksh.0 man-util-catman .cat ./usr/share/man/cat1/ktrace.0 man-debug-catman .cat ./usr/share/man/cat1/ktruss.0 man-debug-catman .cat +./usr/share/man/cat1/kvno.0 man-krb5-catman kerberos,.cat ./usr/share/man/cat1/kyua-about.0 man-kyua-catman kyua,.cat ./usr/share/man/cat1/kyua-atf-tester.0 man-kyua-catman kyua,.cat ./usr/share/man/cat1/kyua-config.0 man-kyua-catman kyua,.cat @@ -3342,6 +3343,7 @@ ./usr/share/man/html1/ksh.html man-util-htmlman html ./usr/share/man/html1/ktrace.html man-debug-htmlman html ./usr/share/man/html1/ktruss.html man-debug-htmlman html +./usr/share/man/html1/kvno.html man-krb5-htmlman kerberos,html ./usr/share/man/html1/kyua-about.html man-kyua-htmlman kyua,html ./usr/share/man/html1/kyua-atf-tester.html man-kyua-htmlman kyua,html ./usr/share/man/html1/kyua-config.html man-kyua-htmlman kyua,html @@ -6080,6 +6082,7 @@ ./usr/share/man/man1/ksh.1 man-util-man .man ./usr/share/man/man1/ktrace.1 man-debug-man .man ./usr/share/man/man1/ktruss.1 man-debug-man .man +./usr/share/man/man1/kvno.1 man-krb5-man kerberos,.man ./usr/share/man/man1/kyua-about.1 man-kyua-man kyua,.man ./usr/share/man/man1/kyua-atf-tester.1 man-kyua-man kyua,.man ./usr/share/man/man1/kyua-config.1 man-kyua-man kyua,.man
CVS commit: src/sys/dev/ic
Module Name:src Committed By: buhrow Date: Tue Apr 1 23:57:54 UTC 2014 Modified Files: src/sys/dev/ic: mpt_netbsd.c mpt_netbsd.h Log Message: Checking in changes to improve error handling. Specifically: - if commands timeout, clear the queues to the the card and perform a soft reset on the LSI hardware since when these timeouts occur, the LSI firmware is not graceful about recovering at all. - Recover gracefully from more kinds of errors using the same recovery mechanism listed above. Also, implement mpt_ioctl() to handle bus reset requests from scsictl(8). To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/mpt_netbsd.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/mpt_netbsd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/mpt_netbsd.c diff -u src/sys/dev/ic/mpt_netbsd.c:1.19 src/sys/dev/ic/mpt_netbsd.c:1.20 --- src/sys/dev/ic/mpt_netbsd.c:1.19 Sun Sep 23 01:13:21 2012 +++ src/sys/dev/ic/mpt_netbsd.c Tue Apr 1 23:57:54 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: mpt_netbsd.c,v 1.19 2012/09/23 01:13:21 chs Exp $ */ +/* $NetBSD: mpt_netbsd.c,v 1.20 2014/04/01 23:57:54 buhrow Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -77,22 +77,28 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: mpt_netbsd.c,v 1.19 2012/09/23 01:13:21 chs Exp $); +__KERNEL_RCSID(0, $NetBSD: mpt_netbsd.c,v 1.20 2014/04/01 23:57:54 buhrow Exp $); #include dev/ic/mpt.h /* pulls in all headers */ +#include sys/scsiio.h static int mpt_poll(mpt_softc_t *, struct scsipi_xfer *, int); static void mpt_timeout(void *); +static void mpt_restart(mpt_softc_t *, request_t *); static void mpt_done(mpt_softc_t *, uint32_t); +static int mpt_drain_queue(mpt_softc_t *); static void mpt_run_xfer(mpt_softc_t *, struct scsipi_xfer *); static void mpt_set_xfer_mode(mpt_softc_t *, struct scsipi_xfer_mode *); static void mpt_get_xfer_mode(mpt_softc_t *, struct scsipi_periph *); static void mpt_ctlop(mpt_softc_t *, void *vmsg, uint32_t); static void mpt_event_notify_reply(mpt_softc_t *, MSG_EVENT_NOTIFY_REPLY *); +static void mpt_bus_reset(mpt_softc_t *); static void mpt_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t, void *); static void mpt_minphys(struct buf *); +static int mpt_ioctl(struct scsipi_channel *, u_long, void *, int, + struct proc *); /* * XXX - this assumes the device_private() of the attachement starts with @@ -121,6 +127,7 @@ mpt_scsipi_attach(mpt_softc_t *mpt) adapt-adapt_max_periph = maxq - 2; adapt-adapt_request = mpt_scsipi_request; adapt-adapt_minphys = mpt_minphys; + adapt-adapt_ioctl = mpt_ioctl; /* Fill in the scsipi_channel. */ memset(chan, 0, sizeof(*chan)); @@ -138,7 +145,8 @@ mpt_scsipi_attach(mpt_softc_t *mpt) chan-chan_ntargets = mpt-mpt_max_devices; chan-chan_id = mpt-mpt_ini_id; - (void) config_found(mpt-sc_dev, mpt-sc_channel, scsiprint); +/*Save the output of the config so we can rescan the bus in case of errors*/ + mpt-sc_scsibus_dv = config_found(mpt-sc_dev, mpt-sc_channel, scsiprint); } int @@ -303,26 +311,11 @@ mpt_intr(void *arg) { mpt_softc_t *mpt = arg; int nrepl = 0; - uint32_t reply; if ((mpt_read(mpt, MPT_OFFSET_INTR_STATUS) MPT_INTR_REPLY_READY) == 0) return (0); - reply = mpt_pop_reply_queue(mpt); - while (reply != MPT_REPLY_EMPTY) { - nrepl++; - if (mpt-verbose 1) { - if ((reply MPT_CONTEXT_REPLY) != 0) { -/* Address reply; IOC has something to say */ -mpt_print_reply(MPT_REPLY_PTOV(mpt, reply)); - } else { -/* Context reply; all went well */ -mpt_prt(mpt, context %u reply OK, reply); - } - } - mpt_done(mpt, reply); - reply = mpt_pop_reply_queue(mpt); - } +nrepl = mpt_drain_queue(mpt); return (nrepl != 0); } @@ -357,13 +350,20 @@ static void mpt_timeout(void *arg) { request_t *req = arg; - struct scsipi_xfer *xs = req-xfer; - struct scsipi_periph *periph = xs-xs_periph; - mpt_softc_t *mpt = DEV_TO_MPT( - periph-periph_channel-chan_adapter-adapt_dev); - uint32_t oseq; - int s; - + struct scsipi_xfer *xs; + struct scsipi_periph *periph; + mpt_softc_t *mpt; + uint32_t oseq; + int s, nrepl = 0; + +if (req-xfer == NULL) { + printf(mpt_timeout: NULL xfer for request index 0x%x, sequenc 0x%x\n, + req-index, req-sequence); + return; + } + xs = req-xfer; + periph = xs-xs_periph; + mpt = (void *) periph-periph_channel-chan_adapter-adapt_dev; scsipi_printaddr(periph); printf(command timeout\n); @@ -373,11 +373,28 @@ mpt_timeout(void *arg) mpt-timeouts++; if (mpt_intr(mpt)) { if (req-sequence != oseq) { + mpt-success ++; mpt_prt(mpt, recovered from command timeout); splx(s); return; } } + + /* + *Ensure the IOC is really done giving us data since it appears it can + *sometimes fail to give us interrupts under heavy load. + */ + nrepl = mpt_drain_queue(mpt); + if (nrepl ) { +
CVS commit: src/sys/arch/sgimips/gio
Module Name:src Committed By: ozaki-r Date: Wed Apr 2 00:46:12 UTC 2014 Modified Files: src/sys/arch/sgimips/gio: pci_gio.c Log Message: Get rid of a wrong comma To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sgimips/gio/pci_gio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sgimips/gio/pci_gio.c diff -u src/sys/arch/sgimips/gio/pci_gio.c:1.12 src/sys/arch/sgimips/gio/pci_gio.c:1.13 --- src/sys/arch/sgimips/gio/pci_gio.c:1.12 Sat Mar 29 19:28:30 2014 +++ src/sys/arch/sgimips/gio/pci_gio.c Wed Apr 2 00:46:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_gio.c,v 1.12 2014/03/29 19:28:30 christos Exp $ */ +/* $NetBSD: pci_gio.c,v 1.13 2014/04/02 00:46:11 ozaki-r Exp $ */ /* * Copyright (c) 2006 Stephen M. Rumble @@ -25,7 +25,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pci_gio.c,v 1.12 2014/03/29 19:28:30 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_gio.c,v 1.13 2014/04/02 00:46:11 ozaki-r Exp $); /* * Glue for PCI devices that are connected to the GIO bus by various little @@ -302,7 +302,7 @@ giopci_intr_map(const struct pci_attach_ static const char * giopci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih, char * buf, -size_t, len) +size_t len) { snprintf(buf, len, slot %s, (ih == GIO_SLOT_EXP0) ? EXP0 : (ih == GIO_SLOT_EXP1) ? EXP1 : GFX);
CVS commit: src
Module Name:src Committed By: riastradh Date: Wed Apr 2 01:22:11 UTC 2014 Modified Files: src/distrib/sets/lists/xcomp: mi src/external/mit/xorg/server/xorg-server/include: Makefile Log Message: Install compositeext.h and shmint.h from X.org. To generate a diff of this commit: cvs rdiff -u -r1.150 -r1.151 src/distrib/sets/lists/xcomp/mi cvs rdiff -u -r1.10 -r1.11 \ src/external/mit/xorg/server/xorg-server/include/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/xcomp/mi diff -u src/distrib/sets/lists/xcomp/mi:1.150 src/distrib/sets/lists/xcomp/mi:1.151 --- src/distrib/sets/lists/xcomp/mi:1.150 Sat Mar 22 13:40:55 2014 +++ src/distrib/sets/lists/xcomp/mi Wed Apr 2 01:22:11 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.150 2014/03/22 13:40:55 njoly Exp $ +# $NetBSD: mi,v 1.151 2014/04/02 01:22:11 riastradh Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -5880,6 +5880,7 @@ ./usr/X11R7/include/xorg/colormap.h -unknown- xorg ./usr/X11R7/include/xorg/colormapst.h -unknown- xorg ./usr/X11R7/include/xorg/compiler.h -unknown- xorg +./usr/X11R7/include/xorg/compositeext.h -unknown- xorg ./usr/X11R7/include/xorg/cursor.h -unknown- xorg ./usr/X11R7/include/xorg/cursorstr.h -unknown- xorg ./usr/X11R7/include/xorg/damage.h -unknown- xorg @@ -5973,6 +5974,7 @@ ./usr/X11R7/include/xorg/set.h-unknown- xorg ./usr/X11R7/include/xorg/shadow.h -unknown- xorg ./usr/X11R7/include/xorg/shadowfb.h -unknown- xorg +./usr/X11R7/include/xorg/shmint.h -unknown- xorg ./usr/X11R7/include/xorg/site.h-unknown- xorg ./usr/X11R7/include/xorg/swaprep.h -unknown- xorg ./usr/X11R7/include/xorg/swapreq.h -unknown- xorg Index: src/external/mit/xorg/server/xorg-server/include/Makefile diff -u src/external/mit/xorg/server/xorg-server/include/Makefile:1.10 src/external/mit/xorg/server/xorg-server/include/Makefile:1.11 --- src/external/mit/xorg/server/xorg-server/include/Makefile:1.10 Tue Aug 2 07:56:33 2011 +++ src/external/mit/xorg/server/xorg-server/include/Makefile Wed Apr 2 01:22:11 2014 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.10 2011/08/02 07:56:33 mrg Exp $ +# $NetBSD: Makefile,v 1.11 2014/04/02 01:22:11 riastradh Exp $ .include bsd.own.mk XORGSRC= ${X11SRCDIR.xorg-server} -XORGINC_SUBDIR= Xext dbe exa fb include mi \ +XORGINC_SUBDIR= Xext composite dbe exa fb include mi \ miext/damage miext/shadow randr render xkb record XF86_SUBDIR= common ddc dixmods/extmod dri fbdevhw i2c int10 modes \ os-support os-support/bus parser rac ramdac shadowfb \ @@ -24,7 +24,8 @@ INCSDIR=${X11INCDIR}/xorg INCS= BT.h IBM.h TI.h XIstubs.h Xprintf.h \ bt829.h \ callback.h closestr.h closure.h colormap.h \ - colormapst.h compiler.h cursor.h cursorstr.h damage.h damagestr.h \ + colormapst.h compiler.h compositeext.h cursor.h cursorstr.h \ + damage.h damagestr.h \ dbestruct.h dgaproc.h dix.h dixevents.h dixfont.h dixfontstr.h \ dixgrabs.h dixstruct.h dri.h dristruct.h edid.h exa.h exevents.h \ eventconvert.h events.h eventstr.h list.h \ @@ -38,7 +39,8 @@ INCS= BT.h IBM.h TI.h XIstubs.h Xprintf. protocol-versions.h \ propertyst.h randrstr.h region.h regionstr.h resource.h \ rgb.h sarea.h screenint.h scrnintstr.h selection.h servermd.h \ - shadow.h shadowfb.h site.h swaprep.h swapreq.h tda8425.h tda9850.h \ + shadow.h shadowfb.h shmint.h site.h swaprep.h swapreq.h \ + tda8425.h tda9850.h \ tda9885.h uda1380.h validate.h vbe.h vbeModes.h vgaHW.h \ window.h windowstr.h xaa.h xaalocal.h xaarop.h \ xkbDflts.h xkb.h set.h \
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Wed Apr 2 02:14:08 UTC 2014 Modified Files: src/sys/arch/x86/x86: x86_autoconf.c Log Message: - tidy up debugging To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/arch/x86/x86/x86_autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/x86_autoconf.c diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.68 src/sys/arch/x86/x86/x86_autoconf.c:1.69 --- src/sys/arch/x86/x86/x86_autoconf.c:1.68 Thu May 16 15:06:45 2013 +++ src/sys/arch/x86/x86/x86_autoconf.c Tue Apr 1 22:14:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_autoconf.c,v 1.68 2013/05/16 19:06:45 christos Exp $ */ +/* $NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.68 2013/05/16 19:06:45 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: x86_autoconf.c,v 1.69 2014/04/02 02:14:08 christos Exp $); #include sys/param.h #include sys/systm.h @@ -64,6 +64,12 @@ __KERNEL_RCSID(0, $NetBSD: x86_autoconf struct disklist *x86_alldisks; int x86_ndisks; +#ifdef DEBUG_GEOM +#define DPRINTF(a) printf a +#else +#define DPRINTF(a) +#endif + static int is_valid_disk(device_t dv) { @@ -124,71 +130,60 @@ matchbiosdisks(void) x86_alldisks-dl_biosdisks[i].bi_cyl = big-disk[i].cyl; x86_alldisks-dl_biosdisks[i].bi_lbasecs = big-disk[i].totsec; x86_alldisks-dl_biosdisks[i].bi_flags = big-disk[i].flags; -#ifdef GEOM_DEBUG -#ifdef notyet - printf(disk %x: flags %x, interface %x, device %llx\n, - big-disk[i].dev, big-disk[i].flags, - big-disk[i].interface_path, big-disk[i].device_path); -#endif + DPRINTF((%s: disk %x: flags %x, + __func__, big-disk[i].dev, big-disk[i].flags)); +#ifdef BIOSDISK_EXTINFO_V3 + DPRINTF((, interface %x, device %llx, + big-disk[i].interface_path, big-disk[i].device_path)); #endif + DPRINTF((\n)); } /* XXX Code duplication from findroot(). */ n = -1; for (dv = deviter_first(di, DEVITER_F_ROOT_FIRST); dv != NULL; dv = deviter_next(di)) { - if (device_class(dv) != DV_DISK) + if (!is_valid_disk(dv)) continue; -#ifdef GEOM_DEBUG - printf(matchbiosdisks: trying to match (%s) %s\n, - device_xname(dv), device_cfdata(dv)-cf_name); -#endif - if (is_valid_disk(dv)) { - n++; - snprintf(x86_alldisks-dl_nativedisks[n].ni_devname, - sizeof(x86_alldisks-dl_nativedisks[n].ni_devname), - %s, device_xname(dv)); + DPRINTF((%s: trying to match (%s) %s: , __func__, + device_xname(dv), device_cfdata(dv)-cf_name)); + n++; + snprintf(x86_alldisks-dl_nativedisks[n].ni_devname, + sizeof(x86_alldisks-dl_nativedisks[n].ni_devname), + %s, device_xname(dv)); - if ((tv = opendisk(dv)) == NULL) -continue; + if ((tv = opendisk(dv)) == NULL) { + DPRINTF((cannot open\n)); + continue; + } - error = vn_rdwr(UIO_READ, tv, mbr, DEV_BSIZE, 0, - UIO_SYSSPACE, 0, NOCRED, NULL, NULL); - VOP_CLOSE(tv, FREAD, NOCRED); - vput(tv); - if (error) { -#ifdef GEOM_DEBUG -printf(matchbiosdisks: %s: MBR read failure\n, -device_xname(dv)); -#endif -continue; - } + error = vn_rdwr(UIO_READ, tv, mbr, DEV_BSIZE, 0, UIO_SYSSPACE, + 0, NOCRED, NULL, NULL); + VOP_CLOSE(tv, FREAD, NOCRED); + vput(tv); + if (error) { + DPRINTF((MBR read failure %d\n, error)); + continue; + } - for (ck = i = 0; i DEV_BSIZE; i++) -ck += mbr[i]; - for (m = i = 0; i numbig; i++) { -be = big-disk[i]; -#ifdef GEOM_DEBUG -printf(match %s with %d -dev ck %x bios ck %x\n, device_xname(dv), i, -ck, be-cksum); -#endif -if (be-flags BI_GEOM_INVALID) - continue; -if (be-cksum == ck -memcmp(mbr[MBR_PART_OFFSET], be-mbrparts, -MBR_PART_COUNT * - sizeof(struct mbr_partition)) == 0) { -#ifdef GEOM_DEBUG - printf(matched BIOS disk %x with %s\n, - be-dev, device_xname(dv)); -#endif - x86_alldisks-dl_nativedisks[n]. - ni_biosmatches[m++] = i; -} + for (ck = i = 0; i DEV_BSIZE; i++) + ck += mbr[i]; + for (m = i = 0; i numbig; i++) { + be = big-disk[i]; + if (be-flags BI_GEOM_INVALID) +continue; + DPRINTF((matched with %d dev ck %x bios ck %x\n, + i, ck, be-cksum)); + if (be-cksum == ck memcmp(mbr[MBR_PART_OFFSET], + be-mbrparts, MBR_PART_COUNT + * sizeof(struct mbr_partition)) == 0) { +DPRINTF((%s: matched BIOS disk %x with %s\n, +__func__, be-dev, device_xname(dv))); +x86_alldisks-dl_nativedisks[n]. +ni_biosmatches[m++] = i; } - x86_alldisks-dl_nativedisks[n].ni_nmatches = m; } + x86_alldisks-dl_nativedisks[n].ni_nmatches = m; } deviter_release(di); } @@ -212,11 +207,16 @@ match_bootwedge(device_t dv, struct btin /* *
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: christos Date: Wed Apr 2 02:17:01 UTC 2014 Modified Files: src/sys/dev/raidframe: rf_netbsdkintf.c Log Message: If we are autoconfiguring root, then only change the booted_device if we booted from one of the components of the root raid set. This allows us to boot from other media, without forcing the found raid to always be root. Allow the old behavior with RAIDFRAME_FORCE_ROOT. XXX: cpu_rootconf() is called twice now, which prints the booted device message twice. Perhaps we can remember that cpu_rootconf has been called and avoid calling it twice to avoid that. To generate a diff of this commit: cvs rdiff -u -r1.305 -r1.306 src/sys/dev/raidframe/rf_netbsdkintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.305 src/sys/dev/raidframe/rf_netbsdkintf.c:1.306 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.305 Sun Mar 16 01:20:29 2014 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Tue Apr 1 22:17:01 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.305 2014/03/16 05:20:29 dholland Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.306 2014/04/02 02:17:01 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***/ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.305 2014/03/16 05:20:29 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: rf_netbsdkintf.c,v 1.306 2014/04/02 02:17:01 christos Exp $); #ifdef _KERNEL_OPT #include opt_compat_netbsd.h @@ -447,14 +447,30 @@ rf_autoconfig(device_t self) return 1; } +static int +rf_containsboot(RF_Raid_t *r, device_t dv) { + const char *bootname = device_xname(dv); + size_t len = strlen(bootname); + + for (int col = 0; col r-numCol; col++) { + char *devname = r-Disks[col].devname; + devname += sizeof(/dev/) - 1; + if (strncmp(devname, bootname, len) == 0) { + struct raid_softc *sc = r-softc; + aprint_debug(raid%d includes boot device %s\n, + sc-sc_unit, devname); + return 1; + } + } + return 0; +} + void rf_buildroothack(RF_ConfigSet_t *config_sets) { RF_ConfigSet_t *cset; RF_ConfigSet_t *next_cset; - int col; int num_root; - char *devname; struct raid_softc *sc, *rsc; sc = rsc = NULL; @@ -496,14 +512,22 @@ rf_buildroothack(RF_ConfigSet_t *config_ /* we found something bootable... */ if (num_root == 1) { + device_t candidate_root; if (rsc-sc_dkdev.dk_nwedges != 0) { /* XXX: How do we find the real root partition? */ char cname[sizeof(cset-ac-devname)]; snprintf(cname, sizeof(cname), %s%c, device_xname(rsc-sc_dev), 'a'); - booted_device = dkwedge_find_by_wname(cname); + candidate_root = dkwedge_find_by_wname(cname); } else - booted_device = rsc-sc_dev; + candidate_root = rsc-sc_dev; +#ifndef RAIDFRAME_FORCE_ROOT + if (booted_device == NULL) + cpu_rootconf(); + if (booted_device == NULL + || rf_containsboot(rsc-sc_r, booted_device)) +#endif + booted_device = candidate_root; } else if (num_root 1) { /* @@ -528,14 +552,7 @@ rf_buildroothack(RF_ConfigSet_t *config_ if (r-root_partition == 0) continue; - for (col = 0; col r-numCol; col++) { -devname = r-Disks[col].devname; -devname += sizeof(/dev/) - 1; -if (strncmp(devname, device_xname(booted_device), - strlen(device_xname(booted_device))) != 0) - continue; -aprint_debug(raid%d includes boot device %s\n, - sc-sc_unit, devname); + if (rf_containsboot(r, booted_device)) { num_root++; rsc = sc; }
CVS import: othersrc/external/bsd/starsign
Module Name:othersrc Committed By: agc Date: Wed Apr 2 04:03:33 UTC 2014 Update of /cvsroot/othersrc/external/bsd/starsign In directory ivanova.netbsd.org:/tmp/cvs-serv619 Log Message: Initial import of starsign into othersrc/external/bsd/starsign The starsign suite of scripts allows (ssh and pgp) signatures to be made on files and data. The user's signatures provide trust for the public part of an ephemeral key; the private part is thrown away after signing the data. A signed tar (or star) archive is produced when signing. Start times and durations of signatures are supported, and are covered by the ephemeral key signature. When signing (with starsign(1)), the start time, durations, signing host's public ssh host key, and the data to be signed are all covered by the signature. The default key type is ssh. PGP keys can be specified at signing time. Care should be taken that the relevant public key is available on the remote host where the data will be verified; although, if the key is not available, the data can always be retrieved by using tar(1), the only difference being that the trust has not been verified. When verifying (with starverify(1)), firstly, the signature on the public part of the ephemeral key is verified, and then the ephemeral key's signature on the data and metadata is verified. Finally, the start time and duration are verified. starcat(1) can be used to sign or verify in a pipe. starinfo(1) displays signature information on the signed data and metadata in the archive. In action: % cp /usr/pkgsrc/packages/All/digest-20121220.tgz . Signing data: % starsign -t pgp -u a...@pkgsrc.org digest-20121220.tgz Creating signed archive for digest-20121220.tgz Generating ephemeral key Generating public/private rsa key pair. Your identification has been saved in starsign-ephemeral-key. Your public key has been saved in starsign-ephemeral-key.pub. The key fingerprint is: 5c:0a:02:a5:71:bb:ee:12:d5:df:46:21:93:f5:20:b7 a...@netbsd-001.cupertino.alistaircrooks.com The key's randomart image is: +--[ RSA 4096]+ | o.o .o+ | | = . +o.+ | | . o.. oE..| |.o.o o. | | .. .So | | ... o | | ... | | .. | | ..| +-+ Signing ephemeral key to add trust signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12 Key fingerprint: d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823 uid Alistair Crooks alist...@hockley-crooks.com uid Alistair Crooks a...@pkgsrc.org uid Alistair Crooks a...@netbsd.org uid Alistair Crooks a...@alistaircrooks.com uid Alistair Crooks (Yahoo!) agcro...@yahoo-inc.com uid Alistair Crooks a...@netflix.com encryption 2048/RSA (Encrypt or Sign) 79deb61e488eee74 2004-01-12 netpgp passphrase: signature 4096/RSA (Encrypt or Sign) cdbe2fcf04983a76 1970-01-01 Key fingerprint: 835c 67c3 f7a9 dd10 5a26 d009 cdbe 2fcf 0498 3a76 uid netbsd-001.cupertino.alistaircrooks.com (starsign-ephemeral-key.pub) a...@netbsd-001.cupertino.alistaircrooks.com % ls -al digest-20121220.tgz.star -rw-r--r-- 1 agc users 43356 Apr 1 20:45 digest-20121220.tgz.star % tar tvzf digest-20121220.tgz.star -rw-r--r-- 1 agc wheel 41192 Apr 1 20:45 signed.tar.gz -rw--- 1 agc wheel549 Apr 1 20:45 signed.tar.gz.sig -rw-r--r-- 1 agc wheel769 Apr 1 20:45 starsign-ephemeral-key.pub -rw--- 1 agc wheel293 Apr 1 20:45 starsign-ephemeral-key.pub.sig -rw-r--r-- 1 agc wheel 3 Apr 1 20:45 keytype -rw-r--r-- 1 agc wheel 14 Apr 1 20:45 userid -rw-r--r-- 1 agc wheel 28 Apr 1 20:45 secring tar: ustar vol 1, 7 files, 51200 bytes read, 0 bytes written in 1 secs (51200 bytes/sec) Display information on the star file: % starinfo digest-20121220.tgz.star Verifying signed archive: digest-20121220.tgz.star Key type: pgp User id: a...@pkgsrc.org = Verifying signature on ephemeral key Good signature for starsign-ephemeral-key.pub.sig made Tue Apr 1 20:45:48 2014 signature 2048/RSA (Encrypt or Sign) 1b68dcfcc0596823 2004-01-12 fingerprint d415 9deb 336d e4cc cdfa 00cd 1b68 dcfc c059 6823 uid Alistair Crooks a...@alistaircrooks.com uid Alistair Crooks alist...@hockley-crooks.com uid Alistair Crooks a...@pkgsrc.org uid Alistair Crooks a...@netbsd.org uid Alistair Crooks
CVS import: othersrc/external/bsd/dust
Module Name:othersrc Committed By: agc Date: Wed Apr 2 04:38:22 UTC 2014 Update of /cvsroot/othersrc/external/bsd/dust In directory ivanova.netbsd.org:/tmp/cvs-serv5253 Log Message: Initial import of dust(1) into the othersrc/external/bsd/dust repo. dust(1) is a small shell script which orders humanised du(1) output in size order. A long time ago, Jeff Rizzo prodded me into writing this shell script, dust, which does a humanised du(1) listing, then sorts the output into size order, smallest to largest. The -r argument to dust reverses the output, placing the largest files first, and smallest last. Some months later, and Jeff assures me that it's useful (I'd forgotten I wrote it), so much so that he has come up with fixes for files with spaces in their names. Thanks, Jeff, much appreciated! Sample usage: % dust . 4.0K ./bin 18K ./dist 26K . % dust dist/* 4.0K dist/dust.sh 12K dist/dust.1 % However, it's probably easier to show a more useful, every day use of dust: % dust /e/pkgsrc | tail -10 2.6G /e/pkgsrc/pkgsrc 3.2G /e/pkgsrc/repo/src/gnu/dist 3.5G /e/pkgsrc/repo/src/gnu 6.8G /e/pkgsrc/src/.git/objects/pack 6.8G /e/pkgsrc/src/.git/objects 6.8G /e/pkgsrc/src/.git 6.8G /e/pkgsrc/src 9.8G /e/pkgsrc/repo/src 11G /e/pkgsrc/repo 32G /e/pkgsrc % Once again, my thanks to riz. Status: Vendor Tag: CROOKS Release Tags: dust-base N othersrc/external/bsd/dust/Makefile N othersrc/external/bsd/dust/dist/dust.sh N othersrc/external/bsd/dust/dist/dust.1 N othersrc/external/bsd/dust/bin/Makefile No conflicts created by this import