CVS commit: src/external/bsd/atf/dist/tools

2010-04-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  8 06:58:27 UTC 2010

Modified Files:
src/external/bsd/atf/dist/tools: atf-report.1

Log Message:
Fix typo reported by Ryo HAYASAKA in PR 43136.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/tools/atf-report.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/atf-report.1
diff -u src/external/bsd/atf/dist/tools/atf-report.1:1.1.1.1 src/external/bsd/atf/dist/tools/atf-report.1:1.2
--- src/external/bsd/atf/dist/tools/atf-report.1:1.1.1.1	Mon Jan 19 07:11:52 2009
+++ src/external/bsd/atf/dist/tools/atf-report.1	Thu Apr  8 06:58:26 2010
@@ -63,7 +63,7 @@
 .Fl o
 options are provided (more than one are allowed), they specify the complete
 list of reports to generate.
-They are all generated simulatneously, and for obvious reasons, two reports
+They are all generated simultaneously, and for obvious reasons, two reports
 cannot be written to the same file.
 Note that the default output is suppressed when
 .Fl o



CVS commit: src/share/man/man4

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 08:42:40 UTC 2010

Modified Files:
src/share/man/man4: acpidalb.4

Log Message:
Emphasize the powerd(8) script and use .Tn for acronyms.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/acpidalb.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/acpidalb.4
diff -u src/share/man/man4/acpidalb.4:1.5 src/share/man/man4/acpidalb.4:1.6
--- src/share/man/man4/acpidalb.4:1.5	Mon Jan 25 10:12:41 2010
+++ src/share/man/man4/acpidalb.4	Thu Apr  8 08:42:40 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpidalb.4,v 1.5 2010/01/25 10:12:41 jruoho Exp $
+.\ $NetBSD: acpidalb.4,v 1.6 2010/04/08 08:42:40 jruoho Exp $
 .\
 .\ Copyright (c) 2008 Christoph Egger ceg...@netbsd.org
 .\ All rights reserved.
@@ -41,10 +41,12 @@
 .Pp
 These are recognized on startup from system-wake or at runtime.
 Behaviour may differ from the standard specification in relation
-to the ACPI implementation.
+to the
+.Tn ACPI
+implementation.
 .Pp
 The hotkeys are reported to the power management daemon as
-.Dv hotkey_button .
+.Em hotkey_button .
 .Sh SEE ALSO
 .Xr acpi 4 ,
 .Xr powerd 8



CVS commit: src/sys/dev/acpi/wmi

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 09:35:15 UTC 2010

Added Files:
src/sys/dev/acpi/wmi: files.wmi wmi_dell.c

