CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jruoho Date: Sun Feb 28 09:23:30 UTC 2010 Modified Files: src/sys/dev/acpi: acpi_lid.c Log Message: Cleanup: * Semantics. * Remove ACPI_LID_DEBUG. * Reduce the amount of error reporting. * As the status of the lid (open/closed) is known upon suspend, move the state variable to the softc, and avoid one object evaluation this way. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/dev/acpi/acpi_lid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
re: CVS commit: src/sys/dev/acpi
Module Name: src Committed By:jruoho Date:Sun Feb 28 09:23:30 UTC 2010 Modified Files: src/sys/dev/acpi: acpi_lid.c Log Message: Cleanup: * Semantics. * Remove ACPI_LID_DEBUG. * Reduce the amount of error reporting. * As the status of the lid (open/closed) is known upon suspend, move the state variable to the softc, and avoid one object evaluation this way. i'm curious why ignoring the various errors is a good thing. in particular, sysmon_pswitch_register() and pmf_device_register() failure mean the device won't work properly, yet there is nothing to indicate such... .mrg.
Re: CVS commit: src/sys/dev/acpi
On Sun, Feb 28, 2010 at 09:16:38PM +1100, matthew green wrote: i'm curious why ignoring the various errors is a good thing. in particular, sysmon_pswitch_register() and pmf_device_register() failure mean the device won't work properly, yet there is nothing to indicate such... Well, generally I've tried to reduce the verbosity in the acpi(4) subtree, as it is quite chatty compared to many other subsystems. The acpi(4) device drivers are also believed to be robust, having been in production since NetBSD 1.6. The sysmon_pswitch_register() is currently a dummy function. If pmf_device_register() fails, the failure should noticeable without an error message in the event of e.g. suspend... As for things like AcpiOsExecute(), the failures typically involve invalid parameters (can be verified not to be the case by manual code inspection) or lack of memory (in which case there sure are bigger problems than ACPI drivers). - Jukka.
CVS commit: src/tests/lib/libc
Module Name:src Committed By: martin Date: Sun Feb 28 11:06:59 UTC 2010 Modified Files: src/tests/lib/libc: Atffile Log Message: remove string directory for now, it isn't installed To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/Atffile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/Atffile diff -u src/tests/lib/libc/Atffile:1.3 src/tests/lib/libc/Atffile:1.4 --- src/tests/lib/libc/Atffile:1.3 Sun Jan 24 21:12:17 2010 +++ src/tests/lib/libc/Atffile Sun Feb 28 11:06:59 2010 @@ -4,4 +4,4 @@ tp: hash tp: stdlib -tp: string +
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: martin Date: Sun Feb 28 11:34:42 UTC 2010 Modified Files: src/sys/dev/i2c: i2c.c i2cvar.h Log Message: Generic (device property based) framework for optional direct configuration of i2c devices, as discussed on tech-kern. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/i2c/i2c.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/i2cvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/ofw
Module Name:src Committed By: martin Date: Sun Feb 28 11:35:40 UTC 2010 Modified Files: src/sys/dev/ofw: ofw_subr.c openfirm.h Log Message: Supporting cast for i2c direct configuration on OF machines To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ofw/ofw_subr.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ofw/openfirm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/ofw
Module Name:src Committed By: martin Date: Sun Feb 28 11:35:40 UTC 2010 Modified Files: src/sys/dev/ofw: ofw_subr.c openfirm.h Log Message: Supporting cast for i2c direct configuration on OF machines To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ofw/ofw_subr.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ofw/openfirm.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/ofw/ofw_subr.c diff -u src/sys/dev/ofw/ofw_subr.c:1.16 src/sys/dev/ofw/ofw_subr.c:1.17 --- src/sys/dev/ofw/ofw_subr.c:1.16 Thu Jan 21 15:56:08 2010 +++ src/sys/dev/ofw/ofw_subr.c Sun Feb 28 11:35:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.16 2010/01/21 15:56:08 martin Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.17 2010/02/28 11:35:40 martin Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ofw_subr.c,v 1.16 2010/01/21 15:56:08 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: ofw_subr.c,v 1.17 2010/02/28 11:35:40 martin Exp $); #include sys/param.h #include sys/systm.h @@ -325,3 +325,60 @@ strncpy(buffer, pos + 2, len); return buffer; } + +/* + * Iterate over the subtree of a i2c controller node. + * Add all sub-devices into an array as part of the controller's + * device properties. + * This is used by the i2c bus attach code to do direct configuration. + */ +void +of_enter_i2c_devs(prop_dictionary_t props, int ofnode) +{ + int node, len; + char name[32]; + uint64_t r64; + uint64_t r32; + uint8_t smr[24]; + prop_array_t array; + prop_dictionary_t dev; + + array = prop_array_create(); + + for (node = OF_child(ofnode); node; node = OF_peer(node)) { + if (OF_getprop(node, name, name, sizeof(name)) = 0) + continue; + len = OF_getproplen(node, reg); + if (len == sizeof(r64)) { + if (OF_getprop(node, reg, r64, sizeof(r64)) + != sizeof(r64)) +continue; + r32 = r64; + } else if (len == sizeof(r32)) { + if (OF_getprop(node, reg, r32, sizeof(r32)) + != sizeof(r32)) +continue; + } else if (len == 24) { + if (OF_getprop(node, reg, smr, sizeof(smr)) + != sizeof(smr)) +continue; + /* smbus reg property */ + r32 = smr[7]; + } else { + panic(unexpected \reg\ size %d for \%s\, + parent %x, node %x, + len, name, ofnode, node); + } + + dev = prop_dictionary_create(); + prop_dictionary_set_cstring(dev, name, name); + prop_dictionary_set_uint32(dev, addr, r32 1); + prop_dictionary_set_uint64(dev, cookie, node); + of_to_dataprop(dev, node, compatible, compatible); + prop_array_add(array, dev); + prop_object_release(dev); + } + + prop_dictionary_set(props, i2c-child-devices, array); + prop_object_release(array); +} Index: src/sys/dev/ofw/openfirm.h diff -u src/sys/dev/ofw/openfirm.h:1.27 src/sys/dev/ofw/openfirm.h:1.28 --- src/sys/dev/ofw/openfirm.h:1.27 Wed Nov 11 16:56:52 2009 +++ src/sys/dev/ofw/openfirm.h Sun Feb 28 11:35:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.h,v 1.27 2009/11/11 16:56:52 macallan Exp $ */ +/* $NetBSD: openfirm.h,v 1.28 2010/02/28 11:35:40 martin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -115,4 +115,6 @@ int *of_network_decode_media(int, int *, int *); char *of_get_mode_string(char *, int); +void of_enter_i2c_devs(prop_dictionary_t, int); + #endif /*_OPENFIRM_H_*/
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: martin Date: Sun Feb 28 11:36:27 UTC 2010 Modified Files: src/sys/dev/i2c: adm1021.c lm75.c spdmem.c Log Message: Add direct config support for a few devices To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/adm1021.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/i2c/lm75.c cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/spdmem.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/i2c/adm1021.c diff -u src/sys/dev/i2c/adm1021.c:1.3 src/sys/dev/i2c/adm1021.c:1.4 --- src/sys/dev/i2c/adm1021.c:1.3 Fri Jun 5 12:42:43 2009 +++ src/sys/dev/i2c/adm1021.c Sun Feb 28 11:36:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: adm1021.c,v 1.3 2009/06/05 12:42:43 hubertf Exp $ */ +/* $NetBSD: adm1021.c,v 1.4 2010/02/28 11:36:27 martin Exp $ */ /* $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: adm1021.c,v 1.3 2009/06/05 12:42:43 hubertf Exp $); +__KERNEL_RCSID(0, $NetBSD: adm1021.c,v 1.4 2010/02/28 11:36:27 martin Exp $); #include sys/param.h #include sys/systm.h @@ -62,18 +62,35 @@ CFATTACH_DECL_NEW(admtemp, sizeof(struct admtemp_softc), admtemp_match, admtemp_attach, NULL, NULL); +static const char * admtemp_compats[] = { + i2c-max1617, + NULL +}; int admtemp_match(device_t parent, cfdata_t match, void *aux) { struct i2c_attach_args *ia = aux; - if (((ia-ia_addr = 0x18) (ia-ia_addr = 0x1a)) || - ((ia-ia_addr = 0x29) (ia-ia_addr = 0x2b)) || - ((ia-ia_addr = 0x4c) (ia-ia_addr = 0x4e))) - return (1); + if (ia-ia_name == NULL) { + /* + * Indirect config - not much we can do! + * Check typical addresses. + */ + if (((ia-ia_addr = 0x18) (ia-ia_addr = 0x1a)) || + ((ia-ia_addr = 0x29) (ia-ia_addr = 0x2b)) || + ((ia-ia_addr = 0x4c) (ia-ia_addr = 0x4e))) + return (1); + } else { + /* + * Direct config - match via the list of compatible + * hardware. + */ + if (iic_compat_match(ia, admtemp_compats)) + return 1; + } - return (0); + return 0; } Index: src/sys/dev/i2c/lm75.c diff -u src/sys/dev/i2c/lm75.c:1.20 src/sys/dev/i2c/lm75.c:1.21 --- src/sys/dev/i2c/lm75.c:1.20 Fri Jan 9 17:20:31 2009 +++ src/sys/dev/i2c/lm75.c Sun Feb 28 11:36:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lm75.c,v 1.20 2009/01/09 17:20:31 briggs Exp $ */ +/* $NetBSD: lm75.c,v 1.21 2010/02/28 11:36:27 martin Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: lm75.c,v 1.20 2009/01/09 17:20:31 briggs Exp $); +__KERNEL_RCSID(0, $NetBSD: lm75.c,v 1.21 2010/02/28 11:36:27 martin Exp $); #include sys/param.h #include sys/systm.h @@ -71,6 +71,16 @@ static uint32_t lmtemp_decode_ds75(const uint8_t *); static uint32_t lmtemp_decode_lm77(const uint8_t *); + +static const char * lmtemp_compats[] = { + i2c-lm75, + /* + * see XXX in _attach() below: add code once non-lm75 matches are + * added here! + */ + NULL +}; + enum { lmtemp_lm75 = 0, lmtemp_ds75, @@ -100,15 +110,28 @@ struct i2c_attach_args *ia = aux; int i; - for (i = 0; lmtemptbl[i].lmtemp_type != -1 ; i++) - if (lmtemptbl[i].lmtemp_type == cf-cf_flags) - break; - if (lmtemptbl[i].lmtemp_type == -1) - return 0; - - if ((ia-ia_addr lmtemptbl[i].lmtemp_addrmask) == - lmtemptbl[i].lmtemp_addr) - return 1; + if (ia-ia_name == NULL) { + /* + * Indirect config - not much we can do! + */ + for (i = 0; lmtemptbl[i].lmtemp_type != -1 ; i++) + if (lmtemptbl[i].lmtemp_type == cf-cf_flags) +break; + if (lmtemptbl[i].lmtemp_type == -1) + return 0; + + if ((ia-ia_addr lmtemptbl[i].lmtemp_addrmask) == + lmtemptbl[i].lmtemp_addr) + return 1; + } else { + /* + * Direct config - match via the list of compatible + * hardware. + */ + if (iic_compat_match(ia, lmtemp_compats)) + return 1; + } + return 0; } @@ -120,16 +143,27 @@ struct i2c_attach_args *ia = aux; int i; - for (i = 0; lmtemptbl[i].lmtemp_type != -1 ; i++) - if (lmtemptbl[i].lmtemp_type == - device_cfdata(self)-cf_flags) - break; + if (ia-ia_name == NULL) { + for (i = 0; lmtemptbl[i].lmtemp_type != -1 ; i++) + if (lmtemptbl[i].lmtemp_type == + device_cfdata(self)-cf_flags) +break; + } else { + /* XXX - add code when adding other direct matches! */ + i = 0; + } sc-sc_tag = ia-ia_tag; sc-sc_address = ia-ia_addr; aprint_naive(: Temperature Sensor\n); - aprint_normal(: %s Temperature Sensor\n, lmtemptbl[i].lmtemp_name); + if (ia-ia_name) { + aprint_normal(: %s %s Temperature Sensor\n, ia-ia_name, + lmtemptbl[i].lmtemp_name); + } else { + aprint_normal(: %s Temperature Sensor\n, + lmtemptbl[i].lmtemp_name); + } /* Set the configuration of the LM75 to defaults. */ iic_acquire_bus(sc-sc_tag, I2C_F_POLL); @@ -143,7 +177,8 @@ sc-sc_sme = sysmon_envsys_create(); /*
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: martin Date: Sun Feb 28 11:36:27 UTC 2010 Modified Files: src/sys/dev/i2c: adm1021.c lm75.c spdmem.c Log Message: Add direct config support for a few devices To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/adm1021.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/i2c/lm75.c cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/spdmem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: martin Date: Sun Feb 28 11:43:40 UTC 2010 Modified Files: src/sys/arch/sparc64/sparc64: autoconf.c Log Message: Add support for direct configuration of i2c devices To generate a diff of this commit: cvs rdiff -u -r1.168 -r1.169 src/sys/arch/sparc64/sparc64/autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/ic
Module Name:src Committed By: martin Date: Sun Feb 28 11:47:28 UTC 2010 Modified Files: src/sys/dev/ic: pcf8584.c pcf8584var.h Log Message: Update pcf8584 driver from OpenBSD To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/pcf8584.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/pcf8584var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/ic
Module Name:src Committed By: martin Date: Sun Feb 28 11:47:28 UTC 2010 Modified Files: src/sys/dev/ic: pcf8584.c pcf8584var.h Log Message: Update pcf8584 driver from OpenBSD To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/pcf8584.c cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/pcf8584var.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/pcf8584.c diff -u src/sys/dev/ic/pcf8584.c:1.5 src/sys/dev/ic/pcf8584.c:1.6 --- src/sys/dev/ic/pcf8584.c:1.5 Mon Apr 28 20:23:51 2008 +++ src/sys/dev/ic/pcf8584.c Sun Feb 28 11:47:28 2010 @@ -1,239 +1,308 @@ -/* $NetBSD: pcf8584.c,v 1.5 2008/04/28 20:23:51 martin Exp $ */ - -/*- - * Copyright (c) 2007 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Tobias Nygren. - * - * 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. - */ +/* $NetBSD: pcf8584.c,v 1.6 2010/02/28 11:47:28 martin Exp $ */ +/* $OpenBSD: pcf8584.c,v 1.9 2007/10/20 18:46:21 kettenis Exp $ */ /* - * Philips PCF8584 I2C Bus Controller + * Copyright (c) 2006 David Gwynne d...@openbsd.org * - * This driver does not yet support multi-master arbitration, concurrent access - * or interrupts, but it should be usable for single-master applications. - * It is currently used by the envctrl(4) driver on sparc64. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pcf8584.c,v 1.5 2008/04/28 20:23:51 martin Exp $); - #include sys/param.h +#include sys/systm.h #include sys/device.h +#include sys/malloc.h #include sys/kernel.h -#include sys/systm.h -#include sys/condvar.h -#include sys/mutex.h -#include sys/bus.h -#include machine/param.h +#include sys/rwlock.h +#include sys/proc.h + +#include machine/bus.h + #include dev/i2c/i2cvar.h -#include dev/ic/pcf8584reg.h + #include dev/ic/pcf8584var.h -static void pcf8584_bus_reset(struct pcf8584_handle *, int); -static int pcf8584_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t, - void *, size_t, int); -static int pcf8584_acquire_bus(void *, int); -static void pcf8584_release_bus(void *, int); -static void pcf8584_wait(struct pcf8584_handle *, int); - -/* Must delay for 500 ns between bus accesses according to manual. */ -#define DATA_W(x) (DELAY(1), bus_space_write_1(ha-ha_iot, ha-ha_ioh, 0, x)) -#define DATA_R() (DELAY(1), bus_space_read_1(ha-ha_iot, ha-ha_ioh, 0)) -#define CSR_W(x) (DELAY(1), bus_space_write_1(ha-ha_iot, ha-ha_ioh, 1, x)) -#define STATUS_R() (DELAY(1), bus_space_read_1(ha-ha_iot, ha-ha_ioh, 1)) -#define BUSY() ((STATUS_R() PCF8584_STATUS_BBN) == 0) -#define PENDING() ((STATUS_R() PCF8584_STATUS_PIN) == 0) -#define NAK() ((STATUS_R() PCF8584_STATUS_LRB) != 0) +#define PCF_S0 0x00 +#define PCF_S1 0x01 +#define PCF_S2 0x02 +#define PCF_S3 0x03 + +#define PCF_CTRL_ACK (10) +#define PCF_CTRL_STO (11) +#define
Re: CVS commit: src/distrib/utils/sysinst
On Wed, Feb 17, 2010 at 04:09:52PM +, Martin Husemann wrote: Modified Files: src/distrib/utils/sysinst: disks.c Log Message: eeh says we should not enable fsck_lfs on lfs partitions Even assuming this is true in the medium to long term rather than a temporary problem... this is not the right way to do this unless there is zero chance there will ever be a working fsck_lfs, which I don't think we want to admit is the case. The right thing to do is to make fsck_lfs exit without doing anything (or otherwise behave innocuously) when run with -p. That can be adjusted easily in the future by deploying a new fsck_lfs binary; introducing gunk into users' fstab files requires hand-editing or expensive/delicate postinstall foo later, or creates a permanent disability, none of which is desirable. -- David A. Holland dholl...@netbsd.org
CVS commit: src/sys/arch/sparc64
Module Name:src Committed By: martin Date: Sun Feb 28 11:49:44 UTC 2010 Modified Files: src/sys/arch/sparc64/conf: GENERIC SCHIZO files.sparc64 Added Files: src/sys/arch/sparc64/dev: pcf8591_envctrl.c pcfiic_ebus.c tda.c Removed Files: src/sys/arch/sparc64/dev: envctrl.c envctrlreg.h Log Message: Remove the envctrl driver, it is superseeded by the more general pcfiic @ ebus. Add the SB1000/SB2000 fan controll driver (tda). From OpenBSD. Move config files over to direct configuration of i2c devices. To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/arch/sparc64/conf/GENERIC cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/conf/SCHIZO cvs rdiff -u -r1.124 -r1.125 src/sys/arch/sparc64/conf/files.sparc64 cvs rdiff -u -r1.11 -r0 src/sys/arch/sparc64/dev/envctrl.c cvs rdiff -u -r1.5 -r0 src/sys/arch/sparc64/dev/envctrlreg.h cvs rdiff -u -r0 -r1.1 src/sys/arch/sparc64/dev/pcf8591_envctrl.c \ src/sys/arch/sparc64/dev/pcfiic_ebus.c src/sys/arch/sparc64/dev/tda.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/sparc64
Module Name:src Committed By: martin Date: Sun Feb 28 11:49:44 UTC 2010 Modified Files: src/sys/arch/sparc64/conf: GENERIC SCHIZO files.sparc64 Added Files: src/sys/arch/sparc64/dev: pcf8591_envctrl.c pcfiic_ebus.c tda.c Removed Files: src/sys/arch/sparc64/dev: envctrl.c envctrlreg.h Log Message: Remove the envctrl driver, it is superseeded by the more general pcfiic @ ebus. Add the SB1000/SB2000 fan controll driver (tda). From OpenBSD. Move config files over to direct configuration of i2c devices. To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/arch/sparc64/conf/GENERIC cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/conf/SCHIZO cvs rdiff -u -r1.124 -r1.125 src/sys/arch/sparc64/conf/files.sparc64 cvs rdiff -u -r1.11 -r0 src/sys/arch/sparc64/dev/envctrl.c cvs rdiff -u -r1.5 -r0 src/sys/arch/sparc64/dev/envctrlreg.h cvs rdiff -u -r0 -r1.1 src/sys/arch/sparc64/dev/pcf8591_envctrl.c \ src/sys/arch/sparc64/dev/pcfiic_ebus.c src/sys/arch/sparc64/dev/tda.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/sparc64/conf/GENERIC diff -u src/sys/arch/sparc64/conf/GENERIC:1.117 src/sys/arch/sparc64/conf/GENERIC:1.118 --- src/sys/arch/sparc64/conf/GENERIC:1.117 Sat Feb 13 08:54:58 2010 +++ src/sys/arch/sparc64/conf/GENERIC Sun Feb 28 11:49:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.117 2010/02/13 08:54:58 mrg Exp $ +# $NetBSD: GENERIC,v 1.118 2010/02/28 11:49:44 martin Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident GENERIC-$Revision: 1.117 $ +#ident GENERIC-$Revision: 1.118 $ maxusers 64 @@ -906,17 +906,20 @@ Other device configuration psm* at ebus? # Ultrabook IIi microcontroller -envctrl* at ebus? # Ultra E450 environmental monitoring +pcfiic* at ebus? # various environmental monitoring +iic* at pcfiic? lom* at ebus? # LOMlite lights out management # Netra X1 / T1 style environmental monitoring alipm* at pci? iic* at alipm? -spdmem* at iic? addr 0x54 -spdmem* at iic? addr 0x55 -spdmem* at iic? addr 0x56 -spdmem* at iic? addr 0x57 -admtemp* at iic? addr 0x18 + +# I2C devices +spdmem* at iic? addr? +admtemp* at iic? addr? +ecadc* at iic? addr? # envctrl/envctrltwo on E250/E450 +lmtemp* at iic? addr? +tda* at iic? addr? # fan controll on SB1000/2000 ### Other pseudo-devices Index: src/sys/arch/sparc64/conf/SCHIZO diff -u src/sys/arch/sparc64/conf/SCHIZO:1.6 src/sys/arch/sparc64/conf/SCHIZO:1.7 --- src/sys/arch/sparc64/conf/SCHIZO:1.6 Sat Feb 13 22:24:09 2010 +++ src/sys/arch/sparc64/conf/SCHIZO Sun Feb 28 11:49:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: SCHIZO,v 1.6 2010/02/13 22:24:09 mrg Exp $ +# $NetBSD: SCHIZO,v 1.7 2010/02/28 11:49:44 martin Exp $ # # GENERIC with schizo support enabled, with the annoying schizo interupt # option @@ -7,7 +7,7 @@ include arch/sparc64/conf/GENERIC.MP #include arch/sparc64/conf/GENERIC -#ident SCHIZO.$Revision: 1.6 $ +#ident SCHIZO.$Revision: 1.7 $ options CHEETAH @@ -20,6 +20,3 @@ # this crashes when attaching. #no machfb - -# this matches when it isn't present. ugh. -no admtemp Index: src/sys/arch/sparc64/conf/files.sparc64 diff -u src/sys/arch/sparc64/conf/files.sparc64:1.124 src/sys/arch/sparc64/conf/files.sparc64:1.125 --- src/sys/arch/sparc64/conf/files.sparc64:1.124 Mon Feb 22 22:28:58 2010 +++ src/sys/arch/sparc64/conf/files.sparc64 Sun Feb 28 11:49:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: files.sparc64,v 1.124 2010/02/22 22:28:58 mrg Exp $ +# $NetBSD: files.sparc64,v 1.125 2010/02/28 11:49:44 martin Exp $ # @(#)files.sparc64 8.1 (Berkeley) 7/19/93 # sparc64-specific configuration info @@ -68,9 +68,17 @@ attach power at sbus, ebus file arch/sparc64/dev/power.c power -device envctrl: sysmon_envsys, pcf8584, i2cbus -attach envctrl at ebus -file arch/sparc64/dev/envctrl.c envctrl +device tda +attach tda at iic +file arch/sparc64/dev/tda.c tda + +device pcfiic: sysmon_envsys, pcf8584, i2cbus +attach pcfiic at ebus +file arch/sparc64/dev/pcfiic_ebus.c pcfiic + +device ecadc +attach ecadc at iic +file arch/sparc64/dev/pcf8591_envctrl.c device lom: sysmon_envsys, sysmon_wdog attach lom at ebus Added files: Index: src/sys/arch/sparc64/dev/pcf8591_envctrl.c diff -u /dev/null src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.1 --- /dev/null Sun Feb 28 11:49:44 2010 +++ src/sys/arch/sparc64/dev/pcf8591_envctrl.c Sun Feb 28 11:49:44 2010 @@ -0,0 +1,255 @@ +/* $NetBSD: pcf8591_envctrl.c,v 1.1 2010/02/28 11:49:44 martin Exp $ */ +/* $OpenBSD: pcf8591_envctrl.c,v 1.6 2007/10/25 21:17:20 kettenis Exp $ */ + +/* + * Copyright (c) 2006 Damien Miller d...@openbsd.org + * Copyright (c) 2007 Mark Kettenis kette...@openbsd.org + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted,
CVS commit: src/sys/arch/i386/conf
Module Name:src Committed By: jruoho Date: Sun Feb 28 13:10:43 UTC 2010 Modified Files: src/sys/arch/i386/conf: ALL Log Message: Add ACPI_DEBUG_ALLOC. To generate a diff of this commit: cvs rdiff -u -r1.243 -r1.244 src/sys/arch/i386/conf/ALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/conf
Module Name:src Committed By: jruoho Date: Sun Feb 28 13:10:43 UTC 2010 Modified Files: src/sys/arch/i386/conf: ALL Log Message: Add ACPI_DEBUG_ALLOC. To generate a diff of this commit: cvs rdiff -u -r1.243 -r1.244 src/sys/arch/i386/conf/ALL 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/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.243 src/sys/arch/i386/conf/ALL:1.244 --- src/sys/arch/i386/conf/ALL:1.243 Sun Feb 28 09:24:46 2010 +++ src/sys/arch/i386/conf/ALL Sun Feb 28 13:10:43 2010 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.243 2010/02/28 09:24:46 jruoho Exp $ +# $NetBSD: ALL,v 1.244 2010/02/28 13:10:43 jruoho Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident ALL-$Revision: 1.243 $ +#ident ALL-$Revision: 1.244 $ maxusers 64 # estimated number of users @@ -1759,7 +1759,13 @@ options AC97_IO_DEBUG options ACPI_APM_DEBUG options ACPI_BUT_DEBUG + +# ACPI_DEBUG_ALLOC can not be used with ACPI +# kernel modules. It requires also ACPI_DEBUG. +# #options ACPI_DEBUG +#options ACPI_DEBUG_ALLOC + options ACPI_EXTRA_DEBUG options ACPI_FDC_DEBUG options ACPI_MADT_DEBUG
Re: CVS commit: src/sys/dev/ic
On Sat, Feb 27, 2010 at 04:40:12AM +, Izumi Tsutsui wrote: Log Message: Always call device dependent functions via pointers rather than using conditionals to switch inline functions for modern processors. Eh ??? if (foo) bar(); else baz(); will probably execute faster than: (*bar_baz)(); since the indirect jump is (IIRC) always unpredicted. the 'if' version stands a chance of correctly predicting the jump. David -- David Laight: da...@l8s.co.uk
CVS commit: src/sys
Module Name:src Committed By: jruoho Date: Sun Feb 28 13:56:50 UTC 2010 Modified Files: src/sys/arch/x86/acpi: acpi_wakeup.c src/sys/dev/acpi: wmi_acpi.c Log Message: Use native functions instead of polluting the namespace with ACPICA-macros. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/acpi/acpi_wakeup.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/acpi/wmi_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: martin Date: Sun Feb 28 13:59:05 UTC 2010 Modified Files: src/sys/arch/sparc64/sparc64: autoconf.c src/sys/dev/ofw: ofw_subr.c openfirm.h Log Message: Interpret the reg property of i2c nodes more liberal, and depending on the cell size in use. I have been unable to find any documents about the i2c bindings for OF, so this is all pretty much voodoo. To generate a diff of this commit: cvs rdiff -u -r1.169 -r1.170 src/sys/arch/sparc64/sparc64/autoconf.c cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ofw/ofw_subr.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/ofw/openfirm.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/sparc64/sparc64/autoconf.c diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.169 src/sys/arch/sparc64/sparc64/autoconf.c:1.170 --- src/sys/arch/sparc64/sparc64/autoconf.c:1.169 Sun Feb 28 11:43:40 2010 +++ src/sys/arch/sparc64/sparc64/autoconf.c Sun Feb 28 13:59:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.169 2010/02/28 11:43:40 martin Exp $ */ +/* $NetBSD: autoconf.c,v 1.170 2010/02/28 13:59:05 martin Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.169 2010/02/28 11:43:40 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.170 2010/02/28 13:59:05 martin Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -873,7 +873,7 @@ struct ebus_attach_args *ea = aux; ofnode = ea-ea_node; - } else if (device_is_a(dev, iic)) { + } else if (device_is_a(busdev, iic)) { struct i2c_attach_args *ia = aux; ofnode = (int)ia-ia_cookie; @@ -995,7 +995,8 @@ prop_object_t cfg = prop_dictionary_get(props, i2c-child-devices); if (!cfg) -of_enter_i2c_devs(props, busnode); +of_enter_i2c_devs(props, busnode, +sizeof(cell_t)); } } Index: src/sys/dev/ofw/ofw_subr.c diff -u src/sys/dev/ofw/ofw_subr.c:1.17 src/sys/dev/ofw/ofw_subr.c:1.18 --- src/sys/dev/ofw/ofw_subr.c:1.17 Sun Feb 28 11:35:40 2010 +++ src/sys/dev/ofw/ofw_subr.c Sun Feb 28 13:59:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.17 2010/02/28 11:35:40 martin Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.18 2010/02/28 13:59:05 martin Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ofw_subr.c,v 1.17 2010/02/28 11:35:40 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: ofw_subr.c,v 1.18 2010/02/28 13:59:05 martin Exp $); #include sys/param.h #include sys/systm.h @@ -333,13 +333,13 @@ * This is used by the i2c bus attach code to do direct configuration. */ void -of_enter_i2c_devs(prop_dictionary_t props, int ofnode) +of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size) { int node, len; char name[32]; - uint64_t r64; - uint64_t r32; - uint8_t smr[24]; + uint64_t reg64; + uint32_t reg32; + uint64_t addr; prop_array_t array; prop_dictionary_t dev; @@ -349,30 +349,26 @@ if (OF_getprop(node, name, name, sizeof(name)) = 0) continue; len = OF_getproplen(node, reg); - if (len == sizeof(r64)) { - if (OF_getprop(node, reg, r64, sizeof(r64)) - != sizeof(r64)) + addr = 0; + if (cell_size == 8 len = sizeof(reg64)) { + if (OF_getprop(node, reg, reg64, sizeof(reg64)) + sizeof(reg64)) continue; - r32 = r64; - } else if (len == sizeof(r32)) { - if (OF_getprop(node, reg, r32, sizeof(r32)) - != sizeof(r32)) + addr = reg64; + } else if (cell_size == 4 len = sizeof(reg32)) { + if (OF_getprop(node, reg, reg32, sizeof(reg32)) + sizeof(reg32)) continue; - } else if (len == 24) { - if (OF_getprop(node, reg, smr, sizeof(smr)) - != sizeof(smr)) -continue; - /* smbus reg property */ - r32 = smr[7]; + addr = reg32; } else { - panic(unexpected \reg\ size %d for \%s\, - parent %x, node %x, - len, name, ofnode, node); + continue; } + addr = 1; + if (addr == 0) continue; dev = prop_dictionary_create(); prop_dictionary_set_cstring(dev, name, name); - prop_dictionary_set_uint32(dev, addr, r32 1); + prop_dictionary_set_uint32(dev, addr, addr); prop_dictionary_set_uint64(dev, cookie, node); of_to_dataprop(dev, node, compatible, compatible); prop_array_add(array, dev); Index: src/sys/dev/ofw/openfirm.h diff -u src/sys/dev/ofw/openfirm.h:1.28 src/sys/dev/ofw/openfirm.h:1.29 --- src/sys/dev/ofw/openfirm.h:1.28 Sun Feb 28 11:35:40 2010 +++ src/sys/dev/ofw/openfirm.h Sun Feb 28 13:59:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.h,v 1.28 2010/02/28 11:35:40 martin Exp $ */ +/* $NetBSD: openfirm.h,v 1.29 2010/02/28 13:59:05 martin Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -115,6 +115,6 @@ int *of_network_decode_media(int, int *, int *); char *of_get_mode_string(char *, int); -void of_enter_i2c_devs(prop_dictionary_t, int); +void of_enter_i2c_devs(prop_dictionary_t,
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Sun Feb 28 14:45:48 UTC 2010 Modified Files: src/external/cddl/osnet/include: unistd.h src/external/cddl/osnet/sbin/zfs: Makefile src/external/cddl/osnet/sbin/zpool: Makefile src/external/cddl/osnet/sys/kern: ddi.c misc.c taskq.c src/external/cddl/osnet/sys/machine: endian.h src/external/cddl/osnet/sys/sys: byteorder.h cpuvar.h elf.h idmap.h modctl.h mount.h policy.h proc.h types.h uio.h vfs.h vnode.h zfs_context.h src/external/cddl/osnet/sys/sys/acl: acl_common.h Log Message: Add NetBSD build glue to build new zfs version 22 sources. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/include/unistd.h cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sbin/zfs/Makefile cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sbin/zpool/Makefile cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/kern/ddi.c cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/sys/kern/misc.c \ src/external/cddl/osnet/sys/kern/taskq.c cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/machine/endian.h cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/sys/byteorder.h \ src/external/cddl/osnet/sys/sys/cpuvar.h \ src/external/cddl/osnet/sys/sys/elf.h \ src/external/cddl/osnet/sys/sys/modctl.h \ src/external/cddl/osnet/sys/sys/mount.h \ src/external/cddl/osnet/sys/sys/policy.h \ src/external/cddl/osnet/sys/sys/proc.h \ src/external/cddl/osnet/sys/sys/uio.h \ src/external/cddl/osnet/sys/sys/vfs.h \ src/external/cddl/osnet/sys/sys/vnode.h cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/sys/idmap.h cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/sys/sys/types.h \ src/external/cddl/osnet/sys/sys/zfs_context.h cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/sys/acl/acl_common.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/include/unistd.h diff -u src/external/cddl/osnet/include/unistd.h:1.3 src/external/cddl/osnet/include/unistd.h:1.4 --- src/external/cddl/osnet/include/unistd.h:1.3 Sun Feb 21 01:46:34 2010 +++ src/external/cddl/osnet/include/unistd.h Sun Feb 28 14:45:47 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: unistd.h,v 1.3 2010/02/21 01:46:34 darran Exp $ */ +/* $NetBSD: unistd.h,v 1.4 2010/02/28 14:45:47 haad Exp $ */ /* * Copyright (C) 2007 John Birrell j...@freebsd.org @@ -38,4 +38,6 @@ #define ftruncate64 ftruncate #define pread64 pread +#define _SC_PHYS_PAGES 500 + #endif Index: src/external/cddl/osnet/sbin/zfs/Makefile diff -u src/external/cddl/osnet/sbin/zfs/Makefile:1.2 src/external/cddl/osnet/sbin/zfs/Makefile:1.3 --- src/external/cddl/osnet/sbin/zfs/Makefile:1.2 Wed Oct 21 22:31:19 2009 +++ src/external/cddl/osnet/sbin/zfs/Makefile Sun Feb 28 14:45:47 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/10/21 22:31:19 joerg Exp $ +# $NetBSD: Makefile,v 1.3 2010/02/28 14:45:47 haad Exp $ .include ../../Makefile.zfs @@ -18,7 +18,10 @@ LIBZFS_OBJDIR!= cd ${LIBZFS_SRCDIR} ${PRINTOBJDIR} LDADD+= -L${LIBZFS_OBJDIR} -lzfs -LDADD+= -lm -lutil +LIBUMEM_OBJDIR!= cd ${LIBUMEM_SRCDIR} ${PRINTOBJDIR} +LDADD+= -L${LIBUMEM_OBJDIR} -lumem + +LDADD+= -lm -lutil -lpthread .PATH: ${ZFSDIR}/dist/cmd/zfs Index: src/external/cddl/osnet/sbin/zpool/Makefile diff -u src/external/cddl/osnet/sbin/zpool/Makefile:1.2 src/external/cddl/osnet/sbin/zpool/Makefile:1.3 --- src/external/cddl/osnet/sbin/zpool/Makefile:1.2 Wed Oct 21 22:32:20 2009 +++ src/external/cddl/osnet/sbin/zpool/Makefile Sun Feb 28 14:45:47 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/10/21 22:32:20 joerg Exp $ +# $NetBSD: Makefile,v 1.3 2010/02/28 14:45:47 haad Exp $ .include ../../Makefile.zfs @@ -7,7 +7,7 @@ USETBL= yes SRCS= zpool_main.c zpool_iter.c zpool_util.c zpool_vdev.c -DPADD= ${LIBAVL} ${LIBZFS} ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL} +DPADD= ${LIBAVL} ${LIBZFS} ${LIBM} ${LIBNVPAIR} ${LIBUUTIL} ${LIBUTIL} ${LIBUMEM} LIBAVL_OBJDIR!= cd ${LIBAVL_SRCDIR} ${PRINTOBJDIR} LDADD+= -L${LIBAVL_OBJDIR} -lavl @@ -21,7 +21,13 @@ LIBZFS_OBJDIR!= cd ${LIBZFS_SRCDIR} ${PRINTOBJDIR} LDADD+= -L${LIBZFS_OBJDIR} -lzfs -LDADD+= -lm -lutil +LIBUMEM_OBJDIR!= cd ${LIBUMEM_SRCDIR} ${PRINTOBJDIR} +LDADD+= -L${LIBUMEM_OBJDIR} -lumem + +LIBZPOOL_OBJDIR!= cd ${LIBZPOOL_SRCDIR} ${PRINTOBJDIR} +LDADD+= -L${LIBZPOOL_OBJDIR} -lzpool + +LDADD+= -lm -lutil -lpthread .PATH: ${ZFSDIR}/dist/cmd/zpool Index: src/external/cddl/osnet/sys/kern/ddi.c diff -u src/external/cddl/osnet/sys/kern/ddi.c:1.2 src/external/cddl/osnet/sys/kern/ddi.c:1.3 --- src/external/cddl/osnet/sys/kern/ddi.c:1.2 Mon Aug 10 22:41:51 2009 +++ src/external/cddl/osnet/sys/kern/ddi.c Sun Feb 28 14:45:47 2010 @@ -34,6 +34,7 @@ #include sys/ddi.h #include sys/errno.h #include sys/param.h
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Sun Feb 28 14:45:48 UTC 2010 Modified Files: src/external/cddl/osnet/include: unistd.h src/external/cddl/osnet/sbin/zfs: Makefile src/external/cddl/osnet/sbin/zpool: Makefile src/external/cddl/osnet/sys/kern: ddi.c misc.c taskq.c src/external/cddl/osnet/sys/machine: endian.h src/external/cddl/osnet/sys/sys: byteorder.h cpuvar.h elf.h idmap.h modctl.h mount.h policy.h proc.h types.h uio.h vfs.h vnode.h zfs_context.h src/external/cddl/osnet/sys/sys/acl: acl_common.h Log Message: Add NetBSD build glue to build new zfs version 22 sources. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/include/unistd.h cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sbin/zfs/Makefile cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sbin/zpool/Makefile cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/kern/ddi.c cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/sys/kern/misc.c \ src/external/cddl/osnet/sys/kern/taskq.c cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/machine/endian.h cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/sys/sys/byteorder.h \ src/external/cddl/osnet/sys/sys/cpuvar.h \ src/external/cddl/osnet/sys/sys/elf.h \ src/external/cddl/osnet/sys/sys/modctl.h \ src/external/cddl/osnet/sys/sys/mount.h \ src/external/cddl/osnet/sys/sys/policy.h \ src/external/cddl/osnet/sys/sys/proc.h \ src/external/cddl/osnet/sys/sys/uio.h \ src/external/cddl/osnet/sys/sys/vfs.h \ src/external/cddl/osnet/sys/sys/vnode.h cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/sys/idmap.h cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/sys/sys/types.h \ src/external/cddl/osnet/sys/sys/zfs_context.h cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/sys/sys/acl/acl_common.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Sun Feb 28 15:07:14 UTC 2010 Added Files: src/external/cddl/osnet/sys/sys: sysevent.h Log Message: Add our local version of sysevent.h file without door.h useage. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/sysevent.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Sun Feb 28 15:07:14 UTC 2010 Added Files: src/external/cddl/osnet/sys/sys: sysevent.h Log Message: Add our local version of sysevent.h file without door.h useage. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/sysevent.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/cddl/osnet/sys/sys/sysevent.h diff -u /dev/null src/external/cddl/osnet/sys/sys/sysevent.h:1.1 --- /dev/null Sun Feb 28 15:07:14 2010 +++ src/external/cddl/osnet/sys/sys/sysevent.h Sun Feb 28 15:07:14 2010 @@ -0,0 +1,276 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the License). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets [] replaced with your own identifying + * information: Portions Copyright [] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_SYSEVENT_H +#define _SYS_SYSEVENT_H + +#include sys/nvpair.h + +#ifdef __cplusplus +extern C { +#endif + +#ifndef NULL +#if defined(_LP64) !defined(__cplusplus) +#define NULL0L +#else +#define NULL 0 +#endif +#endif + +/* Internal registration class and subclass */ +#define EC_ALL register_all_classes +#define EC_SUB_ALL register_all_subclasses + +/* + * Event allocation/enqueuing sleep/nosleep flags + */ +#define SE_SLEEP 0 +#define SE_NOSLEEP 1 + +/* Framework error codes */ +#define SE_EINVAL 1 /* Invalid argument */ +#define SE_ENOMEM 2 /* Unable to allocate memory */ +#define SE_EQSIZE 3 /* Maximum event q size exceeded */ +#define SE_EFAULT 4 /* Copy fault */ +#define SE_NOTFOUND 5 /* Attribute not found */ +#define SE_NO_TRANSPORT 6 /* sysevent transport down */ + +/* Internal data types */ + +#define SE_DATA_TYPE_BYTE DATA_TYPE_BYTE +#define SE_DATA_TYPE_INT16 DATA_TYPE_INT16 +#define SE_DATA_TYPE_UINT16 DATA_TYPE_UINT16 +#define SE_DATA_TYPE_INT32 DATA_TYPE_INT32 +#define SE_DATA_TYPE_UINT32 DATA_TYPE_UINT32 +#define SE_DATA_TYPE_INT64 DATA_TYPE_INT64 +#define SE_DATA_TYPE_UINT64 DATA_TYPE_UINT64 +#define SE_DATA_TYPE_STRING DATA_TYPE_STRING +#define SE_DATA_TYPE_BYTES DATA_TYPE_BYTE_ARRAY +#define SE_DATA_TYPE_TIME DATA_TYPE_HRTIME + +#define SE_KERN_PID 0 + +#define SUNW_VENDOR SUNW +#define SE_USR_PUB usr: +#define SE_KERN_PUB kern: +#define SUNW_KERN_PUB SUNW_VENDOR:SE_KERN_PUB +#define SUNW_USR_PUB SUNW_VENDOR:SE_USR_PUB + +/* + * Event header and attribute value limits + */ +#define MAX_ATTR_NAME 1024 +#define MAX_STRING_SZ 1024 +#define MAX_BYTE_ARRAY 1024 + +#define MAX_CLASS_LEN 64 +#define MAX_SUBCLASS_LEN 64 +#define MAX_PUB_LEN 128 +#define MAX_CHNAME_LEN 128 +#define MAX_SUBID_LEN 16 + +/* + * Limit for the event payload size + */ +#define MAX_EV_SIZE_LEN (SHRT_MAX/4) + +/* Opaque sysevent_t data type */ +typedef void *sysevent_t; + +/* Opaque channel bind data type */ +typedef void evchan_t; + +/* sysevent attribute list */ +typedef nvlist_t sysevent_attr_list_t; + +/* sysevent attribute name-value pair */ +typedef nvpair_t sysevent_attr_t; + +/* Unique event identifier */ +typedef struct sysevent_id { + uint64_t eid_seq; + hrtime_t eid_ts; +} sysevent_id_t; + +/* Event attribute value structures */ +typedef struct sysevent_bytes { + int32_t size; + uchar_t *data; +} sysevent_bytes_t; + +typedef struct sysevent_value { + int32_t value_type; /* data type */ + union { + uchar_t sv_byte; + int16_t sv_int16; + uint16_t sv_uint16; + int32_t sv_int32; + uint32_t sv_uint32; + int64_t sv_int64; + uint64_t sv_uint64; + hrtime_t sv_time; + char *sv_string; + sysevent_bytes_t sv_bytes; + } value; +} sysevent_value_t; + +/* + * The following flags determine the memory allocation semantics to use for + * kernel event buffer allocation by userland and kernel versions of + * sysevent_evc_publish(). + * + * EVCH_SLEEP and EVCH_NOSLEEP respectively map to KM_SLEEP and KM_NOSLEEP. + * EVCH_TRYHARD is a kernel-only publish flag that allow event allocation + * routines to use use alternate kmem caches in situations where free memory + * may be low. Kernel callers of sysevent_evc_publish() must set flags to + * one of EVCH_SLEEP, EVCH_NOSLEEP or EVCH_TRYHARD. Userland callers of + * sysevent_evc_publish() must set flags to one of
CVS commit: src/external/cddl/osnet/include/fm
Module Name:src Committed By: haad Date: Sun Feb 28 15:10:12 UTC 2010 Added Files: src/external/cddl/osnet/include/fm: libtopo.h Log Message: Add missing header file I have missed it in first round of glue commits. More to come. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/include/fm/libtopo.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/include
Module Name:src Committed By: haad Date: Sun Feb 28 15:13:27 UTC 2010 Added Files: src/external/cddl/osnet/include: aclutils.h directory.h idmap.h sha2.h Log Message: Add another set of headers files. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/include/aclutils.h \ src/external/cddl/osnet/include/directory.h \ src/external/cddl/osnet/include/idmap.h \ src/external/cddl/osnet/include/sha2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/include
Module Name:src Committed By: haad Date: Sun Feb 28 15:13:27 UTC 2010 Added Files: src/external/cddl/osnet/include: aclutils.h directory.h idmap.h sha2.h Log Message: Add another set of headers files. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/include/aclutils.h \ src/external/cddl/osnet/include/directory.h \ src/external/cddl/osnet/include/idmap.h \ src/external/cddl/osnet/include/sha2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/cddl/osnet/include/idmap.h diff -u /dev/null src/external/cddl/osnet/include/idmap.h:1.1 --- /dev/null Sun Feb 28 15:13:27 2010 +++ src/external/cddl/osnet/include/idmap.h Sun Feb 28 15:13:27 2010 @@ -0,0 +1,93 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the License). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets [] replaced with your own identifying + * information: Portions Copyright [] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_IDMAP_H +#define _SYS_IDMAP_H + + +/* Idmap status codes */ +#define IDMAP_SUCCESS 0 +#define IDMAP_NEXT 1 +#define IDMAP_ERR_OTHER -1 +#define IDMAP_ERR_INTERNAL - +#define IDMAP_ERR_MEMORY -9998 +#define IDMAP_ERR_NORESULT -9997 +#define IDMAP_ERR_NOTUSER -9996 +#define IDMAP_ERR_NOTGROUP -9995 +#define IDMAP_ERR_NOTSUPPORTED -9994 +#define IDMAP_ERR_W2U_NAMERULE -9993 +#define IDMAP_ERR_U2W_NAMERULE -9992 +#define IDMAP_ERR_CACHE -9991 +#define IDMAP_ERR_DB -9990 +#define IDMAP_ERR_ARG -9989 +#define IDMAP_ERR_SID -9988 +#define IDMAP_ERR_IDTYPE -9987 +#define IDMAP_ERR_RPC_HANDLE -9986 +#define IDMAP_ERR_RPC -9985 +#define IDMAP_ERR_CLIENT_HANDLE -9984 +#define IDMAP_ERR_BUSY -9983 +#define IDMAP_ERR_PERMISSION_DENIED -9982 +#define IDMAP_ERR_NOMAPPING -9981 +#define IDMAP_ERR_NEW_ID_ALLOC_REQD -9980 +#define IDMAP_ERR_DOMAIN -9979 +#define IDMAP_ERR_SECURITY -9978 +#define IDMAP_ERR_NOTFOUND -9977 +#define IDMAP_ERR_DOMAIN_NOTFOUND -9976 +#define IDMAP_ERR_UPDATE_NOTALLOWED -9975 +#define IDMAP_ERR_CFG -9974 +#define IDMAP_ERR_CFG_CHANGE -9973 +#define IDMAP_ERR_NOTMAPPED_WELLKNOWN -9972 +#define IDMAP_ERR_RETRIABLE_NET_ERR -9971 +#define IDMAP_ERR_W2U_NAMERULE_CONFLICT -9970 +#define IDMAP_ERR_U2W_NAMERULE_CONFLICT -9969 +#define IDMAP_ERR_BAD_UTF8 -9968 +#define IDMAP_ERR_NONE_GENERATED -9967 +#define IDMAP_ERR_PROP_UNKNOWN -9966 +#define IDMAP_ERR_NS_LDAP_OP_FAILED -9965 +#define IDMAP_ERR_NS_LDAP_PARTIAL -9964 +#define IDMAP_ERR_NS_LDAP_CFG -9963 +#define IDMAP_ERR_NS_LDAP_BAD_WINNAME -9962 +#define IDMAP_ERR_NO_ACTIVEDIRECTORY -9961 + +/* Reserved GIDs for some well-known SIDs */ +#define IDMAP_WK_LOCAL_SYSTEM_GID 2147483648U /* 0x8000 */ +#define IDMAP_WK_CREATOR_GROUP_GID 2147483649U +#define IDMAP_WK__MAX_GID 2147483649U + +/* Reserved UIDs for some well-known SIDs */ +#define IDMAP_WK_CREATOR_OWNER_UID 2147483648U +#define IDMAP_WK__MAX_UID 2147483648U + +/* Reserved SIDs */ +#define IDMAP_WK_CREATOR_SID_AUTHORITY S-1-3 + +/* + * Max door RPC size for ID mapping (can't be too large relative to the + * default user-land thread stack size, since clnt_door_call() + * alloca()s). See libidmap:idmap_init(). + */ +#define IDMAP_MAX_DOOR_RPC (256 * 1024) + +#endif /* _SYS_IDMAP_H */ Index: src/external/cddl/osnet/include/sha2.h diff -u /dev/null src/external/cddl/osnet/include/sha2.h:1.1 --- /dev/null Sun Feb 28 15:13:27 2010 +++ src/external/cddl/osnet/include/sha2.h Sun Feb 28 15:13:27 2010 @@ -0,0 +1,21 @@ +#ifndef _SHA256_H_ +#define _SHA256_H_ + +#include string.h + +#include_next sha2.h + +#define SHA256Init(b) SHA256_Init(b) +#define SHA256Update SHA256_Update + +static void +SHA256Final(void *digest, SHA256_CTX *ctx) +{ + uint8_t tmp[SHA256_DIGEST_LENGTH]; + + SHA256_Final(tmp, ctx); + memcpy(digest, tmp, sizeof(tmp)); +} + + +#endif
CVS commit: src/external/cddl/osnet/dist/common/util
Module Name:src Committed By: haad Date: Sun Feb 28 15:17:44 UTC 2010 Added Files: src/external/cddl/osnet/dist/common/util: sscanf.h Log Message: Add missing header file, I will tag it to osnet-20100224 later. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/dist/common/util/sscanf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/dist/common/util
Module Name:src Committed By: haad Date: Sun Feb 28 15:17:44 UTC 2010 Added Files: src/external/cddl/osnet/dist/common/util: sscanf.h Log Message: Add missing header file, I will tag it to osnet-20100224 later. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/dist/common/util/sscanf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/cddl/osnet/dist/common/util/sscanf.h diff -u /dev/null src/external/cddl/osnet/dist/common/util/sscanf.h:1.1 --- /dev/null Sun Feb 28 15:17:44 2010 +++ src/external/cddl/osnet/dist/common/util/sscanf.h Sun Feb 28 15:17:44 2010 @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the License). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets [] replaced with your own identifying + * information: Portions Copyright [] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _COMMON_UTIL_SSCANF_H +#define _COMMON_UTIL_SSCANF_H + +#pragma ident %Z%%M% %I% %E% SMI + +#include sys/types.h +#include sys/varargs.h + +#ifdef __cplusplus +extern C { +#endif + +/*SCANFLIKE2*/ +extern int sscanf(const char *, const char *, ...); +extern int vsscanf(const char *, const char *, va_list); + +#ifdef __cplusplus +} +#endif + +#endif /* _COMMON_UTIL_SSCANF_H */
CVS commit: src/sys/modules/zfs
Module Name:src Committed By: haad Date: Sun Feb 28 15:22:16 UTC 2010 Modified Files: src/sys/modules/zfs: Makefile Log Message: Update zfs module to new sources. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/modules/zfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/modules/zfs
Module Name:src Committed By: haad Date: Sun Feb 28 15:22:16 UTC 2010 Modified Files: src/sys/modules/zfs: Makefile Log Message: Update zfs module to new sources. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/modules/zfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/modules/zfs/Makefile diff -u src/sys/modules/zfs/Makefile:1.2 src/sys/modules/zfs/Makefile:1.3 --- src/sys/modules/zfs/Makefile:1.2 Mon Aug 10 22:39:38 2009 +++ src/sys/modules/zfs/Makefile Sun Feb 28 15:22:16 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/08/10 22:39:38 haad Exp $ +# $NetBSD: Makefile,v 1.3 2010/02/28 15:22:16 haad Exp $ .include ../Makefile.inc @@ -10,6 +10,7 @@ SRCS+= zfs_comutil.c SRCS+= zfs_deleg.c +SRCS+= zfs_fletcher.c SRCS+= zfs_namecheck.c SRCS+= zfs_prop.c SRCS+= zpool_prop.c @@ -28,6 +29,8 @@ SRCS+= arc.c SRCS+= bplist.c SRCS+= dbuf.c +SRCS+= ddt.c +SRCS+= ddt_zap.c SRCS+= dmu.c SRCS+= dmu_object.c SRCS+= dmu_objset.c @@ -44,7 +47,6 @@ SRCS+= dsl_prop.c SRCS+= dsl_scrub.c SRCS+= dsl_synctask.c -SRCS+= fletcher.c SRCS+= gzip.c SRCS+= lzjb.c SRCS+= metaslab.c @@ -93,6 +95,7 @@ SRCS+= zio_inject.c SRCS+= zutil.c SRCS+= zvol.c +SRCS+= zle.c .PATH: ${ZFSDIR}/sys/kern @@ -113,6 +116,7 @@ CWARNFLAGS+= -Wno-format CPPFLAGS+= -I${ZFSDIR}/sys +CPPFLAGS+= -I${ZFSDIR}/dist/common CPPFLAGS+= -I${ZFSDIR}/dist/common/acl CPPFLAGS+= -I${ZFSDIR}/dist/common/zfs CPPFLAGS+= -I${ZFSDIR}/dist/uts/common/fs/zfs
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Sun Feb 28 15:24:04 UTC 2010 Modified Files: src/external/cddl/osnet: Makefile.zfs Log Message: Add missing -I definition. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/Makefile.zfs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet
Module Name:src Committed By: haad Date: Sun Feb 28 15:24:04 UTC 2010 Modified Files: src/external/cddl/osnet: Makefile.zfs Log Message: Add missing -I definition. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/Makefile.zfs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/Makefile.zfs diff -u src/external/cddl/osnet/Makefile.zfs:1.1 src/external/cddl/osnet/Makefile.zfs:1.2 --- src/external/cddl/osnet/Makefile.zfs:1.1 Fri Aug 7 20:57:55 2009 +++ src/external/cddl/osnet/Makefile.zfs Sun Feb 28 15:24:04 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.zfs,v 1.1 2009/08/07 20:57:55 haad Exp $ +# $NetBSD: Makefile.zfs,v 1.2 2010/02/28 15:24:04 haad Exp $ .include bsd.own.mk @@ -37,6 +37,8 @@ CPPFLAGS+= -I${ZFSDIR}/dist/lib/libzfs/common CPPFLAGS+= -I${ZFSDIR}/dist/lib/libzpool/common +CPPFLAGS+= -I${ZFSDIR}/dist/common + LIBAVL_SRCDIR= ${ZFSDIR}/lib/libavl LIBNVPAIR_SRCDIR= ${ZFSDIR}/lib/libnvpair LIBUMEM_SRCDIR= ${ZFSDIR}/lib/libumem
Re: CVS commit: src/sys/dev/ic
Eh ??? if (foo) bar(); else baz(); will probably execute faster than: (*bar_baz)(); since the indirect jump is (IIRC) always unpredicted. What do you have to predict on unconditional branches? Anyway, the most major user of MI dp8390 is NE2000 and it doesn't use inlined ones at all. -- Izumi Tsutsui
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: martin Date: Sun Feb 28 15:30:22 UTC 2010 Modified Files: src/sys/arch/sparc64/dev: pcf8591_envctrl.c Log Message: dmesg cosmetics To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc64/dev/pcf8591_envctrl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: martin Date: Sun Feb 28 15:30:22 UTC 2010 Modified Files: src/sys/arch/sparc64/dev: pcf8591_envctrl.c Log Message: dmesg cosmetics To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc64/dev/pcf8591_envctrl.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/sparc64/dev/pcf8591_envctrl.c diff -u src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.2 src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.3 --- src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.2 Sun Feb 28 12:40:46 2010 +++ src/sys/arch/sparc64/dev/pcf8591_envctrl.c Sun Feb 28 15:30:22 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pcf8591_envctrl.c,v 1.2 2010/02/28 12:40:46 pgoyette Exp $ */ +/* $NetBSD: pcf8591_envctrl.c,v 1.3 2010/02/28 15:30:22 martin Exp $ */ /* $OpenBSD: pcf8591_envctrl.c,v 1.6 2007/10/25 21:17:20 kettenis Exp $ */ /* @@ -193,7 +193,7 @@ } aprint_naive(: Temp Sensors\n); - aprint_normal(%s Temp Sensors\n, ia-ia_name); + aprint_normal(: %s Temp Sensors\n, ia-ia_name); } static void
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: snj Date: Sun Feb 28 15:32:32 UTC 2010 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_fixup.c Log Message: Fix some minor errors in comments. To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/mips/mips_fixup.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: snj Date: Sun Feb 28 15:32:32 UTC 2010 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_fixup.c Log Message: Fix some minor errors in comments. To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/mips/mips_fixup.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/mips/mips/mips_fixup.c diff -u src/sys/arch/mips/mips/mips_fixup.c:1.1.2.3 src/sys/arch/mips/mips/mips_fixup.c:1.1.2.4 --- src/sys/arch/mips/mips/mips_fixup.c:1.1.2.3 Sun Feb 28 03:21:07 2010 +++ src/sys/arch/mips/mips/mips_fixup.c Sun Feb 28 15:32:32 2010 @@ -29,7 +29,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: mips_fixup.c,v 1.1.2.3 2010/02/28 03:21:07 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_fixup.c,v 1.1.2.4 2010/02/28 15:32:32 snj Exp $); #include sys/param.h @@ -204,7 +204,7 @@ /* * Find the lowest and highest jumps we will be replacing. We don't - * need to do but it does make weeding out the non-matching jumps + * need to do it but it does make weeding out the non-matching jumps * faster. */ for (size_t i = 0; i noffsets; i++) { @@ -220,7 +220,7 @@ uint32_t opcode = insn 26; /* - * First we check to see if this is a jump and whether its + * First we check to see if this is a jump and whether it is * within the range we are interested in. */ if ((opcode != OPCODE_J opcode != OPCODE_JAL) @@ -237,7 +237,7 @@ /* * Yes, we need to fix it up. Replace the old * displacement with the real displacement. If we've - * moved to a new cache line, sync the last cacheline + * moved to a new cache line, sync the last cache line * we fixed. */ *insnp ^= offset ^ real_offsets[i];
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: snj Date: Sun Feb 28 15:33:21 UTC 2010 Modified Files: src/sys/dev/i2c: i2cvar.h Log Message: Spelling police. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/i2c/i2cvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: snj Date: Sun Feb 28 15:33:21 UTC 2010 Modified Files: src/sys/dev/i2c: i2cvar.h Log Message: Spelling police. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/i2c/i2cvar.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/i2c/i2cvar.h diff -u src/sys/dev/i2c/i2cvar.h:1.7 src/sys/dev/i2c/i2cvar.h:1.8 --- src/sys/dev/i2c/i2cvar.h:1.7 Sun Feb 28 11:34:42 2010 +++ src/sys/dev/i2c/i2cvar.h Sun Feb 28 15:33:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: i2cvar.h,v 1.7 2010/02/28 11:34:42 martin Exp $ */ +/* $NetBSD: i2cvar.h,v 1.8 2010/02/28 15:33:21 snj Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -124,9 +124,9 @@ ia_compat array */ const char ** ia_compat; /* chip names */ /* - * The following is of limited usefullness and should only be used - * in rare cases where we realy know what we are doing. Example: - * a machine depended i2c driver (located in sys/arch/$arch/dev) + * The following is of limited usefulness and should only be used + * in rare cases where we really know what we are doing. Example: + * a machine dependent i2c driver (located in sys/arch/$arch/dev) * needing to access some firmware properties. * Depending on the firmware in use, an identifier for the device * may be present. Example: on OpenFirmware machines the device
CVS commit: src
Module Name:src Committed By: snj Date: Sun Feb 28 15:52:17 UTC 2010 Modified Files: src/crypto/dist/ipsec-tools: ChangeLog.old src/crypto/dist/ipsec-tools/src/racoon: sockmisc.c sockmisc.h src/sys/arch/amiga/dev: grf_rtreg.h src/sys/arch/atari/dev: ncr5380.c src/sys/arch/hpcmips/dev: mq200reg.h src/sys/arch/i386/isa: ahc_isa.c src/sys/arch/ia64/unwind: decode.h stackframe.h src/sys/arch/mac68k/dev: ncr5380.c src/sys/dev/usb: if_atu.c src/sys/fs/ntfs: TODO src/sys/net: if_spppsubr.c Log Message: Fight the ever-increasing size of src checkouts by spelling useful without an extra l. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/crypto/dist/ipsec-tools/ChangeLog.old cvs rdiff -u -r1.17 -r1.18 src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c cvs rdiff -u -r1.11 -r1.12 src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/dev/grf_rtreg.h cvs rdiff -u -r1.65 -r1.66 src/sys/arch/atari/dev/ncr5380.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpcmips/dev/mq200reg.h cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/isa/ahc_isa.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/unwind/decode.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/unwind/stackframe.h cvs rdiff -u -r1.63 -r1.64 src/sys/arch/mac68k/dev/ncr5380.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/if_atu.c cvs rdiff -u -r1.3 -r1.4 src/sys/fs/ntfs/TODO cvs rdiff -u -r1.118 -r1.119 src/sys/net/if_spppsubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: snj Date: Sun Feb 28 15:52:17 UTC 2010 Modified Files: src/crypto/dist/ipsec-tools: ChangeLog.old src/crypto/dist/ipsec-tools/src/racoon: sockmisc.c sockmisc.h src/sys/arch/amiga/dev: grf_rtreg.h src/sys/arch/atari/dev: ncr5380.c src/sys/arch/hpcmips/dev: mq200reg.h src/sys/arch/i386/isa: ahc_isa.c src/sys/arch/ia64/unwind: decode.h stackframe.h src/sys/arch/mac68k/dev: ncr5380.c src/sys/dev/usb: if_atu.c src/sys/fs/ntfs: TODO src/sys/net: if_spppsubr.c Log Message: Fight the ever-increasing size of src checkouts by spelling useful without an extra l. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/crypto/dist/ipsec-tools/ChangeLog.old cvs rdiff -u -r1.17 -r1.18 src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c cvs rdiff -u -r1.11 -r1.12 src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/dev/grf_rtreg.h cvs rdiff -u -r1.65 -r1.66 src/sys/arch/atari/dev/ncr5380.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpcmips/dev/mq200reg.h cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/isa/ahc_isa.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/unwind/decode.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/unwind/stackframe.h cvs rdiff -u -r1.63 -r1.64 src/sys/arch/mac68k/dev/ncr5380.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/if_atu.c cvs rdiff -u -r1.3 -r1.4 src/sys/fs/ntfs/TODO cvs rdiff -u -r1.118 -r1.119 src/sys/net/if_spppsubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/dist/ipsec-tools/ChangeLog.old diff -u src/crypto/dist/ipsec-tools/ChangeLog.old:1.1 src/crypto/dist/ipsec-tools/ChangeLog.old:1.2 --- src/crypto/dist/ipsec-tools/ChangeLog.old:1.1 Tue Jan 20 14:36:08 2009 +++ src/crypto/dist/ipsec-tools/ChangeLog.old Sun Feb 28 15:52:16 2010 @@ -2241,7 +2241,7 @@ * src/racoon/crypto_openssl.c (eay_3des_*): Check for strict key length only with old API. (eay_des_encrypt): Ditto. - * src/racoon/eaytest.c: Make the testsuite usefull, i.e. exit with + * src/racoon/eaytest.c: Make the testsuite useful, i.e. exit with non-zero error code if any of the tests fail. (main): Print banner with version. * src/racoon/Makefile.in: Run eaytest in 'make check'. Index: src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c diff -u src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c:1.17 src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c:1.18 --- src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c:1.17 Tue Jul 7 12:25:22 2009 +++ src/crypto/dist/ipsec-tools/src/racoon/sockmisc.c Sun Feb 28 15:52:16 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sockmisc.c,v 1.17 2009/07/07 12:25:22 tteras Exp $ */ +/* $NetBSD: sockmisc.c,v 1.18 2010/02/28 15:52:16 snj Exp $ */ /* Id: sockmisc.c,v 1.24 2006/05/07 21:32:59 manubsd Exp */ @@ -940,7 +940,7 @@ return -1; } -/* Some usefull functions for sockaddr port manipulations. */ +/* Some useful functions for sockaddr port manipulations. */ u_int16_t extract_port (const struct sockaddr *addr) { Index: src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h diff -u src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h:1.11 src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h:1.12 --- src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h:1.11 Fri Jul 3 06:41:47 2009 +++ src/crypto/dist/ipsec-tools/src/racoon/sockmisc.h Sun Feb 28 15:52:16 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: sockmisc.h,v 1.11 2009/07/03 06:41:47 tteras Exp $ */ +/* $NetBSD: sockmisc.h,v 1.12 2010/02/28 15:52:16 snj Exp $ */ /* Id: sockmisc.h,v 1.9 2005/10/05 16:55:41 manubsd Exp */ @@ -88,7 +88,7 @@ const struct netaddr *daddr)); extern int naddr_score(const struct netaddr *naddr, const struct sockaddr *saddr); -/* Some usefull functions for sockaddr port manipulations. */ +/* Some useful functions for sockaddr port manipulations. */ extern u_int16_t extract_port __P((const struct sockaddr *addr)); extern u_int16_t *set_port __P((struct sockaddr *addr, u_int16_t new_port)); extern u_int16_t *get_port_ptr __P((struct sockaddr *addr)); Index: src/sys/arch/amiga/dev/grf_rtreg.h diff -u src/sys/arch/amiga/dev/grf_rtreg.h:1.15 src/sys/arch/amiga/dev/grf_rtreg.h:1.16 --- src/sys/arch/amiga/dev/grf_rtreg.h:1.15 Sun Mar 4 05:59:20 2007 +++ src/sys/arch/amiga/dev/grf_rtreg.h Sun Feb 28 15:52:16 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: grf_rtreg.h,v 1.15 2007/03/04 05:59:20 christos Exp $ */ +/* $NetBSD: grf_rtreg.h,v 1.16 2010/02/28 15:52:16 snj Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -381,10 +381,10 @@ #define SEQ_ID_CHAR_MAP_SELECT 0x03 #define SEQ_ID_MEMORY_MODE 0x04 #define SEQ_ID_EXTENDED_ENABLE 0x05 /* down from here, all seq registers are NCR extensions */ -#define SEQ_ID_UNKNOWN1 0x06 /* it does exist so it's probably usefull */ -#define SEQ_ID_UNKNOWN2 0x07 /* it does exist so it's probably usefull
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Sun Feb 28 17:22:01 UTC 2010 Added Files: src/external/cddl/osnet/sys/sys: sha2.h Log Message: Add NetBSD/Solaris compatibility SHA header. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/sha2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Sun Feb 28 17:22:01 UTC 2010 Added Files: src/external/cddl/osnet/sys/sys: sha2.h Log Message: Add NetBSD/Solaris compatibility SHA header. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/sha2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/cddl/osnet/sys/sys/sha2.h diff -u /dev/null src/external/cddl/osnet/sys/sys/sha2.h:1.1 --- /dev/null Sun Feb 28 17:22:01 2010 +++ src/external/cddl/osnet/sys/sys/sha2.h Sun Feb 28 17:22:01 2010 @@ -0,0 +1,20 @@ +#ifndef _SHA2_H_ +#define _SHA2_H_ + +#include_next sys/sha2.h + +#define SHA2_CTX SHA256_CTX +#define SHA2Init(a, b) SHA256_Init(b) +#define SHA2Update SHA256_Update + +static void +SHA2Final(void *digest, SHA2_CTX *ctx) +{ + uint8_t tmp[SHA256_DIGEST_LENGTH]; + + SHA256_Final(tmp, ctx); + memcpy(digest, tmp, sizeof(tmp)); +} + + +#endif
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jruoho Date: Sun Feb 28 17:22:41 UTC 2010 Modified Files: src/sys/dev/acpi: acpi_acad.c acpi_bat.c acpi_button.c acpi_lid.c thinkpad_acpi.c Log Message: Introduce support for ACPI kernel modules. Tested on couple of laptops. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/acpi/acpi_acad.c cvs rdiff -u -r1.82 -r1.83 src/sys/dev/acpi/acpi_bat.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/acpi/acpi_button.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/acpi/acpi_lid.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/thinkpad_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jruoho Date: Sun Feb 28 17:22:41 UTC 2010 Modified Files: src/sys/dev/acpi: acpi_acad.c acpi_bat.c acpi_button.c acpi_lid.c thinkpad_acpi.c Log Message: Introduce support for ACPI kernel modules. Tested on couple of laptops. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/dev/acpi/acpi_acad.c cvs rdiff -u -r1.82 -r1.83 src/sys/dev/acpi/acpi_bat.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/acpi/acpi_button.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/acpi/acpi_lid.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/thinkpad_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/acpi_acad.c diff -u src/sys/dev/acpi/acpi_acad.c:1.40 src/sys/dev/acpi/acpi_acad.c:1.41 --- src/sys/dev/acpi/acpi_acad.c:1.40 Wed Feb 24 22:37:56 2010 +++ src/sys/dev/acpi/acpi_acad.c Sun Feb 28 17:22:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_acad.c,v 1.40 2010/02/24 22:37:56 dyoung Exp $ */ +/* $NetBSD: acpi_acad.c,v 1.41 2010/02/28 17:22:41 jruoho Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,11 +40,12 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: acpi_acad.c,v 1.40 2010/02/24 22:37:56 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: acpi_acad.c,v 1.41 2010/02/28 17:22:41 jruoho Exp $); #include sys/param.h #include sys/systm.h #include sys/device.h +#include sys/module.h #include sys/mutex.h #include dev/acpi/acpica.h @@ -301,3 +302,79 @@ sysmon_envsys_destroy(sc-sc_sme); sc-sc_sme = NULL; } + +#ifdef _MODULE + +MODULE(MODULE_CLASS_DRIVER, acpiacad, NULL); +CFDRIVER_DECL(acpiacad, DV_DULL, NULL); + +static int acpiacadloc[] = { -1 }; +extern struct cfattach acpiacad_ca; + +static struct cfparent acpiparent = { + acpinodebus, NULL, DVUNIT_ANY +}; + +static struct cfdata acpiacad_cfdata[] = { + { + .cf_name = acpiacad, + .cf_atname = acpiacad, + .cf_unit = 0, + .cf_fstate = FSTATE_STAR, + .cf_loc = acpiacadloc, + .cf_flags = 0, + .cf_pspec = acpiparent, + }, + + { NULL } +}; + +static int +acpiacad_modcmd(modcmd_t cmd, void *context) +{ + int err; + + switch (cmd) { + + case MODULE_CMD_INIT: + + err = config_cfdriver_attach(acpiacad_cd); + + if (err != 0) + return err; + + err = config_cfattach_attach(acpiacad, acpiacad_ca); + + if (err != 0) { + config_cfdriver_detach(acpiacad_cd); + return err; + } + + err = config_cfdata_attach(acpiacad_cfdata, 1); + + if (err != 0) { + config_cfattach_detach(acpiacad, acpiacad_ca); + config_cfdriver_detach(acpiacad_cd); + return err; + } + + return 0; + + case MODULE_CMD_FINI: + + err = config_cfdata_detach(acpiacad_cfdata); + + if (err != 0) + return err; + + config_cfattach_detach(acpiacad, acpiacad_ca); + config_cfdriver_detach(acpiacad_cd); + + return 0; + + default: + return ENOTTY; + } +} + +#endif /* _MODULE */ Index: src/sys/dev/acpi/acpi_bat.c diff -u src/sys/dev/acpi/acpi_bat.c:1.82 src/sys/dev/acpi/acpi_bat.c:1.83 --- src/sys/dev/acpi/acpi_bat.c:1.82 Wed Feb 24 22:37:56 2010 +++ src/sys/dev/acpi/acpi_bat.c Sun Feb 28 17:22:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_bat.c,v 1.82 2010/02/24 22:37:56 dyoung Exp $ */ +/* $NetBSD: acpi_bat.c,v 1.83 2010/02/28 17:22:41 jruoho Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -75,13 +75,14 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: acpi_bat.c,v 1.82 2010/02/24 22:37:56 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: acpi_bat.c,v 1.83 2010/02/28 17:22:41 jruoho Exp $); #include sys/param.h #include sys/systm.h #include sys/kernel.h /* for hz */ #include sys/kmem.h #include sys/device.h +#include sys/module.h #include sys/mutex.h #include dev/sysmon/sysmonvar.h @@ -782,3 +783,79 @@ return true; } + +#ifdef _MODULE + +MODULE(MODULE_CLASS_DRIVER, acpibat, NULL); +CFDRIVER_DECL(acpibat, DV_DULL, NULL); + +static int acpibatloc[] = { -1 }; +extern struct cfattach acpibat_ca; + +static struct cfparent acpiparent = { + acpinodebus, NULL, DVUNIT_ANY +}; + +static struct cfdata acpibat_cfdata[] = { + { + .cf_name = acpibat, + .cf_atname = acpibat, + .cf_unit = 0, + .cf_fstate = FSTATE_STAR, + .cf_loc = acpibatloc, + .cf_flags = 0, + .cf_pspec = acpiparent, + }, + + { NULL } +}; + +static int +acpibat_modcmd(modcmd_t cmd, void *context) +{ + int err; + + switch (cmd) { + + case MODULE_CMD_INIT: + + err = config_cfdriver_attach(acpibat_cd); + + if (err != 0) + return err; + + err = config_cfattach_attach(acpibat, acpibat_ca); + + if (err != 0) { + config_cfdriver_detach(acpibat_cd); + return err; + } + + err = config_cfdata_attach(acpibat_cfdata, 1); + + if (err != 0) { + config_cfattach_detach(acpibat, acpibat_ca); + config_cfdriver_detach(acpibat_cd); + return err; + } + + return 0; + + case MODULE_CMD_FINI: + + err = config_cfdata_detach(acpibat_cfdata); + + if (err != 0) + return err; + +
Re: CVS commit: src/sys/dev/ic
On Mon, Mar 01, 2010 at 12:28:17AM +0900, Izumi Tsutsui wrote: Eh ??? if (foo) bar(); else baz(); will probably execute faster than: (*bar_baz)(); since the indirect jump is (IIRC) always unpredicted. What do you have to predict on unconditional branches? The branch destination. E.g. the CPU can't start prefetching from the bar(). Joerg
CVS commit: src/external/cddl/osnet/lib
Module Name:src Committed By: haad Date: Sun Feb 28 17:36:51 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzfs: mnttab.c src/external/cddl/osnet/lib/libzpool: kernel.c Added Files: src/external/cddl/osnet/lib/libzfs: stubs.c Log Message: Add fixes for missing symbols from libzfs and libzpool. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzfs/mnttab.c cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/lib/libzfs/stubs.c cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzpool/kernel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/lib
Module Name:src Committed By: haad Date: Sun Feb 28 17:36:51 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzfs: mnttab.c src/external/cddl/osnet/lib/libzpool: kernel.c Added Files: src/external/cddl/osnet/lib/libzfs: stubs.c Log Message: Add fixes for missing symbols from libzfs and libzpool. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzfs/mnttab.c cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/lib/libzfs/stubs.c cvs rdiff -u -r1.1 -r1.2 src/external/cddl/osnet/lib/libzpool/kernel.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/cddl/osnet/lib/libzfs/mnttab.c diff -u src/external/cddl/osnet/lib/libzfs/mnttab.c:1.1 src/external/cddl/osnet/lib/libzfs/mnttab.c:1.2 --- src/external/cddl/osnet/lib/libzfs/mnttab.c:1.1 Fri Aug 7 20:57:56 2009 +++ src/external/cddl/osnet/lib/libzfs/mnttab.c Sun Feb 28 17:36:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mnttab.c,v 1.1 2009/08/07 20:57:56 haad Exp $ */ +/* $NetBSD: mnttab.c,v 1.2 2010/02/28 17:36:51 haad Exp $ */ /*- * Copyright (c) 2006 Pawel Jakub Dawidek p...@freebsd.org @@ -33,7 +33,7 @@ #include sys/cdefs.h /* __FBSDID($FreeBSD: src/compat/opensolaris/misc/mnttab.c,v 1.1 2007/04/06 01:08:59 pjd Exp $); */ -__RCSID($NetBSD: mnttab.c,v 1.1 2009/08/07 20:57:56 haad Exp $); +__RCSID($NetBSD: mnttab.c,v 1.2 2010/02/28 17:36:51 haad Exp $); #include sys/param.h #include sys/statvfs.h @@ -195,3 +195,10 @@ free(statvfs); return (0); } + +int +getmntent(FILE *file, struct mnttab *mnttab) { + + + return 1; +} Index: src/external/cddl/osnet/lib/libzpool/kernel.c diff -u src/external/cddl/osnet/lib/libzpool/kernel.c:1.1 src/external/cddl/osnet/lib/libzpool/kernel.c:1.2 --- src/external/cddl/osnet/lib/libzpool/kernel.c:1.1 Fri Aug 7 20:57:56 2009 +++ src/external/cddl/osnet/lib/libzpool/kernel.c Sun Feb 28 17:36:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.c,v 1.1 2009/08/07 20:57:56 haad Exp $ */ +/* $NetBSD: kernel.c,v 1.2 2010/02/28 17:36:51 haad Exp $ */ /* * CDDL HEADER START @@ -29,7 +29,7 @@ #pragma ident %Z%%M% %I% %E% SMI #include sys/cdefs.h -__RCSID($NetBSD: kernel.c,v 1.1 2009/08/07 20:57:56 haad Exp $); +__RCSID($NetBSD: kernel.c,v 1.2 2010/02/28 17:36:51 haad Exp $); #include sys/zfs_context.h #include sys/sysctl.h @@ -54,6 +54,7 @@ #ifdef XXXNETBSD int hz = 119; /* frequency when using gethrtime() 23 for lbolt */ #endif +int aok; uint64_t physmem; vnode_t *rootdir = (vnode_t *)0xabcd1234; char hw_serial[11]; @@ -63,6 +64,9 @@ userland }; +/* this only exists to have its address taken */ +struct proc p0; + /* * = * threads @@ -692,3 +696,10 @@ return npg * pgsize; } + +void +print_timestamp(int fmt) +{ + + return; +} Added files: Index: src/external/cddl/osnet/lib/libzfs/stubs.c diff -u /dev/null src/external/cddl/osnet/lib/libzfs/stubs.c:1.1 --- /dev/null Sun Feb 28 17:36:51 2010 +++ src/external/cddl/osnet/lib/libzfs/stubs.c Sun Feb 28 17:36:51 2010 @@ -0,0 +1,17 @@ +#include errno.h +#include libintl.h +#include link.h +#include pthread.h +#include strings.h +#include unistd.h + +#include libzfs.h + +#include libzfs_impl.h + +void +libzfs_fru_clear(libzfs_handle_t *hld, boolean_t bol) +{ + + return; +}
CVS commit: src/external/cddl/osnet/lib/libzfs
Module Name:src Committed By: haad Date: Sun Feb 28 17:40:35 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzfs: Makefile Log Message: Add newly added stubs.c file to libzfs build. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libzfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/lib/libzfs
Module Name:src Committed By: haad Date: Sun Feb 28 17:40:35 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzfs: Makefile Log Message: Add newly added stubs.c file to libzfs build. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libzfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzfs/Makefile diff -u src/external/cddl/osnet/lib/libzfs/Makefile:1.3 src/external/cddl/osnet/lib/libzfs/Makefile:1.4 --- src/external/cddl/osnet/lib/libzfs/Makefile:1.3 Sun Feb 21 01:46:35 2010 +++ src/external/cddl/osnet/lib/libzfs/Makefile Sun Feb 28 17:40:35 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2010/02/21 01:46:35 darran Exp $ +# $NetBSD: Makefile,v 1.4 2010/02/28 17:40:35 haad Exp $ .PATH: ${.CURDIR}/../../dist/common/zfs .PATH: ${.CURDIR}/../../dist/common/fs/zfs @@ -9,7 +9,7 @@ LDADD= -lutil # Local -SRCS= deviceid.c mnttab.c mkdirp.c zmount.c fsshare.c zone.c efi.c ucred.c +SRCS= deviceid.c mnttab.c mkdirp.c zmount.c fsshare.c zone.c efi.c ucred.c stubs.c # Sun SRCS+= zfs_namecheck.c zprop_common.c zfs_prop.c zpool_prop.c
Re: CVS commit: src/sys/dev/ic
Eh ??? if (foo) bar(); else baz(); will probably execute faster than: (*bar_baz)(); since the indirect jump is (IIRC) always unpredicted. What do you have to predict on unconditional branches? The branch destination. E.g. the CPU can't start prefetching from the bar(). Probably you guys should check diffs first: + if (sc-write_mbuf == NULL) + sc-write_mbuf = dp8390_write_mbuf; : - if (sc-write_mbuf) - len = (*sc-write_mbuf)(sc, m0, buffer); - else - len = dp8390_write_mbuf(sc, m0, buffer); + len = (*sc-write_mbuf)(sc, m0, buffer); i.e. + if (!foo) foo = bar; : - if (foo) (*foo)() else inlined_bar() + (*foo)() Few (no?) drivers use the latter inlined one so no befefit of prefetch with predict. --- Izumi Tsutsui
CVS commit: src/sys
Module Name:src Committed By: pgoyette Date: Sun Feb 28 20:04:04 UTC 2010 Modified Files: src/sys/dev/sysmon: sysmonvar.h src/sys/sys: envsys.h Log Message: Move definitions of internal data structures and flag bits to avoid exposing them to user-land. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sysmon/sysmonvar.h cvs rdiff -u -r1.30 -r1.31 src/sys/sys/envsys.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/lib/libzfs
Module Name:src Committed By: haad Date: Sun Feb 28 22:40:09 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libzfs: Makefile Log Message: Add missing zfs_fletcher.c to libzfs. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/lib/libzfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/cddl/osnet/lib/libzfs/Makefile diff -u src/external/cddl/osnet/lib/libzfs/Makefile:1.4 src/external/cddl/osnet/lib/libzfs/Makefile:1.5 --- src/external/cddl/osnet/lib/libzfs/Makefile:1.4 Sun Feb 28 17:40:35 2010 +++ src/external/cddl/osnet/lib/libzfs/Makefile Sun Feb 28 22:40:09 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2010/02/28 17:40:35 haad Exp $ +# $NetBSD: Makefile,v 1.5 2010/02/28 22:40:09 haad Exp $ .PATH: ${.CURDIR}/../../dist/common/zfs .PATH: ${.CURDIR}/../../dist/common/fs/zfs @@ -13,7 +13,7 @@ # Sun SRCS+= zfs_namecheck.c zprop_common.c zfs_prop.c zpool_prop.c -SRCS+= zfs_deleg.c zfs_comutil.c +SRCS+= zfs_deleg.c zfs_fletcher.c zfs_comutil.c SRCS+= libzfs_dataset.c libzfs_util.c libzfs_graph.c libzfs_mount.c SRCS+= libzfs_pool.c libzfs_changelist.c libzfs_config.c libzfs_import.c SRCS+= libzfs_status.c libzfs_sendrecv.c
CVS commit: src/distrib/utils/sysinst/arch/sparc64
Module Name:src Committed By: martin Date: Sun Feb 28 22:42:44 UTC 2010 Modified Files: src/distrib/utils/sysinst/arch/sparc64: md.h Log Message: Enable dynamic sizing of the default swap partition To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/sysinst/arch/sparc64/md.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/utils/sysinst/arch/sparc64
Module Name:src Committed By: martin Date: Sun Feb 28 22:42:44 UTC 2010 Modified Files: src/distrib/utils/sysinst/arch/sparc64: md.h Log Message: Enable dynamic sizing of the default swap partition To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/sysinst/arch/sparc64/md.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/sysinst/arch/sparc64/md.h diff -u src/distrib/utils/sysinst/arch/sparc64/md.h:1.15 src/distrib/utils/sysinst/arch/sparc64/md.h:1.16 --- src/distrib/utils/sysinst/arch/sparc64/md.h:1.15 Wed Feb 17 16:11:00 2010 +++ src/distrib/utils/sysinst/arch/sparc64/md.h Sun Feb 28 22:42:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.15 2010/02/17 16:11:00 martin Exp $ */ +/* $NetBSD: md.h,v 1.16 2010/02/28 22:42:44 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -40,6 +40,7 @@ /* md.h -- Machine specific definitions for the sparc */ /* Constants and defines */ +#define DEFSWAPSIZE (-1) /* * Symbolic names for disk partitions.
CVS commit: src/external/cddl/osnet/lib/libumem
Module Name:src Committed By: haad Date: Sun Feb 28 22:45:45 UTC 2010 Modified Files: src/external/cddl/osnet/lib/libumem: Makefile Added Files: src/external/cddl/osnet/lib/libumem: stub_stand.c Log Message: Addmissing symbols to libumem. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/lib/libumem/Makefile cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/lib/libumem/stub_stand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/lib/libumem
Module Name:src Committed By: haad Date: Sun Feb 28 22:50:48 UTC 2010 Added Files: src/external/cddl/osnet/lib/libumem: misc.h Log Message: Add forgotten misc.h header file, which I forgot to commit. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/lib/libumem/misc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/malta
Module Name:src Committed By: matt Date: Sun Feb 28 23:47:06 UTC 2010 Modified Files: src/sys/arch/evbmips/malta [matt-nb5-mips64]: machdep.c Log Message: Use cpu_startup_common. To generate a diff of this commit: cvs rdiff -u -r1.28.10.6 -r1.28.10.7 src/sys/arch/evbmips/malta/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/altq/libaltq
Module Name:src Committed By: joerg Date: Mon Mar 1 00:13:48 UTC 2010 Modified Files: src/usr.sbin/altq/libaltq: qop_hfsc.c Log Message: Use HUGE_VAL instead of INFINITY as positive infinity (or maximum value) is good enough and the side effects of ISO C99 7.12 (4) are not desired. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/altq/libaltq/qop_hfsc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/altq/libaltq
Module Name:src Committed By: joerg Date: Mon Mar 1 00:13:48 UTC 2010 Modified Files: src/usr.sbin/altq/libaltq: qop_hfsc.c Log Message: Use HUGE_VAL instead of INFINITY as positive infinity (or maximum value) is good enough and the side effects of ISO C99 7.12 (4) are not desired. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/altq/libaltq/qop_hfsc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/altq/libaltq/qop_hfsc.c diff -u src/usr.sbin/altq/libaltq/qop_hfsc.c:1.8 src/usr.sbin/altq/libaltq/qop_hfsc.c:1.9 --- src/usr.sbin/altq/libaltq/qop_hfsc.c:1.8 Thu Oct 12 19:59:13 2006 +++ src/usr.sbin/altq/libaltq/qop_hfsc.c Mon Mar 1 00:13:47 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: qop_hfsc.c,v 1.8 2006/10/12 19:59:13 peter Exp $ */ +/* $NetBSD: qop_hfsc.c,v 1.9 2010/03/01 00:13:47 joerg Exp $ */ /* $KAME: qop_hfsc.c,v 1.12 2005/01/05 04:53:47 itojun Exp $ */ /* * Copyright (C) 1999-2000 @@ -753,9 +753,6 @@ /* * admission control using generalized service curve */ -#ifndef INFINITY -#define INFINITY HUGE_VAL /* positive infinity defined in math.h */ -#endif /* add a new service curve to a generilized service curve */ static void @@ -765,7 +762,7 @@ return; if (sc-d != 0) gsc_add_seg(gsc, 0, 0, (double)sc-d, (double)sc-m1); - gsc_add_seg(gsc, (double)sc-d, 0, INFINITY, (double)sc-m2); + gsc_add_seg(gsc, (double)sc-d, 0, HUGE_VAL, (double)sc-m2); } /* subtract a service curve from a generilized service curve */ @@ -776,7 +773,7 @@ return; if (sc-d != 0) gsc_sub_seg(gsc, 0, 0, (double)sc-d, (double)sc-m1); - gsc_sub_seg(gsc, (double)sc-d, 0, INFINITY, (double)sc-m2); + gsc_sub_seg(gsc, (double)sc-d, 0, HUGE_VAL, (double)sc-m2); } /* @@ -800,10 +797,10 @@ return (1); } /* - * gsc has a dummy entry at the end with x = INFINITY. + * gsc has a dummy entry at the end with x = HUGE_VAL. * loop through up to this dummy entry. */ - end = gsc_getentry(gsc, INFINITY); + end = gsc_getentry(gsc, HUGE_VAL); if (end == NULL) return (1); last = NULL; @@ -860,10 +857,10 @@ return (NULL); new-x = x; - if (x == INFINITY || s == NULL) + if (x == HUGE_VAL || s == NULL) new-d = 0; - else if (s-x == INFINITY) - new-d = INFINITY; + else if (s-x == HUGE_VAL) + new-d = HUGE_VAL; else new-d = s-x - x; if (prev == NULL) { @@ -876,12 +873,12 @@ * the start point intersects with the segment pointed by * prev. divide prev into 2 segments */ - if (x == INFINITY) { - prev-d = INFINITY; + if (x == HUGE_VAL) { + prev-d = HUGE_VAL; if (prev-m == 0) new-y = prev-y; else -new-y = INFINITY; +new-y = HUGE_VAL; } else { prev-d = x - prev-x; new-y = prev-d * prev-m + prev-y; @@ -899,8 +896,8 @@ struct segment *start, *end, *s; double x2; - if (d == INFINITY) - x2 = INFINITY; + if (d == HUGE_VAL) + x2 = HUGE_VAL; else x2 = x + d; start = gsc_getentry(gsc, x); @@ -913,7 +910,7 @@ s-y += y + (s-x - x) * m; } - end = gsc_getentry(gsc, INFINITY); + end = gsc_getentry(gsc, HUGE_VAL); for (; s != end; s = LIST_NEXT(s, _next)) { s-y += m * d; } @@ -962,7 +959,7 @@ goto again; } else if (s-m == next-m) { /* join the two entries */ - if (s-d != INFINITY next-d != INFINITY) + if (s-d != HUGE_VAL next-d != HUGE_VAL) s-d += next-d; LIST_REMOVE(next, _next); free(next);
CVS commit: src/dist/pf/sbin/pfctl
Module Name:src Committed By: joerg Date: Mon Mar 1 00:14:08 UTC 2010 Modified Files: src/dist/pf/sbin/pfctl: pfctl_altq.c Log Message: Use HUGE_VAL instead of INFINITY as positive infinity (or maximum value) is good enough and the side effects of ISO C99 7.12 (4) are not desired. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/dist/pf/sbin/pfctl/pfctl_altq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/pf/sbin/pfctl
Module Name:src Committed By: joerg Date: Mon Mar 1 00:14:08 UTC 2010 Modified Files: src/dist/pf/sbin/pfctl: pfctl_altq.c Log Message: Use HUGE_VAL instead of INFINITY as positive infinity (or maximum value) is good enough and the side effects of ISO C99 7.12 (4) are not desired. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/dist/pf/sbin/pfctl/pfctl_altq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/pf/sbin/pfctl/pfctl_altq.c diff -u src/dist/pf/sbin/pfctl/pfctl_altq.c:1.8 src/dist/pf/sbin/pfctl/pfctl_altq.c:1.9 --- src/dist/pf/sbin/pfctl/pfctl_altq.c:1.8 Wed Jun 18 09:06:26 2008 +++ src/dist/pf/sbin/pfctl/pfctl_altq.c Mon Mar 1 00:14:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pfctl_altq.c,v 1.8 2008/06/18 09:06:26 yamt Exp $ */ +/* $NetBSD: pfctl_altq.c,v 1.9 2010/03/01 00:14:08 joerg Exp $ */ /* $OpenBSD: pfctl_altq.c,v 1.92 2007/05/27 05:15:17 claudio Exp $ */ /* @@ -881,9 +881,6 @@ /* * admission control using generalized service curve */ -#ifndef __NetBSD__ -#define INFINITY HUGE_VAL /* positive infinity defined in math.h */ -#endif /* !__NetBSD__ */ /* add a new service curve to a generalized service curve */ static void @@ -893,7 +890,7 @@ return; if (sc-d != 0) gsc_add_seg(gsc, 0.0, 0.0, (double)sc-d, (double)sc-m1); - gsc_add_seg(gsc, (double)sc-d, 0.0, INFINITY, (double)sc-m2); + gsc_add_seg(gsc, (double)sc-d, 0.0, HUGE_VAL, (double)sc-m2); } /* @@ -917,10 +914,10 @@ return (1); } /* - * gsc has a dummy entry at the end with x = INFINITY. + * gsc has a dummy entry at the end with x = HUGE_VAL. * loop through up to this dummy entry. */ - end = gsc_getentry(gsc, INFINITY); + end = gsc_getentry(gsc, HUGE_VAL); if (end == NULL) return (1); last = NULL; @@ -977,10 +974,10 @@ return (NULL); new-x = x; - if (x == INFINITY || s == NULL) + if (x == HUGE_VAL || s == NULL) new-d = 0; - else if (s-x == INFINITY) - new-d = INFINITY; + else if (s-x == HUGE_VAL) + new-d = HUGE_VAL; else new-d = s-x - x; if (prev == NULL) { @@ -993,12 +990,12 @@ * the start point intersects with the segment pointed by * prev. divide prev into 2 segments */ - if (x == INFINITY) { - prev-d = INFINITY; + if (x == HUGE_VAL) { + prev-d = HUGE_VAL; if (prev-m == 0) new-y = prev-y; else -new-y = INFINITY; +new-y = HUGE_VAL; } else { prev-d = x - prev-x; new-y = prev-d * prev-m + prev-y; @@ -1016,8 +1013,8 @@ struct segment *start, *end, *s; double x2; - if (d == INFINITY) - x2 = INFINITY; + if (d == HUGE_VAL) + x2 = HUGE_VAL; else x2 = x + d; start = gsc_getentry(gsc, x); @@ -1030,7 +1027,7 @@ s-y += y + (s-x - x) * m; } - end = gsc_getentry(gsc, INFINITY); + end = gsc_getentry(gsc, HUGE_VAL); for (; s != end; s = LIST_NEXT(s, _next)) { s-y += m * d; }
CVS commit: src/external/cddl/osnet/sys/sys
Module Name:src Committed By: haad Date: Mon Mar 1 00:41:36 UTC 2010 Added Files: src/external/cddl/osnet/sys/sys: bootprops.h priv_impl.h sysdc.h unistd.h Log Message: Add header files needed for building zfs as kernel_module. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/cddl/osnet/sys/sys/bootprops.h \ src/external/cddl/osnet/sys/sys/priv_impl.h \ src/external/cddl/osnet/sys/sys/sysdc.h \ src/external/cddl/osnet/sys/sys/unistd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/cddl/osnet/sys/sys/priv_impl.h diff -u /dev/null src/external/cddl/osnet/sys/sys/priv_impl.h:1.1 --- /dev/null Mon Mar 1 00:41:36 2010 +++ src/external/cddl/osnet/sys/sys/priv_impl.h Mon Mar 1 00:41:35 2010 @@ -0,0 +1,6 @@ +#ifndef _PRIV_IMPL_H_ +#define _PRIV_IMPL_H_ + + + +#endif Index: src/external/cddl/osnet/sys/sys/unistd.h diff -u /dev/null src/external/cddl/osnet/sys/sys/unistd.h:1.1 --- /dev/null Mon Mar 1 00:41:36 2010 +++ src/external/cddl/osnet/sys/sys/unistd.h Mon Mar 1 00:41:35 2010 @@ -0,0 +1,17 @@ + +#include_next sys/unistd.h + +#define _PC_ACL_ENABLED 20 +#define _PC_SATTR_ENABLED 23 +#define _PC_SATTR_EXISTS24 +#define _PC_ACCESS_FILTERING25 +/* UNIX 08 names */ +#define _PC_TIMESTAMP_RESOLUTION 26 + + +/* + * The value of 0 is returned when + * ACL's are not supported + */ +#define _ACL_ACLENT_ENABLED 0x1 +#define _ACL_ACE_ENABLED0x2
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: jym Date: Mon Mar 1 00:55:33 UTC 2010 Modified Files: src/sys/arch/i386/include: pmap.h Log Message: Use PDP_SIZE for NTOPLEVEL_PDES (number of top level PDEs) instead of #ifdef'ing PAE. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/i386/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/include
Module Name:src Committed By: jym Date: Mon Mar 1 00:55:33 UTC 2010 Modified Files: src/sys/arch/i386/include: pmap.h Log Message: Use PDP_SIZE for NTOPLEVEL_PDES (number of top level PDEs) instead of #ifdef'ing PAE. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/arch/i386/include/pmap.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/i386/include/pmap.h diff -u src/sys/arch/i386/include/pmap.h:1.104 src/sys/arch/i386/include/pmap.h:1.105 --- src/sys/arch/i386/include/pmap.h:1.104 Tue Feb 9 22:51:13 2010 +++ src/sys/arch/i386/include/pmap.h Mon Mar 1 00:55:33 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.104 2010/02/09 22:51:13 jym Exp $ */ +/* $NetBSD: pmap.h,v 1.105 2010/03/01 00:55:33 jym Exp $ */ /* * @@ -279,11 +279,7 @@ #define NKL2_START_ENTRIES 0 /* XXX computed on runtime */ #define NKL1_START_ENTRIES 0 /* XXX unused */ -#ifdef PAE -#define NTOPLEVEL_PDES (PAGE_SIZE * 4 / (sizeof (pd_entry_t))) -#else -#define NTOPLEVEL_PDES (PAGE_SIZE / (sizeof (pd_entry_t))) -#endif +#define NTOPLEVEL_PDES (PAGE_SIZE * PDP_SIZE / (sizeof (pd_entry_t))) #define NPDPG (PAGE_SIZE / sizeof (pd_entry_t))
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: macallan Date: Mon Mar 1 01:14:58 UTC 2010 Modified Files: src/sys/arch/sparc64/sparc64: autoconf.c Log Message: Don't call frame-buffer-adr since it doesn't work as expected by the code that got cargo culted over from macppc. While there shut up some leftover debug printf. To generate a diff of this commit: cvs rdiff -u -r1.170 -r1.171 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/autoconf.c diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.170 src/sys/arch/sparc64/sparc64/autoconf.c:1.171 --- src/sys/arch/sparc64/sparc64/autoconf.c:1.170 Sun Feb 28 13:59:05 2010 +++ src/sys/arch/sparc64/sparc64/autoconf.c Mon Mar 1 01:14:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.170 2010/02/28 13:59:05 martin Exp $ */ +/* $NetBSD: autoconf.c,v 1.171 2010/03/01 01:14:58 macallan Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.170 2010/02/28 13:59:05 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.171 2010/03/01 01:14:58 macallan Exp $); #include opt_ddb.h #include opt_kgdb.h @@ -1128,8 +1128,6 @@ prop_dictionary_set_uint32(dict, depth, 8); } OF_getprop(console_node, address, fbaddr, sizeof(fbaddr)); - if (fbaddr == 0) - OF_interpret(frame-buffer-adr, 0, 1, fbaddr); if (fbaddr != 0) { pmap_extract(pmap_kernel(), fbaddr, fbpa); @@ -1164,7 +1162,6 @@ return; if (OF_getprop(options, output-device, output_device, 256) == 0) return; - printf(output-device: %s\n, output_device); /* find the mode string if there is one */ pos = strstr(output_device, :r); if (pos == NULL)
CVS commit: src/sys/arch/i386
Module Name:src Committed By: jym Date: Mon Mar 1 01:15:24 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c rbus_machdep.c src/sys/arch/i386/include: rbus_machdep.h Log Message: Change rbus_min_start_hint() semantic for i386. ram is now psize_t (instead of size_t) to avoid possible overflow when system may have more than 4GB of memory (like PAE). The behavior of rbus_min_start_hint() remains the same. While here, fix printf's format strings (paddr_t = PRIxPADDR). Use ctob() and cast physmem to psize_t to avoid losing bits above 4GB. Comes from PAE patch from Jeremy Morse; adaptation by me. Compile tested for GENERIC only. No regression expected. To generate a diff of this commit: cvs rdiff -u -r1.682 -r1.683 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/i386/i386/rbus_machdep.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/include/rbus_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/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.682 src/sys/arch/i386/i386/machdep.c:1.683 --- src/sys/arch/i386/i386/machdep.c:1.682 Mon Feb 8 19:02:29 2010 +++ src/sys/arch/i386/i386/machdep.c Mon Mar 1 01:15:23 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.682 2010/02/08 19:02:29 joerg Exp $ */ +/* $NetBSD: machdep.c,v 1.683 2010/03/01 01:15:23 jym Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 @@ -67,7 +67,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.682 2010/02/08 19:02:29 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.683 2010/03/01 01:15:23 jym Exp $); #include opt_beep.h #include opt_compat_ibcs2.h @@ -481,7 +481,7 @@ #if NCARDBUS 0 /* Tell RBUS how much RAM we have, so it can use heuristics. */ - rbus_min_start_hint(ptoa(physmem)); + rbus_min_start_hint(ctob((psize_t)physmem)); #endif minaddr = 0; Index: src/sys/arch/i386/i386/rbus_machdep.c diff -u src/sys/arch/i386/i386/rbus_machdep.c:1.24 src/sys/arch/i386/i386/rbus_machdep.c:1.25 --- src/sys/arch/i386/i386/rbus_machdep.c:1.24 Tue Dec 15 22:17:12 2009 +++ src/sys/arch/i386/i386/rbus_machdep.c Mon Mar 1 01:15:24 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rbus_machdep.c,v 1.24 2009/12/15 22:17:12 snj Exp $ */ +/* $NetBSD: rbus_machdep.c,v 1.25 2010/03/01 01:15:24 jym Exp $ */ /* * Copyright (c) 1999 @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rbus_machdep.c,v 1.24 2009/12/15 22:17:12 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: rbus_machdep.c,v 1.25 2010/03/01 01:15:24 jym Exp $); #include opt_pcibios.h #include opt_pcifixup.h @@ -82,10 +82,10 @@ * or 2046 vs 2048. */ void -rbus_min_start_hint(size_t ram) +rbus_min_start_hint(psize_t ram) { #ifdef RBUS_MIN_START_FORCED - aprint_debug(rbus: rbus_min_start from config at 0x%0lx\n, + aprint_debug(rbus: rbus_min_start from config at %#0 PRIxPADDR \n, rbus_min_start); #else if (ram = 192*1024*1024UL) { @@ -113,7 +113,7 @@ rbus_min_start = 3 * 1024 * 1024 * 1024UL; } - aprint_debug(rbus: rbus_min_start set to 0x%0lx\n, + aprint_debug(rbus: rbus_min_start set to %#0 PRIxPADDR \n, rbus_min_start); #endif } Index: src/sys/arch/i386/include/rbus_machdep.h diff -u src/sys/arch/i386/include/rbus_machdep.h:1.8 src/sys/arch/i386/include/rbus_machdep.h:1.9 --- src/sys/arch/i386/include/rbus_machdep.h:1.8 Tue Dec 15 22:17:12 2009 +++ src/sys/arch/i386/include/rbus_machdep.h Mon Mar 1 01:15:24 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rbus_machdep.h,v 1.8 2009/12/15 22:17:12 snj Exp $ */ +/* $NetBSD: rbus_machdep.h,v 1.9 2010/03/01 01:15:24 jym Exp $ */ /* * Copyright (c) 1999 @@ -40,6 +40,6 @@ rbus_tag_t rbus_pccbb_parent_io(struct pci_attach_args *); rbus_tag_t rbus_pccbb_parent_mem(struct pci_attach_args *); -void rbus_min_start_hint(size_t); +void rbus_min_start_hint(psize_t); #endif /* _ARCH_I386_I386_RBUS_MACHDEP_H_ */
CVS commit: src/sys/arch/i386
Module Name:src Committed By: jym Date: Mon Mar 1 01:15:24 UTC 2010 Modified Files: src/sys/arch/i386/i386: machdep.c rbus_machdep.c src/sys/arch/i386/include: rbus_machdep.h Log Message: Change rbus_min_start_hint() semantic for i386. ram is now psize_t (instead of size_t) to avoid possible overflow when system may have more than 4GB of memory (like PAE). The behavior of rbus_min_start_hint() remains the same. While here, fix printf's format strings (paddr_t = PRIxPADDR). Use ctob() and cast physmem to psize_t to avoid losing bits above 4GB. Comes from PAE patch from Jeremy Morse; adaptation by me. Compile tested for GENERIC only. No regression expected. To generate a diff of this commit: cvs rdiff -u -r1.682 -r1.683 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/i386/i386/rbus_machdep.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/include/rbus_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: jym Date: Mon Mar 1 01:35:11 UTC 2010 Modified Files: src/sys/arch/amd64/amd64: machdep.c src/sys/arch/i386/i386: machdep.c Log Message: Do not forget that ptoa() casts the result to vaddr_t, which is bad for paddr_t values under i386 PAE. Use ctob() instead. Although amd64 is not affected by this vaddr_t vs paddr_t issue (both having the same size), for the sake of completeness, switch to ctob() when manipulating paddr_t/psize_t entities in amd64 machdep.c. Compile tested for i386 and amd64. No regression expected. To generate a diff of this commit: cvs rdiff -u -r1.142 -r1.143 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.683 -r1.684 src/sys/arch/i386/i386/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/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.142 src/sys/arch/amd64/amd64/machdep.c:1.143 --- src/sys/arch/amd64/amd64/machdep.c:1.142 Mon Feb 8 19:02:26 2010 +++ src/sys/arch/amd64/amd64/machdep.c Mon Mar 1 01:35:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.142 2010/02/08 19:02:26 joerg Exp $ */ +/* $NetBSD: machdep.c,v 1.143 2010/03/01 01:35:11 jym Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008 @@ -107,7 +107,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.142 2010/02/08 19:02:26 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.143 2010/03/01 01:35:11 jym Exp $); /* #define XENDEBUG_LOW */ @@ -906,7 +906,7 @@ if ((error = cpu_dump()) != 0) goto err; - totalbytesleft = ptoa(cpu_dump_mempagecnt()); + totalbytesleft = ctob(cpu_dump_mempagecnt()); blkno = dumplo + cpu_dumpsize(); dump = bdev-d_dump; error = 0; @@ -1151,7 +1151,7 @@ for (x = 0; x vm_nphysseg; x++) { vps = vm_physmem[x]; - if (ptoa(vps-avail_end) == avail_end) + if (ctob(vps-avail_end) == avail_end) break; } if (x == vm_nphysseg) @@ -1159,12 +1159,12 @@ /* Shrink so it'll fit in the last segment. */ if ((vps-avail_end - vps-avail_start) atop(sz)) - sz = ptoa(vps-avail_end - vps-avail_start); + sz = ctob(vps-avail_end - vps-avail_start); vps-avail_end -= atop(sz); vps-end -= atop(sz); msgbuf_p_seg[msgbuf_p_cnt].sz = sz; -msgbuf_p_seg[msgbuf_p_cnt++].paddr = ptoa(vps-avail_end); +msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(vps-avail_end); /* Remove the last segment if it now has no pages. */ if (vps-start == vps-end) { @@ -1176,7 +1176,7 @@ for (avail_end = 0, x = 0; x vm_nphysseg; x++) if (vm_physmem[x].avail_end avail_end) avail_end = vm_physmem[x].avail_end; - avail_end = ptoa(avail_end); + avail_end = ctob(avail_end); if (sz == reqsz) return; @@ -1293,7 +1293,7 @@ /* Determine physical address space */ avail_start = first_avail; - avail_end = ptoa(xen_start_info.nr_pages); + avail_end = ctob(xen_start_info.nr_pages); pmap_pa_start = (KERNTEXTOFF - KERNBASE); pmap_pa_end = avail_end; __PRINTK((pmap_pa_start 0x%lx avail_start 0x%lx avail_end 0x%lx\n, Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.683 src/sys/arch/i386/i386/machdep.c:1.684 --- src/sys/arch/i386/i386/machdep.c:1.683 Mon Mar 1 01:15:23 2010 +++ src/sys/arch/i386/i386/machdep.c Mon Mar 1 01:35:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.683 2010/03/01 01:15:23 jym Exp $ */ +/* $NetBSD: machdep.c,v 1.684 2010/03/01 01:35:11 jym Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 @@ -67,7 +67,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.683 2010/03/01 01:15:23 jym Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.684 2010/03/01 01:35:11 jym Exp $); #include opt_beep.h #include opt_compat_ibcs2.h @@ -1188,7 +1188,7 @@ vps = NULL; for (x = 0; x vm_nphysseg; ++x) { vps = vm_physmem[x]; - if (ptoa(vps-avail_end) == avail_end) { + if (ctob(vps-avail_end) == avail_end) { break; } } @@ -1197,12 +1197,12 @@ /* Shrink so it'll fit in the last segment. */ if (vps-avail_end - vps-avail_start atop(sz)) - sz = ptoa(vps-avail_end - vps-avail_start); + sz = ctob(vps-avail_end - vps-avail_start); vps-avail_end -= atop(sz); vps-end -= atop(sz); msgbuf_p_seg[msgbuf_p_cnt].sz = sz; - msgbuf_p_seg[msgbuf_p_cnt++].paddr = ptoa(vps-avail_end); + msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(vps-avail_end); /* Remove the last segment if it now has no pages. */ if (vps-start == vps-end) { @@ -1214,7 +1214,7 @@ for (avail_end = 0, x = 0; x vm_nphysseg; x++) if (vm_physmem[x].avail_end avail_end) avail_end = vm_physmem[x].avail_end; - avail_end = ptoa(avail_end); + avail_end = ctob(avail_end); if (sz == reqsz) return; @@ -1386,7 +1386,7 @@ /* Make sure the end of the space used by the kernel is rounded. */ first_avail = round_page(first_avail);
CVS commit: src/lib/libterminfo
Module Name:src Committed By: dholland Date: Mon Mar 1 01:59:48 UTC 2010 Modified Files: src/lib/libterminfo: compile.c Log Message: compile.c needs sys/endian.h; PR 42875 from Henning Petersen. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libterminfo/compile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.2 src/lib/libterminfo/compile.c:1.3 --- src/lib/libterminfo/compile.c:1.2 Thu Feb 25 23:44:02 2010 +++ src/lib/libterminfo/compile.c Mon Mar 1 01:59:48 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.2 2010/02/25 23:44:02 roy Exp $ */ +/* $NetBSD: compile.c,v 1.3 2010/03/01 01:59:48 dholland Exp $ */ /* * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc. @@ -32,7 +32,11 @@ #endif #include sys/cdefs.h -__RCSID($NetBSD: compile.c,v 1.2 2010/02/25 23:44:02 roy Exp $); +__RCSID($NetBSD: compile.c,v 1.3 2010/03/01 01:59:48 dholland Exp $); + +#if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H +#include sys/endian.h +#endif #include assert.h #include ctype.h
CVS commit: src/lib/libterminfo
Module Name:src Committed By: dholland Date: Mon Mar 1 01:59:48 UTC 2010 Modified Files: src/lib/libterminfo: compile.c Log Message: compile.c needs sys/endian.h; PR 42875 from Henning Petersen. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libterminfo/compile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: pgoyette Date: Mon Mar 1 03:14:49 UTC 2010 Modified Files: src/sys/dev/i2c: dbcool.c dbcool_var.h Log Message: Now that sysmon_envsys(8) has learned how to retrieve and update sensor limit values from the device driver, remove the high_limit and low_limit entries from the hw.dbcool#.sensor sysctl(8) tree. These limits are now directly accessible via envstat(8). Simplify the remaining code somewhat. No objections raised on either tech-kern@ or current-users@ XXX The fan controllers's parameters (including those that are tied to XXX temperature sensors) are still in sysctl, since there isn't any clean XXX way to implement the fan controllers in sysmon_envsys yet. It is on XXX my To-Do list... To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/dev/i2c/dbcool.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/dbcool_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: pgoyette Date: Mon Mar 1 03:14:49 UTC 2010 Modified Files: src/sys/dev/i2c: dbcool.c dbcool_var.h Log Message: Now that sysmon_envsys(8) has learned how to retrieve and update sensor limit values from the device driver, remove the high_limit and low_limit entries from the hw.dbcool#.sensor sysctl(8) tree. These limits are now directly accessible via envstat(8). Simplify the remaining code somewhat. No objections raised on either tech-kern@ or current-users@ XXX The fan controllers's parameters (including those that are tied to XXX temperature sensors) are still in sysctl, since there isn't any clean XXX way to implement the fan controllers in sysmon_envsys yet. It is on XXX my To-Do list... To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/dev/i2c/dbcool.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/dbcool_var.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/i2c/dbcool.c diff -u src/sys/dev/i2c/dbcool.c:1.17 src/sys/dev/i2c/dbcool.c:1.18 --- src/sys/dev/i2c/dbcool.c:1.17 Fri Feb 26 18:16:18 2010 +++ src/sys/dev/i2c/dbcool.c Mon Mar 1 03:14:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dbcool.c,v 1.17 2010/02/26 18:16:18 pgoyette Exp $ */ +/* $NetBSD: dbcool.c,v 1.18 2010/03/01 03:14:49 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: dbcool.c,v 1.17 2010/02/26 18:16:18 pgoyette Exp $); +__KERNEL_RCSID(0, $NetBSD: dbcool.c,v 1.18 2010/03/01 03:14:49 pgoyette Exp $); #include sys/param.h #include sys/systm.h @@ -78,6 +78,25 @@ static int dbcool_read_temp(struct dbcool_softc *, uint8_t, bool); static int dbcool_read_volt(struct dbcool_softc *, uint8_t, int, bool); +/* Sensor get/set limit functions */ +static void dbcool_get_limits(struct sysmon_envsys *, envsys_data_t *, + sysmon_envsys_lim_t *, uint32_t *); +static void dbcool_get_temp_limits(struct dbcool_softc *, int, + sysmon_envsys_lim_t *, uint32_t *); +static void dbcool_get_volt_limits(struct dbcool_softc *, int, + sysmon_envsys_lim_t *, uint32_t *); +static void dbcool_get_fan_limits(struct dbcool_softc *, int, + sysmon_envsys_lim_t *, uint32_t *); + +static void dbcool_set_limits(struct sysmon_envsys *, envsys_data_t *, + sysmon_envsys_lim_t *, uint32_t *); +static void dbcool_set_temp_limits(struct dbcool_softc *, int, + sysmon_envsys_lim_t *, uint32_t *); +static void dbcool_set_volt_limits(struct dbcool_softc *, int, + sysmon_envsys_lim_t *, uint32_t *); +static void dbcool_set_fan_limits(struct dbcool_softc *, int, + sysmon_envsys_lim_t *, uint32_t *); + /* SYSCTL Helpers */ static int sysctl_dbcool_temp(SYSCTLFN_PROTO); static int sysctl_adm1030_temp(SYSCTLFN_PROTO); @@ -85,18 +104,14 @@ static int sysctl_dbcool_duty(SYSCTLFN_PROTO); static int sysctl_dbcool_behavior(SYSCTLFN_PROTO); static int sysctl_dbcool_slope(SYSCTLFN_PROTO); -static int sysctl_dbcool_volt_limit(SYSCTLFN_PROTO); -static int sysctl_dbcool_temp_limit(SYSCTLFN_PROTO); -static int sysctl_dbcool_fan_limit(SYSCTLFN_PROTO); static int sysctl_dbcool_thyst(SYSCTLFN_PROTO); /* Set-up subroutines */ -static void dbcool_setup_controllers(struct dbcool_softc *, - const struct sysctlnode *, int, int); -static int dbcool_setup_sensors(struct dbcool_softc *, - const struct sysctlnode *, int, int); -static int dbcool_attach_sensor(struct dbcool_softc *, - const struct sysctlnode *, int, int (*)(SYSCTLFN_PROTO)); +static void dbcool_setup_controllers(struct dbcool_softc *); +static int dbcool_setup_sensors(struct dbcool_softc *); +static int dbcool_attach_sensor(struct dbcool_softc *, int); +static int dbcool_attach_temp_control(struct dbcool_softc *, int, + struct chip_id *); #ifdef DBCOOL_DEBUG static int sysctl_dbcool_reg_select(SYSCTLFN_PROTO); @@ -1211,141 +1226,6 @@ } static int -sysctl_dbcool_volt_limit(SYSCTLFN_ARGS) -{ - struct sysctlnode node; - struct dbcool_softc *sc; - int reg, error; - int nom, sensor_index; - int64_t val, newval; - uint8_t chipreg, newreg; - - node = *rnode; - sc = (struct dbcool_softc *)node.sysctl_data; - chipreg = node.sysctl_num 0xff; - - /* - * Retrieve the nominal value for the voltage sensor - */ - sensor_index = (node.sysctl_num 8 ) 0xff; - nom = nominal_voltages[sc-sc_dc.dc_chip-table[sensor_index].nom_volt_index]; - if (nom 0) - nom = dbcool_supply_voltage(sc); - - /* - * Use int64_t for calculation to avoid overflow - */ - val = sc-sc_dc.dc_readreg(sc-sc_dc, chipreg); - val *= nom; - val /= 0xc0; /* values are scaled so 0xc0 == nominal voltage */ - reg = val; - node.sysctl_data = reg; - error = sysctl_lookup(SYSCTLFN_CALL(node)); - - if (error || newp == NULL) - return error; - - /* - * We were asked to update the value, so scale it and sanity - * check before writing - */ - if
CVS commit: src/share/man/man4
Module Name:src Committed By: pgoyette Date: Mon Mar 1 03:15:16 UTC 2010 Modified Files: src/share/man/man4: dbcool.4 Log Message: Update for changes in sensor limit handling To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/dbcool.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/sbus
Module Name:src Committed By: macallan Date: Mon Mar 1 05:26:53 UTC 2010 Modified Files: src/sys/dev/sbus: p9100.c Log Message: fix ancient typo, noticed by mouse@ To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/dev/sbus/p9100.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/sbus
Module Name:src Committed By: macallan Date: Mon Mar 1 05:26:53 UTC 2010 Modified Files: src/sys/dev/sbus: p9100.c Log Message: fix ancient typo, noticed by mouse@ To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/dev/sbus/p9100.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/sbus/p9100.c diff -u src/sys/dev/sbus/p9100.c:1.52 src/sys/dev/sbus/p9100.c:1.53 --- src/sys/dev/sbus/p9100.c:1.52 Wed Feb 24 22:38:08 2010 +++ src/sys/dev/sbus/p9100.c Mon Mar 1 05:26:53 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: p9100.c,v 1.52 2010/02/24 22:38:08 dyoung Exp $ */ +/* $NetBSD: p9100.c,v 1.53 2010/03/01 05:26:53 macallan Exp $ */ /*- * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: p9100.c,v 1.52 2010/02/24 22:38:08 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: p9100.c,v 1.53 2010/03/01 05:26:53 macallan Exp $); #include sys/param.h #include sys/systm.h @@ -256,7 +256,7 @@ }; #endif -#define PNOZZ_LATCH(sc, off) if(sc-sc_last_offset == (off 0xff80)) { \ +#define PNOZZ_LATCH(sc, off) if(sc-sc_last_offset != (off 0xff80)) { \ sc-sc_junk = bus_space_read_4(sc-sc_bustag, sc-sc_fb_memh, \ off); \ sc-sc_last_offset = off 0xff80; }
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jruoho Date: Mon Mar 1 05:37:37 UTC 2010 Modified Files: src/sys/dev/acpi: smbus_acpi.c Log Message: Semantics: * Use ACPI_ADR_PCI_DEV(x) and ACPI_ADR_PCI_FUNC(x). * !ACPI_FAILURE - ACPI_SUCCESS, UINT32 - uint32_t * Remove whitespace. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/smbus_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: jruoho Date: Mon Mar 1 05:37:37 UTC 2010 Modified Files: src/sys/dev/acpi: smbus_acpi.c Log Message: Semantics: * Use ACPI_ADR_PCI_DEV(x) and ACPI_ADR_PCI_FUNC(x). * !ACPI_FAILURE - ACPI_SUCCESS, UINT32 - uint32_t * Remove whitespace. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/smbus_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/smbus_acpi.c diff -u src/sys/dev/acpi/smbus_acpi.c:1.1 src/sys/dev/acpi/smbus_acpi.c:1.2 --- src/sys/dev/acpi/smbus_acpi.c:1.1 Sat Feb 6 20:10:18 2010 +++ src/sys/dev/acpi/smbus_acpi.c Mon Mar 1 05:37:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: smbus_acpi.c,v 1.1 2010/02/06 20:10:18 pgoyette Exp $ */ +/* $NetBSD: smbus_acpi.c,v 1.2 2010/03/01 05:37:37 jruoho Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: smbus_acpi.c,v 1.1 2010/02/06 20:10:18 pgoyette Exp $); +__KERNEL_RCSID(0, $NetBSD: smbus_acpi.c,v 1.2 2010/03/01 05:37:37 jruoho Exp $); #include sys/param.h #include sys/systm.h @@ -84,14 +84,14 @@ static int acpi_smbus_match(device_t, cfdata_t, void *); static void acpi_smbus_attach(device_t, device_t, void *); -static int acpi_smbus_detach(device_t, int); +static int acpi_smbus_detach(device_t, int); static int acpi_smbus_acquire_bus(void *, int); static void acpi_smbus_release_bus(void *, int); static int acpi_smbus_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t, void *, size_t, int); static void acpi_smbus_alerts(struct acpi_smbus_softc *); static void acpi_smbus_tick(void *); -static void acpi_smbus_notify_handler(ACPI_HANDLE, UINT32, void *); +static void acpi_smbus_notify_handler(ACPI_HANDLE, uint32_t, void *); struct SMB_UDID { uint8_t dev_cap; @@ -203,7 +203,7 @@ /* Retrieve polling interval for SMBus Alerts */ rv = acpi_eval_struct(aa-aa_node-ad_handle, _SBI, smi_buf); - if (!ACPI_FAILURE(rv)) { + if (ACPI_SUCCESS(rv)) { p = smi_buf.Pointer; if (p != NULL p-Type == ACPI_TYPE_PACKAGE p-Package.Count = 2) { @@ -242,17 +242,17 @@ * Retrieve and display native controller info */ rv = AcpiGetParent(sc-sc_devnode-ad_handle, native_dev); - if (!ACPI_FAILURE(rv)) + if (ACPI_SUCCESS(rv)) rv = AcpiGetParent(native_dev, native_bus); - if (!ACPI_FAILURE(rv)) + if (ACPI_SUCCESS(rv)) rv = AcpiGetObjectInfo(native_bus, native_bus_info); - if (!ACPI_FAILURE(rv) + if (ACPI_SUCCESS(rv) acpi_match_hid(native_bus_info, pcibus_acpi_ids) != 0) { rv = AcpiGetObjectInfo(native_dev, native_dev_info); - if (!ACPI_FAILURE(rv)) { + if (ACPI_SUCCESS(rv)) { pci_bus = native_bus_info-Address; - pci_dev = (native_dev_info-Address 16) 0x; - pci_func = native_dev_info-Address 0x; + pci_dev = ACPI_ADR_PCI_DEV(native_dev_info-Address); + pci_func = ACPI_ADR_PCI_FUNC(native_dev_info-Address); aprint_debug_dev(self, Native i2c host controller is on PCI bus %d dev %d func %d\n, pci_bus, pci_dev, pci_func); @@ -269,11 +269,11 @@ } static int -acpi_smbus_detach(device_t self, int flags) +acpi_smbus_detach(device_t self, int flags) { struct acpi_smbus_softc *sc = device_private(self); ACPI_STATUS rv; - + pmf_device_deregister(self); callout_halt(sc-sc_callout, NULL); @@ -288,7 +288,7 @@ } mutex_destroy(sc-sc_i2c_mutex); - + return 0; } @@ -296,16 +296,16 @@ acpi_smbus_acquire_bus(void *cookie, int flags) { struct acpi_smbus_softc *sc = cookie; - + mutex_enter(sc-sc_i2c_mutex); return 0; -} - +} + static void acpi_smbus_release_bus(void *cookie, int flags) -{ +{ struct acpi_smbus_softc *sc = cookie; - + mutex_exit(sc-sc_i2c_mutex); } static int @@ -485,7 +485,7 @@ } static void -acpi_smbus_notify_handler(ACPI_HANDLE hdl, UINT32 notify, void *opaque) +acpi_smbus_notify_handler(ACPI_HANDLE hdl, uint32_t notify, void *opaque) { device_t dv = opaque; struct acpi_smbus_softc *sc = device_private(dv);
CVS commit: src/sys/dev/sbus
Module Name:src Committed By: macallan Date: Mon Mar 1 05:42:08 UTC 2010 Modified Files: src/sys/dev/sbus: files.sbus p9100.c Log Message: make latching optional. The SPARCbook docs claim it's necessary but my 3GX happily works without. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sbus/files.sbus cvs rdiff -u -r1.53 -r1.54 src/sys/dev/sbus/p9100.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/sbus
Module Name:src Committed By: macallan Date: Mon Mar 1 05:42:08 UTC 2010 Modified Files: src/sys/dev/sbus: files.sbus p9100.c Log Message: make latching optional. The SPARCbook docs claim it's necessary but my 3GX happily works without. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sbus/files.sbus cvs rdiff -u -r1.53 -r1.54 src/sys/dev/sbus/p9100.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/sbus/files.sbus diff -u src/sys/dev/sbus/files.sbus:1.34 src/sys/dev/sbus/files.sbus:1.35 --- src/sys/dev/sbus/files.sbus:1.34 Wed Jan 27 21:01:33 2010 +++ src/sys/dev/sbus/files.sbus Mon Mar 1 05:42:08 2010 @@ -1,4 +1,4 @@ -# $NetBSD: files.sbus,v 1.34 2010/01/27 21:01:33 macallan Exp $ +# $NetBSD: files.sbus,v 1.35 2010/03/01 05:42:08 macallan Exp $ # # Config file and device description for machine-independent SBUS code. # Included by ports that need it. @@ -126,6 +126,7 @@ # Tadpole 3GX/3GS (P9100 -- P Nine One Zero Zero - pnozz) defflag opt_pnozz.h PNOZZ_DEBUG defflag opt_pnozz.h PNOZZ_EMUL_CG3 +defflag opt_pnozz.h PNOZZ_USE_LATCH device pnozz: fb, rasops8, bt_dac, wsemuldisplaydev, vcons attach pnozz at sbus file dev/sbus/p9100.c pnozz needs-flag Index: src/sys/dev/sbus/p9100.c diff -u src/sys/dev/sbus/p9100.c:1.53 src/sys/dev/sbus/p9100.c:1.54 --- src/sys/dev/sbus/p9100.c:1.53 Mon Mar 1 05:26:53 2010 +++ src/sys/dev/sbus/p9100.c Mon Mar 1 05:42:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: p9100.c,v 1.53 2010/03/01 05:26:53 macallan Exp $ */ +/* $NetBSD: p9100.c,v 1.54 2010/03/01 05:42:08 macallan Exp $ */ /*- * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: p9100.c,v 1.53 2010/03/01 05:26:53 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: p9100.c,v 1.54 2010/03/01 05:42:08 macallan Exp $); #include sys/param.h #include sys/systm.h @@ -110,8 +110,9 @@ bus_addr_t sc_fb_paddr; /* phys address description */ bus_size_t sc_fb_psize; /* for device mmap() */ +#ifdef PNOZZ_USE_LATCH bus_space_handle_t sc_fb_memh; /* bus space handle */ - +#endif volatile uint32_t sc_junk; uint32_t sc_mono_width; /* for setup_mono */ @@ -256,10 +257,14 @@ }; #endif +#ifdef PNOZZ_USE_LATCH #define PNOZZ_LATCH(sc, off) if(sc-sc_last_offset != (off 0xff80)) { \ sc-sc_junk = bus_space_read_4(sc-sc_bustag, sc-sc_fb_memh, \ off); \ sc-sc_last_offset = off 0xff80; } +#else +#define PNOZZ_LATCH(a, b) +#endif /* * Match a p9100. @@ -338,7 +343,9 @@ * P9100 - all register accesses need to be 'latched in' whenever we * go to another 0x80 aligned 'page' by reading the framebuffer at the * same offset + * XXX apparently the latter isn't true - my SP3GX works fine without */ +#ifdef PNOZZ_USE_LATCH if (fb-fb_pixels == NULL) { if (sbus_bus_map(sc-sc_bustag, sa-sa_reg[2].oa_space, @@ -354,6 +361,7 @@ } else { sc-sc_fb_memh = (bus_space_handle_t) fb-fb_pixels; } +#endif sc-sc_width = prom_getpropint(node, width, 800); sc-sc_height = prom_getpropint(node, height, 600); sc-sc_depth = prom_getpropint(node, depth, 8) 3; @@ -1217,9 +1225,10 @@ ri-ri_stride = sc-sc_stride; ri-ri_flg = RI_CENTER | RI_FULLCLEAR; +#ifdef PNOZZ_USE_LATCH ri-ri_bits = bus_space_vaddr(sc-sc_bustag, sc-sc_fb_memh); - DPRINTF(addr: %08lx\n,(ulong)ri-ri_bits); +#endif rasops_init(ri, sc-sc_height/8, sc-sc_width/8); ri-ri_caps = WSSCREEN_WSCOLORS;
CVS commit: src/sys/arch/sparc/conf
Module Name:src Committed By: macallan Date: Mon Mar 1 06:14:17 UTC 2010 Modified Files: src/sys/arch/sparc/conf: GENERIC INSTALL Log Message: enable PNOZZ_USE_LATCH in case we run into some hardware which needs it To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/arch/sparc/conf/GENERIC cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/conf/INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/sparc/conf
Module Name:src Committed By: macallan Date: Mon Mar 1 06:14:17 UTC 2010 Modified Files: src/sys/arch/sparc/conf: GENERIC INSTALL Log Message: enable PNOZZ_USE_LATCH in case we run into some hardware which needs it To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/arch/sparc/conf/GENERIC cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/conf/INSTALL 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/sparc/conf/GENERIC diff -u src/sys/arch/sparc/conf/GENERIC:1.219 src/sys/arch/sparc/conf/GENERIC:1.220 --- src/sys/arch/sparc/conf/GENERIC:1.219 Fri Jan 15 20:57:12 2010 +++ src/sys/arch/sparc/conf/GENERIC Mon Mar 1 06:14:17 2010 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.219 2010/01/15 20:57:12 bouyer Exp $ +# $NetBSD: GENERIC,v 1.220 2010/03/01 06:14:17 macallan Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident GENERIC-$Revision: 1.219 $ +#ident GENERIC-$Revision: 1.220 $ maxusers 32 @@ -693,6 +693,10 @@ # P9100-based display on Tadpole SPARCbook 3. pnozz0 at sbus? slot ? offset ? +# the SPARCbook 3 hardware docs say that accesses to P9100 registers need to be +# 'latched in' but at least my 3GX works happily without +# Enable it by default since we don't know which hardware really needs it. +options PNOZZ_USE_LATCH # Sun ZX/Leo 24-bit framebuffer zx* at sbus? slot ? offset ? Index: src/sys/arch/sparc/conf/INSTALL diff -u src/sys/arch/sparc/conf/INSTALL:1.72 src/sys/arch/sparc/conf/INSTALL:1.73 --- src/sys/arch/sparc/conf/INSTALL:1.72 Sat Dec 5 20:11:17 2009 +++ src/sys/arch/sparc/conf/INSTALL Mon Mar 1 06:14:17 2010 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.72 2009/12/05 20:11:17 pooka Exp $ +# $NetBSD: INSTALL,v 1.73 2010/03/01 06:14:17 macallan Exp $ # # from: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp # @@ -561,6 +561,10 @@ # P9100-based display on Tadpole SPARCbook 3. pnozz0 at sbus? slot ? offset ? +# the SPARCbook 3 hardware docs say that accesses to P9100 registers need to be +# 'latched in' but at least my 3GX works happily without +# Enable it by default since we don't know which hardware really needs it. +options PNOZZ_USE_LATCH # Sun ZX/Leo 24-bit framebuffer zx* at sbus? slot ? offset ?
CVS commit: src/crypto/external/bsd/netpgp/dist/src/hkpd
Module Name:src Committed By: agc Date: Mon Mar 1 07:41:57 UTC 2010 Added Files: src/crypto/external/bsd/netpgp/dist/src/hkpd: Makefile hkpd.c hkpd.h main.c Log Message: add an embryonic httpd key server (hkpd) to netpgp. this is based on the discontinued draft for hkp servers, in lieu of any official rfc. the post method for adding keys to the server has not been implemented. not until i've gone through all of the implications, anyway. hkp servers serve up pgp public keys over http. the default port is 11371, but it can be any port, specifiable at run time. whilst this hkpd will return valid html to browsers, it is aimed at the ''machine readable'' side, using the ''options=mr'' option to the http get string. this hkpd server will get hooked into the build at a later date. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/dist/src/hkpd/Makefile \ src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.c \ src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.h \ src/crypto/external/bsd/netpgp/dist/src/hkpd/main.c 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/netpgp/dist/src/hkpd/Makefile diff -u /dev/null src/crypto/external/bsd/netpgp/dist/src/hkpd/Makefile:1.1 --- /dev/null Mon Mar 1 07:41:57 2010 +++ src/crypto/external/bsd/netpgp/dist/src/hkpd/Makefile Mon Mar 1 07:41:56 2010 @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2010/03/01 07:41:56 agc Exp $ + +PROG=hkpd +SRCS=hkpd.c main.c +CPPFLAGS+=-g # -DHAVE_CONFIG_H=1 +LDFLAGS+=-g +LDADD+= -lnetpgp +MKMAN=no +WARNS=0 # anything over 0 will fail at the link stage with IDEA errors + +.include bsd.prog.mk Index: src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.c diff -u /dev/null src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.c:1.1 --- /dev/null Mon Mar 1 07:41:57 2010 +++ src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.c Mon Mar 1 07:41:56 2010 @@ -0,0 +1,275 @@ +/*- + * Copyright (c) 2009,2010 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Alistair Crooks (a...@netbsd.org) + * + * 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. + */ + +#include sys/types.h +#include sys/param.h +#include sys/socket.h +#include sys/stat.h +#include sys/param.h + +#include netinet/in.h + +#include errno.h +#include netdb.h +#include netpgp.h +#include regex.h +#include stdio.h +#include stdlib.h +#include string.h +#include unistd.h + +#include hkpd.h + +/* make the string have %xx - %c */ +static size_t +frompercent(char *in, size_t insize, char *out, size_t outsize) +{ + size_t outcc; + char *next; + char *pc; + + outcc = 0; + for (pc = in ; (next = strchr(pc, '%')) != NULL ; pc = next + 3) { + (void) memcpy(out[outcc], pc, (size_t)(next - pc)); + outcc += (size_t)(next - pc); + out[outcc++] = (char)strtol(next + 1, NULL, 16); + } + (void) memcpy(out[outcc], pc, insize - (int)(pc - in)); + outcc += insize - (int)(pc - in); + out[outcc] = 0x0; + return outcc; +} + +#define HKP_HTTP_LEVEL HTTP/1.0 +#define HKP_NAME hkpd +#define HKP_MIME_GET application/pgp-keys +#define HKP_MIME_INDEX text/plain +#define HKP_MACHREAD info:1:1\r\n + +#define HKP_SUCCESS 200 +#define HKP_NOT_FOUND 404 + +/* make into html */ +static int +htmlify(char *buf, size_t size, const int code, const int get, const char *title, const int mr, const char *body) +{ + return snprintf(buf, size, + %s %d %s\r\n + Server: %s/%d\r\n + Content-type: %s\r\n + \r\n + %s + %s, + HKP_HTTP_LEVEL, code, (code == HKP_SUCCESS) ? OK : not found, + HKP_NAME,
CVS commit: src/crypto/external/bsd/netpgp/dist/src/hkpd
Module Name:src Committed By: agc Date: Mon Mar 1 07:41:57 UTC 2010 Added Files: src/crypto/external/bsd/netpgp/dist/src/hkpd: Makefile hkpd.c hkpd.h main.c Log Message: add an embryonic httpd key server (hkpd) to netpgp. this is based on the discontinued draft for hkp servers, in lieu of any official rfc. the post method for adding keys to the server has not been implemented. not until i've gone through all of the implications, anyway. hkp servers serve up pgp public keys over http. the default port is 11371, but it can be any port, specifiable at run time. whilst this hkpd will return valid html to browsers, it is aimed at the ''machine readable'' side, using the ''options=mr'' option to the http get string. this hkpd server will get hooked into the build at a later date. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/netpgp/dist/src/hkpd/Makefile \ src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.c \ src/crypto/external/bsd/netpgp/dist/src/hkpd/hkpd.h \ src/crypto/external/bsd/netpgp/dist/src/hkpd/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/external/bsd/netpgp/dist/src/hkpclient
Module Name:src Committed By: agc Date: Mon Mar 1 07:52:21 UTC 2010 Added Files: src/crypto/external/bsd/netpgp/dist/src/hkpclient: hkpclient.lua optparse.lua tst Log Message: add the scripts used to test the hkpd. fwiw, the hkp client script is - essentially - 7 lines of lua, using libcurl for the http transport. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 \ src/crypto/external/bsd/netpgp/dist/src/hkpclient/hkpclient.lua \ src/crypto/external/bsd/netpgp/dist/src/hkpclient/optparse.lua \ src/crypto/external/bsd/netpgp/dist/src/hkpclient/tst 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/netpgp/dist/src/hkpclient/hkpclient.lua diff -u /dev/null src/crypto/external/bsd/netpgp/dist/src/hkpclient/hkpclient.lua:1.1 --- /dev/null Mon Mar 1 07:52:21 2010 +++ src/crypto/external/bsd/netpgp/dist/src/hkpclient/hkpclient.lua Mon Mar 1 07:52:21 2010 @@ -0,0 +1,74 @@ +#! /usr/bin/env lua + +-- +-- Copyright (c) 2010 The NetBSD Foundation, Inc. +-- All rights reserved. +-- +-- This code is derived from software contributed to The NetBSD Foundation +-- by Alistair Crooks (a...@netbsd.org) +-- +-- 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. +-- + +-- a short HKP client + +require(cURL) + +-- command line args +dofile optparse.lua + +opt = OptionParser{usage=%prog [options] file, version=20100226} + +opt.add_option{-V, --version, action=store_true, dest=version, + help=--version} +opt.add_option{-m, --mr, action=store_true, dest=mr, help=-m} +opt.add_option{-o, --op, action=store, dest=op, help=-o op} +opt.add_option{-p, --port, action=store, dest=port, help=-p port} +opt.add_option{-s, --server, action=store, dest=server, help=-s server} + +-- parse command line args +options,args = opt.parse_args() + +-- set defaults +local server = options.server or pgp.mit.edu +local port = options.port or 11371 +local op = options.op or get +local mr = +if options.mr then mr = options=mr end + +-- get output stream +f = io.output() + +c = cURL.easy_init() + +-- setup url +c:setopt_url(http://; .. server .. : .. port .. + /pks/lookup?op= .. op .. search= .. args[1] .. mr) + +-- perform, invokes callbacks +c:perform({writefunction = function(str) +f:write(str) + end}) + +-- close output file +f:close() + Index: src/crypto/external/bsd/netpgp/dist/src/hkpclient/optparse.lua diff -u /dev/null src/crypto/external/bsd/netpgp/dist/src/hkpclient/optparse.lua:1.1 --- /dev/null Mon Mar 1 07:52:21 2010 +++ src/crypto/external/bsd/netpgp/dist/src/hkpclient/optparse.lua Mon Mar 1 07:52:21 2010 @@ -0,0 +1,123 @@ +-- Lua command line option parser. +-- Interface based on Pythons optparse. +-- http://docs.python.org/lib/module-optparse.html +-- (c) 2008 David Manura, Licensed under the same terms as Lua (MIT license) +-- +-- To be used like this: +-- t={usage=some usage message, version=version string} +-- op=OptionParser(t) +-- op=add_option{opt, action=action, dest=dest, help=help message for this option} +-- +-- with : +-- opt the option string to be used (can be anything, if one letter opt, then should be -x val, more letters: -xy=val ) +-- action one of +-- - store: store in options as key, val +-- - store_true: stores key, true +-- - store_false: stores key, false +-- dest is the key under which the option is saved +--
CVS commit: src/crypto/external/bsd/netpgp/dist/src/hkpclient
Module Name:src Committed By: agc Date: Mon Mar 1 07:52:21 UTC 2010 Added Files: src/crypto/external/bsd/netpgp/dist/src/hkpclient: hkpclient.lua optparse.lua tst Log Message: add the scripts used to test the hkpd. fwiw, the hkp client script is - essentially - 7 lines of lua, using libcurl for the http transport. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 \ src/crypto/external/bsd/netpgp/dist/src/hkpclient/hkpclient.lua \ src/crypto/external/bsd/netpgp/dist/src/hkpclient/optparse.lua \ src/crypto/external/bsd/netpgp/dist/src/hkpclient/tst Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.