Log Message:
Add WMI mappings for Dell laptops. Requested and tested by m...@.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/wmi/files.wmi \
src/sys/dev/acpi/wmi/wmi_dell.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/dev/acpi/wmi/files.wmi
diff -u /dev/null src/sys/dev/acpi/wmi/files.wmi:1.1
--- /dev/null	Thu Apr  8 09:35:15 2010
+++ src/sys/dev/acpi/wmi/files.wmi	Thu Apr  8 09:35:15 2010
@@ -0,0 +1,6 @@
+#	$NetBSD: files.wmi,v 1.1 2010/04/08 09:35:15 jruoho Exp $
+
+# Dell WMI mappings
+device	wmidell: sysmon_power
+attach	wmidell at acpiwmibus
+file	dev/acpi/wmi/wmi_dell.c		wmidell
Index: src/sys/dev/acpi/wmi/wmi_dell.c
diff -u /dev/null src/sys/dev/acpi/wmi/wmi_dell.c:1.1
--- /dev/null	Thu Apr  8 09:35:15 2010
+++ src/sys/dev/acpi/wmi/wmi_dell.c	Thu Apr  8 09:35:15 2010
@@ -0,0 +1,231 @@
+/*	$NetBSD: wmi_dell.c,v 1.1 2010/04/08 09:35:15 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 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/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: wmi_dell.c,v 1.1 2010/04/08 09:35:15 jruoho Exp $);
+
+#include sys/param.h
+#include sys/device.h
+
+#include dev/acpi/acpireg.h
+#include dev/acpi/acpivar.h
+#include dev/acpi/wmi_acpivar.h
+
+#include dev/sysmon/sysmonvar.h
+
+#define _COMPONENT			ACPI_RESOURCE_COMPONENT
+ACPI_MODULE_NAME			(wmi_dell)
+
+#define WMI_DELL_HOTKEY_BRIGHTNESS_DOWN	0xE005
+#define WMI_DELL_HOTKEY_BRIGHTNESS_UP	0xE006
+#define WMI_DELL_HOTKEY_DISPLAY_CYCLE	0xE00B
+#define WMI_DELL_HOTKEY_VOLUME_MUTE	0xE020
+#define WMI_DELL_HOTKEY_VOLUME_DOWN	0xE02E
+#define WMI_DELL_HOTKEY_VOLUME_UP	0xE030
+/*  WMI_DELL_HOTKEY_UNKNOWN		0x */
+
+#define WMI_DELL_PSW_DISPLAY_CYCLE	0
+#define WMI_DELL_PSW_COUNT		1
+
+#define WMI_DELL_GUID_EVENT		9DBB5994-A997-11DA-B012-B622A1EF5492
+
+struct wmi_dell_softc {
+	device_t		sc_dev;
+	device_t		sc_parent;
+	struct sysmon_pswitch	sc_smpsw[WMI_DELL_PSW_COUNT];
+	bool			sc_smpsw_valid;
+};
+
+static int	wmi_dell_match(device_t, cfdata_t, void *);
+static void	wmi_dell_attach(device_t, device_t, void *);
+static int	wmi_dell_detach(device_t, int);
+static void	wmi_dell_notify_handler(ACPI_HANDLE, uint32_t, void *);
+static bool	wmi_dell_suspend(device_t, const pmf_qual_t *);
+static bool	wmi_dell_resume(device_t, const pmf_qual_t *);
+
+CFATTACH_DECL_NEW(wmidell, sizeof(struct wmi_dell_softc),
+wmi_dell_match, wmi_dell_attach, wmi_dell_detach, NULL);
+
+static int
+wmi_dell_match(device_t parent, cfdata_t match, void *aux)
+{
+	return acpi_wmi_guid_match(parent, WMI_DELL_GUID_EVENT);
+}
+
+static void
+wmi_dell_attach(device_t parent, device_t self, void *aux)
+{
+	struct wmi_dell_softc *sc = device_private(self);
+	ACPI_STATUS rv;
+	int e;
+
+	sc-sc_dev = self;
+	sc-sc_parent = parent;
+	sc-sc_smpsw_valid = true;
+
+	rv = acpi_wmi_event_register(parent, wmi_dell_notify_handler);
+
+	if (ACPI_FAILURE(rv)) {
+		aprint_error(: failed to install WMI notify handler\n);
+		return;
+	}
+
+	aprint_naive(\n);
+	aprint_normal(: Dell WMI mappings\n);
+
+	sc-sc_smpsw[WMI_DELL_PSW_DISPLAY_CYCLE].smpsw_name =
+	PSWITCH_HK_DISPLAY_CYCLE;
+
+	sc-sc_smpsw[WMI_DELL_PSW_DISPLAY_CYCLE].smpsw_type =
+	PSWITCH_TYPE_HOTKEY;
+
+	e = sysmon_pswitch_register(sc-sc_smpsw[WMI_DELL_PSW_DISPLAY_CYCLE]);
+
+	if (e != 0)
+		sc-sc_smpsw_valid = false;

CVS commit: src/sys/dev/acpi

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 09:36:03 UTC 2010

Modified Files:
src/sys/dev/acpi: files.acpi

Log Message:
Include 'files.wmi'.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/acpi/files.acpi

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/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.68 src/sys/dev/acpi/files.acpi:1.69
--- src/sys/dev/acpi/files.acpi:1.68	Fri Mar 19 04:04:28 2010
+++ src/sys/dev/acpi/files.acpi	Thu Apr  8 09:36:03 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.68 2010/03/19 04:04:28 cnst Exp $
+#	$NetBSD: files.acpi,v 1.69 2010/04/08 09:36:03 jruoho Exp $
 
 include dev/acpi/acpica/files.acpica
 
@@ -160,3 +160,5 @@
 device	acpismbus: i2cbus
 attach	acpismbus at acpinodebus
 file	dev/acpi/smbus_acpi.c		acpismbus
+
+include	dev/acpi/wmi/files.wmi



CVS commit: src/sys/arch

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 09:45:17 UTC 2010

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC

Log Message:
Add wmidell(4).


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.975 -r1.976 src/sys/arch/i386/conf/GENERIC

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/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.272 src/sys/arch/amd64/conf/GENERIC:1.273
--- src/sys/arch/amd64/conf/GENERIC:1.272	Sun Mar 28 00:00:07 2010
+++ src/sys/arch/amd64/conf/GENERIC	Thu Apr  8 09:45:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.272 2010/03/28 00:00:07 dholland Exp $
+# $NetBSD: GENERIC,v 1.273 2010/04/08 09:45:17 jruoho Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.272 $
+#ident 		GENERIC-$Revision: 1.273 $
 
 maxusers	64		# estimated number of users
 
@@ -304,6 +304,7 @@
 ug* 		at acpi?		# Abit uGuru Hardware monitor
 wb*		at acpi?		# Winbond W83L518D SD/MMC reader
 sdmmc*		at wb?			# SD/MMC bus
+wmidell*	at acpiwmibus?		# Dell WMI mappings
 
 #apm0	at mainbus0			# Advanced power management
 

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.975 src/sys/arch/i386/conf/GENERIC:1.976
--- src/sys/arch/i386/conf/GENERIC:1.975	Sat Mar 27 03:04:51 2010
+++ src/sys/arch/i386/conf/GENERIC	Thu Apr  8 09:45:17 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.975 2010/03/27 03:04:51 nonaka Exp $
+# $NetBSD: GENERIC,v 1.976 2010/04/08 09:45:17 jruoho Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.975 $
+#ident 		GENERIC-$Revision: 1.976 $
 
 maxusers	64		# estimated number of users
 
@@ -380,6 +380,7 @@
 ug*		at acpi?		# Abit uGuru Hardware monitor
 wb*		at acpi?		# Winbond W83L518D SD/MMC reader
 sdmmc*		at wb?			# SD/MMC bus
+wmidell*	at acpiwmibus?		# Dell WMI mappings
 wss*		at acpi?		# NeoMagic 256AV in wss mode
 ym*		at acpi?		# Yamaha OPL3-SA[23] audio
 



CVS commit: src

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 10:06:25 UTC 2010

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: acpiwmi.4

Log Message:
Add acpiwmi(4).


To generate a diff of this commit:
cvs rdiff -u -r1.1198 -r1.1199 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.512 -r1.513 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/acpiwmi.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1198 src/distrib/sets/lists/man/mi:1.1199
--- src/distrib/sets/lists/man/mi:1.1198	Thu Mar 11 10:38:36 2010
+++ src/distrib/sets/lists/man/mi	Thu Apr  8 10:06:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1198 2010/03/11 10:38:36 enami Exp $
+# $NetBSD: mi,v 1.1199 2010/04/08 10:06:25 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -627,6 +627,7 @@
 ./usr/share/man/cat4/acpilid.0			man-sys-catman		.cat
 ./usr/share/man/cat4/acpismbus.0		man-sys-catman		.cat
 ./usr/share/man/cat4/acpitz.0			man-sys-catman		.cat
+./usr/share/man/cat4/acpiwmi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/adb.0			man-sys-catman		.cat
 ./usr/share/man/cat4/adbbt.0			man-sys-catman		.cat
 ./usr/share/man/cat4/adbkbd.0			man-sys-catman		.cat
@@ -1697,6 +1698,7 @@
 ./usr/share/man/cat4/we.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wm.0			man-sys-catman		.cat
+./usr/share/man/cat4/wmidell.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wpi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wscons.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wsdisplay.0		man-sys-catman		.cat
@@ -3317,6 +3319,7 @@
 ./usr/share/man/html4/acpilid.html		man-sys-htmlman		html
 ./usr/share/man/html4/acpismbus.html		man-sys-htmlman		html
 ./usr/share/man/html4/acpitz.html		man-sys-htmlman		html
+./usr/share/man/html4/acpiwmi.html		man-sys-htmlman		html
 ./usr/share/man/html4/adb.html			man-sys-htmlman		html
 ./usr/share/man/html4/adbbt.html		man-sys-htmlman		html
 ./usr/share/man/html4/adbkbd.html		man-sys-htmlman		html
@@ -4268,6 +4271,7 @@
 ./usr/share/man/html4/we.html			man-sys-htmlman		html
 ./usr/share/man/html4/wi.html			man-sys-htmlman		html
 ./usr/share/man/html4/wm.html			man-sys-htmlman		html
+./usr/share/man/html4/wmidell.html		man-sys-htmlman		html
 ./usr/share/man/html4/wpi.html			man-sys-htmlman		html
 ./usr/share/man/html4/wscons.html		man-sys-htmlman		html
 ./usr/share/man/html4/wsdisplay.html		man-sys-htmlman		html
@@ -5707,6 +5711,7 @@
 ./usr/share/man/man4/acpilid.4			man-sys-man		.man
 ./usr/share/man/man4/acpismbus.4		man-sys-man		.man
 ./usr/share/man/man4/acpitz.4			man-sys-man		.man
+./usr/share/man/man4/acpiwmi.4			man-sys-man		.man
 ./usr/share/man/man4/adb.4			man-sys-man		.man
 ./usr/share/man/man4/adbbt.4			man-sys-man		.man
 ./usr/share/man/man4/adbkbd.4			man-sys-man		.man
@@ -6777,6 +6782,7 @@
 ./usr/share/man/man4/we.4			man-sys-man		.man
 ./usr/share/man/man4/wi.4			man-sys-man		.man
 ./usr/share/man/man4/wm.4			man-sys-man		.man
+./usr/share/man/man4/wmidell.4			man-sys-man		.man
 ./usr/share/man/man4/wpi.4			man-sys-man		.man
 ./usr/share/man/man4/wscons.4			man-sys-man		.man
 ./usr/share/man/man4/wsdisplay.4		man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.512 src/share/man/man4/Makefile:1.513
--- src/share/man/man4/Makefile:1.512	Fri Mar 19 04:04:27 2010
+++ src/share/man/man4/Makefile	Thu Apr  8 10:06:25 2010
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.512 2010/03/19 04:04:27 cnst Exp $
+#	$NetBSD: Makefile,v 1.513 2010/04/08 10:06:25 jruoho Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
-MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 acpidalb.4 \
+MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
 	adbbt.4 adbkbd.4 adbms.4 \
 	adc.4 admtemp.4 adv.4 adw.4 age.4 agp.4 agr.4 ahb.4 ahc.4 \
 	ahcisata.4 ahd.4 \
@@ -79,8 +79,8 @@
 #	smccir.4
 
 # ACPI devices
-MAN+=	acpi.4 acpiacad.4 acpibat.4 acpibut.4 acpiec.4 acpilid.4 \
-	acpismbus.4 acpitz.4
+MAN+=	acpi.4 acpiacad.4 acpibat.4 acpibut.4 acpidalb.4 acpiec.4 acpilid.4 \
+	acpismbus.4 acpitz.4 acpiwmi.4
 
 # Radio devices
 MAN+=	radio.4 az.4 mr.4 rt.4 rtii.4 sf2r.4
@@ -144,6 +144,7 @@
 MLINKS+=drm.4 viadrm.4
 
 MLINKS+=acpiec.4 acpiecdt.4
+MLINKS+=acpiwmi.4 wmidell.4
 MLINKS+=aibs.4 aiboost.4
 MLINKS+=ata.4 atabus.4
 MLINKS+=audio.4 audioctl.4

Added files:

Index: src/share/man/man4/acpiwmi.4
diff -u /dev/null src/share/man/man4/acpiwmi.4:1.1
--- /dev/null	Thu Apr  8 10:06:25 2010
+++ src/share/man/man4/acpiwmi.4	Thu Apr  8 10:06:25 2010
@@ -0,0 +1,98 @@
+.\ $NetBSD: acpiwmi.4,v 1.1 2010/04/08 10:06:25 jruoho Exp $
+.\
+.\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without

CVS commit: src/sys/dev/acpi

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 10:33:13 UTC 2010

Modified Files:
src/sys/dev/acpi: wmi_acpi.c wmi_acpivar.h
src/sys/dev/acpi/wmi: wmi_dell.c

Log Message:
Add a dummy acpi_wmi_event_deregister() to match existing conventions.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/acpi/wmi_acpi.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/wmi_acpivar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/wmi/wmi_dell.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/wmi_acpi.c
diff -u src/sys/dev/acpi/wmi_acpi.c:1.16 src/sys/dev/acpi/wmi_acpi.c:1.17
--- src/sys/dev/acpi/wmi_acpi.c:1.16	Mon Mar  8 10:53:03 2010
+++ src/sys/dev/acpi/wmi_acpi.c	Thu Apr  8 10:33:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpi.c,v 1.16 2010/03/08 10:53:03 jruoho Exp $	*/
+/*	$NetBSD: wmi_acpi.c,v 1.17 2010/04/08 10:33:13 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wmi_acpi.c,v 1.16 2010/03/08 10:53:03 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: wmi_acpi.c,v 1.17 2010/04/08 10:33:13 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -544,9 +544,6 @@
 	(*sc-sc_handler)(NULL, evt, sc-sc_child);
 }
 
-/*
- * Adds or removes (NULL) the external event handler.
- */
 ACPI_STATUS
 acpi_wmi_event_register(device_t self, ACPI_NOTIFY_HANDLER handler)
 {
@@ -563,6 +560,12 @@
 	return AE_OK;
 }
 
+ACPI_STATUS
+acpi_wmi_event_deregister(device_t self)
+{
+	return acpi_wmi_event_register(self, NULL);
+}
+
 /*
  * As there is no prior knowledge about the expensive
  * events that cause significant overhead, try to

Index: src/sys/dev/acpi/wmi_acpivar.h
diff -u src/sys/dev/acpi/wmi_acpivar.h:1.7 src/sys/dev/acpi/wmi_acpivar.h:1.8
--- src/sys/dev/acpi/wmi_acpivar.h:1.7	Fri Mar  5 08:30:48 2010
+++ src/sys/dev/acpi/wmi_acpivar.h	Thu Apr  8 10:33:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpivar.h,v 1.7 2010/03/05 08:30:48 jruoho Exp $	*/
+/*	$NetBSD: wmi_acpivar.h,v 1.8 2010/04/08 10:33:13 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -31,16 +31,20 @@
 #define _SYS_DEV_ACPI_WMI_ACPIVAR_H
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wmi_acpivar.h,v 1.7 2010/03/05 08:30:48 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: wmi_acpivar.h,v 1.8 2010/04/08 10:33:13 jruoho Exp $);
 
-ACPI_STATUS acpi_wmi_event_register(device_t, ACPI_NOTIFY_HANDLER);
-ACPI_STATUS acpi_wmi_event_get(device_t, uint32_t, ACPI_BUFFER *);
-int acpi_wmi_guid_match(device_t, const char *);
-ACPI_STATUS acpi_wmi_data_query(device_t, const char *,
-uint8_t, ACPI_BUFFER *);
-ACPI_STATUS acpi_wmi_data_write(device_t, const char *,
-uint8_t, ACPI_BUFFER *);
-ACPI_STATUS acpi_wmi_method(device_t, const char *, uint8_t,
-uint32_t, ACPI_BUFFER *, ACPI_BUFFER *);
+ACPI_STATUS	acpi_wmi_event_register(device_t, ACPI_NOTIFY_HANDLER);
+ACPI_STATUS	acpi_wmi_event_deregister(device_t);
+ACPI_STATUS	acpi_wmi_event_get(device_t, uint32_t, ACPI_BUFFER *);
+
+int		acpi_wmi_guid_match(device_t, const char *);
+
+ACPI_STATUS	acpi_wmi_data_query(device_t, const char *,
+uint8_t, ACPI_BUFFER *);
+ACPI_STATUS	acpi_wmi_data_write(device_t, const char *,
+uint8_t, ACPI_BUFFER *);
+
+ACPI_STATUS	acpi_wmi_method(device_t, const char *, uint8_t,
+uint32_t, ACPI_BUFFER *, ACPI_BUFFER *);
 
 #endif	/* !_SYS_DEV_ACPI_WMI_ACPIVAR_H */

Index: src/sys/dev/acpi/wmi/wmi_dell.c
diff -u src/sys/dev/acpi/wmi/wmi_dell.c:1.1 src/sys/dev/acpi/wmi/wmi_dell.c:1.2
--- src/sys/dev/acpi/wmi/wmi_dell.c:1.1	Thu Apr  8 09:35:15 2010
+++ src/sys/dev/acpi/wmi/wmi_dell.c	Thu Apr  8 10:33:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_dell.c,v 1.1 2010/04/08 09:35:15 jruoho Exp $ */
+/*	$NetBSD: wmi_dell.c,v 1.2 2010/04/08 10:33:13 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wmi_dell.c,v 1.1 2010/04/08 09:35:15 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: wmi_dell.c,v 1.2 2010/04/08 10:33:13 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -124,7 +124,7 @@
 	int i;
 
 	(void)pmf_device_deregister(self);
-	(void)acpi_wmi_event_register(parent, NULL);
+	(void)acpi_wmi_event_deregister(parent);
 
 	if (sc-sc_smpsw_valid != true)
 		return 0;
@@ -141,7 +141,7 @@
 	struct wmi_dell_softc *sc = device_private(self);
 	device_t parent = sc-sc_parent;
 
-	(void)acpi_wmi_event_register(parent, NULL);
+	(void)acpi_wmi_event_deregister(parent);
 
 	return true;
 }



CVS commit: src/sys

2010-04-08 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Apr  8 11:51:14 UTC 2010

Modified Files:
src/sys/compat/common: kern_time_50.c
src/sys/compat/linux/common: linux_time.c
src/sys/compat/linux32/common: linux32_time.c
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c
src/sys/kern: kern_time.c
src/sys/sys: timevar.h

Log Message:
Add a new clock_gettime1() function that holds most of the
clock_gettime syscall code (except for the copyout). Adjust all
corresponding syscalls to make use of it.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/common/kern_time_50.c
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/common/linux_time.c
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux32/common/linux32_time.c
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_time.c
cvs rdiff -u -r1.164 -r1.165 src/sys/kern/kern_time.c
cvs rdiff -u -r1.28 -r1.29 src/sys/sys/timevar.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/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.14 src/sys/compat/common/kern_time_50.c:1.15
--- src/sys/compat/common/kern_time_50.c:1.14	Sat Apr  3 17:20:05 2010
+++ src/sys/compat/common/kern_time_50.c	Thu Apr  8 11:51:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.14 2010/04/03 17:20:05 njoly Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.15 2010/04/08 11:51:13 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_time_50.c,v 1.14 2010/04/03 17:20:05 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_time_50.c,v 1.15 2010/04/08 11:51:13 njoly Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_aio.h
@@ -113,21 +113,14 @@
 		syscallarg(clockid_t) clock_id;
 		syscallarg(struct timespec50 *) tp;
 	} */
-	clockid_t clock_id;
+	int error;
 	struct timespec ats;
 	struct timespec50 ats50;
 
-	clock_id = SCARG(uap, clock_id);
-	switch (clock_id) {
-	case CLOCK_REALTIME:
-		nanotime(ats);
-		break;
-	case CLOCK_MONOTONIC:
-		nanouptime(ats);
-		break;
-	default:
-		return (EINVAL);
-	}
+	error = clock_gettime1(SCARG(uap, clock_id), ats);
+	if (error != 0)
+		return error;
+
 	timespec_to_timespec50(ats, ats50);
 
 	return copyout(ats50, SCARG(uap, tp), sizeof(ats50));

Index: src/sys/compat/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.31 src/sys/compat/linux/common/linux_time.c:1.32
--- src/sys/compat/linux/common/linux_time.c:1.31	Sat Apr  3 17:20:05 2010
+++ src/sys/compat/linux/common/linux_time.c	Thu Apr  8 11:51:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.31 2010/04/03 17:20:05 njoly Exp $ */
+/*	$NetBSD: linux_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_time.c,v 1.31 2010/04/03 17:20:05 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $);
 
 #include sys/param.h
 #include sys/ucred.h
@@ -194,19 +194,18 @@
 		syscallarg(clockid_t) which;
 		syscallarg(struct linux_timespec *)tp;
 	} */
+	int error;
+	clockid_t id;
 	struct timespec ts;
 	struct linux_timespec lts;
 
-	switch (SCARG(uap, which)) {
-	case LINUX_CLOCK_REALTIME:
-		nanotime(ts);
-		break;
-	case LINUX_CLOCK_MONOTONIC:
-		nanouptime(ts);
-		break;
-	default:
-		return EINVAL;
-	}
+	error = linux_to_native_clockid(id, SCARG(uap, which));
+	if (error != 0)
+		return error;
+
+	error = clock_gettime1(id, ts);
+	if (error != 0)
+		return error;
 
 	native_to_linux_timespec(lts, ts);
 	return copyout(lts, SCARG(uap, tp), sizeof lts);

Index: src/sys/compat/linux32/common/linux32_time.c
diff -u src/sys/compat/linux32/common/linux32_time.c:1.31 src/sys/compat/linux32/common/linux32_time.c:1.32
--- src/sys/compat/linux32/common/linux32_time.c:1.31	Sat Apr  3 17:20:05 2010
+++ src/sys/compat/linux32/common/linux32_time.c	Thu Apr  8 11:51:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_time.c,v 1.31 2010/04/03 17:20:05 njoly Exp $ */
+/*	$NetBSD: linux32_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: linux32_time.c,v 1.31 2010/04/03 17:20:05 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux32_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -307,19 +307,18 @@
 		syscallarg(clockid_t) which;
 		syscallarg(linux32_timespecp_t) tp;
 	} */
+	int error;
+	clockid_t id;
 	struct timespec ts;
 	struct linux32_timespec lts;
 
-	switch (SCARG(uap, which)) {
-	case LINUX_CLOCK_REALTIME:
-		nanotime(ts);
-		break;
-	case 

CVS commit: src/sys/dev/acpi

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 12:14:19 UTC 2010

Modified Files:
src/sys/dev/acpi: files.acpi
src/sys/dev/acpi/wmi: files.wmi wmi_dell.c
Added Files:
src/sys/dev/acpi/wmi: wmi_acpi.c wmi_acpivar.h
Removed Files:
src/sys/dev/acpi: wmi_acpi.c wmi_acpivar.h

Log Message:
Move acpiwmi(4) to the sys/dev/acpi/wmi -subdirectory.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/acpi/files.acpi
cvs rdiff -u -r1.17 -r0 src/sys/dev/acpi/wmi_acpi.c
cvs rdiff -u -r1.8 -r0 src/sys/dev/acpi/wmi_acpivar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/wmi/files.wmi
cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/wmi/wmi_acpi.c \
src/sys/dev/acpi/wmi/wmi_acpivar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/wmi/wmi_dell.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/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.69 src/sys/dev/acpi/files.acpi:1.70
--- src/sys/dev/acpi/files.acpi:1.69	Thu Apr  8 09:36:03 2010
+++ src/sys/dev/acpi/files.acpi	Thu Apr  8 12:14:19 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.69 2010/04/08 09:36:03 jruoho Exp $
+#	$NetBSD: files.acpi,v 1.70 2010/04/08 12:14:19 jruoho Exp $
 
 include dev/acpi/acpica/files.acpica
 
@@ -9,7 +9,6 @@
 define	acpiapmbus { }
 define	acpinodebus { }
 define	acpiecdtbus { }
-define	acpiwmibus { }
 
 device	acpi: acpica, acpiapmbus, acpinodebus, acpiecdtbus, sysmon_power, sysmon_taskq
 attach	acpi at acpibus
@@ -146,11 +145,6 @@
 attach	wb at acpinodebus with wb_acpi
 file	dev/acpi/wb_acpi.c		wb_acpi
 
-# ACPI-WMI Mapper
-device	acpiwmi: acpiwmibus
-attach	acpiwmi at acpinodebus
-file	dev/acpi/wmi_acpi.c		acpiwmi
-
 # ASUSTeK AI Booster ATK0110
 device	aibs: sysmon_envsys
 attach	aibs at acpinodebus

Index: src/sys/dev/acpi/wmi/files.wmi
diff -u src/sys/dev/acpi/wmi/files.wmi:1.1 src/sys/dev/acpi/wmi/files.wmi:1.2
--- src/sys/dev/acpi/wmi/files.wmi:1.1	Thu Apr  8 09:35:15 2010
+++ src/sys/dev/acpi/wmi/files.wmi	Thu Apr  8 12:14:19 2010
@@ -1,4 +1,11 @@
-#	$NetBSD: files.wmi,v 1.1 2010/04/08 09:35:15 jruoho Exp $
+#	$NetBSD: files.wmi,v 1.2 2010/04/08 12:14:19 jruoho Exp $
+
+define	acpiwmibus { }
+
+# ACPI WMI mapper
+device	acpiwmi: acpiwmibus
+attach	acpiwmi at acpinodebus
+file	dev/acpi/wmi/wmi_acpi.c		acpiwmi
 
 # Dell WMI mappings
 device	wmidell: sysmon_power

Index: src/sys/dev/acpi/wmi/wmi_dell.c
diff -u src/sys/dev/acpi/wmi/wmi_dell.c:1.2 src/sys/dev/acpi/wmi/wmi_dell.c:1.3
--- src/sys/dev/acpi/wmi/wmi_dell.c:1.2	Thu Apr  8 10:33:13 2010
+++ src/sys/dev/acpi/wmi/wmi_dell.c	Thu Apr  8 12:14:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_dell.c,v 1.2 2010/04/08 10:33:13 jruoho Exp $ */
+/*	$NetBSD: wmi_dell.c,v 1.3 2010/04/08 12:14:19 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -31,14 +31,14 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wmi_dell.c,v 1.2 2010/04/08 10:33:13 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: wmi_dell.c,v 1.3 2010/04/08 12:14:19 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
 
 #include dev/acpi/acpireg.h
 #include dev/acpi/acpivar.h
-#include dev/acpi/wmi_acpivar.h
+#include dev/acpi/wmi/wmi_acpivar.h
 
 #include dev/sysmon/sysmonvar.h
 

Added files:

Index: src/sys/dev/acpi/wmi/wmi_acpi.c
diff -u /dev/null src/sys/dev/acpi/wmi/wmi_acpi.c:1.1
--- /dev/null	Thu Apr  8 12:14:19 2010
+++ src/sys/dev/acpi/wmi/wmi_acpi.c	Thu Apr  8 12:14:19 2010
@@ -0,0 +1,789 @@
+/*	$NetBSD: wmi_acpi.c,v 1.1 2010/04/08 12:14:19 jruoho Exp $	*/
+
+/*-
+ * Copyright (c) 2009, 2010 Jukka Ruohonen jruoho...@iki.fi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY 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 

CVS commit: src/sys/fs/msdosfs

2010-04-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr  8 15:03:34 UTC 2010

Modified Files:
src/sys/fs/msdosfs: denode.h msdosfs_vnops.c

Log Message:
Use genfs instead of homegrown stuff where possible.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/fs/msdosfs/denode.h
cvs rdiff -u -r1.61 -r1.62 src/sys/fs/msdosfs/msdosfs_vnops.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/fs/msdosfs/denode.h
diff -u src/sys/fs/msdosfs/denode.h:1.16 src/sys/fs/msdosfs/denode.h:1.17
--- src/sys/fs/msdosfs/denode.h:1.16	Mon Nov 26 19:01:46 2007
+++ src/sys/fs/msdosfs/denode.h	Thu Apr  8 15:03:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: denode.h,v 1.16 2007/11/26 19:01:46 pooka Exp $	*/
+/*	$NetBSD: denode.h,v 1.17 2010/04/08 15:03:33 pooka Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -260,7 +260,6 @@
 int	msdosfs_lookup		(void *);
 int	msdosfs_create		(void *);
 int	msdosfs_mknod		(void *);
-int	msdosfs_open		(void *);
 int	msdosfs_close		(void *);
 int	msdosfs_access		(void *);
 int	msdosfs_getattr		(void *);
@@ -281,7 +280,6 @@
 int	msdosfs_rmdir		(void *);
 int	msdosfs_symlink		(void *);
 int	msdosfs_readdir		(void *);
-int	msdosfs_readlink	(void *);
 #define	msdosfs_abortop		genfs_abortop
 int	msdosfs_inactive	(void *);
 int	msdosfs_reclaim		(void *);

Index: src/sys/fs/msdosfs/msdosfs_vnops.c
diff -u src/sys/fs/msdosfs/msdosfs_vnops.c:1.61 src/sys/fs/msdosfs/msdosfs_vnops.c:1.62
--- src/sys/fs/msdosfs/msdosfs_vnops.c:1.61	Fri Jul  3 21:17:40 2009
+++ src/sys/fs/msdosfs/msdosfs_vnops.c	Thu Apr  8 15:03:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.61 2009/07/03 21:17:40 elad Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.62 2010/04/08 15:03:33 pooka Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.61 2009/07/03 21:17:40 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.62 2010/04/08 15:03:33 pooka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -186,20 +186,6 @@
 }
 
 int
-msdosfs_open(void *v)
-{
-#if 0
-	struct vop_open_args /* {
-		struct vnode *a_vp;
-		int a_mode;
-		kauth_cred_t a_cred;
-	} */ *ap;
-#endif
-
-	return (0);
-}
-
-int
 msdosfs_close(void *v)
 {
 	struct vop_close_args /* {
@@ -1685,23 +1671,6 @@
 }
 
 /*
- * DOS filesystems don't know what symlinks are.
- */
-int
-msdosfs_readlink(void *v)
-{
-#if 0
-	struct vop_readlink_args /* {
-		struct vnode *a_vp;
-		struct uio *a_uio;
-		kauth_cred_t a_cred;
-	} */ *ap;
-#endif
-
-	return (EINVAL);
-}
-
-/*
  * vp  - address of vnode file the file
  * bn  - which cluster we are interested in mapping to a filesystem block number.
  * vpp - returns the vnode for the block special file holding the filesystem
@@ -1946,7 +1915,7 @@
 	{ vop_lookup_desc, msdosfs_lookup },		/* lookup */
 	{ vop_create_desc, msdosfs_create },		/* create */
 	{ vop_mknod_desc, msdosfs_mknod },		/* mknod */
-	{ vop_open_desc, msdosfs_open },		/* open */
+	{ vop_open_desc, genfs_nullop },		/* open */
 	{ vop_close_desc, msdosfs_close },		/* close */
 	{ vop_access_desc, msdosfs_access },		/* access */
 	{ vop_getattr_desc, msdosfs_getattr },		/* getattr */
@@ -1968,7 +1937,7 @@
 	{ vop_rmdir_desc, msdosfs_rmdir },		/* rmdir */
 	{ vop_symlink_desc, msdosfs_symlink },		/* symlink */
 	{ vop_readdir_desc, msdosfs_readdir },		/* readdir */
-	{ vop_readlink_desc, msdosfs_readlink },	/* readlink */
+	{ vop_readlink_desc, genfs_einval },		/* readlink */
 	{ vop_abortop_desc, msdosfs_abortop },		/* abortop */
 	{ vop_inactive_desc, msdosfs_inactive },	/* inactive */
 	{ vop_reclaim_desc, msdosfs_reclaim },		/* reclaim */



CVS commit: src/sys/miscfs/genfs

2010-04-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr  8 15:56:26 UTC 2010

Modified Files:
src/sys/miscfs/genfs: genfs_vnops.c

Log Message:
Call VOP_ABORTOP in genfs_eopnotsupp.  This prevents file system
authors from having to get down on their knees and pray they won't
get POGA'd(*) again.

This plugs componentname leaks in at least smbfs and buggy puffs
servers (buggy servers shouldn't be able to leak kernel memory).

*) principle of greatest astonishment


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/miscfs/genfs/genfs_vnops.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/miscfs/genfs/genfs_vnops.c
diff -u src/sys/miscfs/genfs/genfs_vnops.c:1.176 src/sys/miscfs/genfs/genfs_vnops.c:1.177
--- src/sys/miscfs/genfs/genfs_vnops.c:1.176	Wed Jan 27 15:52:31 2010
+++ src/sys/miscfs/genfs/genfs_vnops.c	Thu Apr  8 15:56:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_vnops.c,v 1.176 2010/01/27 15:52:31 uebayasi Exp $	*/
+/*	$NetBSD: genfs_vnops.c,v 1.177 2010/04/08 15:56:26 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_vnops.c,v 1.176 2010/01/27 15:52:31 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_vnops.c,v 1.177 2010/04/08 15:56:26 pooka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -170,7 +170,8 @@
 
 /*
  * Called when an fs doesn't support a particular vop.
- * This takes care to vrele, vput, or vunlock passed in vnodes.
+ * This takes care to vrele, vput, or vunlock passed in vnodes
+ * and calls VOP_ABORTOP for a componentname (in non-rename VOP).
  */
 int
 genfs_eopnotsupp(void *v)
@@ -181,14 +182,35 @@
 	} */ *ap = v;
 	struct vnodeop_desc *desc = ap-a_desc;
 	struct vnode *vp, *vp_last = NULL;
-	int flags, i, j, offset;
+	int flags, i, j, offset_cnp, offset_vp;
+
+	KASSERT(desc-vdesc_offset != VOP_LOOKUP_DESCOFFSET);
+	KASSERT(desc-vdesc_offset != VOP_ABORTOP_DESCOFFSET);
+
+	/*
+	 * Free componentname that lookup potentially SAVENAMEd.
+	 *
+	 * As is logical, componentnames for VOP_RENAME are handled by
+	 * the caller of VOP_RENAME.  Yay, rename!
+	 */
+	if (desc-vdesc_offset != VOP_RENAME_DESCOFFSET 
+	(offset_vp = desc-vdesc_vp_offsets[0]) != VDESC_NO_OFFSET 
+	(offset_cnp = desc-vdesc_componentname_offset) != VDESC_NO_OFFSET){
+		struct componentname *cnp;
+		struct vnode *dvp;
+
+		dvp = *VOPARG_OFFSETTO(struct vnode **, offset_vp, ap);
+		cnp = *VOPARG_OFFSETTO(struct componentname **, offset_cnp, ap);
+
+		VOP_ABORTOP(dvp, cnp);
+	}
 
 	flags = desc-vdesc_flags;
 	for (i = 0; i  VDESC_MAX_VPS; flags =1, i++) {
-		if ((offset = desc-vdesc_vp_offsets[i]) == VDESC_NO_OFFSET)
+		if ((offset_vp = desc-vdesc_vp_offsets[i]) == VDESC_NO_OFFSET)
 			break;	/* stop at end of list */
 		if ((j = flags  VDESC_VP0_WILLPUT)) {
-			vp = *VOPARG_OFFSETTO(struct vnode **, offset, ap);
+			vp = *VOPARG_OFFSETTO(struct vnode **, offset_vp, ap);
 
 			/* Skip if NULL */
 			if (!vp)



CVS commit: src/sys/compat

2010-04-08 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Apr  8 15:59:37 UTC 2010

Modified Files:
src/sys/compat/linux/common: linux_time.c
src/sys/compat/linux32/common: linux32_time.c

Log Message:
Do not use 0 for pointers, but NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/linux/common/linux_time.c
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/linux32/common/linux32_time.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/compat/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.32 src/sys/compat/linux/common/linux_time.c:1.33
--- src/sys/compat/linux/common/linux_time.c:1.32	Thu Apr  8 11:51:13 2010
+++ src/sys/compat/linux/common/linux_time.c	Thu Apr  8 15:59:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $ */
+/*	$NetBSD: linux_time.c,v 1.33 2010/04/08 15:59:37 njoly Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_time.c,v 1.33 2010/04/08 15:59:37 njoly Exp $);
 
 #include sys/param.h
 #include sys/ucred.h
@@ -285,7 +285,7 @@
 
 	linux_to_native_timespec(rqts, lrqts);
 
-	error = nanosleep1(l, rqts, SCARG(uap, rmtp) ? rmts : 0);
+	error = nanosleep1(l, rqts, SCARG(uap, rmtp) ? rmts : NULL);
 	if (SCARG(uap, rmtp) == NULL || (error != 0  error != EINTR))
 		return error;
 

Index: src/sys/compat/linux32/common/linux32_time.c
diff -u src/sys/compat/linux32/common/linux32_time.c:1.32 src/sys/compat/linux32/common/linux32_time.c:1.33
--- src/sys/compat/linux32/common/linux32_time.c:1.32	Thu Apr  8 11:51:13 2010
+++ src/sys/compat/linux32/common/linux32_time.c	Thu Apr  8 15:59:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $ */
+/*	$NetBSD: linux32_time.c,v 1.33 2010/04/08 15:59:37 njoly Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: linux32_time.c,v 1.32 2010/04/08 11:51:13 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux32_time.c,v 1.33 2010/04/08 15:59:37 njoly Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -373,7 +373,7 @@
 		return error;
 	linux32_to_native_timespec(rqts, lrqts);
 
-	error = nanosleep1(l, rqts, SCARG_P32(uap, rmtp) ? rmts : 0);
+	error = nanosleep1(l, rqts, SCARG_P32(uap, rmtp) ? rmts : NULL);
 	if (SCARG_P32(uap, rmtp) == NULL || (error != 0  error != EINTR))
 		return error;
 



CVS commit: src/sys/fs/msdosfs

2010-04-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr  8 16:04:35 UTC 2010

Modified Files:
src/sys/fs/msdosfs: denode.h msdosfs_vnops.c

Log Message:
In genfs where available.

The only functional change is mknod now returning EOPNOTSUPP instead
of EINVAL.  I make this sacrifice willingly and with a clean conscience.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/fs/msdosfs/denode.h
cvs rdiff -u -r1.62 -r1.63 src/sys/fs/msdosfs/msdosfs_vnops.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/fs/msdosfs/denode.h
diff -u src/sys/fs/msdosfs/denode.h:1.17 src/sys/fs/msdosfs/denode.h:1.18
--- src/sys/fs/msdosfs/denode.h:1.17	Thu Apr  8 15:03:33 2010
+++ src/sys/fs/msdosfs/denode.h	Thu Apr  8 16:04:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: denode.h,v 1.17 2010/04/08 15:03:33 pooka Exp $	*/
+/*	$NetBSD: denode.h,v 1.18 2010/04/08 16:04:35 pooka Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -259,7 +259,6 @@
  */
 int	msdosfs_lookup		(void *);
 int	msdosfs_create		(void *);
-int	msdosfs_mknod		(void *);
 int	msdosfs_close		(void *);
 int	msdosfs_access		(void *);
 int	msdosfs_getattr		(void *);
@@ -274,11 +273,9 @@
 int	msdosfs_fsync		(void *);
 #define	msdosfs_seek		genfs_seek
 int	msdosfs_remove		(void *);
-int	msdosfs_link		(void *);
 int	msdosfs_rename		(void *);
 int	msdosfs_mkdir		(void *);
 int	msdosfs_rmdir		(void *);
-int	msdosfs_symlink		(void *);
 int	msdosfs_readdir		(void *);
 #define	msdosfs_abortop		genfs_abortop
 int	msdosfs_inactive	(void *);

Index: src/sys/fs/msdosfs/msdosfs_vnops.c
diff -u src/sys/fs/msdosfs/msdosfs_vnops.c:1.62 src/sys/fs/msdosfs/msdosfs_vnops.c:1.63
--- src/sys/fs/msdosfs/msdosfs_vnops.c:1.62	Thu Apr  8 15:03:33 2010
+++ src/sys/fs/msdosfs/msdosfs_vnops.c	Thu Apr  8 16:04:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.62 2010/04/08 15:03:33 pooka Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.63 2010/04/08 16:04:35 pooka Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.62 2010/04/08 15:03:33 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.63 2010/04/08 16:04:35 pooka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -171,21 +171,6 @@
 }
 
 int
-msdosfs_mknod(void *v)
-{
-	struct vop_mknod_args /* {
-		struct vnode *a_dvp;
-		struct vnode **a_vpp;
-		struct componentname *a_cnp;
-		struct vattr *a_vap;
-	} */ *ap = v;
-
-	PNBUF_PUT(ap-a_cnp-cn_pnbuf);
-	vput(ap-a_dvp);
-	return (EINVAL);
-}
-
-int
 msdosfs_close(void *v)
 {
 	struct vop_close_args /* {
@@ -751,25 +736,6 @@
 }
 
 /*
- * DOS filesystems don't know what links are. But since we already called
- * msdosfs_lookup() with create and lockparent, the parent is locked so we
- * have to free it before we return the error.
- */
-int
-msdosfs_link(void *v)
-{
-	struct vop_link_args /* {
-		struct vnode *a_dvp;
-		struct vnode *a_vp;
-		struct componentname *a_cnp;
-	} */ *ap = v;
-
-	VOP_ABORTOP(ap-a_dvp, ap-a_cnp);
-	vput(ap-a_dvp);
-	return (EOPNOTSUPP);
-}
-
-/*
  * Renames on files require moving the denode to a new hash queue since the
  * denode's location is used to compute which hash queue to put the file
  * in. Unless it is a rename in place.  For example mv a b.
@@ -1384,25 +1350,6 @@
 	return (error);
 }
 
-/*
- * DOS filesystems don't know what symlinks are.
- */
-int
-msdosfs_symlink(void *v)
-{
-	struct vop_symlink_args /* {
-		struct vnode *a_dvp;
-		struct vnode **a_vpp;
-		struct componentname *a_cnp;
-		struct vattr *a_vap;
-		char *a_target;
-	} */ *ap = v;
-
-	VOP_ABORTOP(ap-a_dvp, ap-a_cnp);
-	vput(ap-a_dvp);
-	return (EOPNOTSUPP);
-}
-
 int
 msdosfs_readdir(void *v)
 {
@@ -1914,7 +1861,7 @@
 	{ vop_default_desc, vn_default_error },
 	{ vop_lookup_desc, msdosfs_lookup },		/* lookup */
 	{ vop_create_desc, msdosfs_create },		/* create */
-	{ vop_mknod_desc, msdosfs_mknod },		/* mknod */
+	{ vop_mknod_desc, genfs_eopnotsupp },		/* mknod */
 	{ vop_open_desc, genfs_nullop },		/* open */
 	{ vop_close_desc, msdosfs_close },		/* close */
 	{ vop_access_desc, msdosfs_access },		/* access */
@@ -1931,11 +1878,11 @@
 	{ vop_fsync_desc, msdosfs_fsync },		/* fsync */
 	{ vop_seek_desc, msdosfs_seek },		/* seek */
 	{ vop_remove_desc, msdosfs_remove },		/* remove */
-	{ vop_link_desc, msdosfs_link },		/* link */
+	{ vop_link_desc, genfs_eopnotsupp },		/* link */
 	{ vop_rename_desc, msdosfs_rename },		/* rename */
 	{ vop_mkdir_desc, msdosfs_mkdir },		/* mkdir */
 	{ vop_rmdir_desc, msdosfs_rmdir },		/* rmdir */
-	{ vop_symlink_desc, msdosfs_symlink },		/* symlink */
+	{ vop_symlink_desc, genfs_eopnotsupp },	/* symlink */
 	{ vop_readdir_desc, msdosfs_readdir },		/* readdir */
 	{ vop_readlink_desc, genfs_einval },		/* readlink */
 	{ vop_abortop_desc, msdosfs_abortop },		/* abortop */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-04-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  8 16:05:31 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap.c

Log Message:
Fix problem where pmap_clear_modify could go into an infinite loop.
Spotted by cyber.


To generate a diff of this commit:
cvs rdiff -u -r1.179.16.22 -r1.179.16.23 src/sys/arch/mips/mips/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.22 src/sys/arch/mips/mips/pmap.c:1.179.16.23
--- src/sys/arch/mips/mips/pmap.c:1.179.16.22	Thu Mar 11 08:19:01 2010
+++ src/sys/arch/mips/mips/pmap.c	Thu Apr  8 16:05:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.179.16.22 2010/03/11 08:19:01 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.179.16.23 2010/04/08 16:05:31 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.179.16.22 2010/03/11 08:19:01 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.179.16.23 2010/04/08 16:05:31 matt Exp $);
 
 /*
  *	Manages physical address maps.
@@ -1886,7 +1886,8 @@
 bool
 pmap_clear_modify(struct vm_page *pg)
 {
-	struct pv_entry *pv = pg-mdpage.pvh_first;
+	pv_entry_t pv = pg-mdpage.pvh_first;
+	pv_entry_t pv_next;
 	uint16_t gen;
 
 	PMAP_COUNT(clear_modify);
@@ -1916,11 +1917,12 @@
 	 */
 	kpreempt_disable();
 	gen = VM_PAGE_PVLIST_LOCK(pg, false);
-	while (pv != NULL) {
+	for (; pv != NULL; pv = pv_next) {
 		pmap_t pmap = pv-pv_pmap;
 		vaddr_t va = pv-pv_va;
 		pt_entry_t *pte;
 		uint32_t pt_entry;
+		pv_next = pv-pv_next;
 		if (pmap == pmap_kernel()) {
 			pte = kvtopte(va);
 		} else {
@@ -1946,13 +1948,11 @@
 		VM_PAGE_PVLIST_UNLOCK(pg);
 		pmap_tlb_invalidate_addr(pmap, va);
 		pmap_update(pmap);
-		if (gen != VM_PAGE_PVLIST_LOCK(pg, false)) {
+		if (__predict_false(gen != VM_PAGE_PVLIST_LOCK(pg, false))) {
 			/*
 			 * The list changed!  So restart from the beginning.
 			 */
-			pv = pg-mdpage.pvh_first;
-		} else {
-			pv = pv-pv_next;
+			pv_next = pg-mdpage.pvh_first;
 		}
 	}
 	VM_PAGE_PVLIST_UNLOCK(pg);



CVS commit: src/sys/dev/rasops

2010-04-08 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr  8 16:45:53 UTC 2010

Modified Files:
src/sys/dev/rasops: rasops1.c rasops_bitops.h

Log Message:
add support for shadow framebuffers
tested on sparc with a cg12


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/rasops/rasops1.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/rasops/rasops_bitops.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/rasops/rasops1.c
diff -u src/sys/dev/rasops/rasops1.c:1.20 src/sys/dev/rasops/rasops1.c:1.21
--- src/sys/dev/rasops/rasops1.c:1.20	Sat Mar 14 21:04:22 2009
+++ src/sys/dev/rasops/rasops1.c	Thu Apr  8 16:45:53 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: rasops1.c,v 1.20 2009/03/14 21:04:22 dsl Exp $	*/
+/* 	$NetBSD: rasops1.c,v 1.21 2010/04/08 16:45:53 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rasops1.c,v 1.20 2009/03/14 21:04:22 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: rasops1.c,v 1.21 2010/04/08 16:45:53 macallan Exp $);
 
 #include opt_rasops.h
 
@@ -90,7 +90,7 @@
 	u_int fs, rs, fb, bg, fg, lmask, rmask;
 	u_int32_t height, width;
 	struct rasops_info *ri;
-	int32_t *rp;
+	int32_t *rp, *hrp = NULL, tmp, tmp2;
 	u_char *fr;
 
 	ri = (struct rasops_info *)cookie;
@@ -106,6 +106,9 @@
 
 	col *= ri-ri_font-fontwidth;
 	rp = (int32_t *)(ri-ri_bits + row * ri-ri_yscale + ((col  3)  ~3));
+	if (ri-ri_hwbits)
+		hrp = (int32_t *)(ri-ri_hwbits + row * ri-ri_yscale +
+		((col  3)  ~3));
 	height = ri-ri_font-fontheight;
 	width = ri-ri_font-fontwidth;
 	col = col  31;
@@ -134,8 +137,13 @@
 			bg = rmask;
 
 			while (height--) {
-*rp = (*rp  lmask) | bg;
+tmp = (*rp  lmask) | bg;
+*rp = tmp;
 DELTA(rp, rs, int32_t *);
+if (ri-ri_hwbits) {
+	*hrp = tmp;
+	DELTA(hrp, rs, int32_t *);
+}
 			}
 		} else {
 			/* NOT fontbits if bg is white */
@@ -143,21 +151,31 @@
 while (height--) {
 	fb = ~(fr[3] | (fr[2]  8) |
 	(fr[1]  16) | (fr[0]  24));
-	*rp = (*rp  lmask)
+	tmp = (*rp  lmask)
 	| (MBE(fb  col)  rmask);
+	*rp = tmp;
 
 	fr += fs;
 	DELTA(rp, rs, int32_t *);
+	if (ri-ri_hwbits) {
+		*hrp = tmp;
+		DELTA(hrp, rs, int32_t *);
+	}
 }
 			} else {
 while (height--) {
 	fb = (fr[3] | (fr[2]  8) |
 	(fr[1]  16) | (fr[0]  24));
-	*rp = (*rp  lmask)
+	tmp = (*rp  lmask)
 	| (MBE(fb  col)  rmask);
+	*rp = tmp;
 
 	fr += fs;
 	DELTA(rp, rs, int32_t *);
+	if (ri-ri_hwbits) {
+		*hrp = tmp;
+		DELTA(hrp, rs, int32_t *);
+	}
 }
 			}
 		}
@@ -165,7 +183,12 @@
 		/* Do underline */
 		if ((attr  1) != 0) {
 			DELTA(rp, -(ri-ri_stride  1), int32_t *);
-			*rp = (*rp  lmask) | (fg  rmask);
+			tmp = (*rp  lmask) | (fg  rmask);
+			*rp = tmp;
+			if (ri-ri_hwbits) {
+DELTA(hrp, -(ri-ri_stride  1), int32_t *);
+*hrp = tmp;
+			}
 		}
 	} else {
 		lmask = ~rasops_lmask[col];
@@ -176,9 +199,16 @@
 			bg = bg  ~lmask;
 
 			while (height--) {
-rp[0] = (rp[0]  lmask) | bg;
-rp[1] = (rp[1]  rmask) | width;
+tmp = (rp[0]  lmask) | bg;
+tmp2 = (rp[1]  rmask) | width;
+rp[0] = tmp;
+rp[1] = tmp2;
 DELTA(rp, rs, int32_t *);
+if (ri-ri_hwbits) {
+	hrp[0] = tmp;
+	hrp[1] = tmp2;
+	DELTA(hrp, rs, int32_t *);
+}
 			}
 		} else {
 			width = 32 - col;
@@ -189,28 +219,40 @@
 	fb = ~(fr[3] | (fr[2]  8) |
 	(fr[1]  16) | (fr[0]  24));
 
-	rp[0] = (rp[0]  lmask)
+	tmp = (rp[0]  lmask)
 	| MBE((u_int)fb  col);
 
-	rp[1] = (rp[1]  rmask)
+	tmp2 = (rp[1]  rmask)
 	| (MBE((u_int)fb  width)  ~rmask);
-
+	rp[0] = tmp;
+	rp[1] = tmp2;
 	fr += fs;
 	DELTA(rp, rs, int32_t *);
+	if (ri-ri_hwbits) {
+		hrp[0] = tmp;
+		hrp[1] = tmp2;
+		DELTA(hrp, rs, int32_t *);
+	}
 }
 			} else {
 while (height--) {
 	fb = (fr[3] | (fr[2]  8) |
 	(fr[1]  16) | (fr[0]  24));
 
-	rp[0] = (rp[0]  lmask)
+	tmp = (rp[0]  lmask)
 	| MBE(fb  col);
 
-	rp[1] = (rp[1]  rmask)
+	tmp2 = (rp[1]  rmask)
 	| (MBE(fb  width)  ~rmask);
-
+	rp[0] = tmp;
+	rp[1] = tmp2;
 	fr += fs;
 	DELTA(rp, rs, int32_t *);
+	if (ri-ri_hwbits) {
+		hrp[0] = tmp;
+		hrp[1] = tmp2;
+		DELTA(hrp, rs, int32_t *);
+	}
 }
 			}
 		}
@@ -218,8 +260,15 @@
 		/* Do underline */
 		if ((attr  1) != 0) {
 			DELTA(rp, -(ri-ri_stride  1), int32_t *);
-			rp[0] = (rp[0]  lmask) | (fg  ~lmask);
-			rp[1] = (rp[1]  rmask) | (fg  ~rmask);
+			tmp = (rp[0]  lmask) | (fg  ~lmask);
+			tmp2 = (rp[1]  rmask) | (fg  ~rmask);
+			rp[0] = tmp;
+			rp[1] = tmp2;
+			if (ri-ri_hwbits) {
+DELTA(hrp, -(ri-ri_stride  1), int32_t *);
+hrp[0] = tmp;
+hrp[1] = tmp2;
+			}
 		}
 	}
 }
@@ -233,7 +282,7 @@
 

CVS commit: src/sys/dev/sbus

2010-04-08 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr  8 16:49:34 UTC 2010

Modified Files:
src/sys/dev/sbus: cgtwelve.c

Log Message:
use a shadow framebuffer


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sbus/cgtwelve.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/cgtwelve.c
diff -u src/sys/dev/sbus/cgtwelve.c:1.1 src/sys/dev/sbus/cgtwelve.c:1.2
--- src/sys/dev/sbus/cgtwelve.c:1.1	Wed Mar 24 00:33:06 2010
+++ src/sys/dev/sbus/cgtwelve.c	Thu Apr  8 16:49:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgtwelve.c,v 1.1 2010/03/24 00:33:06 macallan Exp $ */
+/*	$NetBSD: cgtwelve.c,v 1.2 2010/04/08 16:49:34 macallan Exp $ */
 
 /*-
  * Copyright (c) 2010 Michael Lorenz
@@ -29,7 +29,7 @@
 /* a console driver for the Sun CG12 / Matrox SG3 graphics board */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgtwelve.c,v 1.1 2010/03/24 00:33:06 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgtwelve.c,v 1.2 2010/04/08 16:49:34 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -37,6 +37,7 @@
 #include sys/device.h
 #include sys/ioctl.h
 #include sys/conf.h
+#include sys/kmem.h
 
 #include sys/bus.h
 #include machine/autoconf.h
@@ -62,6 +63,7 @@
 	device_t	sc_dev;
 	bus_space_tag_t sc_tag;
 	void		*sc_fbaddr;
+	void		*sc_shadow;
 	int		sc_width;
 	int		sc_height;
 	int		sc_stride;
@@ -162,6 +164,7 @@
 		
 	aprint_normal_dev(self, %d x %d\n, sc-sc_width, sc-sc_height);
 
+	sc-sc_shadow = kmem_alloc(sc-sc_fbsize, KM_SLEEP);
 	isconsole = fb_is_console(node);
 
 	sc-sc_mode = WSDISPLAYIO_MODE_EMUL;
@@ -193,7 +196,74 @@
 	aa.accesscookie = sc-vd;
 
 	config_found(self, aa, wsemuldisplaydevprint);
-
+#if 0
+	if (sbus_bus_map(sa-sa_bustag,
+			 sa-sa_slot,
+			 sa-sa_offset + CG12_OFF_REGISTERS,
+			 0xc, 0, bh) == 0) {
+		int i, j;
+
+		bus_space_write_4(sa-sa_bustag, bh, CG12_EIC_RESET, 0);
+
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_RDMSK_HOST, CG12_PLN_RD_ENABLE);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_WRMSK_HOST, CG12_PLN_WR_ENABLE);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_SL_HOST, CG12_PLN_SL_ENABLE);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_HPAGE, CG12_HPAGE_ENABLE);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_HACCESS, CG12_HACCESS_ENABLE);
+		memset(sc-sc_fbaddr, 0, 0x1);
+
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_RDMSK_LOC, 0x);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_WRMSK_LOC, 0x);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_LACCESS, CG12_HACCESS_24BIT);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_LPAGE, CG12_HPAGE_24BIT);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_SL_LOCAL0, CG12_PLN_SL_24BIT);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_DWG_CTL, DWGCTL_BITBLT | 0x00f3);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_F_XLEFT, 10);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_F_XRIGHT, 1010);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_Y_DST, 10);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_COLOUR0, 0x);
+#if 1
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_LENGTH | 0x1000, 800);
+#endif
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_RDMSK_HOST, CG12_PLN_RD_OVERLAY);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_WRMSK_HOST, CG12_PLN_WR_OVERLAY);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12DPU_PLN_SL_HOST, CG12_PLN_SL_OVERLAY);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_HPAGE, CG12_HPAGE_OVERLAY);
+		bus_space_write_4(sa-sa_bustag, bh,
+		CG12APU_HACCESS, CG12_HACCESS_OVERLAY);
+
+		for (i = 0x100; i  0x300; i += 32) {
+			printf(%04x:, i);
+			for (j = 0; j  32; j += 4) {
+printf( %08x, bus_space_read_4(sa-sa_bustag,
+bh, i + j));
+			}
+			printf(\n);
+		}
+		bus_space_unmap(sa-sa_bustag, bh, 0xc);
+	}
+	panic(poof);
+#endif
 }
 
 
@@ -210,7 +280,12 @@
 	ri-ri_stride = sc-sc_stride;
 	ri-ri_flg = RI_CENTER;
 
-	ri-ri_bits = sc-sc_fbaddr;
+	if (sc-sc_shadow == NULL) {
+		ri-ri_bits = sc-sc_fbaddr;
+	} else {
+		ri-ri_hwbits = sc-sc_fbaddr;
+		ri-ri_bits = sc-sc_shadow;
+	}
 
 	rasops_init(ri, ri-ri_height/8, ri-ri_width/8);
 	ri-ri_caps = WSSCREEN_REVERSE;



CVS commit: src/sys

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 17:32:30 UTC 2010

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC
src/sys/dev/acpi/wmi: files.wmi
Added Files:
src/sys/dev/acpi/wmi: wmi_hp.c

Log Message:
Add WMI mappings for HP laptops. Requested by ceg...@.
Thanks to apb@ and cegger@ for initial testing.

XXX: This conflicts with hpqlb(4). Someone with the suitable hardware needs
 to complete the list of hotkeys before -- and if -- this can replace
 hpqlb(4). For now, the driver was left uncommented in the GENERICs.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.976 -r1.977 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/wmi/files.wmi
cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/wmi/wmi_hp.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/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.273 src/sys/arch/amd64/conf/GENERIC:1.274
--- src/sys/arch/amd64/conf/GENERIC:1.273	Thu Apr  8 09:45:17 2010
+++ src/sys/arch/amd64/conf/GENERIC	Thu Apr  8 17:32:30 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.273 2010/04/08 09:45:17 jruoho Exp $
+# $NetBSD: GENERIC,v 1.274 2010/04/08 17:32:30 jruoho Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.273 $
+#ident 		GENERIC-$Revision: 1.274 $
 
 maxusers	64		# estimated number of users
 
@@ -305,6 +305,7 @@
 wb*		at acpi?		# Winbond W83L518D SD/MMC reader
 sdmmc*		at wb?			# SD/MMC bus
 wmidell*	at acpiwmibus?		# Dell WMI mappings
+#wmihp*		at acpiwmibus?		# HP WMI mappings
 
 #apm0	at mainbus0			# Advanced power management
 

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.976 src/sys/arch/i386/conf/GENERIC:1.977
--- src/sys/arch/i386/conf/GENERIC:1.976	Thu Apr  8 09:45:17 2010
+++ src/sys/arch/i386/conf/GENERIC	Thu Apr  8 17:32:30 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.976 2010/04/08 09:45:17 jruoho Exp $
+# $NetBSD: GENERIC,v 1.977 2010/04/08 17:32:30 jruoho Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.976 $
+#ident 		GENERIC-$Revision: 1.977 $
 
 maxusers	64		# estimated number of users
 
@@ -381,6 +381,7 @@
 wb*		at acpi?		# Winbond W83L518D SD/MMC reader
 sdmmc*		at wb?			# SD/MMC bus
 wmidell*	at acpiwmibus?		# Dell WMI mappings
+#wmihp*		at acpiwmibus?		# HP WMI mappings
 wss*		at acpi?		# NeoMagic 256AV in wss mode
 ym*		at acpi?		# Yamaha OPL3-SA[23] audio
 

Index: src/sys/dev/acpi/wmi/files.wmi
diff -u src/sys/dev/acpi/wmi/files.wmi:1.2 src/sys/dev/acpi/wmi/files.wmi:1.3
--- src/sys/dev/acpi/wmi/files.wmi:1.2	Thu Apr  8 12:14:19 2010
+++ src/sys/dev/acpi/wmi/files.wmi	Thu Apr  8 17:32:30 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.wmi,v 1.2 2010/04/08 12:14:19 jruoho Exp $
+#	$NetBSD: files.wmi,v 1.3 2010/04/08 17:32:30 jruoho Exp $
 
 define	acpiwmibus { }
 
@@ -11,3 +11,8 @@
 device	wmidell: sysmon_power
 attach	wmidell at acpiwmibus
 file	dev/acpi/wmi/wmi_dell.c		wmidell
+
+# HP WMI mappings
+device	wmihp: sysmon_envsys
+attach	wmihp at acpiwmibus
+file	dev/acpi/wmi/wmi_hp.c		wmihp

Added files:

Index: src/sys/dev/acpi/wmi/wmi_hp.c
diff -u /dev/null src/sys/dev/acpi/wmi/wmi_hp.c:1.1
--- /dev/null	Thu Apr  8 17:32:31 2010
+++ src/sys/dev/acpi/wmi/wmi_hp.c	Thu Apr  8 17:32:30 2010
@@ -0,0 +1,528 @@
+/*	$NetBSD: wmi_hp.c,v 1.1 2010/04/08 17:32:30 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * 

CVS commit: src/usr.bin/make

2010-04-08 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Thu Apr  8 17:41:29 UTC 2010

Modified Files:
src/usr.bin/make: main.c parse.c
src/usr.bin/make/unit-tests: Makefile test.exp
Added Files:
src/usr.bin/make/unit-tests: doterror error

Log Message:
Process .ERROR the same as .BEGIN, .END etc
so that it cannot be the default target.
Add unit-tests for .info - .error, and .ERROR.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/usr.bin/make/main.c
cvs rdiff -u -r1.161 -r1.162 src/usr.bin/make/parse.c
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/doterror \
src/usr.bin/make/unit-tests/error
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/make/unit-tests/test.exp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.176 src/usr.bin/make/main.c:1.177
--- src/usr.bin/make/main.c:1.176	Wed Apr  7 00:11:27 2010
+++ src/usr.bin/make/main.c	Thu Apr  8 17:41:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.176 2010/04/07 00:11:27 sjg Exp $	*/
+/*	$NetBSD: main.c,v 1.177 2010/04/08 17:41:29 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: main.c,v 1.176 2010/04/07 00:11:27 sjg Exp $;
+static char rcsid[] = $NetBSD: main.c,v 1.177 2010/04/08 17:41:29 sjg Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = @(#)main.c	8.3 (Berkeley) 3/19/94;
 #else
-__RCSID($NetBSD: main.c,v 1.176 2010/04/07 00:11:27 sjg Exp $);
+__RCSID($NetBSD: main.c,v 1.177 2010/04/08 17:41:29 sjg Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1876,7 +1876,7 @@
 void
 PrintOnError(GNode *gn, const char *s)
 {
-GNode *en;
+static GNode *en = NULL;
 char tmp[64];
 char *cp;
 
@@ -1885,6 +1885,8 @@
 	
 printf(\n%s: stopped in %s\n, progname, curdir);
 
+if (en)
+	return;/* we've been here! */
 if (gn) {
 	/*
 	 * We can print this even if there is no .ERROR target.

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.161 src/usr.bin/make/parse.c:1.162
--- src/usr.bin/make/parse.c:1.161	Wed Apr  7 00:11:27 2010
+++ src/usr.bin/make/parse.c	Thu Apr  8 17:41:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.161 2010/04/07 00:11:27 sjg Exp $	*/
+/*	$NetBSD: parse.c,v 1.162 2010/04/08 17:41:29 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: parse.c,v 1.161 2010/04/07 00:11:27 sjg Exp $;
+static char rcsid[] = $NetBSD: parse.c,v 1.162 2010/04/08 17:41:29 sjg Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)parse.c	8.3 (Berkeley) 3/19/94;
 #else
-__RCSID($NetBSD: parse.c,v 1.161 2010/04/07 00:11:27 sjg Exp $);
+__RCSID($NetBSD: parse.c,v 1.162 2010/04/08 17:41:29 sjg Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -191,6 +191,7 @@
 Begin,  	/* .BEGIN */
 Default,	/* .DEFAULT */
 End,	/* .END */
+dotError,	/* .ERROR */
 Ignore,	/* .IGNORE */
 Includes,	/* .INCLUDES */
 Interrupt,	/* .INTERRUPT */
@@ -245,6 +246,7 @@
 { .BEGIN, 	  Begin,	0 },
 { .DEFAULT,	  Default,  	0 },
 { .END,   	  End,		0 },
+{ .ERROR,   	  dotError,	0 },
 { .EXEC,	  Attribute,   	OP_EXEC },
 { .IGNORE,	  Ignore,   	OP_IGNORE },
 { .INCLUDES,	  Includes, 	0 },
@@ -1017,6 +1019,7 @@
 		 *	.NOPATH		Don't search for file in the path
 		 *	.BEGIN
 		 *	.END
+		 *	.ERROR
 		 *	.INTERRUPT  	Are not to be considered the
 		 *			main target.
 		 *  	.NOTPARALLEL	Make only one target at a time.
@@ -1037,6 +1040,7 @@
 			break;
 		case Begin:
 		case End:
+		case dotError:
 		case Interrupt:
 			gn = Targ_FindNode(line, TARG_CREATE);
 			gn-type |= OP_NOTMAIN|OP_SPECIAL;
@@ -1166,6 +1170,7 @@
 	case Default:
 	case Begin:
 	case End:
+	case dotError:
 	case Interrupt:
 		/*
 		 * These four create nodes on which to hang commands, so

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.25 src/usr.bin/make/unit-tests/Makefile:1.26
--- src/usr.bin/make/unit-tests/Makefile:1.25	Thu Nov 19 00:30:25 2009
+++ src/usr.bin/make/unit-tests/Makefile	Thu Apr  8 17:41:29 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2009/11/19 00:30:25 sjg Exp $
+# $NetBSD: Makefile,v 1.26 2010/04/08 17:41:29 sjg Exp $
 #
 # Unit tests for make(1)
 # The main targets are:
@@ -21,8 +21,10 @@
 SUBFILES= \
 	comment \
 	cond1 \
+	error \
 	export \
 	export-all \
+	doterror \
 	dotwait \
 	forsubst \
 	moderrs \
@@ -40,11 +42,13 @@
 
 all: ${SUBFILES}
 
+flags.doterror=
+
 # the tests are actually done with sub-makes.
 .PHONY: ${SUBFILES}
 .PRECIOUS: ${SUBFILES}
 ${SUBFILES}:
-	-...@${.make} -k -f ${UNIT_TESTS}/$@
+	

CVS commit: src

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 17:44:22 UTC 2010

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile acpiwmi.4

Log Message:
Add wmihp(4).


To generate a diff of this commit:
cvs rdiff -u -r1.1199 -r1.1200 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.513 -r1.514 src/share/man/man4/Makefile
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/acpiwmi.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1199 src/distrib/sets/lists/man/mi:1.1200
--- src/distrib/sets/lists/man/mi:1.1199	Thu Apr  8 10:06:25 2010
+++ src/distrib/sets/lists/man/mi	Thu Apr  8 17:44:22 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1199 2010/04/08 10:06:25 jruoho Exp $
+# $NetBSD: mi,v 1.1200 2010/04/08 17:44:22 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1699,6 +1699,7 @@
 ./usr/share/man/cat4/wi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wm.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wmidell.0			man-sys-catman		.cat
+./usr/share/man/cat4/wmihp.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wpi.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wscons.0			man-sys-catman		.cat
 ./usr/share/man/cat4/wsdisplay.0		man-sys-catman		.cat
@@ -4272,6 +4273,7 @@
 ./usr/share/man/html4/wi.html			man-sys-htmlman		html
 ./usr/share/man/html4/wm.html			man-sys-htmlman		html
 ./usr/share/man/html4/wmidell.html		man-sys-htmlman		html
+./usr/share/man/html4/wmihp.html		man-sys-htmlman		html
 ./usr/share/man/html4/wpi.html			man-sys-htmlman		html
 ./usr/share/man/html4/wscons.html		man-sys-htmlman		html
 ./usr/share/man/html4/wsdisplay.html		man-sys-htmlman		html
@@ -6783,6 +6785,7 @@
 ./usr/share/man/man4/wi.4			man-sys-man		.man
 ./usr/share/man/man4/wm.4			man-sys-man		.man
 ./usr/share/man/man4/wmidell.4			man-sys-man		.man
+./usr/share/man/man4/wmihp.4			man-sys-man		.man
 ./usr/share/man/man4/wpi.4			man-sys-man		.man
 ./usr/share/man/man4/wscons.4			man-sys-man		.man
 ./usr/share/man/man4/wsdisplay.4		man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.513 src/share/man/man4/Makefile:1.514
--- src/share/man/man4/Makefile:1.513	Thu Apr  8 10:06:25 2010
+++ src/share/man/man4/Makefile	Thu Apr  8 17:44:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.513 2010/04/08 10:06:25 jruoho Exp $
+#	$NetBSD: Makefile,v 1.514 2010/04/08 17:44:22 jruoho Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -144,7 +144,7 @@
 MLINKS+=drm.4 viadrm.4
 
 MLINKS+=acpiec.4 acpiecdt.4
-MLINKS+=acpiwmi.4 wmidell.4
+MLINKS+=acpiwmi.4 wmidell.4 wmihp.4
 MLINKS+=aibs.4 aiboost.4
 MLINKS+=ata.4 atabus.4
 MLINKS+=audio.4 audioctl.4

Index: src/share/man/man4/acpiwmi.4
diff -u src/share/man/man4/acpiwmi.4:1.1 src/share/man/man4/acpiwmi.4:1.2
--- src/share/man/man4/acpiwmi.4:1.1	Thu Apr  8 10:06:25 2010
+++ src/share/man/man4/acpiwmi.4	Thu Apr  8 17:44:22 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpiwmi.4,v 1.1 2010/04/08 10:06:25 jruoho Exp $
+.\ $NetBSD: acpiwmi.4,v 1.2 2010/04/08 17:44:22 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -55,8 +55,8 @@
 .Bl -tag -width wmidell  -offset indent
 .It Sy wmidell
 Dell laptops
-.\ .It Sy wmihp
-.\ Hewlett-Packard laptops
+.It Sy wmihp
+Hewlett-Packard laptops
 .El
 .Pp
 The functionality varies from vendor to vendor.
@@ -81,15 +81,16 @@
 wrote the actual
 .Nm
 as well as
-.Sy wmidell .
-.\ and .Sy wmihp .
-.\ The
-.\ .Sy wmihp
-.\ was based on the earlier work done by
-.\ Michael Gmelin
-.\ .Aq free...@grem.de
-.\ for
-.\ .Fx .
+.Sy wmidell
+and
+.Sy wmihp .
+The
+.Sy wmihp
+was based on the earlier work done by
+.An Michael Gmelin
+.Aq free...@grem.de
+for
+.Fx .
 .Sh CAVEATS
 While
 .Tn WMI



CVS commit: src/sys/arch/i386/conf

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 17:50:34 UTC 2010

Modified Files:
src/sys/arch/i386/conf: ALL

Log Message:
Add wmidell(4) and wmihp(4).


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 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.252 src/sys/arch/i386/conf/ALL:1.253
--- src/sys/arch/i386/conf/ALL:1.252	Thu Apr  1 04:04:11 2010
+++ src/sys/arch/i386/conf/ALL	Thu Apr  8 17:50:34 2010
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.252 2010/04/01 04:04:11 jakllsch Exp $
+# $NetBSD: ALL,v 1.253 2010/04/08 17:50:34 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.252 $
+#ident 		ALL-$Revision: 1.253 $
 
 maxusers	64		# estimated number of users
 
@@ -391,6 +391,8 @@
 ug* 		at acpi?		# Abit uGuru Hardware monitor
 wb*		at acpi?		# Winbond W83L518D SD/MMC reader
 sdmmc*		at wb?			# SD/MMC bus
+wmidell*	at acpiwmibus?		# Dell WMI mappings
+wmihp*		at acpiwmibus?		# HP WMI mappings
 wss* 		at acpi?		# NeoMagic 256AV in wss mode
 ym* 		at acpi?		# Yamaha OPL3-SA[23] audio
 



CVS commit: src/share/man/man4

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 17:53:42 UTC 2010

Modified Files:
src/share/man/man4: acpiwmi.4 hpqlb.4

Log Message:
Note the conflict between wmihp(4) and hpqlb(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/acpiwmi.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/hpqlb.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/acpiwmi.4
diff -u src/share/man/man4/acpiwmi.4:1.2 src/share/man/man4/acpiwmi.4:1.3
--- src/share/man/man4/acpiwmi.4:1.2	Thu Apr  8 17:44:22 2010
+++ src/share/man/man4/acpiwmi.4	Thu Apr  8 17:53:42 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpiwmi.4,v 1.2 2010/04/08 17:44:22 jruoho Exp $
+.\ $NetBSD: acpiwmi.4,v 1.3 2010/04/08 17:53:42 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -97,3 +97,8 @@
 should provide a certain degree of portability across laptop
 models from a particular vendor, there is no guarantee that the mappings
 are functional in all models.
+.Pp
+The
+.Sy wmihp
+driver conflicts with
+.Xr hpqlb 4 .

Index: src/share/man/man4/hpqlb.4
diff -u src/share/man/man4/hpqlb.4:1.4 src/share/man/man4/hpqlb.4:1.5
--- src/share/man/man4/hpqlb.4:1.4	Mon May 19 07:53:22 2008
+++ src/share/man/man4/hpqlb.4	Thu Apr  8 17:53:42 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: hpqlb.4,v 1.4 2008/05/19 07:53:22 wiz Exp $
+.\ $NetBSD: hpqlb.4,v 1.5 2010/04/08 17:53:42 jruoho Exp $
 .\
 .\ Copyright (c) 2008 Christoph Egger ceg...@netbsd.org
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 18, 2008
+.Dd April 8, 2010
 .Dt HPQLB 4
 .Os
 .Sh NAME
@@ -63,3 +63,8 @@
 .Nx
 by
 .An Christoph Egger .
+.Sh CAVEATS
+The
+.Nm
+driver conflicts with
+.Xr acpiwmi 4 .



CVS commit: src/share/man/man4

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 18:11:20 UTC 2010

Modified Files:
src/share/man/man4: hpqlb.4

Log Message:
Refer to the correct driver.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/hpqlb.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/hpqlb.4
diff -u src/share/man/man4/hpqlb.4:1.5 src/share/man/man4/hpqlb.4:1.6
--- src/share/man/man4/hpqlb.4:1.5	Thu Apr  8 17:53:42 2010
+++ src/share/man/man4/hpqlb.4	Thu Apr  8 18:11:20 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: hpqlb.4,v 1.5 2010/04/08 17:53:42 jruoho Exp $
+.\ $NetBSD: hpqlb.4,v 1.6 2010/04/08 18:11:20 jruoho Exp $
 .\
 .\ Copyright (c) 2008 Christoph Egger ceg...@netbsd.org
 .\ All rights reserved.
@@ -67,4 +67,4 @@
 The
 .Nm
 driver conflicts with
-.Xr acpiwmi 4 .
+.Xr wmihp 4 .



CVS commit: src/share/man/man4

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 18:20:46 UTC 2010

Modified Files:
src/share/man/man4: Makefile

Log Message:
Fix build failure noted by t...@.


To generate a diff of this commit:
cvs rdiff -u -r1.514 -r1.515 src/share/man/man4/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.514 src/share/man/man4/Makefile:1.515
--- src/share/man/man4/Makefile:1.514	Thu Apr  8 17:44:22 2010
+++ src/share/man/man4/Makefile	Thu Apr  8 18:20:46 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.514 2010/04/08 17:44:22 jruoho Exp $
+#	$NetBSD: Makefile,v 1.515 2010/04/08 18:20:46 jruoho Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -144,7 +144,7 @@
 MLINKS+=drm.4 viadrm.4
 
 MLINKS+=acpiec.4 acpiecdt.4
-MLINKS+=acpiwmi.4 wmidell.4 wmihp.4
+MLINKS+=acpiwmi.4 wmidell.4 acpiwmi.4 wmihp.4
 MLINKS+=aibs.4 aiboost.4
 MLINKS+=ata.4 atabus.4
 MLINKS+=audio.4 audioctl.4



CVS commit: src/share/man/man4

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr  8 18:31:53 UTC 2010

Modified Files:
src/share/man/man4: acpiwmi.4

Log Message:
Finally, add wmihp to the SYNOPSIS. Duh.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/acpiwmi.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/acpiwmi.4
diff -u src/share/man/man4/acpiwmi.4:1.3 src/share/man/man4/acpiwmi.4:1.4
--- src/share/man/man4/acpiwmi.4:1.3	Thu Apr  8 17:53:42 2010
+++ src/share/man/man4/acpiwmi.4	Thu Apr  8 18:31:53 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpiwmi.4,v 1.3 2010/04/08 17:53:42 jruoho Exp $
+.\ $NetBSD: acpiwmi.4,v 1.4 2010/04/08 18:31:53 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -35,7 +35,7 @@
 .Cd acpiwmi* at acpi?
 .Cd acpiwmibus* at acpiwmi?
 .Cd wmidell* at acpiwmibus?
-.\ .Cd wmihp* at acpiwmibus?
+.Cd wmihp* at acpiwmibus?
 .Sh DESCRIPTION
 The
 .Nm



CVS commit: [netbsd-5] src/external/mit/xorg/lib/dri

2010-04-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr  8 23:13:32 UTC 2010

Modified Files:
src/external/mit/xorg/lib/dri/i915 [netbsd-5]: Makefile
src/external/mit/xorg/lib/dri/i965 [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by yhardy in ticket #1364):
external/mit/xorg/lib/dri/i965/Makefile: revision 1.9
external/mit/xorg/lib/dri/i915/Makefile: revision 1.7
Don't link libOSMesa, this functionality is provided by mesa_dri.so.


To generate a diff of this commit:
cvs rdiff -u -r1.2.6.3 -r1.2.6.4 src/external/mit/xorg/lib/dri/i915/Makefile
cvs rdiff -u -r1.3.6.4 -r1.3.6.5 src/external/mit/xorg/lib/dri/i965/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/mit/xorg/lib/dri/i915/Makefile
diff -u src/external/mit/xorg/lib/dri/i915/Makefile:1.2.6.3 src/external/mit/xorg/lib/dri/i915/Makefile:1.2.6.4
--- src/external/mit/xorg/lib/dri/i915/Makefile:1.2.6.3	Sat Jan 16 17:36:44 2010
+++ src/external/mit/xorg/lib/dri/i915/Makefile	Thu Apr  8 23:13:32 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2.6.3 2010/01/16 17:36:44 bouyer Exp $
+# $NetBSD: Makefile,v 1.2.6.4 2010/04/08 23:13:32 snj Exp $
 
 MODULE=	i915
 
@@ -59,6 +59,5 @@
 CPPFLAGS+=	 -DI915 -DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP
 
 LIBDPLIBS+=	drm_intel	${.CURDIR}/../../libdrm_intel
-LIBDPLIBS+=	OSMesa		${.CURDIR}/../../libOSMesa
 
 .include ${.CURDIR}/../dri.mk

Index: src/external/mit/xorg/lib/dri/i965/Makefile
diff -u src/external/mit/xorg/lib/dri/i965/Makefile:1.3.6.4 src/external/mit/xorg/lib/dri/i965/Makefile:1.3.6.5
--- src/external/mit/xorg/lib/dri/i965/Makefile:1.3.6.4	Sat Jan 16 17:36:44 2010
+++ src/external/mit/xorg/lib/dri/i965/Makefile	Thu Apr  8 23:13:32 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3.6.4 2010/01/16 17:36:44 bouyer Exp $
+# $NetBSD: Makefile,v 1.3.6.5 2010/04/08 23:13:32 snj Exp $
 
 MODULE=	i965
 
@@ -90,6 +90,5 @@
 COPTS.brw_draw_upload.c=	-Wno-error
 
 LIBDPLIBS+=	drm_intel	${.CURDIR}/../../libdrm_intel
-LIBDPLIBS+=	OSMesa		${.CURDIR}/../../libOSMesa
 
 .include ${.CURDIR}/../dri.mk



CVS commit: [netbsd-5] src/external/mit/xorg/lib/dri/libmesa

2010-04-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr  8 23:14:27 UTC 2010

Modified Files:
src/external/mit/xorg/lib/dri/libmesa [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by yhardy in ticket #1364):
external/mit/xorg/lib/dri/libmesa/Makefile: revision 1.5
i915 and i965 dri modules need glapi.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 \
src/external/mit/xorg/lib/dri/libmesa/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/mit/xorg/lib/dri/libmesa/Makefile
diff -u src/external/mit/xorg/lib/dri/libmesa/Makefile:1.1.2.5 src/external/mit/xorg/lib/dri/libmesa/Makefile:1.1.2.6
--- src/external/mit/xorg/lib/dri/libmesa/Makefile:1.1.2.5	Sat Oct 10 19:53:22 2009
+++ src/external/mit/xorg/lib/dri/libmesa/Makefile	Thu Apr  8 23:14:27 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.5 2009/10/10 19:53:22 sborrill Exp $
+#	$NetBSD: Makefile,v 1.1.2.6 2010/04/08 23:14:27 snj Exp $
 
 .include bsd.own.mk
 
@@ -7,7 +7,7 @@
 
 SHLIB_MAJOR=	0
 
-MESA_SRC_MODULES=	main math vbo tnl shader swrast slang ss
+MESA_SRC_MODULES=	glapi main math vbo tnl shader swrast slang ss
 
 CPPFLAGS+=	-I${X11SRCDIR.MesaLib}/src/mesa/main \
 		-I${X11SRCDIR.MesaLib}/src/mesa/glapi \



CVS commit: [netbsd-5] src/doc

2010-04-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr  8 23:17:24 UTC 2010

Modified Files:
src/doc [netbsd-5]: CHANGES-5.1

Log Message:
Ticket 1364.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.222 -r1.1.2.223 src/doc/CHANGES-5.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.222 src/doc/CHANGES-5.1:1.1.2.223
--- src/doc/CHANGES-5.1:1.1.2.222	Sun Apr  4 23:23:51 2010
+++ src/doc/CHANGES-5.1	Thu Apr  8 23:17:24 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.222 2010/04/04 23:23:51 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.223 2010/04/08 23:17:24 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -17146,3 +17146,11 @@
 	http://bugs.freedesktop.org/show_bug.cgi?id=20718
 	[mrg, ticket #1361]
 
+external/mit/xorg/lib/dri/i915/Makefile		1.7
+external/mit/xorg/lib/dri/i965/Makefile		1.9
+external/mit/xorg/lib/dri/libmesa/Makefile	1.5
+
+	Fix a problem where GL applications would dump core when run under
+	the intel driver.  PR xsrc/42754.
+	[yhardy, ticket #1364]
+



CVS commit: src/crypto/external/bsd/openssl/dist/ssl

2010-04-08 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Apr  9 04:34:13 UTC 2010

Modified Files:
src/crypto/external/bsd/openssl/dist/ssl: s3_enc.c s3_srvr.c t1_enc.c

Log Message:
Fix crash in openssl (I suspect caused by malformed packets):
handshake_dgst[] may be used without being allocated, causing NULL
pointer dereference.
Fix by checking that handshake_dgst is not NULL before use.
Reported to openssl as ticket openssl.org #2214.
Fix tested on netbsd-5 by Luke Mewburn with apache, and by me with
freeradius (fixing segmentation fault in both cases).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/openssl/dist/ssl/t1_enc.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/external/bsd/openssl/dist/ssl/s3_enc.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c:1.1.1.1 src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c:1.2
--- src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c:1.1.1.1	Sun Jul 19 23:05:47 2009
+++ src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c	Fri Apr  9 04:34:13 2010
@@ -578,7 +578,7 @@
 		{
 		BIO_write (s-s3-handshake_buffer,(void *)buf,len);
 		} 
-	else 
+	else if (s-s3-handshake_dgst != NULL)
 		{
 		int i;
 		for (i=0;i SSL_MAX_DIGEST;i++) 

Index: src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c:1.4 src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c:1.5
--- src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c:1.4	Sun Jan 10 16:39:10 2010
+++ src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c	Fri Apr  9 04:34:13 2010
@@ -537,20 +537,22 @@
 if (s-s3-handshake_buffer)
 	if (!ssl3_digest_cached_records(s))
 		return -1;
-for (dgst_num=0; dgst_numSSL_MAX_DIGEST;dgst_num++)	
-	if (s-s3-handshake_dgst[dgst_num]) 
-		{
-		int dgst_size;
-
-		s-method-ssl3_enc-cert_verify_mac(s,EVP_MD_CTX_type(s-s3-handshake_dgst[dgst_num]),(s-s3-tmp.cert_verify_md[offset]));
-		dgst_size=EVP_MD_CTX_size(s-s3-handshake_dgst[dgst_num]);
-		if (dgst_size  0)
+if (s-s3-handshake_dgst != NULL) {
+	for (dgst_num=0; dgst_numSSL_MAX_DIGEST;dgst_num++)	
+		if (s-s3-handshake_dgst[dgst_num]) 
 			{
-			ret = -1;
-			goto end;
-			}
-		offset+=dgst_size;
-		}		
+			int dgst_size;
+
+			s-method-ssl3_enc-cert_verify_mac(s,EVP_MD_CTX_type(s-s3-handshake_dgst[dgst_num]),(s-s3-tmp.cert_verify_md[offset]));
+			dgst_size=EVP_MD_CTX_size(s-s3-handshake_dgst[dgst_num]);
+			if (dgst_size  0)
+{
+ret = -1;
+goto end;
+}
+			offset+=dgst_size;
+			}		
+	}
 }
 			break;
 

Index: src/crypto/external/bsd/openssl/dist/ssl/t1_enc.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/t1_enc.c:1.1.1.2 src/crypto/external/bsd/openssl/dist/ssl/t1_enc.c:1.2
--- src/crypto/external/bsd/openssl/dist/ssl/t1_enc.c:1.1.1.2	Sat Dec 26 23:34:36 2009
+++ src/crypto/external/bsd/openssl/dist/ssl/t1_enc.c	Fri Apr  9 04:34:13 2010
@@ -788,14 +788,16 @@
 		if (!ssl3_digest_cached_records(s))
 			return 0;
 
-	for (i=0;iSSL_MAX_DIGEST;i++) 
-		{
-		  if (s-s3-handshake_dgst[i]EVP_MD_CTX_type(s-s3-handshake_dgst[i])==md_nid) 
-		  	{
-		  	d=s-s3-handshake_dgst[i];
-			break;
+	if (s-s3-handshake_dgst) {
+		for (i=0;iSSL_MAX_DIGEST;i++) 
+			{
+			  if (s-s3-handshake_dgst[i]EVP_MD_CTX_type(s-s3-handshake_dgst[i])==md_nid) 
+{
+d=s-s3-handshake_dgst[i];
+break;
+}
 			}
-		}
+	}
 	if (!d) {
 		SSLerr(SSL_F_TLS1_CERT_VERIFY_MAC,SSL_R_NO_REQUIRED_DIGEST);
 		return 0;
@@ -833,7 +835,7 @@
 		if (mask  s-s3-tmp.new_cipher-algorithm2)
 			{
 			int hashsize = EVP_MD_size(md);
-			if (hashsize  0 || hashsize  (int)(sizeof buf - (size_t)(q-buf)))
+			if (hashsize  0 || hashsize  (int)(sizeof buf - (size_t)(q-buf)) || s-s3-handshake_dgst == NULL)
 {
 /* internal error: 'buf' is too small for this cipersuite! */
 err = 1;



CVS commit: src/sys/dev/acpi/wmi

2010-04-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Apr  9 04:48:23 UTC 2010

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c

Log Message:
Fix a potential NULL pointer dereference.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/wmi/wmi_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/wmi/wmi_acpi.c
diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.2 src/sys/dev/acpi/wmi/wmi_acpi.c:1.3
--- src/sys/dev/acpi/wmi/wmi_acpi.c:1.2	Thu Apr  8 12:36:21 2010
+++ src/sys/dev/acpi/wmi/wmi_acpi.c	Fri Apr  9 04:48:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpi.c,v 1.2 2010/04/08 12:36:21 jruoho Exp $	*/
+/*	$NetBSD: wmi_acpi.c,v 1.3 2010/04/09 04:48:23 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wmi_acpi.c,v 1.2 2010/04/08 12:36:21 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: wmi_acpi.c,v 1.3 2010/04/09 04:48:23 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -501,14 +501,14 @@
 	ACPI_OBJECT obj;
 	ACPI_HANDLE hdl;
 
-	hdl = sc-sc_node-ad_handle;
-
 	if (sc == NULL || obuf == NULL)
 		return AE_BAD_PARAMETER;
 
 	if (sc-sc_handler == NULL)
 		return AE_ABORT_METHOD;
 
+	hdl = sc-sc_node-ad_handle;
+
 	obj.Type = ACPI_TYPE_INTEGER;
 	obj.Integer.Value = event;