CVS commit: src/external/lgpl3/gmp/dist

2012-12-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Dec 16 14:40:08 UTC 2012

Modified Files:
src/external/lgpl3/gmp/dist: gmp-h.in

Log Message:
Always use extern __inline__ with gcc = 4.2.
Fall back to prototypes on older gcc versions.

Fixes link errors (duplicate symbols) when mpfr's configure check for libgmp


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/lgpl3/gmp/dist/gmp-h.in

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

Modified files:

Index: src/external/lgpl3/gmp/dist/gmp-h.in
diff -u src/external/lgpl3/gmp/dist/gmp-h.in:1.2 src/external/lgpl3/gmp/dist/gmp-h.in:1.3
--- src/external/lgpl3/gmp/dist/gmp-h.in:1.2	Sat Jul  2 14:05:03 2011
+++ src/external/lgpl3/gmp/dist/gmp-h.in	Sun Dec 16 14:40:07 2012
@@ -421,10 +421,9 @@ typedef __mpq_struct *mpq_ptr;
 GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
 inline semantics, unless -fgnu89-inline is used.  */
 #ifdef __GNUC__
-#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4  __GNUC_MINOR__ == 2)
+#if (defined __GNUC_STDC_INLINE__) || \
+(__GNUC__ == 4  __GNUC_MINOR__ = 2) || (__GNUC__  4)
 #define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
-#else
-#define __GMP_EXTERN_INLINE  extern __inline__
 #endif
 #define __GMP_INLINE_PROTOTYPES  1
 #endif



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

2012-10-12 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Oct 12 13:02:30 UTC 2012

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

Log Message:
Add support for various things:
- hddtemp sensor
- ambient light sensor on/off (via sysctl)
- display info
- docking station info


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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/dev/acpi/wmi/wmi_hp.c
diff -u src/sys/dev/acpi/wmi/wmi_hp.c:1.6 src/sys/dev/acpi/wmi/wmi_hp.c:1.7
--- src/sys/dev/acpi/wmi/wmi_hp.c:1.6	Wed Feb 16 13:15:49 2011
+++ src/sys/dev/acpi/wmi/wmi_hp.c	Fri Oct 12 13:02:28 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_hp.c,v 1.6 2011/02/16 13:15:49 jruoho Exp $ */
+/*	$NetBSD: wmi_hp.c,v 1.7 2012/10/12 13:02:28 cegger Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wmi_hp.c,v 1.6 2011/02/16 13:15:49 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: wmi_hp.c,v 1.7 2012/10/12 13:02:28 cegger Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -70,6 +70,13 @@ __KERNEL_RCSID(0, $NetBSD: wmi_hp.c,v 1
 
 #include dev/sysmon/sysmonvar.h
 
+#include sys/sysctl.h
+
+/*
+ * HP CMI whitepaper:
+ * http://h20331.www2.hp.com/Hpsub/downloads/cmi_whitepaper.pdf
+ */
+
 #define _COMPONENT			ACPI_RESOURCE_COMPONENT
 ACPI_MODULE_NAME			(wmi_hp)
 
@@ -93,6 +100,12 @@ ACPI_MODULE_NAME			(wmi_hp)
 
 #define WMI_HP_HOTKEY_BRIGHTNESS_UP	0x02
 #define WMI_HP_HOTKEY_BRIGHTNESS_DOWN	0x03
+#define WMI_HP_HOTKEY_PROG1		0x20e6
+#define WMI_HP_HOTKEY_MEDIA1		0x20e8
+#define WMI_HP_HOTKEY_MEDIA2		0x2142
+#define WMI_HP_HOTKEY_INFO		0x213b
+#define WMI_HP_HOTKEY_DIRECTION		0x2169
+#define WMI_HP_HOTKEY_HELP		0x231b
 /*  WMI_HP_HOTKEY_UNKNOWN		0xXX */
 
 #define WMI_HP_SWITCH_WLAN		0x01
@@ -118,12 +131,21 @@ ACPI_MODULE_NAME			(wmi_hp)
 
 #define WMI_HP_GUID_EVENT		95F24279-4D7B-4334-9387-ACCDC67EF61C
 #define WMI_HP_GUID_METHOD		5FB7F034-2C63-45E9-BE91-3D44E2C707E4
+#define WMI_HP_GUID_CMI			2D114B49-2DFB-4130-B8FE-4A3C09E75133
 
 #define WMI_HP_SENSOR_WLAN		0
 #define WMI_HP_SENSOR_BT		1
 #define WMI_HP_SENSOR_WWAN		2
-#define WMI_HP_SENSOR_COUNT		3
-#define WMI_HP_SENSOR_SIZE		3 * sizeof(envsys_data_t)
+#define WMI_HP_SENSOR_HDDTEMP		3
+#define WMI_HP_SENSOR_DISPLAY		4
+#define WMI_HP_SENSOR_DOCK		5
+#define WMI_HP_SENSOR_COUNT		6
+#define WMI_HP_SENSOR_SIZE	WMI_HP_SENSOR_COUNT * sizeof(envsys_data_t)
+
+#define ACPI_HP_CMI_PATHS		0x01
+#define ACPI_HP_CMI_ENUMS		0x02
+#define ACPI_HP_CMI_FLAGS		0x04
+#define ACPI_HP_CMI_MAX_INSTANCE	0x08
 
 struct wmi_hp_softc {
 	device_t		sc_dev;
@@ -143,13 +165,17 @@ static void	wmi_hp_notify_handler(ACPI_H
 static void	wmi_hp_hotkey(void *);
 static bool	wmi_hp_method(struct wmi_hp_softc *);
 static bool	wmi_hp_method_read(struct wmi_hp_softc *, uint8_t);
-
-#if 0
 static bool	wmi_hp_method_write(struct wmi_hp_softc *, uint8_t, uint32_t);
-#endif
 
 static void	wmi_hp_sensor_init(struct wmi_hp_softc *);
-static void	wmi_hp_sensor_update(void *);
+static void	wmi_hp_sensor_switch_update(void *);
+static void	wmi_hp_sensor_refresh(struct sysmon_envsys *, envsys_data_t *);
+
+static void sysctl_wmi_hp_setup(struct wmi_hp_softc *);
+static int sysctl_wmi_hp_set_als(SYSCTLFN_PROTO);
+static struct sysctllog *wmihp_sysctllog = NULL;
+static int wmihp_als = 0;
+static struct wmi_hp_softc *wmi_hp_sc = NULL;  /* XXX */
 
 CFATTACH_DECL_NEW(wmihp, sizeof(struct wmi_hp_softc),
 wmi_hp_match, wmi_hp_attach, wmi_hp_detach, NULL);
@@ -193,7 +219,9 @@ wmi_hp_attach(device_t parent, device_t 
 	if (sc-sc_sensor == NULL)
 		return;
 
+	wmi_hp_sc = sc; /* XXX Can I pass sc as a cookie to sysctl? */
 	wmi_hp_sensor_init(sc);
+	sysctl_wmi_hp_setup(sc);
 }
 
 static int
@@ -215,6 +243,11 @@ wmi_hp_detach(device_t self, int flags)
 
 	pmf_device_deregister(self);
 
+	if (wmihp_sysctllog != NULL)
+		sysctl_teardown(wmihp_sysctllog);
+	wmihp_sysctllog = NULL;
+	wmi_hp_sc = NULL;
+
 	return 0;
 }
 
@@ -283,7 +316,7 @@ wmi_hp_notify_handler(ACPI_HANDLE hdl, u
 	switch (val) {
 
 	case WMI_HP_EVENT_SWITCH:
-		rv = AcpiOsExecute(handler, wmi_hp_sensor_update, self);
+		rv = AcpiOsExecute(handler, wmi_hp_sensor_switch_update, self);
 		break;
 
 	case WMI_HP_EVENT_HOTKEY:
@@ -327,6 +360,24 @@ wmi_hp_hotkey(void *aux)
 		pmf_event_inject(NULL, PMFE_DISPLAY_BRIGHTNESS_DOWN);
 		break;
 
+	case WMI_HP_HOTKEY_PROG1:
+		aprint_debug_dev(self, PROG1 hotkey pressed\n);
+		break;
+	case WMI_HP_HOTKEY_MEDIA1:
+		aprint_debug_dev(self, MEDIA1 hotkey pressed\n);
+		break;
+	case WMI_HP_HOTKEY_MEDIA2:
+		aprint_debug_dev(self, MEDIA2 hotkey pressed\n);
+		break;
+	case WMI_HP_HOTKEY_INFO:
+		aprint_debug_dev(self, INFO hotkey pressed\n);
+		break;
+	case WMI_HP_HOTKEY_DIRECTION:
+		aprint_debug_dev(self, DIRECTION hotkey pressed\n);
+		break;
+	case WMI_HP_HOTKEY_HELP:
+		

CVS commit: src/sys/dev/usb

2012-07-17 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jul 17 10:18:43 UTC 2012

Modified Files:
src/sys/dev/usb: usb.c

Log Message:
Do not mutex_enter() a usb_taskq[-1].
Fixes LOCKDEBUG panic.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/dev/usb/usb.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/usb/usb.c
diff -u src/sys/dev/usb/usb.c:1.130 src/sys/dev/usb/usb.c:1.131
--- src/sys/dev/usb/usb.c:1.130	Sun Jun 10 06:15:54 2012
+++ src/sys/dev/usb/usb.c	Tue Jul 17 10:18:43 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.130 2012/06/10 06:15:54 mrg Exp $	*/
+/*	$NetBSD: usb.c,v 1.131 2012/07/17 10:18:43 cegger Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.130 2012/06/10 06:15:54 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.131 2012/07/17 10:18:43 cegger Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_usb.h
@@ -364,12 +364,13 @@ usb_rem_task(usbd_device_handle dev, str
 {
 	struct usb_taskq *taskq;
 
+	if (task-queue == -1)
+		return;
+
 	taskq = usb_taskq[task-queue];
 	mutex_enter(taskq-lock);
-	if (task-queue != -1) {
-		TAILQ_REMOVE(taskq-tasks, task, next);
-		task-queue = -1;
-	}
+	TAILQ_REMOVE(taskq-tasks, task, next);
+	task-queue = -1;
 	mutex_exit(taskq-lock);
 }
 



CVS commit: src/sys/dev/usb

2012-07-17 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jul 17 10:33:46 UTC 2012

Modified Files:
src/sys/dev/usb: usb.c

Log Message:
revert previous. testing queue number requires lock held.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/dev/usb/usb.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/usb/usb.c
diff -u src/sys/dev/usb/usb.c:1.131 src/sys/dev/usb/usb.c:1.132
--- src/sys/dev/usb/usb.c:1.131	Tue Jul 17 10:18:43 2012
+++ src/sys/dev/usb/usb.c	Tue Jul 17 10:33:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.131 2012/07/17 10:18:43 cegger Exp $	*/
+/*	$NetBSD: usb.c,v 1.132 2012/07/17 10:33:46 cegger Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.131 2012/07/17 10:18:43 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.132 2012/07/17 10:33:46 cegger Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_usb.h
@@ -364,13 +364,12 @@ usb_rem_task(usbd_device_handle dev, str
 {
 	struct usb_taskq *taskq;
 
-	if (task-queue == -1)
-		return;
-
 	taskq = usb_taskq[task-queue];
 	mutex_enter(taskq-lock);
-	TAILQ_REMOVE(taskq-tasks, task, next);
-	task-queue = -1;
+	if (task-queue != -1) {
+		TAILQ_REMOVE(taskq-tasks, task, next);
+		task-queue = -1;
+	}
 	mutex_exit(taskq-lock);
 }
 



CVS commit: src/sys/arch/xen/xen

2012-05-23 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed May 23 10:01:51 UTC 2012

Modified Files:
src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
destroy mutex and cv first.
Fixes LOCKDEBUG crash when a guest shut down.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/xen/xbdback_xenbus.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/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.55 src/sys/arch/xen/xen/xbdback_xenbus.c:1.56
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.55	Wed Dec  7 15:47:43 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Wed May 23 10:01:51 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.55 2011/12/07 15:47:43 cegger Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.56 2012/05/23 10:01:51 cegger Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.55 2011/12/07 15:47:43 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: xbdback_xenbus.c,v 1.56 2012/05/23 10:01:51 cegger Exp $);
 
 #include sys/atomic.h
 #include sys/buf.h
@@ -513,6 +513,8 @@ xbdback_xenbus_destroy(void *arg)
 		vn_close(xbdi-xbdi_vp, FREAD, NOCRED);
 	}
 	SLIST_REMOVE(xbdback_instances, xbdi, xbdback_instance, next);
+	mutex_destroy(xbdi-xbdi_lock);
+	cv_destroy(xbdi-xbdi_cv);
 	kmem_free(xbdi, sizeof(*xbdi));
 	return 0;
 }



CVS commit: src/sys/arch/x86/x86

2012-05-09 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed May  9 13:58:09 UTC 2012

Modified Files:
src/sys/arch/x86/x86: cpu_ucode_amd.c

Log Message:
fix crash when booting with -x.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/cpu_ucode_amd.c

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

Modified files:

Index: src/sys/arch/x86/x86/cpu_ucode_amd.c
diff -u src/sys/arch/x86/x86/cpu_ucode_amd.c:1.1 src/sys/arch/x86/x86/cpu_ucode_amd.c:1.2
--- src/sys/arch/x86/x86/cpu_ucode_amd.c:1.1	Fri Jan 13 16:05:15 2012
+++ src/sys/arch/x86/x86/cpu_ucode_amd.c	Wed May  9 13:58:09 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_amd.c,v 1.1 2012/01/13 16:05:15 cegger Exp $ */
+/* $NetBSD: cpu_ucode_amd.c,v 1.2 2012/05/09 13:58:09 cegger Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_ucode_amd.c,v 1.1 2012/01/13 16:05:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_ucode_amd.c,v 1.2 2012/05/09 13:58:09 cegger Exp $);
 
 #include opt_xen.h
 #include opt_cpu_ucode.h
@@ -168,7 +168,7 @@ cpu_apply_cb(void *arg0, void *arg1)
 
 		hdr = (struct microcode_amd_header *)mc_amd.mpb;
 		if (hdr-ah_processor_rev_id != mc.mc_equiv_cpuid) {
-			aprint_debug_dev(dev, ucode: patch does not
+			aprint_debug_dev(dev, ucode: patch does not 
 			match this cpu 
 			(patch is for cpu id %x, cpu id is %x)\n,
 			hdr-ah_processor_rev_id, mc.mc_equiv_cpuid);
@@ -196,6 +196,8 @@ cpu_apply_cb(void *arg0, void *arg1)
 		}
 
 next:
+		if (mc.mc_mpbuf == NULL)
+			break;
 		mc.mc_buf += mc.mc_mpbuf-mpb_len +
 		sizeof(mc.mc_mpbuf-mpb_type) +
 		sizeof(mc.mc_mpbuf-mpb_len);



CVS commit: src/usr.sbin/cpuctl/arch

2012-04-17 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Apr 17 13:00:10 UTC 2012

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
print cpu family for AMD CPU families 0x12 - 0x15


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/cpuctl/arch/i386.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/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.30 src/usr.sbin/cpuctl/arch/i386.c:1.31
--- src/usr.sbin/cpuctl/arch/i386.c:1.30	Thu Apr  5 11:05:53 2012
+++ src/usr.sbin/cpuctl/arch/i386.c	Tue Apr 17 13:00:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.30 2012/04/05 11:05:53 cegger Exp $	*/
+/*	$NetBSD: i386.c,v 1.31 2012/04/17 13:00:09 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: i386.c,v 1.30 2012/04/05 11:05:53 cegger Exp $);
+__RCSID($NetBSD: i386.c,v 1.31 2012/04/17 13:00:09 cegger Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -959,24 +959,22 @@ amd_amd64_name(struct cpu_info *ci)
 		}
 		break;
 	case 0x01:
-		switch (model) {
-			case 0x02:
-ret = Family 10h;
-break;
-			default:
-ret = Unknown AMD64 CPU;
-break;
-		}
+		ret = Family 10h;
 		break;
 	case 0x02:
-		switch (model) {
-			case 0x03:
-ret = Family 11h;
-break;
-			default:
-ret = Unknown AMD64 CPU;
-break;
-		}
+		ret = Family 11h;
+		break;
+	case 0x03:
+		ret = Family 12h;
+		break;
+	case 0x05:
+		ret = Family 14h;
+		break;
+	case 0x06:
+		ret = Family 15h;
+		break;
+	default:
+		ret = Unknown AMD64 CPU;
 		break;
 	}
 



CVS commit: src/sys/arch/x86/pci

2012-04-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Apr 16 16:07:24 UTC 2012

Modified Files:
src/sys/arch/x86/pci: amdnb_misc.c

Log Message:
Add rescan support. Re-fixes PR 45268.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/pci/amdnb_misc.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdnb_misc.c
diff -u src/sys/arch/x86/pci/amdnb_misc.c:1.1 src/sys/arch/x86/pci/amdnb_misc.c:1.2
--- src/sys/arch/x86/pci/amdnb_misc.c:1.1	Fri Apr 13 13:11:17 2012
+++ src/sys/arch/x86/pci/amdnb_misc.c	Mon Apr 16 16:07:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdnb_misc.c,v 1.1 2012/04/13 13:11:17 cegger Exp $ */
+/*	$NetBSD: amdnb_misc.c,v 1.2 2012/04/16 16:07:24 cegger Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amdnb_misc.c,v 1.1 2012/04/13 13:11:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: amdnb_misc.c,v 1.2 2012/04/16 16:07:24 cegger Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -41,9 +41,16 @@ __KERNEL_RCSID(0, $NetBSD: amdnb_misc.c
 static int amdnb_misc_match(device_t, cfdata_t match, void *);
 static void amdnb_misc_attach(device_t, device_t, void *);
 static int amdnb_misc_detach(device_t, int);
+static int amdnb_misc_rescan(device_t, const char *, const int *);
+static void amdnb_misc_childdet(device_t, device_t);
 
-CFATTACH_DECL_NEW(amdnb_misc, 0,
-amdnb_misc_match, amdnb_misc_attach, amdnb_misc_detach, NULL);
+struct amdnb_misc_softc {
+	struct pci_attach_args sc_pa;
+};
+
+CFATTACH_DECL3_NEW(amdnb_misc, sizeof(struct amdnb_misc_softc),
+amdnb_misc_match, amdnb_misc_attach, amdnb_misc_detach, NULL,
+amdnb_misc_rescan, amdnb_misc_childdet, DVF_DETACH_SHUTDOWN);
 
 
 static int
@@ -71,8 +78,41 @@ amdnb_misc_match(device_t parent, cfdata
 static int
 amdnb_misc_search(device_t parent, cfdata_t cf, const int *locs, void *aux)
 {
-	if (config_match(parent, cf, aux))
-		config_attach_loc(parent, cf, locs, aux, NULL);
+	device_t dev;
+	deviter_t di;
+	bool attach;
+
+	if (!config_match(parent, cf, aux))
+		return 0;
+
+	attach = true;
+
+	/* Figure out if found child 'cf' is already attached.
+	 * No need to attach it twice.
+	 */
+
+	/* XXX: I only want to iterate over the children of *this* device.
+	 * Can we introduce a
+	 * deviter_first_child(di, parent, DEVITER_F_LEAVES_ONLY)
+	 * or even better, can we introduce a query function that returns
+	 * if a child is already attached?
+	 */
+	for (dev = deviter_first(di, DEVITER_F_LEAVES_FIRST); dev != NULL;
+	dev = deviter_next(di))
+	{
+		if (device_parent(dev) != parent)
+			continue;
+		if (device_is_a(dev, cf-cf_name)) {
+			attach = false;
+			break;
+		}
+	}
+	deviter_release(di);
+
+	if (!attach)
+		return 0;
+
+	config_attach_loc(parent, cf, locs, aux, NULL);
 
 	return 0;
 }
@@ -80,13 +120,20 @@ amdnb_misc_search(device_t parent, cfdat
 static void
 amdnb_misc_attach(device_t parent, device_t self, void *aux)
 {
+	struct amdnb_misc_softc *sc = device_private(self);
+	struct pci_attach_args *pa = aux;
+
+	sc-sc_pa = *pa;
+
 	aprint_naive(\n);
 	aprint_normal(: AMD NB Misc Configuration\n);
 
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, couldn't establish power handler\n);
 
-	config_search_loc(amdnb_misc_search, self, amdnb_miscbus, NULL, aux);
+	config_search_loc(amdnb_misc_search, self, amdnb_miscbus,
+	NULL, sc-sc_pa);
+
 	return;
 }
 
@@ -102,3 +149,23 @@ amdnb_misc_detach(device_t self, int fla
 	pmf_device_deregister(self);
 	return rv;
 }
+
+static int
+amdnb_misc_rescan(device_t self, const char *ifattr, const int *locators)
+{
+	struct amdnb_misc_softc *sc = device_private(self);
+
+	if (!ifattr_match(ifattr, amdnb_miscbus))
+		return 0;
+
+	config_search_loc(amdnb_misc_search, self, ifattr,
+	locators, sc-sc_pa);
+
+	return 0;
+}
+
+static void
+amdnb_misc_childdet(device_t self, device_t child)
+{
+	return;
+}



CVS commit: src/sys/dev/pci

2012-04-13 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Apr 13 12:03:14 UTC 2012

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD Family15h ids


To generate a diff of this commit:
cvs rdiff -u -r1.1114 -r1.1115 src/sys/dev/pci/pcidevs

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/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1114 src/sys/dev/pci/pcidevs:1.1115
--- src/sys/dev/pci/pcidevs:1.1114	Mon Apr  9 08:09:36 2012
+++ src/sys/dev/pci/pcidevs	Fri Apr 13 12:03:14 2012
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1114 2012/04/09 08:09:36 mlelstv Exp $
+$NetBSD: pcidevs,v 1.1115 2012/04/13 12:03:14 cegger Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -932,6 +932,12 @@ product AMD AMD64_F11_DRAM	0x1302	AMD64 
 product AMD AMD64_F11_MISC	0x1303	AMD64 Family11h Miscellaneous Configuration
 product AMD AMD64_F11_LINK	0x1304	AMD64 Family11h Link Configuration
 product AMD F14_RC	0x1510	Family14h Root Complex
+product AMD F15_HT	0x1600	Family15h HyperTransport Configuration
+product AMD F15_ADDR	0x1601	Family15h Address Map Configuration
+product AMD F15_DRAM	0x1602	Family15h DRAM Configuration
+product AMD F15_MISC	0x1603	Family15h Miscellaneous Configuration
+product AMD F15_LINK	0x1604	Family15h Link Configuration
+product AMD F15_NB	0x1605	Family15h North Bridge Configuration
 product AMD F14_HT	0x1700	Family12h/14h HyperTransport Configuration
 product AMD F14_ADDR	0x1701	Family12h/14h Address Map Configuration
 product AMD F14_DRAM	0x1702	Family12h/14h DRAM Configuration



CVS commit: src/sys/arch/x86/pci

2012-04-13 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Apr 13 12:14:42 UTC 2012

Modified Files:
src/sys/arch/x86/pci: amdtemp.c

Log Message:
- support AMD Family15h
- deregister pmf on detach


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/pci/amdtemp.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdtemp.c
diff -u src/sys/arch/x86/pci/amdtemp.c:1.13 src/sys/arch/x86/pci/amdtemp.c:1.14
--- src/sys/arch/x86/pci/amdtemp.c:1.13	Fri Mar  2 19:26:41 2012
+++ src/sys/arch/x86/pci/amdtemp.c	Fri Apr 13 12:14:41 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdtemp.c,v 1.13 2012/03/02 19:26:41 nonaka Exp $ */
+/*  $NetBSD: amdtemp.c,v 1.14 2012/04/13 12:14:41 cegger Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -48,7 +48,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amdtemp.c,v 1.13 2012/03/02 19:26:41 nonaka Exp $ );
+__KERNEL_RCSID(0, $NetBSD: amdtemp.c,v 1.14 2012/04/13 12:14:41 cegger Exp $ );
 
 #include sys/param.h
 #include sys/bus.h
@@ -197,6 +197,7 @@ amdtemp_match(device_t parent, cfdata_t 
 	case PCI_PRODUCT_AMD_AMD64_F10_MISC:
 	case PCI_PRODUCT_AMD_AMD64_F11_MISC:
 	case PCI_PRODUCT_AMD_F14_NB:	/* Family12h too */
+	case PCI_PRODUCT_AMD_F15_MISC:
 		break;
 	default:
 		return 0;
@@ -225,7 +226,7 @@ amdtemp_match(device_t parent, cfdata_t 
 
 
 	/* Not yet supported CPUs */
-	if (family  0x14)
+	if (family  0x15)
 		return 0;
 
 	return 2;	/* supercede pchb(4) */
@@ -270,6 +271,7 @@ amdtemp_attach(device_t parent, device_t
 	case 0x11: /* AMD Griffin */
 	case 0x12: /* AMD Lynx/Sabine (Llano) */
 	case 0x14: /* AMD Brazos (Ontario/Zacate/Desna) */
+	case 0x15:
 		amdtemp_family10_init(sc);
 		break;
 
@@ -299,6 +301,7 @@ amdtemp_attach(device_t parent, device_t
 	case 0x11:
 	case 0x12:
 	case 0x14:
+	case 0x15:
 		amdtemp_family10_setup_sensors(sc, device_unit(self));
 		break;
 	}
@@ -326,6 +329,7 @@ amdtemp_attach(device_t parent, device_t
 	case 0x11:
 	case 0x12:
 	case 0x14:
+	case 0x15:
 		sc-sc_sme-sme_refresh = amdtemp_family10_refresh;
 		break;
 	}
@@ -358,6 +362,7 @@ amdtemp_detach(device_t self, int flags)
 {
 	struct amdtemp_softc *sc = device_private(self);
 
+	pmf_device_deregister(self);
 	if (sc-sc_sme != NULL)
 		sysmon_envsys_unregister(sc-sc_sme);
 



CVS commit: src/sys/arch

2012-04-13 Thread Christoph Egger
-ISA w/ HPET

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.64 src/sys/arch/i386/conf/XEN3_DOM0:1.65
--- src/sys/arch/i386/conf/XEN3_DOM0:1.64	Sat Mar 10 21:51:53 2012
+++ src/sys/arch/i386/conf/XEN3_DOM0	Fri Apr 13 13:11:16 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3_DOM0,v 1.64 2012/03/10 21:51:53 joerg Exp $
+#	$NetBSD: XEN3_DOM0,v 1.65 2012/04/13 13:11:16 cegger Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -273,7 +273,8 @@ lpt0	at isa? port 0x378 irq 7	# standard
 
 # Hardware monitors
 
-amdtemp* at pchb?			# AMD CPU Temperature sensors
+amdnb_misc* at pci?			# AMD NB Misc Configuration
+amdtemp* at amdnb_misc?			# AMD CPU Temperature sensors
 
 # AMD 768 and 8111 power/ACPI controllers
 amdpm*	at pci? dev ? function ?	# RNG and SMBus 1.0 interface

Index: src/sys/arch/x86/pci/amdtemp.c
diff -u src/sys/arch/x86/pci/amdtemp.c:1.14 src/sys/arch/x86/pci/amdtemp.c:1.15
--- src/sys/arch/x86/pci/amdtemp.c:1.14	Fri Apr 13 12:14:41 2012
+++ src/sys/arch/x86/pci/amdtemp.c	Fri Apr 13 13:11:17 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdtemp.c,v 1.14 2012/04/13 12:14:41 cegger Exp $ */
+/*  $NetBSD: amdtemp.c,v 1.15 2012/04/13 13:11:17 cegger Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -48,7 +48,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: amdtemp.c,v 1.14 2012/04/13 12:14:41 cegger Exp $ );
+__KERNEL_RCSID(0, $NetBSD: amdtemp.c,v 1.15 2012/04/13 13:11:17 cegger Exp $ );
 
 #include sys/param.h
 #include sys/bus.h
@@ -189,19 +189,7 @@ amdtemp_match(device_t parent, cfdata_t 
 	pcireg_t cpu_signature;
 	uint32_t family;
 
-	if (PCI_VENDOR(pa-pa_id) != PCI_VENDOR_AMD)
-		return 0;
-
-	switch (PCI_PRODUCT(pa-pa_id)) {
-	case PCI_PRODUCT_AMD_AMD64_MISC:
-	case PCI_PRODUCT_AMD_AMD64_F10_MISC:
-	case PCI_PRODUCT_AMD_AMD64_F11_MISC:
-	case PCI_PRODUCT_AMD_F14_NB:	/* Family12h too */
-	case PCI_PRODUCT_AMD_F15_MISC:
-		break;
-	default:
-		return 0;
-	}
+	KASSERT(PCI_VENDOR(pa-pa_id) == PCI_VENDOR_AMD);
 
 	cpu_signature = pci_conf_read(pa-pa_pc,
 	pa-pa_tag, CPUID_FAMILY_MODEL_R);
@@ -229,7 +217,7 @@ amdtemp_match(device_t parent, cfdata_t 
 	if (family  0x15)
 		return 0;
 
-	return 2;	/* supercede pchb(4) */
+	return 1;
 }
 
 static void

Index: src/sys/arch/x86/pci/files.pci
diff -u src/sys/arch/x86/pci/files.pci:1.13 src/sys/arch/x86/pci/files.pci:1.14
--- src/sys/arch/x86/pci/files.pci:1.13	Thu Aug 18 20:55:20 2011
+++ src/sys/arch/x86/pci/files.pci	Fri Apr 13 13:11:17 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.13 2011/08/18 20:55:20 jakllsch Exp $
+#	$NetBSD: files.pci,v 1.14 2012/04/13 13:11:17 cegger Exp $
 
 device 	aapic
 attach 	aapic at pci
@@ -6,9 +6,10 @@ file 	arch/x86/pci/aapic.c		aapic
 
 file	arch/x86/pci/agp_machdep.c	agp
 
+define amdnb_miscbus {}
+
 # PCI-Host bridge chipsets
-define amdtempbus {}
-device	pchb:	pcibus, agpbus, amdtempbus,
+device	pchb:	pcibus, agpbus,
 		agp_ali, agp_amd, agp_amd64, agp_i810,
 		agp_intel, agp_sis, agp_via
 attach	pchb at pci
@@ -28,8 +29,12 @@ attach  hpet at amdpcib with amdpcib_hpe
 filearch/x86/pci/amdpcib_hpet.c		amdpcib_hpet
 
 # AMD Processors -- Miscellaneous Control
+device	amdnb_misc: amdnb_miscbus
+attach	amdnb_misc at pci
+file	arch/x86/pci/amdnb_misc.c	amdnb_misc
+
 device	amdtemp: sysmon_envsys
-attach	amdtemp at amdtempbus
+attach	amdtemp at amdnb_miscbus
 file	arch/x86/pci/amdtemp.c		amdtemp
 
 # PCI-LPC bridges

Added files:

Index: src/sys/arch/x86/pci/amdnb_misc.c
diff -u /dev/null src/sys/arch/x86/pci/amdnb_misc.c:1.1
--- /dev/null	Fri Apr 13 13:11:17 2012
+++ src/sys/arch/x86/pci/amdnb_misc.c	Fri Apr 13 13:11:17 2012
@@ -0,0 +1,104 @@
+/*	$NetBSD: amdnb_misc.c,v 1.1 2012/04/13 13:11:17 cegger Exp $ */
+/*
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christoph Egger.
+ *
+ * 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

CVS commit: src/sys/modules/amdtemp

2012-04-13 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Apr 13 13:36:57 UTC 2012

Modified Files:
src/sys/modules/amdtemp: amdtemp.ioconf

Log Message:
replace amdtempbus with amdnb_miscbus.
pointed out by pgoyette@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/amdtemp/amdtemp.ioconf

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

Modified files:

Index: src/sys/modules/amdtemp/amdtemp.ioconf
diff -u src/sys/modules/amdtemp/amdtemp.ioconf:1.3 src/sys/modules/amdtemp/amdtemp.ioconf:1.4
--- src/sys/modules/amdtemp/amdtemp.ioconf:1.3	Sat Aug 20 19:53:45 2011
+++ src/sys/modules/amdtemp/amdtemp.ioconf	Fri Apr 13 13:36:57 2012
@@ -1,4 +1,4 @@
-# $NetBSD: amdtemp.ioconf,v 1.3 2011/08/20 19:53:45 jakllsch Exp $
+# $NetBSD: amdtemp.ioconf,v 1.4 2012/04/13 13:36:57 cegger Exp $
 
 ioconf amdtemp
 
@@ -6,6 +6,6 @@ include conf/files
 include dev/pci/files.pci
 include arch/x86/pci/files.pci
 
-pseudo-root amdtempbus*
+pseudo-root amdnb_miscbus*
 
-amdtemp* at amdtempbus?
+amdtemp* at amdnb_miscbus?



CVS commit: src/usr.sbin/cpuctl/arch

2012-04-05 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Apr  5 11:05:54 UTC 2012

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
report l3 cache information on AMD Family 10h and newer processors


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/cpuctl/arch/i386.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/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.29 src/usr.sbin/cpuctl/arch/i386.c:1.30
--- src/usr.sbin/cpuctl/arch/i386.c:1.29	Fri Mar  2 16:29:31 2012
+++ src/usr.sbin/cpuctl/arch/i386.c	Thu Apr  5 11:05:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.29 2012/03/02 16:29:31 sborrill Exp $	*/
+/*	$NetBSD: i386.c,v 1.30 2012/04/05 11:05:53 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: i386.c,v 1.29 2012/03/02 16:29:31 sborrill Exp $);
+__RCSID($NetBSD: i386.c,v 1.30 2012/04/05 11:05:53 cegger Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -1769,9 +1769,9 @@ amd_cpu_cacheinfo(struct cpu_info *ci)
 		cai-cai_associativity = 0;	/* XXX Unknown/reserved */
 
 	/*
-	 * Determine L3 cache info on AMD Family 10h processors
+	 * Determine L3 cache info on AMD Family 10h and newer processors
 	 */
-	if (family == 0x10) {
+	if (family = 0x10) {
 		cai = ci-ci_cinfo[CAI_L3CACHE];
 		cai-cai_totalsize = AMD_L3_EDX_C_SIZE(descs[3]);
 		cai-cai_associativity = AMD_L3_EDX_C_ASSOC(descs[3]);



CVS commit: src

2012-01-17 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jan 17 10:47:28 UTC 2012

Modified Files:
src/share/man/man9: kauth.9 secmodel_securelevel.9
src/sys/kern: kern_cpu.c
src/sys/secmodel/securelevel: secmodel_securelevel.c
src/sys/secmodel/suser: secmodel_suser.c
src/sys/sys: kauth.h

Log Message:
fix secmodel implementation of CPU_UCODE.
ok wiz@ for the manpages
ok elad@


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/share/man/man9/kauth.9
cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/secmodel_securelevel.9
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.25 -r1.26 \
src/sys/secmodel/securelevel/secmodel_securelevel.c
cvs rdiff -u -r1.37 -r1.38 src/sys/secmodel/suser/secmodel_suser.c
cvs rdiff -u -r1.67 -r1.68 src/sys/sys/kauth.h

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/man9/kauth.9
diff -u src/share/man/man9/kauth.9:1.95 src/share/man/man9/kauth.9:1.96
--- src/share/man/man9/kauth.9:1.95	Sun Dec  4 23:59:25 2011
+++ src/share/man/man9/kauth.9	Tue Jan 17 10:47:27 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: kauth.9,v 1.95 2011/12/04 23:59:25 jym Exp $
+.\ $NetBSD: kauth.9,v 1.96 2012/01/17 10:47:27 cegger Exp $
 .\
 .\ Copyright (c) 2005, 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd November 8, 2011
+.Dd January 16, 2012
 .Dt KAUTH 9
 .Os
 .Sh NAME
@@ -770,6 +770,12 @@ platforms.
 Below is a list of available actions, along with which platforms are affected
 by each.
 .Bl -tag -width compact
+.It Dv KAUTH_MACHDEP_CPU_UCODE_APPLY
+Request to apply a CPU microcode to a CPU.
+This is related to the
+.Em CPU_UCODE
+kernel config
+.Xr options 4 .
 .It Dv KAUTH_MACHDEP_CACHEFLUSH
 Request to flush the whole CPU cache.
 Affects

Index: src/share/man/man9/secmodel_securelevel.9
diff -u src/share/man/man9/secmodel_securelevel.9:1.11 src/share/man/man9/secmodel_securelevel.9:1.12
--- src/share/man/man9/secmodel_securelevel.9:1.11	Sun Dec  4 21:08:45 2011
+++ src/share/man/man9/secmodel_securelevel.9	Tue Jan 17 10:47:27 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: secmodel_securelevel.9,v 1.11 2011/12/04 21:08:45 jym Exp $
+.\ $NetBSD: secmodel_securelevel.9,v 1.12 2012/01/17 10:47:27 cegger Exp $
 .\
 .\ Copyright (c) 2006 Elad Efrat e...@netbsd.org
 .\ Copyright (c) 2000 Hugh Graham
@@ -26,7 +26,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 4, 2011
+.Dd January 16, 2012
 .Dt SECMODEL_SECURELEVEL 9
 .Os
 .Sh NAME
@@ -154,6 +154,8 @@ The system clock may not be set backward
 Per-process coredump name may not be changed.
 .It
 Packet filtering and NAT rules may not be altered.
+.It
+CPU ucode loading is denied on platforms that support it.
 .El
 .El
 .Pp

Index: src/sys/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.53 src/sys/kern/kern_cpu.c:1.54
--- src/sys/kern/kern_cpu.c:1.53	Fri Jan 13 16:05:15 2012
+++ src/sys/kern/kern_cpu.c	Tue Jan 17 10:47:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.53 2012/01/13 16:05:15 cegger Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.54 2012/01/17 10:47:27 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_cpu.c,v 1.53 2012/01/13 16:05:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_cpu.c,v 1.54 2012/01/17 10:47:27 cegger Exp $);
 
 #include opt_cpu_ucode.h
 
@@ -258,11 +258,6 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void
 		NULL, NULL, NULL, NULL);
 		if (error != 0)
 			break;
-		error = kauth_authorize_system(l-l_cred,
-		KAUTH_SYSTEM_CPU, KAUTH_REQ_SYSTEM_CPU_UCODE_APPLY,
-		data, NULL, NULL);
-		if (error != 0)
-			break;
 		error = cpu_ucode_apply(data);
 		break;
 #endif

Index: src/sys/secmodel/securelevel/secmodel_securelevel.c
diff -u src/sys/secmodel/securelevel/secmodel_securelevel.c:1.25 src/sys/secmodel/securelevel/secmodel_securelevel.c:1.26
--- src/sys/secmodel/securelevel/secmodel_securelevel.c:1.25	Fri Jan 13 16:05:15 2012
+++ src/sys/secmodel/securelevel/secmodel_securelevel.c	Tue Jan 17 10:47:27 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_securelevel.c,v 1.25 2012/01/13 16:05:15 cegger Exp $ */
+/* $NetBSD: secmodel_securelevel.c,v 1.26 2012/01/17 10:47:27 cegger Exp $ */
 /*-
  * Copyright (c) 2006 Elad Efrat e...@netbsd.org
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: secmodel_securelevel.c,v 1.25 2012/01/13 16:05:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: secmodel_securelevel.c,v 1.26 2012/01/17 10:47:27 cegger Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_insecure.h
@@ -484,8 +484,8 

CVS commit: src

2012-01-13 Thread Christoph Egger
 ucode [file]\n, progname);
 	exit(EXIT_FAILURE);
 	/* NOTREACHED */
 }
@@ -181,11 +188,34 @@ cpu_nointr(char **argv)
 }
 
 static void
+cpu_ucode(char **argv)
+{
+	int error;
+	struct cpu_ucode uc;
+
+	if (argv[0] != NULL)
+		strlcpy(uc.fwname, argv[0], sizeof(uc.fwname));
+	else
+		memset(uc.fwname, '\0', sizeof(uc.fwname));
+
+	error = ioctl(fd, IOC_CPU_UCODE_APPLY, uc);
+	if (error  0) {
+		if (uc.fwname[0])
+			err(EXIT_FAILURE, %s, uc.fwname);
+		else
+			err(EXIT_FAILURE, IOC_CPU_UCODE_APPLY);
+	}
+}
+
+
+static void
 cpu_identify(char **argv)
 {
 	char name[32];
 	unsigned int id, np;
 	cpuset_t *cpuset;
+	struct cpu_ucode ucode;
+	char ucbuf[16];
 
 	np = sysconf(_SC_NPROCESSORS_CONF);
 	id = getcpuid(argv);
@@ -209,6 +239,16 @@ cpu_identify(char **argv)
 		cpuset_destroy(cpuset);
 	}
 	identifycpu(name);
+
+	if (ioctl(fd, IOC_CPU_UCODE_GET_VERSION, ucode)  0)
+		ucode.version = (uint64_t)-1;
+	if (ucode.version == (uint64_t)-1)
+		strcpy(ucbuf, ?);
+	else
+		snprintf(ucbuf, sizeof(ucbuf), 0x%PRIx64,
+		ucode.version);
+
+	printf(%s: UCode version: %s\n, name, ucbuf);
 }
 
 static u_int
@@ -263,11 +303,13 @@ cpu_list(char **argv)
 			strcpy(ibuf, ?);
 		else
 			snprintf(ibuf, sizeof(ibuf), %d, cs.cs_intrcnt - 1);
+
 		lastmod = (time_t)cs.cs_lastmod |
 		((time_t)cs.cs_lastmodhi  32);
 		ts = asctime(localtime(lastmod));
 		ts[strlen(ts) - 1] = '\0';
-		printf(%-4d %-4x %-12s %-10s %s %s\n, i, cs.cs_hwid, state,
+		printf(%-4d %-4x %-12s %-10s %s %-5s\n,
+		   i, cs.cs_hwid, state,
 		   intr, ts, ibuf);
 	}
 }

Added files:

Index: src/sys/arch/x86/include/cpu_ucode.h
diff -u /dev/null src/sys/arch/x86/include/cpu_ucode.h:1.1
--- /dev/null	Fri Jan 13 16:05:16 2012
+++ src/sys/arch/x86/include/cpu_ucode.h	Fri Jan 13 16:05:14 2012
@@ -0,0 +1,42 @@
+/* $NetBSD: cpu_ucode.h,v 1.1 2012/01/13 16:05:14 cegger Exp $ */
+/*
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christoph Egger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *  
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE  
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _X86_CPU_UCODE_H_
+#define _X86_CPU_UCODE_H_
+
+#include sys/cpu.h
+#include sys/cpuio.h
+#include dev/firmload.h
+
+int cpu_ucode_amd_get_version(struct cpu_ucode *);
+int cpu_ucode_amd_firmware_open(firmware_handle_t *, const char *);
+int cpu_ucode_amd_apply(struct cpu_ucode_softc *);
+
+#endif

Index: src/sys/arch/x86/x86/cpu_ucode.c
diff -u /dev/null src/sys/arch/x86/x86/cpu_ucode.c:1.1
--- /dev/null	Fri Jan 13 16:05:16 2012
+++ src/sys/arch/x86/x86/cpu_ucode.c	Fri Jan 13 16:05:15 2012
@@ -0,0 +1,102 @@
+/* $NetBSD: cpu_ucode.c,v 1.1 2012/01/13 16:05:15 cegger Exp $ */
+/*
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christoph Egger.
+ *
+ * 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

CVS commit: src/doc

2012-01-13 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Jan 13 16:15:48 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
cpu ucode loading support for x86 and xen


To generate a diff of this commit:
cvs rdiff -u -r1.1643 -r1.1644 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1643 src/doc/CHANGES:1.1644
--- src/doc/CHANGES:1.1643	Fri Jan 13 09:21:11 2012
+++ src/doc/CHANGES	Fri Jan 13 16:15:48 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1643 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1644 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1198,3 +1198,4 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
 	sandpoint: Iomega Storcenter support. [phx 20111228]
 	adventure(6): New save file format. Please regenerate (restore
 		and re-save) any old save files. [dholland 20120107]
+	x86, xen: Add cpu ucode loading support via cpuctl(8). [cegger 20120113]



CVS commit: src/sys/arch/x86/include

2011-12-09 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Dec  9 10:08:47 UTC 2011

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
add AMD ucode MSRs


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.53 src/sys/arch/x86/include/specialreg.h:1.54
--- src/sys/arch/x86/include/specialreg.h:1.53	Mon Oct  3 17:31:35 2011
+++ src/sys/arch/x86/include/specialreg.h	Fri Dec  9 10:08:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.53 2011/10/03 17:31:35 njoly Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.54 2011/12/09 10:08:47 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -503,6 +503,8 @@
 /* AMD Family10h MSRs */
 #define	MSR_OSVW_ID_LENGTH		0xc0010140
 #define	MSR_OSVW_STATUS			0xc0010141
+#define	MSR_UCODE_AMD_PATCHLEVEL	0x008b
+#define	MSR_UCODE_AMD_PATCHLOADER	0xc0010020
 
 /* X86 MSRs */
 #define	MSR_RDTSCP_AUX			0xc103



CVS commit: src/sys/arch/xen/include/xen-public/arch-x86

2011-12-09 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Dec  9 10:14:20 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public/arch-x86: xen.h

Log Message:
re-apply merge loss


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen.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/xen/include/xen-public/arch-x86/xen.h
diff -u src/sys/arch/xen/include/xen-public/arch-x86/xen.h:1.1.1.2 src/sys/arch/xen/include/xen-public/arch-x86/xen.h:1.2
--- src/sys/arch/xen/include/xen-public/arch-x86/xen.h:1.1.1.2	Wed Dec  7 14:41:17 2011
+++ src/sys/arch/xen/include/xen-public/arch-x86/xen.h	Fri Dec  9 10:14:20 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xen.h,v 1.1.1.2 2011/12/07 14:41:17 cegger Exp $ */
+/* $NetBSD: xen.h,v 1.2 2011/12/09 10:14:20 cegger Exp $ */
 /**
  * arch-x86/xen.h
  * 
@@ -46,10 +46,14 @@
 #define __XEN_GUEST_HANDLE(name)__guest_handle_ ## name
 #define XEN_GUEST_HANDLE(name)  __XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
-#ifdef __XEN_TOOLS__
+
+#if __XEN_INTERFACE_VERSION__ = 0x00030201
+#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
+#else
+#define set_xen_guest_handle(hnd, val)  (hnd) = val
+#define get_xen_guest_handle(val, hnd)  val = (hnd)
 #endif
-#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
 
 #if defined(__i386__)
 #include xen-x86_32.h



CVS commit: src/sys/arch/xen/xen

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 13:49:04 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c

Log Message:
build fix: add back sys/malloc.h. malloc(9) is still in use.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/xen/evtchn.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.57 src/sys/arch/xen/xen/evtchn.c:1.58
--- src/sys/arch/xen/xen/evtchn.c:1.57	Wed Dec  7 12:31:51 2011
+++ src/sys/arch/xen/xen/evtchn.c	Wed Dec  7 13:49:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.57 2011/12/07 12:31:51 cherry Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.58 2011/12/07 13:49:04 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.57 2011/12/07 12:31:51 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.58 2011/12/07 13:49:04 cegger Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -66,6 +66,7 @@ __KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1
 #include sys/systm.h
 #include sys/device.h
 #include sys/proc.h
+#include sys/malloc.h
 #include sys/kmem.h
 #include sys/reboot.h
 #include sys/mutex.h



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 14:41:19 UTC 2011

Update of /cvsroot/src/sys/arch/xen/include/xen-public
In directory ivanova.netbsd.org:/tmp/cvs-serv11047

Log Message:
Welcome to Xen 4.1.2 headers.

New interfaces for PV drivers:
- Xen transcedent memory
- USB IO
- SCSI IO

PCI IO improvements:
- PCI MSI support
- PCI Express AER support

New features:
- xen honors flags to be placed into guest kernel available pte bits
  if enabled (for grant table)
- support for 128 vcpus
  (old interface is still present and supports up to 32 vcpus)
- PCI passthrough: new hypercalls to support SR-IOV
- new hypercall for physical cpu hotplugging
- new hypercall for physical page offlining
- fixes to compile with clang
- machine check recovery mechanism

Status:

Vendor Tag: Xen
Release Tags:   xen-4_1_2

C src/sys/arch/xen/include/xen-public/grant_table.h
U src/sys/arch/xen/include/xen-public/xencomm.h
N src/sys/arch/xen/include/xen-public/tmem.h
C src/sys/arch/xen/include/xen-public/dom0_ops.h
U src/sys/arch/xen/include/xen-public/nmi.h
U src/sys/arch/xen/include/xen-public/kexec.h
U src/sys/arch/xen/include/xen-public/platform.h
U src/sys/arch/xen/include/xen-public/sysctl.h
C src/sys/arch/xen/include/xen-public/event_channel.h
U src/sys/arch/xen/include/xen-public/features.h
U src/sys/arch/xen/include/xen-public/COPYING
C src/sys/arch/xen/include/xen-public/physdev.h
U src/sys/arch/xen/include/xen-public/version.h
U src/sys/arch/xen/include/xen-public/elfnote.h
U src/sys/arch/xen/include/xen-public/callback.h
U src/sys/arch/xen/include/xen-public/memory.h
N src/sys/arch/xen/include/xen-public/mem_event.h
C src/sys/arch/xen/include/xen-public/trace.h
U src/sys/arch/xen/include/xen-public/xen-compat.h
U src/sys/arch/xen/include/xen-public/sched.h
U src/sys/arch/xen/include/xen-public/vcpu.h
C src/sys/arch/xen/include/xen-public/arch-x86_32.h
C src/sys/arch/xen/include/xen-public/arch-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-ia64.h
U src/sys/arch/xen/include/xen-public/xenoprof.h
C src/sys/arch/xen/include/xen-public/xen.h
U src/sys/arch/xen/include/xen-public/domctl.h
U src/sys/arch/xen/include/xen-public/xsm/flask_op.h
U src/sys/arch/xen/include/xen-public/xsm/acm.h
U src/sys/arch/xen/include/xen-public/xsm/acm_ops.h
U src/sys/arch/xen/include/xen-public/io/console.h
U src/sys/arch/xen/include/xen-public/io/tpmif.h
U src/sys/arch/xen/include/xen-public/io/ring.h
U src/sys/arch/xen/include/xen-public/io/protocols.h
U src/sys/arch/xen/include/xen-public/io/pciif.h
N src/sys/arch/xen/include/xen-public/io/usbif.h
U src/sys/arch/xen/include/xen-public/io/kbdif.h
U src/sys/arch/xen/include/xen-public/io/fbif.h
C src/sys/arch/xen/include/xen-public/io/blkif.h
U src/sys/arch/xen/include/xen-public/io/xenbus.h
N src/sys/arch/xen/include/xen-public/io/vscsiif.h
U src/sys/arch/xen/include/xen-public/io/fsif.h
U src/sys/arch/xen/include/xen-public/io/xs_wire.h
C src/sys/arch/xen/include/xen-public/io/netif.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_info_table.h
U src/sys/arch/xen/include/xen-public/hvm/save.h
U src/sys/arch/xen/include/xen-public/hvm/params.h
U src/sys/arch/xen/include/xen-public/hvm/ioreq.h
U src/sys/arch/xen/include/xen-public/hvm/hvm_op.h
U src/sys/arch/xen/include/xen-public/hvm/e820.h
U src/sys/arch/xen/include/xen-public/arch-ia64/sioemu.h
U src/sys/arch/xen/include/xen-public/arch-ia64/debug_op.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/save.h
U src/sys/arch/xen/include/xen-public/arch-ia64/hvm/memmap.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_64.h
U src/sys/arch/xen/include/xen-public/arch-x86/cpuid.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
U src/sys/arch/xen/include/xen-public/arch-x86/xen-mca.h
U src/sys/arch/xen/include/xen-public/arch-x86/hvm/save.h

10 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jXen:yesterday -jXen src/sys/arch/xen/include/xen-public



CVS commit: src/sys/arch/xen/include/xen-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:04:19 UTC 2011

Modified Files:
src/sys/arch/xen/include/xen-public: event_channel.h grant_table.h
physdev.h trace.h xen.h
src/sys/arch/xen/include/xen-public/arch-x86: xen-x86_32.h
src/sys/arch/xen/include/xen-public/io: blkif.h netif.h xs_wire.h

Log Message:
merge.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/event_channel.h \
src/sys/arch/xen/include/xen-public/grant_table.h \
src/sys/arch/xen/include/xen-public/physdev.h \
src/sys/arch/xen/include/xen-public/trace.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/xen-public/xen.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/sys/arch/xen/include/xen-public/arch-x86/xen-x86_32.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/xen-public/io/blkif.h \
src/sys/arch/xen/include/xen-public/io/netif.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/sys/arch/xen/include/xen-public/io/xs_wire.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/xen/include/xen-public/event_channel.h
diff -u src/sys/arch/xen/include/xen-public/event_channel.h:1.5 src/sys/arch/xen/include/xen-public/event_channel.h:1.6
--- src/sys/arch/xen/include/xen-public/event_channel.h:1.5	Wed Dec  7 13:24:04 2011
+++ src/sys/arch/xen/include/xen-public/event_channel.h	Wed Dec  7 15:04:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: event_channel.h,v 1.5 2011/12/07 13:24:04 cegger Exp $ */
+/* $NetBSD: event_channel.h,v 1.6 2011/12/07 15:04:18 cegger Exp $ */
 /**
  * event_channel.h
  * 
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
 
+#include xen.h
+
 /*
  * Prototype for this hypercall is:
  *  int event_channel_op(int cmd, void *args)
Index: src/sys/arch/xen/include/xen-public/grant_table.h
diff -u src/sys/arch/xen/include/xen-public/grant_table.h:1.5 src/sys/arch/xen/include/xen-public/grant_table.h:1.6
--- src/sys/arch/xen/include/xen-public/grant_table.h:1.5	Wed Dec  7 13:24:04 2011
+++ src/sys/arch/xen/include/xen-public/grant_table.h	Wed Dec  7 15:04:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: grant_table.h,v 1.5 2011/12/07 13:24:04 cegger Exp $ */
+/* $NetBSD: grant_table.h,v 1.6 2011/12/07 15:04:18 cegger Exp $ */
 /**
  * grant_table.h
  * 
@@ -29,6 +29,7 @@
 #ifndef __XEN_PUBLIC_GRANT_TABLE_H__
 #define __XEN_PUBLIC_GRANT_TABLE_H__
 
+#include xen.h
 
 /***
  * GRANT TABLE REPRESENTATION
@@ -85,12 +86,26 @@
  */
 
 /*
+ * Reference to a grant entry in a specified domain's grant table.
+ */
+typedef uint32_t grant_ref_t;
+
+/*
  * A grant table comprises a packed array of grant entries in one or more
  * page frames shared between Xen and a guest.
  * [XEN]: This field is written by Xen and read by the sharing guest.
  * [GST]: This field is written by the guest and read by Xen.
  */
-struct grant_entry {
+
+/*
+ * Version 1 of the grant table entry structure is maintained purely
+ * for backwards compatibility.  New guests should use version 2.
+ */
+#if __XEN_INTERFACE_VERSION__  0x0003020a
+#define grant_entry_v1 grant_entry
+#define grant_entry_v1_t grant_entry_t
+#endif
+struct grant_entry_v1 {
 /* GTF_xxx: various type and flag information.  [XEN,GST] */
 uint16_t flags;
 /* The domain being granted foreign privileges. [GST] */
@@ -101,7 +116,7 @@ struct grant_entry {
  */
 uint32_t frame;
 };
-typedef struct grant_entry grant_entry_t;
+typedef struct grant_entry_v1 grant_entry_v1_t;
 
 /*
  * Type of grant entry.
@@ -109,10 +124,13 @@ typedef struct grant_entry grant_entry_t
  *  GTF_permit_access: Allow @domid to map/access @frame.
  *  GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
  *   to this guest. Xen writes the page number to @frame.
+ *  GTF_transitive: Allow @domid to transitively access a subrange of
+ *  @trans_grant in @trans_domid.  No mappings are allowed.
  */
 #define GTF_invalid (0U0)
 #define GTF_permit_access   (1U0)
 #define GTF_accept_transfer (2U0)
+#define GTF_transitive  (3U0)
 #define GTF_type_mask   (3U0)
 
 /*
@@ -121,6 +139,9 @@ typedef struct grant_entry grant_entry_t
  *  GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
  *  GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
  *  GTF_PAT, GTF_PWT, GTF_PCD: (x86) cache attribute flags for the grant [GST]
+ *  GTF_sub_page: Grant access to only a subrange of the page.  @domid
+ *will only be allowed to copy from the grant, and not
+ *map it. [GST]
  */
 #define _GTF_readonly   (2)
 #define GTF_readonly(1U_GTF_readonly)
@@ -134,6 

CVS commit: src/sys/arch

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 15:47:43 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: genassym.cf
src/sys/arch/i386/i386: genassym.cf
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/include: granttables.h hypervisor.h xenbus.h
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h
src/sys/arch/xen/x86: cpu.c xen_ipi.c xen_pmap.c
src/sys/arch/xen/xen: clock.c evtchn.c hypervisor.c if_xennet_xenbus.c
pciback.c xbd_xenbus.c xbdback_xenbus.c xencons.c xpci_xenbus.c

Log Message:
switch from xen3-public to xen-public.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/granttables.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/include/xenbus.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/include/i386/hypercalls.h
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/xen/x86/cpu.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/x86/xen_pmap.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/xen/xen/evtchn.c \
src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/xen/pciback.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/xen/xen/xbdback_xenbus.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/xen/xen/xencons.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/xen/xpci_xenbus.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/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.48 src/sys/arch/amd64/amd64/genassym.cf:1.49
--- src/sys/arch/amd64/amd64/genassym.cf:1.48	Fri Jul  1 19:24:14 2011
+++ src/sys/arch/amd64/amd64/genassym.cf	Wed Dec  7 15:47:41 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.48 2011/07/01 19:24:14 dyoung Exp $
+#	$NetBSD: genassym.cf,v 1.49 2011/12/07 15:47:41 cegger Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -119,7 +119,7 @@ include machine/i82093var.h
 endif
 
 ifdef XEN
-include xen/xen3-public/xen.h
+include xen/xen-public/xen.h
 endif  
 
 include sys/bus.h

Index: src/sys/arch/i386/i386/genassym.cf
diff -u src/sys/arch/i386/i386/genassym.cf:1.90 src/sys/arch/i386/i386/genassym.cf:1.91
--- src/sys/arch/i386/i386/genassym.cf:1.90	Fri Jul  1 18:14:15 2011
+++ src/sys/arch/i386/i386/genassym.cf	Wed Dec  7 15:47:42 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.90 2011/07/01 18:14:15 dyoung Exp $
+#	$NetBSD: genassym.cf,v 1.91 2011/12/07 15:47:42 cegger Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@ include machine/types.h
 include machine/segments.h
 
 ifdef XEN
-include xen/xen3-public/sched.h
+include xen/xen-public/sched.h
 endif
 
 if defined(_KERNEL)  defined(_KERNEL_OPT)

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.43 src/sys/arch/x86/include/cpu.h:1.44
--- src/sys/arch/x86/include/cpu.h:1.43	Sat Nov 19 17:13:39 2011
+++ src/sys/arch/x86/include/cpu.h	Wed Dec  7 15:47:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.43 2011/11/19 17:13:39 cherry Exp $	*/
+/*	$NetBSD: cpu.h,v 1.44 2011/12/07 15:47:42 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -68,8 +68,8 @@
 #include sys/device_if.h /* for device_t */
 
 #ifdef XEN
-#include xen/xen3-public/xen.h
-#include xen/xen3-public/event_channel.h
+#include xen/xen-public/xen.h
+#include xen/xen-public/event_channel.h
 #endif /* XEN */
 
 struct intrsource;

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.143 src/sys/arch/x86/x86/pmap.c:1.144
--- src/sys/arch/x86/x86/pmap.c:1.143	Sun Dec  4 16:24:13 2011
+++ src/sys/arch/x86/x86/pmap.c	Wed Dec  7 15:47:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.143 2011/12/04 16:24:13 chs Exp $	*/
+/*	$NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.143 2011/12/04 16:24:13 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.144 2011/12/07 15:47:42 cegger Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -209,7 +209,7 @@ __KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.1
 #include x86/i82489var.h
 
 #ifdef XEN
-#include 

CVS commit: src/sys/arch/xen/include

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:01:39 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
switch from xen3-public to xen-public.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/include/i386/hypercalls.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/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.7 src/sys/arch/xen/include/amd64/hypercalls.h:1.8
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.7	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Dec  7 16:01:39 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.7 2011/12/07 15:47:42 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.8 2011/12/07 16:01:39 cegger Exp $ */
 /**
  * hypercall.h
  * 
@@ -399,7 +399,7 @@ HYPERVISOR_dom0_op(
 }
 #endif	/* __XEN_INTERFACE_VERSION__ */
 
-#include xen/xen3-public/arch-x86/xen-mca.h
+#include xen/xen-public/arch-x86/xen-mca.h
 
 static inline int
 HYPERVISOR_machine_check(struct xen_mc *mc)

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.13 src/sys/arch/xen/include/i386/hypercalls.h:1.14
--- src/sys/arch/xen/include/i386/hypercalls.h:1.13	Wed Dec  7 15:47:42 2011
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Dec  7 16:01:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.13 2011/12/07 15:47:42 cegger Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.14 2011/12/07 16:01:39 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -173,7 +173,7 @@ HYPERVISOR_get_debugreg(int reg)
 return ret;
 }
 
-#include xen/xen3-public/arch-x86/xen-mca.h
+#include xen/xen-public/arch-x86/xen-mca.h
 
 static __inline int
 HYPERVISOR_machine_check(struct xen_mc *mc)



CVS commit: src/sys/arch/xen/include/xen3-public

2011-12-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec  7 16:11:02 UTC 2011

Removed Files:
src/sys/arch/xen/include/xen3-public: COPYING arch-ia64.h arch-x86_32.h
arch-x86_64.h callback.h dom0_ops.h domctl.h elfnote.h elfstructs.h
event_channel.h features.h grant_table.h kexec.h libelf.h memory.h
nmi.h physdev.h platform.h sched.h sysctl.h trace.h vcpu.h
version.h xen-compat.h xen.h xencomm.h xenoprof.h
src/sys/arch/xen/include/xen3-public/arch-ia64: debug_op.h sioemu.h
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm: memmap.h save.h
src/sys/arch/xen/include/xen3-public/arch-x86: cpuid.h xen-mca.h
xen-x86_32.h xen-x86_64.h xen.h
src/sys/arch/xen/include/xen3-public/arch-x86/hvm: save.h
src/sys/arch/xen/include/xen3-public/hvm: e820.h hvm_info_table.h
hvm_op.h ioreq.h params.h save.h vmx_assist.h
src/sys/arch/xen/include/xen3-public/io: blkif.h console.h fbif.h
fsif.h kbdif.h netif.h pciif.h protocols.h ring.h tpmif.h xenbus.h
xs_wire.h
src/sys/arch/xen/include/xen3-public/xsm: acm.h acm_ops.h flask_op.h

Log Message:
remove xen3-public


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/COPYING \
src/sys/arch/xen/include/xen3-public/callback.h \
src/sys/arch/xen/include/xen3-public/elfstructs.h \
src/sys/arch/xen/include/xen3-public/nmi.h \
src/sys/arch/xen/include/xen3-public/xenoprof.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/arch-ia64.h \
src/sys/arch/xen/include/xen3-public/physdev.h \
src/sys/arch/xen/include/xen3-public/trace.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_32.h \
src/sys/arch/xen/include/xen3-public/memory.h \
src/sys/arch/xen/include/xen3-public/sched.h \
src/sys/arch/xen/include/xen3-public/vcpu.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/arch-x86_64.h \
src/sys/arch/xen/include/xen3-public/dom0_ops.h \
src/sys/arch/xen/include/xen3-public/event_channel.h \
src/sys/arch/xen/include/xen3-public/version.h \
src/sys/arch/xen/include/xen3-public/xen-compat.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/domctl.h \
src/sys/arch/xen/include/xen3-public/features.h \
src/sys/arch/xen/include/xen3-public/kexec.h \
src/sys/arch/xen/include/xen3-public/libelf.h \
src/sys/arch/xen/include/xen3-public/platform.h \
src/sys/arch/xen/include/xen3-public/sysctl.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/elfnote.h \
src/sys/arch/xen/include/xen3-public/xencomm.h
cvs rdiff -u -r1.8 -r0 src/sys/arch/xen/include/xen3-public/grant_table.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/xen.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/debug_op.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/sioemu.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/memmap.h
cvs rdiff -u -r1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-ia64/hvm/save.h
cvs rdiff -u -r1.1.1.1 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/cpuid.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-mca.h
cvs rdiff -u -r1.4 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_32.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen-x86_64.h \
src/sys/arch/xen/include/xen3-public/arch-x86/xen.h
cvs rdiff -u -r1.2 -r0 \
src/sys/arch/xen/include/xen3-public/arch-x86/hvm/save.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/hvm/e820.h \
src/sys/arch/xen/include/xen3-public/hvm/hvm_op.h \
src/sys/arch/xen/include/xen3-public/hvm/ioreq.h \
src/sys/arch/xen/include/xen3-public/hvm/params.h \
src/sys/arch/xen/include/xen3-public/hvm/vmx_assist.h
cvs rdiff -u -r1.3 -r0 \
src/sys/arch/xen/include/xen3-public/hvm/hvm_info_table.h \
src/sys/arch/xen/include/xen3-public/hvm/save.h
cvs rdiff -u -r1.7 -r0 src/sys/arch/xen/include/xen3-public/io/blkif.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/xen/include/xen3-public/io/console.h \
src/sys/arch/xen/include/xen3-public/io/kbdif.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/xen/include/xen3-public/io/fbif.h \
src/sys/arch/xen/include/xen3-public/io/protocols.h
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/xen/include/xen3-public/io/fsif.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/xen/include/xen3-public/io/netif.h \
src/sys/arch/xen/include/xen3-public/io/xenbus.h
cvs rdiff -u -r1.5 -r0 src/sys/arch/xen/include/xen3-public/io/pciif.h \
src/sys/arch/xen/include/xen3-public/io/tpmif.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/xen/include/xen3-public/io/ring.h
cvs rdiff -u -r1.9 -r0 src/sys/arch/xen/include/xen3-public/io/xs_wire.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/xen/include/xen3-public/xsm/acm.h \

CVS commit: src/sys/arch/xen/xen

2011-09-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Sep 21 15:26:47 UTC 2011

Modified Files:
src/sys/arch/xen/xen: evtchn.c

Log Message:
Initialize mutex before use. Lets me boot a dom0 kernel again
without a lockdebug panic.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/xen/xen/evtchn.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/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.54 src/sys/arch/xen/xen/evtchn.c:1.55
--- src/sys/arch/xen/xen/evtchn.c:1.54	Tue Sep 20 00:12:24 2011
+++ src/sys/arch/xen/xen/evtchn.c	Wed Sep 21 15:26:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.54 2011/09/20 00:12:24 jym Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.55 2011/09/21 15:26:47 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.54 2011/09/20 00:12:24 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: evtchn.c,v 1.55 2011/09/21 15:26:47 cegger Exp $);
 
 #include opt_xen.h
 #include isa.h
@@ -179,6 +179,7 @@
 void
 events_init(void)
 {
+	mutex_init(evtchn_lock, MUTEX_DEFAULT, IPL_NONE);
 	debug_port = bind_virq_to_evtch(VIRQ_DEBUG);
 
 	KASSERT(debug_port != -1);



CVS commit: src/sys/dev/acpi

2011-09-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Sep  7 08:43:20 UTC 2011

Modified Files:
src/sys/dev/acpi: hpacel_acpi.c

Log Message:
hpacel_reg_info() wants a device_t and not an ACPI_HANDLE.
Fixes NULL pointer dereference in hpacel_reg_info().


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/hpacel_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/hpacel_acpi.c
diff -u src/sys/dev/acpi/hpacel_acpi.c:1.2 src/sys/dev/acpi/hpacel_acpi.c:1.3
--- src/sys/dev/acpi/hpacel_acpi.c:1.2	Wed Jul 13 10:59:35 2011
+++ src/sys/dev/acpi/hpacel_acpi.c	Wed Sep  7 08:43:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpacel_acpi.c,v 1.2 2011/07/13 10:59:35 jruoho Exp $ */
+/*	$NetBSD: hpacel_acpi.c,v 1.3 2011/09/07 08:43:20 cegger Exp $ */
 
 /*-
  * Copyright (c) 2009, 2011 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hpacel_acpi.c,v 1.2 2011/07/13 10:59:35 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: hpacel_acpi.c,v 1.3 2011/09/07 08:43:20 cegger Exp $);
 
 #include sys/param.h
 #include sys/module.h
@@ -324,7 +324,7 @@
 	/*
 	 * Update the register information.
 	 */
-	(void)hpacel_reg_info(hdl);
+	(void)hpacel_reg_info(self);
 
 out:
 	if (ACPI_FAILURE(rv))



CVS commit: src/sys/dev/mii

2011-06-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jun  7 09:24:17 UTC 2011

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
add BCM5785


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/mii/miidevs

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/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.101 src/sys/dev/mii/miidevs:1.102
--- src/sys/dev/mii/miidevs:1.101	Sat May 28 05:55:58 2011
+++ src/sys/dev/mii/miidevs	Tue Jun  7 09:24:17 2011
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.101 2011/05/28 05:55:58 matt Exp $
+$NetBSD: miidevs,v 1.102 2011/06/07 09:24:17 cegger Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -169,6 +169,7 @@
 model BROADCOM2 BCM5482		0x000b BCM5482 1000BASE-T media interface
 model BROADCOM2 BCM5755		0x000c BCM5755 1000BASE-T media interface
 model BROADCOM2 BCM5754		0x000e BCM5754/5787 1000BASE-T media interface
+model BROADCOM2 BCM5785		0x0016 BCM5785 1000BASE-T media interface
 model BROADCOM2 BCM5709CAX	0x002c BCM5709CAX 10/100/1000baseT PHY
 model BROADCOM2 BCM5722		0x002d BCM5722 1000BASE-T media interface
 model BROADCOM2 BCM5784		0x003a BCM5784 10/100/1000baseT PHY



CVS commit: src/sys/dev/mii

2011-06-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jun  7 09:26:27 UTC 2011

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/mii/miidevs_data.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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.104 src/sys/dev/mii/miidevs.h:1.105
--- src/sys/dev/mii/miidevs.h:1.104	Sat May 28 05:56:15 2011
+++ src/sys/dev/mii/miidevs.h	Tue Jun  7 09:26:27 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.104 2011/05/28 05:56:15 matt Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.105 2011/06/07 09:26:27 cegger Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.101 2011/05/28 05:55:58 matt Exp
+ *	NetBSD: miidevs,v 1.102 2011/06/07 09:24:17 cegger Exp
  */
 
 /*-
@@ -220,6 +220,8 @@
 #define	MII_STR_BROADCOM2_BCM5755	BCM5755 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM2_BCM5754	0x000e
 #define	MII_STR_BROADCOM2_BCM5754	BCM5754/5787 1000BASE-T media interface
+#define	MII_MODEL_BROADCOM2_BCM5785	0x0016
+#define	MII_STR_BROADCOM2_BCM5785	BCM5785 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM2_BCM5709CAX	0x002c
 #define	MII_STR_BROADCOM2_BCM5709CAX	BCM5709CAX 10/100/1000baseT PHY
 #define	MII_MODEL_BROADCOM2_BCM5722	0x002d

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.92 src/sys/dev/mii/miidevs_data.h:1.93
--- src/sys/dev/mii/miidevs_data.h:1.92	Sat May 28 05:56:15 2011
+++ src/sys/dev/mii/miidevs_data.h	Tue Jun  7 09:26:27 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.92 2011/05/28 05:56:15 matt Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.93 2011/06/07 09:26:27 cegger Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.101 2011/05/28 05:55:58 matt Exp
+ *	NetBSD: miidevs,v 1.102 2011/06/07 09:24:17 cegger Exp
  */
 
 /*-
@@ -81,6 +81,7 @@
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5482, MII_STR_BROADCOM2_BCM5482 },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5755, MII_STR_BROADCOM2_BCM5755 },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5754, MII_STR_BROADCOM2_BCM5754 },
+ { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5785, MII_STR_BROADCOM2_BCM5785 },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5709CAX, MII_STR_BROADCOM2_BCM5709CAX },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5722, MII_STR_BROADCOM2_BCM5722 },
  { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5784, MII_STR_BROADCOM2_BCM5784 },



CVS commit: src/sys/dev/pci

2011-06-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jun  7 10:07:35 UTC 2011

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add ATI Radeon Cypress and Lucent IEEE 1394b Controller


To generate a diff of this commit:
cvs rdiff -u -r1.1084 -r1.1085 src/sys/dev/pci/pcidevs

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/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1084 src/sys/dev/pci/pcidevs:1.1085
--- src/sys/dev/pci/pcidevs:1.1084	Mon Jun  6 14:31:23 2011
+++ src/sys/dev/pci/pcidevs	Tue Jun  7 10:07:35 2011
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1084 2011/06/06 14:31:23 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1085 2011/06/07 10:07:35 cegger Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1405,6 +1405,7 @@
 product ATI RADEON_X850XT_S	0x5d72	Radeon X850 XT Secondary
 product ATI RADEON_X700		0x5e4b	Radeon X700 Pro
 product ATI RADEON_X700_S	0x5e6b	Radeon X700 Pro Secondary
+product ATI RADEON_HD5870	0x6898	Radeon HD 5870 Cypress
 product ATI RADEON_HD5600_RD	0x68c1	Redwood
 product ATI RADEON_X1300	0x7146	Radeon X1300 Series (RV515)
 product ATI RADEON_X1300_S	0x7166	Radeon X1300 Series (RV515) Secondary
@@ -3172,6 +3173,7 @@
 product LUCENT USBHC		0x5801	USB Host Controller
 product LUCENT USBHC2		0x5802	2-port USB Host Controller
 product LUCENT FW322_323	0x5811	FW322/323 IEEE 1394 Host Controller
+product LUCENT FW643_PCIE	0x5901	FW643 PCIE IEEE 1394b Host Controller
 product LUCENT ET1310		0xed00	ET1310 10/100/1000 Ethernet
 product LUCENT ET1301		0xed01	ET1301 10/100 Ethernet
 



CVS commit: src/sys/dev/mii

2011-06-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Jun  7 10:10:44 UTC 2011

Modified Files:
src/sys/dev/mii: brgphy.c

Log Message:
add BCM5785 phy:

brgphy0 at bge0 phy 1: BCM5785 1000BASE-T media interface, rev. 3
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FD , auto


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/mii/brgphy.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/mii/brgphy.c
diff -u src/sys/dev/mii/brgphy.c:1.58 src/sys/dev/mii/brgphy.c:1.59
--- src/sys/dev/mii/brgphy.c:1.58	Mon May  2 09:03:10 2011
+++ src/sys/dev/mii/brgphy.c	Tue Jun  7 10:10:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: brgphy.c,v 1.58 2011/05/02 09:03:10 jym Exp $	*/
+/*	$NetBSD: brgphy.c,v 1.59 2011/06/07 10:10:44 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: brgphy.c,v 1.58 2011/05/02 09:03:10 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: brgphy.c,v 1.59 2011/06/07 10:10:44 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -202,6 +202,9 @@
 	{ MII_OUI_BROADCOM2,		MII_MODEL_BROADCOM2_BCM5784,
 	  MII_STR_BROADCOM2_BCM5784 },
 
+	{ MII_OUI_BROADCOM2,		MII_MODEL_BROADCOM2_BCM5785,
+	  MII_STR_BROADCOM2_BCM5785 },
+
 	{ MII_OUI_xxBROADCOM_ALT1,	MII_MODEL_xxBROADCOM_ALT1_BCM5906,
 	  MII_STR_xxBROADCOM_ALT1_BCM5906 },
 



CVS commit: src/sys/dev/pci

2011-06-03 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Jun  3 09:51:40 UTC 2011

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
fix crash by NULL pointer dereferencing I get everytime
right after this message:

bge0: discarding oversize frame (len=-4)


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/dev/pci/if_bge.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/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.196 src/sys/dev/pci/if_bge.c:1.197
--- src/sys/dev/pci/if_bge.c:1.196	Sun May 22 08:15:20 2011
+++ src/sys/dev/pci/if_bge.c	Fri Jun  3 09:51:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.196 2011/05/22 08:15:20 mrg Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.197 2011/06/03 09:51:40 cegger Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.196 2011/05/22 08:15:20 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.197 2011/06/03 09:51:40 cegger Exp $);
 
 #include vlan.h
 #include rnd.h
@@ -3406,6 +3406,11 @@
 			stdcnt++;
 			dmamap = sc-bge_cdata.bge_rx_std_map[rxidx];
 			sc-bge_cdata.bge_rx_std_map[rxidx] = 0;
+			if (dmamap == NULL) {
+ifp-if_ierrors++;
+bge_newbuf_std(sc, sc-bge_std, m, dmamap);
+continue;
+			}
 			bus_dmamap_sync(sc-bge_dmatag, dmamap, 0,
 			dmamap-dm_mapsize, BUS_DMASYNC_POSTREAD);
 			bus_dmamap_unload(sc-bge_dmatag, dmamap);



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

2011-04-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Apr 11 08:56:17 UTC 2011

Modified Files:
src/sys/arch/xen/conf: files.xen

Log Message:
build xen kernels again after db_trace merge


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/xen/conf/files.xen

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/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.114 src/sys/arch/xen/conf/files.xen:1.115
--- src/sys/arch/xen/conf/files.xen:1.114	Sun Apr  3 22:29:27 2011
+++ src/sys/arch/xen/conf/files.xen	Mon Apr 11 08:56:17 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.114 2011/04/03 22:29:27 dyoung Exp $
+#	$NetBSD: files.xen,v 1.115 2011/04/11 08:56:17 cegger Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -42,8 +42,8 @@
 file	arch/i386/i386/db_dbgreg.S	ddb | kstack_check_dr0
 file	arch/i386/i386/db_disasm.c	ddb
 file	arch/i386/i386/db_interface.c	ddb
+file	arch/i386/i386/db_machdep.c	ddb
 file	arch/i386/i386/db_memrw.c	ddb | kgdb
-file	arch/i386/i386/db_trace.c	ddb
 file	arch/i386/i386/dumpsys.c
 file	arch/i386/i386/gdt.c
 file	arch/i386/i386/ipkdb_glue.c	ipkdb
@@ -72,9 +72,9 @@
 file	arch/amd64/amd64/cpufunc.S
 file	arch/amd64/amd64/cpu_in_cksum.S		(inet | inet6)  cpu_in_cksum
 file	arch/amd64/amd64/db_disasm.c		ddb
-file	arch/amd64/amd64/db_interface.c	 ddb
+file	arch/amd64/amd64/db_interface.c		ddb
+file	arch/amd64/amd64/db_machdep.c		ddb
 file	arch/amd64/amd64/db_memrw.c		ddb | kgdb
-file	arch/amd64/amd64/db_trace.c		ddb
 file	arch/amd64/amd64/kgdb_machdep.c	 kgdb
 file	arch/amd64/amd64/kobj_machdep.c	 	modular
 file	arch/amd64/amd64/gdt.c
@@ -88,6 +88,7 @@
 endif
 
 file	kern/subr_disk_mbr.c		disk
+file	arch/x86/x86/db_trace.c		ddb
 file	arch/xen/x86/hypervisor_machdep.c
 # file 	arch/x86/x86/mtrr_i686.c	mtrr
 file	arch/x86/x86/syscall.c



CVS commit: src/sys/arch/xen/xenbus

2011-04-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Apr 11 15:00:49 UTC 2011

Modified Files:
src/sys/arch/xen/xenbus: xenbus_probe.c

Log Message:
Continue scanning for other frontends when initialization
of one frontend failed. Bug reported by Konrad Wilk on port-xen@.
Fix this for all error pathes within the loop.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/xen/xenbus/xenbus_probe.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/xen/xenbus/xenbus_probe.c
diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.29 src/sys/arch/xen/xenbus/xenbus_probe.c:1.30
--- src/sys/arch/xen/xenbus/xenbus_probe.c:1.29	Wed Mar 30 22:34:03 2011
+++ src/sys/arch/xen/xenbus/xenbus_probe.c	Mon Apr 11 15:00:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.29 2011/03/30 22:34:03 jym Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.30 2011/04/11 15:00:49 cegger Exp $ */
 /**
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xenbus_probe.c,v 1.29 2011/03/30 22:34:03 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: xenbus_probe.c,v 1.30 2011/04/11 15:00:49 cegger Exp $);
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -294,6 +294,7 @@
 		return err;
 
 	for (i = 0; i  dir_n; i++) {
+		err = 0;
 		/*
 		 * add size of path to size of xenbus_device. xenbus_device
 		 * already has room for one char in xbusd_path.



CVS commit: src/sys/arch/xen/xenbus

2011-04-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Apr 12 05:09:32 UTC 2011

Modified Files:
src/sys/arch/xen/xenbus: xenbus_probe.c

Log Message:
previous fix does not work if there is exactly only one entry where continue
exits the loop.
Apply fix from Konrad Wilke on port-xen@
That makes NetBSD DomU boot on Linux Dom0 with xl.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/xen/xenbus/xenbus_probe.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/xen/xenbus/xenbus_probe.c
diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.30 src/sys/arch/xen/xenbus/xenbus_probe.c:1.31
--- src/sys/arch/xen/xenbus/xenbus_probe.c:1.30	Mon Apr 11 15:00:49 2011
+++ src/sys/arch/xen/xenbus/xenbus_probe.c	Tue Apr 12 05:09:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.30 2011/04/11 15:00:49 cegger Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.31 2011/04/12 05:09:32 cegger Exp $ */
 /**
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xenbus_probe.c,v 1.30 2011/04/11 15:00:49 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: xenbus_probe.c,v 1.31 2011/04/12 05:09:32 cegger Exp $);
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -317,6 +317,7 @@
 			printf(xenbus: can't get state 
 			for %s (%d)\n, xbusd-xbusd_path, err);
 			free(xbusd, M_DEVBUF);
+			err = 0;
 			continue;
 		}
 		if (state != XenbusStateInitialising) {



CVS commit: src/sys/external/isc/atheros_hal/conf

2011-03-05 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Mar  5 14:42:12 UTC 2011

Modified Files:
src/sys/external/isc/atheros_hal/conf: files.ath_hal

Log Message:
add defflag for AR9285.

Spotted by jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/isc/atheros_hal/conf/files.ath_hal

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

Modified files:

Index: src/sys/external/isc/atheros_hal/conf/files.ath_hal
diff -u src/sys/external/isc/atheros_hal/conf/files.ath_hal:1.3 src/sys/external/isc/atheros_hal/conf/files.ath_hal:1.4
--- src/sys/external/isc/atheros_hal/conf/files.ath_hal:1.3	Mon Feb 21 11:06:37 2011
+++ src/sys/external/isc/atheros_hal/conf/files.ath_hal	Sat Mar  5 14:42:11 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ath_hal,v 1.3 2011/02/21 11:06:37 cegger Exp $
+#	$NetBSD: files.ath_hal,v 1.4 2011/03/05 14:42:11 cegger Exp $
 
 defflag opt_athhal.h	ATHHAL_ASSERT ATHHAL_DEBUG ATHHAL_DEBUG_ALQ
 defflag opt_athhal.h	ATHHAL_WRITE_EEPROM ATHHAL_WRITE_REGDOMAIN
@@ -113,6 +113,7 @@
 #
 defflag opt_athhal.h	ATHHAL_AR5416: athhal_eeprom_v14, athhal_eeprom_v4k, athhal_ar5212_subr
 defflag opt_athhal.h	ATHHAL_AR9280: ATHHAL_AR5416
+defflag opt_athhal.h	ATHHAL_AR9285: ATHHAL_AR5416
 
 file	external/isc/atheros_hal/dist/ar5416/ar2133.c		ath  athhal_ar5416
 file	external/isc/atheros_hal/dist/ar5416/ar5416_ani.c	ath  athhal_ar5416



CVS commit: src/share/man/man4

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 11:08:21 UTC 2011

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

Log Message:
add AR9285 support


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man4/ath.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/ath.4
diff -u src/share/man/man4/ath.4:1.29 src/share/man/man4/ath.4:1.30
--- src/share/man/man4/ath.4:1.29	Sun Feb 20 11:22:34 2011
+++ src/share/man/man4/ath.4	Mon Feb 21 11:08:21 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: ath.4,v 1.29 2011/02/20 11:22:34 jmcneill Exp $
+.\ $NetBSD: ath.4,v 1.30 2011/02/21 11:08:21 cegger Exp $
 .\
 .\ Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
 .\ All rights reserved.
@@ -41,7 +41,7 @@
 .\ $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ath.4,v 1.16 2004/02/18 08:30:08 maxim Exp $
 .\ parts from $FreeBSD: /repoman/r/ncvs/src/share/man/man4/ath_hal.4,v 1.7 2004/01/07 20:49:51 blackend Exp $
 .\
-.Dd February 20, 2011
+.Dd February 21, 2011
 .Dt ATH 4
 .Os
 .Sh NAME
@@ -55,7 +55,7 @@
 .Nm
 driver provides support for wireless network adapters based on
 the Atheros AR2413, AR2417, AR5210, AR5211, AR5212, AR5213, AR5413,
-AR5416, AR5424, AR9160, and AR9280 chips.
+AR5416, AR5424, AR9160, AR9280, and AR9285 chips.
 Chip-specific support is provided by the Atheros Hardware Access Layer
 (HAL).
 .Pp



CVS commit: src/doc

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 11:09:16 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
ath(4): Add support for AR9285 devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1510 -r1.1511 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1510 src/doc/CHANGES:1.1511
--- src/doc/CHANGES:1.1510	Sun Feb 20 17:09:31 2011
+++ src/doc/CHANGES	Mon Feb 21 11:09:16 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1510 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1511 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -865,3 +865,4 @@
 		more efficient, added fast software interrupts and kernel
 		preemption.  Added support for RMI (NetLogic) XLS/XLR models.
 		Major clean up for MIPS port. [matt 20110220]
+	ath(4): Add support for AR9285 devices. [cegger 20110221]



CVS commit: src/sys/modules/ath_hal

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 11:16:47 UTC 2011

Modified Files:
src/sys/modules/ath_hal: Makefile Makefile.inc

Log Message:
catch up to AR9285 changes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/modules/ath_hal/Makefile \
src/sys/modules/ath_hal/Makefile.inc

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

Modified files:

Index: src/sys/modules/ath_hal/Makefile
diff -u src/sys/modules/ath_hal/Makefile:1.2 src/sys/modules/ath_hal/Makefile:1.3
--- src/sys/modules/ath_hal/Makefile:1.2	Sun Feb 20 11:26:33 2011
+++ src/sys/modules/ath_hal/Makefile	Mon Feb 21 11:16:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/02/20 11:26:33 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.3 2011/02/21 11:16:47 cegger Exp $
 
 .include ../Makefile.inc
 
@@ -89,7 +89,10 @@
 	ar5416_xmit.c \
 	ar9160_attach.c \
 	ar9280.c \
-	ar9280_attach.c
+	ar9280_attach.c \
+	ar9285.c \
+	ar9285_attach.c \
+	ar9285_reset.c
 
 WARNS=		3
 
Index: src/sys/modules/ath_hal/Makefile.inc
diff -u src/sys/modules/ath_hal/Makefile.inc:1.2 src/sys/modules/ath_hal/Makefile.inc:1.3
--- src/sys/modules/ath_hal/Makefile.inc:1.2	Sun Feb 20 11:26:34 2011
+++ src/sys/modules/ath_hal/Makefile.inc	Mon Feb 21 11:16:47 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.inc,v 1.2 2011/02/20 11:26:34 jmcneill Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2011/02/21 11:16:47 cegger Exp $
 
 CPPFLAGS+=	-I${S}/external/isc/atheros_hal/dist
 CPPFLAGS+=	-I${S}/external/isc/atheros_hal/ic
 CPPFLAGS+=	-DATHHAL_AR5210 -DATHHAL_AR5211 -DATHHAL_AR5212 \
 		-DATHHAL_AR5311 -DATHHAL_AR5312 -DATHHAL_AR5416 \
-		-DATHHAL_AR9280
+		-DATHHAL_AR9280 -DATHHAL_AR9285
 CPPFLAGS+=	-DATHHAL_RF2316 -DATHHAL_RF2317 -DATHHAL_RF2413 \
 		-DATHHAL_RF2425 -DATHHAL_RF5111 -DATHHAL_RF5112 \
 		-DATHHAL_RF5413



CVS commit: src/sys/external/isc/atheros_hal/dist/ar5416

2011-02-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Feb 21 13:04:22 UTC 2011

Modified Files:
src/sys/external/isc/atheros_hal/dist/ar5416: ar9285_reset.c

Log Message:
make it compile with ATHHAL_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c

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

Modified files:

Index: src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c
diff -u src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c:1.1 src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c:1.2
--- src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c:1.1	Mon Feb 21 11:06:38 2011
+++ src/sys/external/isc/atheros_hal/dist/ar5416/ar9285_reset.c	Mon Feb 21 13:04:22 2011
@@ -119,7 +119,7 @@
 twiceMaxRegulatoryPower = AH_MIN(MAX_RATE_POWER, AH_PRIVATE(ah)-ah_powerLimit); 
 pModal = pEepData-modalHeader;
 HALDEBUG(ah, HAL_DEBUG_RESET, %s Channel=%u CfgCtl=%u\n,
-	__func__,chan-ic_freq, cfgCtl );  
+	__func__,chan-channel, cfgCtl );  
   
 if (IS_EEP_MINOR_V2(ah)) {
 ht40PowerIncForPdadc = pModal-ht40PowerIncForPdadc;



CVS commit: src/sys/net

2011-02-20 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Feb 20 13:51:17 UTC 2011

Modified Files:
src/sys/net: if_media.h

Log Message:
add MBSS. From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/net/if_media.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/net/if_media.h
diff -u src/sys/net/if_media.h:1.54 src/sys/net/if_media.h:1.55
--- src/sys/net/if_media.h:1.54	Wed Jan 26 00:57:47 2011
+++ src/sys/net/if_media.h	Sun Feb 20 13:51:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.h,v 1.54 2011/01/26 00:57:47 dyoung Exp $	*/
+/*	$NetBSD: if_media.h,v 1.55 2011/02/20 13:51:17 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -244,6 +244,7 @@
 #define	IFM_IEEE80211_TURBO	0x0800	/* Operate in Turbo mode */
 #define	IFM_IEEE80211_IBSS	0x1000	/* Operate in IBSS mode */
 #define	IFM_IEEE80211_WDS 	0x2000	/* Operate as an WDS master */
+#define	IFM_IEEE80211_MBSS	0x4000	/* Operate in MBSS mode */
 
 /* operating mode for multi-mode devices */
 #define	IFM_IEEE80211_11A	0x0001	/* 5 GHz, OFDM mode */
@@ -535,6 +536,7 @@
 	{ IFM_IEEE80211 | IFM_IEEE80211_TURBO,	turbo },		\
 	{ IFM_IEEE80211 | IFM_IEEE80211_IBSS,	ibss },		\
 	{ IFM_IEEE80211 | IFM_IEEE80211_WDS, 	wds },		\
+	{ IFM_IEEE80211 | IFM_IEEE80211_MBSS,	mesh },		\
 	\
 	{ 0, NULL },			\
 }



CVS commit: src/sys/arch/x86/include

2011-02-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Feb 15 10:11:25 UTC 2011

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
update cpuid bits


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.49 src/sys/arch/x86/include/specialreg.h:1.50
--- src/sys/arch/x86/include/specialreg.h:1.49	Tue Oct 12 00:39:08 2010
+++ src/sys/arch/x86/include/specialreg.h	Tue Feb 15 10:11:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.49 2010/10/12 00:39:08 jakllsch Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.50 2011/02/15 10:11:25 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -158,7 +158,7 @@
 /* Intel Fn8001 extended features - %ecx */
 #define	CPUID_LAHF	0x0001	/* LAHF/SAHF in IA-32e mode, 64bit sub*/
 
-#define	CPUID_INTEL_FLAGS4	\20\1LAHF
+#define	CPUID_INTEL_FLAGS4	\20\1LAHF\02B02\03B03
 
 
 /* AMD/VIA Fn8001 extended features - %edx */
@@ -173,8 +173,9 @@
 #define CPUID_3DNOW2	0x4000	/* 3DNow! Instruction Extension */
 #define CPUID_3DNOW	0x8000	/* 3DNow! Instructions */
 
-#define CPUID_EXT_FLAGS	\20\14SYSCALL/SYSRET\24MPC\25NOX\27MXX\32FFXSR \
-			\33P1GB\34RDTSCP\36LONG\0373DNOW2\0403DNOW
+#define CPUID_EXT_FLAGS	\20\14SYSCALL/SYSRET\24MPC\25NOX \
+			\27MXX\32FFXSR\33P1GB\34RDTSCP \
+			\36LONG\0373DNOW2\0403DNOW \
 
 /* AMD Fn8001 extended features - %ecx */
 #define CPUID_LAHF	0x0001	/* LAHF/SAHF instruction */
@@ -188,24 +189,40 @@
 #define CPUID_3DNOWPF	0x0100	/* 3DNow Prefetch */
 #define CPUID_OSVW	0x0200	/* OS visible workarounds */
 #define CPUID_IBS	0x0400	/* Instruction Based Sampling */
-#define CPUID_SSE5	0x0800	/* SSE5 instruction set */
+#define CPUID_XOP	0x0800	/* XOP instruction set */
 #define CPUID_SKINIT	0x1000	/* SKINIT */
 #define CPUID_WDT	0x2000	/* watchdog timer support */
+#define CPUID_LWP	0x8000	/* Light Weight Profiling */
+#define CPUID_FMA4	0x0001	/* FMA4 instructions */
+#define CPUID_NODEID	0x0008	/* NodeID MSR available*/
+#define CPUID_TBM	0x0020	/* TBM instructions */
+#define CPUID_TOPOEXT	0x0040	/* cpuid Topology Extension */
 
 #define CPUID_AMD_FLAGS4	\20\1LAHF\2CMPLEGACY\3SVM\4EAPIC\5ALTMOVCR0 \
 \6LZCNT\7SSE4A\10MISALIGNSSE \
 \0113DNOWPREFETCH\12OSVW\13IBS \
-\14SSE5\15SKINIT\16WDT
+\14XOP\15SKINIT\16WDT\20LWP \
+\21FMA4\22B17\23B18\24NodeID\25B20\26TBM \
+\27TopoExt\30B23\31B24 \
+\32B25\33B25\34B26 \
+\35B27\36B28\37B29\40B30\41B31\42B32
 
 /* AMD Fn800a %edx features (SVM features) */
 #define	CPUID_AMD_SVM_NP		0x0001
 #define	CPUID_AMD_SVM_LbrVirt		0x0002
 #define	CPUID_AMD_SVM_SVML		0x0004
 #define	CPUID_AMD_SVM_NRIPS		0x0008
-#define	CPUID_AMD_SVM_Ssse3Sse5Dis	0x0200
+#define	CPUID_AMD_SVM_TSCRateCtrl	0x0010
+#define	CPUID_AMD_SVM_VMCBCleanBits	0x0020
+#define	CPUID_AMD_SVM_FlushByASID	0x0040
+#define	CPUID_AMD_SVM_DecodeAssist	0x0080
 #define	CPUID_AMD_SVM_PauseFilter	0x0400
 #define	CPUID_AMD_SVM_FLAGS	 \20\1NP\2LbrVirt\3SVML\4NRIPS \
-\12Ssse3Sse5Dis\13PauseFilter
+\5TSCRate\6VMCBCleanBits\7FlushByASID \
+\10DecodeAssist\11B08 \
+\12B09\13PauseFilter \
+\14B11\15B12 \
+\16B13\17B17\20B18\21B19
 
 /*
  * AMD Advanced Power Management
@@ -221,9 +238,10 @@
 #define CPUID_APM_HWP	0x0080	/* HW P-State control */
 #define CPUID_APM_TSC	0x0100	/* TSC invariant */
 #define CPUID_APM_CPB	0x0200	/* Core performance boost */
+#define CPUID_APM_EFF	0x0400	/* Effective Frequency (read-only) */
 
 #define CPUID_APM_FLAGS		\20\1TS\2FID\3VID\4TTP\5HTC\6STC\007100 \
-\10HWP\11TSC\12CPB
+\10HWP\11TSC\12CPB\13EffFreq\14B11\15B12
 
 /*
  * Centaur Extended Feature flags
@@ -246,6 +264,7 @@
  */
 
 #define	CPUID2_SSE3	0x0001	/* Streaming SIMD Extensions 3 */
+#define	CPUID2_PCLMUL	0x0002	/* PCLMULQDQ instructions */
 #define	CPUID2_DTES64	0x0004	/* 64-bit Debug Trace */
 #define	CPUID2_MONITOR	0x0008	/* MONITOR/MWAIT instructions */
 #define	CPUID2_DS_CPL	0x0010	/* CPL Qualified Debug Store */
@@ -263,13 +282,18 @@
 #define	CPUID2_SSE42	0x0010	/* Streaming SIMD Extensions 4.2 */
 #define	CPUID2_X2APIC	0x0020	/* xAPIC Extensions */
 #define	CPUID2_POPCNT	0x0080	/* popcount instruction available */
+#define	CPUID2_AES	0x0200	/* AES instructions */
+#define	CPUID2_XSAVE	0x0400	/* XSAVE instructions */
+#define	CPUID2_OSXSAVE	0x0800	/* XGETBV/XSETBV instructions */
+#define	CPUID2_AVX	0x1000	/* AVX instructions */
+#define	CPUID2_F16C	0x2000	/* half precision conversion */
 #define	CPUID2_RAZ	0x8000	/* 

CVS commit: src/sys/dev/pckbport

2011-02-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Feb  8 07:32:47 UTC 2011

Modified Files:
src/sys/dev/pckbport: pmsreg.h

Log Message:
add PS/2 registers from synaptics spec:
PMS_RESET_WRAP_MODE, PMS_SET_WRAP_MODE, PMS_ACK, PMS_ERROR and PMS_RESEND

while here use #definetab consistently.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pckbport/pmsreg.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/pckbport/pmsreg.h
diff -u src/sys/dev/pckbport/pmsreg.h:1.2 src/sys/dev/pckbport/pmsreg.h:1.3
--- src/sys/dev/pckbport/pmsreg.h:1.2	Sun Dec 11 12:23:22 2005
+++ src/sys/dev/pckbport/pmsreg.h	Tue Feb  8 07:32:47 2011
@@ -1,19 +1,24 @@
-/* $NetBSD: pmsreg.h,v 1.2 2005/12/11 12:23:22 christos Exp $ */
+/* $NetBSD: pmsreg.h,v 1.3 2011/02/08 07:32:47 cegger Exp $ */
 
 /* mouse commands */
-#define	PMS_SET_SCALE11	0xe6	/* set scaling 1:1 */
-#define	PMS_SET_SCALE21 0xe7	/* set scaling 2:1 */
-#define	PMS_SET_RES	0xe8	/* set resolution (0..3) */
-#define	PMS_GET_SCALE	0xe9	/* get scaling factor */
-#define PMS_SEND_DEV_STATUS	0xe9
-#define	PMS_SET_STREAM	0xea	/* set streaming mode */
-#define PMS_SEND_DEV_DATA	0xeb
-#define PMS_SET_REMOTE_MODE	0xf0
-#define PMS_SEND_DEV_ID	0xf2
-#define	PMS_SET_SAMPLE	0xf3	/* set sampling rate */
-#define	PMS_DEV_ENABLE	0xf4	/* mouse on */
-#define	PMS_DEV_DISABLE	0xf5	/* mouse off */
-#define PMS_SET_DEFAULTS	0xf6
-#define	PMS_RESET	0xff	/* reset */
+#define	PMS_SET_SCALE11		0xe6	/* set scaling 1:1 */
+#define	PMS_SET_SCALE21		0xe7	/* set scaling 2:1 */
+#define	PMS_SET_RES		0xe8	/* set resolution (0..3) */
+#define	PMS_GET_SCALE		0xe9	/* get scaling factor */
+#define	PMS_SEND_DEV_STATUS	0xe9	/* status request */
+#define	PMS_SET_STREAM		0xea	/* set streaming mode */
+#define	PMS_SEND_DEV_DATA	0xeb	/* read data */
+#define	PMS_RESET_WRAP_MODE	0xec
+#define	PMS_SET_WRAP_MODE	0xed
+#define	PMS_SET_REMOTE_MODE	0xf0
+#define	PMS_SEND_DEV_ID		0xf2	/* read device type */
+#define	PMS_SET_SAMPLE		0xf3	/* set sampling rate */
+#define	PMS_DEV_ENABLE		0xf4	/* mouse on */
+#define	PMS_DEV_DISABLE		0xf5	/* mouse off */
+#define	PMS_SET_DEFAULTS	0xf6
+#define	PMS_ACK			0xfa
+#define	PMS_ERROR		0xfc
+#define	PMS_RESEND		0xfe
+#define	PMS_RESET		0xff	/* reset */
 
-#define	PMS_RSTDONE	0xaa
+#define	PMS_RSTDONE		0xaa



CVS commit: src/sys/dev/pckbport

2011-01-29 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Jan 29 20:37:25 UTC 2011

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
use aprint_debug_dev and get rid of SYNAPTICSDEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.25 src/sys/dev/pckbport/synaptics.c:1.26
--- src/sys/dev/pckbport/synaptics.c:1.25	Mon Nov 15 05:58:18 2010
+++ src/sys/dev/pckbport/synaptics.c	Sat Jan 29 20:37:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.25 2010/11/15 05:58:18 uebayasi Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.26 2011/01/29 20:37:24 cegger Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include opt_pms.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.25 2010/11/15 05:58:18 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: synaptics.c,v 1.26 2011/01/29 20:37:24 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -147,10 +147,8 @@
 	res |= pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, 1, 3,
 	resp, 0);
 	if (res) {
-#ifdef SYNAPTICSDEBUG
-		aprint_normal_dev(psc-sc_dev,
+		aprint_debug_dev(psc-sc_dev,
 		synaptics_probe: Identify Touchpad error.\n);
-#endif
 		/*
 		 * Reset device in case the probe confused it.
 		 */
@@ -162,10 +160,8 @@
 	}
 
 	if (resp[1] != SYNAPTICS_MAGIC_BYTE) {
-#ifdef SYNAPTICSDEBUG
-		aprint_normal_dev(psc-sc_dev,
+		aprint_debug_dev(psc-sc_dev,
 		synaptics_probe: Not synaptics.\n);
-#endif
 		res = 1;
 		goto doreset;
 	}
@@ -205,10 +201,8 @@
 		sc-flags |= SYN_FLAG_HAS_BUTTONS_4_5;
 
 	if (sc-caps  SYNAPTICS_CAP_EXTENDED) {
-#ifdef SYNAPTICSDEBUG
-		aprint_normal_dev(psc-sc_dev,
+		aprint_debug_dev(psc-sc_dev,
 		synaptics_probe: Capabilities 0x%04x.\n, sc-caps);
-#endif
 		if (sc-caps  SYNAPTICS_CAP_PASSTHROUGH)
 			sc-flags |= SYN_FLAG_HAS_PASSTHROUGH;
 
@@ -225,12 +219,10 @@
 			cmd[0] = PMS_SEND_DEV_STATUS;
 			res |= pckbport_poll_cmd(psc-sc_kbctag,
 			psc-sc_kbcslot, cmd, 1, 3, resp, 0);
-#ifdef SYNAPTICSDEBUG
 			if (res == 0)
-aprint_normal_dev(psc-sc_dev,
+aprint_debug_dev(psc-sc_dev,
 synaptics_probe: Extended 
 Capabilities 0x%02x.\n, resp[1]);
-#endif
 			if (!res  (resp[1]  4) = 2) {
 /* Yes. */
 sc-flags |= SYN_FLAG_HAS_UP_DOWN_BUTTONS;
@@ -790,20 +782,16 @@
 	switch (psc-inputstate) {
 	case 0:
 		if ((data  0xc8) != 0x80) {
-#ifdef SYNAPTICSDEBUG
-			aprint_normal_dev(psc-sc_dev,
+			aprint_debug_dev(psc-sc_dev,
 			pms_input: 0x%02x out of sync\n, data);
-#endif
 			return;	/* not in sync yet, discard input */
 		}
 		/*FALLTHROUGH*/
 
 	case 3:
 		if ((data  8) == 8) {
-#ifdef SYNAPTICSDEBUG
-			aprint_normal_dev(psc-sc_dev,
+			aprint_debug_dev(psc-sc_dev,
 			pms_input: dropped in relative mode, reset\n);
-#endif
 			psc-inputstate = 0;
 			psc-sc_enabled = 0;
 			wakeup(psc-sc_enabled);



CVS commit: src/sys/dev

2011-01-22 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Jan 22 08:13:47 UTC 2011

Modified Files:
src/sys/dev/mii: atphy.c
src/sys/dev/pci: if_ale.c

Log Message:
Fixes from PR kern/44395 Masanori Kanaoka:
- Fix register address in ale_phy_reset(). from linux
- Fix mask value in ale_stop_mac().
- Fix multicast handling. from openbsd
- Fix phy reset handling.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/if_ale.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/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.7 src/sys/dev/mii/atphy.c:1.8
--- src/sys/dev/mii/atphy.c:1.7	Sat Dec 11 18:10:16 2010
+++ src/sys/dev/mii/atphy.c	Sat Jan 22 08:13:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.7 2010/12/11 18:10:16 matt Exp $ */
+/*	$NetBSD: atphy.c,v 1.8 2011/01/22 08:13:47 cegger Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atphy.c,v 1.7 2010/12/11 18:10:16 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: atphy.c,v 1.8 2011/01/22 08:13:47 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -118,6 +118,7 @@
 	struct mii_attach_args *ma = aux;
 	struct mii_data *mii = ma-mii_data;
 	const struct mii_phydesc *mpd;
+	uint16_t bmsr;
 
 	mpd = mii_phy_match(ma, etphys);
 	aprint_naive(: Media interface\n);
@@ -135,7 +136,8 @@
 
 	PHY_RESET(sc);
 
-	sc-mii_capabilities = PHY_READ(sc, MII_BMSR)  ma-mii_capmask;
+	bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
+	sc-mii_capabilities = bmsr  ma-mii_capmask;
 	if (sc-mii_capabilities  BMSR_EXTSTAT)
 		sc-mii_extcapabilities = PHY_READ(sc, MII_EXTSR);
 
@@ -220,8 +222,7 @@
 		/*
 		 * Reset the PHY so all changes take effect.
 		 */
-		PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_RESET | BMCR_AUTOEN |
-		BMCR_STARTNEG);
+		PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
 done:
 		break;
 
@@ -364,9 +365,12 @@
 	reg |= ATPHY_SCR_POLARITY_REVERSAL;
 	PHY_WRITE(sc, ATPHY_SCR, reg);
 
-	/* Workaround F1 bug to reset phy. */
 	atphy_mii_phy_auto(sc);
 
+	/* Workaround F1 bug to reset phy. */
+	reg = PHY_READ(sc, MII_BMCR) | BMCR_RESET;
+	PHY_WRITE(sc, MII_BMCR, reg);
+
 	for (i = 0; i  1000; i++) {
 		DELAY(1);
 		if ((PHY_READ(sc, MII_BMCR)  BMCR_RESET) == 0)
@@ -386,7 +390,7 @@
 	if (sc-mii_extcapabilities  (EXTSR_1000TFDX | EXTSR_1000THDX))
 		PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX |
 		GTCR_ADV_1000THDX);
-	PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
+	PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
 
 	return EJUSTRETURN;
 }

Index: src/sys/dev/pci/if_ale.c
diff -u src/sys/dev/pci/if_ale.c:1.12 src/sys/dev/pci/if_ale.c:1.13
--- src/sys/dev/pci/if_ale.c:1.12	Tue Jul 20 09:17:24 2010
+++ src/sys/dev/pci/if_ale.c	Sat Jan 22 08:13:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ale.c,v 1.12 2010/07/20 09:17:24 cegger Exp $	*/
+/*	$NetBSD: if_ale.c,v 1.13 2011/01/22 08:13:47 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon yong...@freebsd.org
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ale.c,v 1.12 2010/07/20 09:17:24 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ale.c,v 1.13 2011/01/22 08:13:47 cegger Exp $);
 
 #include vlan.h
 
@@ -367,12 +367,12 @@
 	ale_miibus_writereg(sc-sc_dev, sc-ale_phyaddr,
 	ATPHY_DBG_ADDR, 0x04);
 	ale_miibus_writereg(sc-sc_dev, sc-ale_phyaddr,
-	ATPHY_DBG_ADDR, 0x8BBB);
+	ATPHY_DBG_DATA, 0x8BBB);
 	/* 10BT center tap voltage. */
 	ale_miibus_writereg(sc-sc_dev, sc-ale_phyaddr,
 	ATPHY_DBG_ADDR, 0x05);
 	ale_miibus_writereg(sc-sc_dev, sc-ale_phyaddr,
-	ATPHY_DBG_ADDR, 0x2C46);
+	ATPHY_DBG_DATA, 0x2C46);
 
 #undef	ATPHY_DBG_ADDR
 #undef	ATPHY_DBG_DATA
@@ -1910,7 +1910,7 @@
 
 	reg = CSR_READ_4(sc, ALE_MAC_CFG);
 	if ((reg  (MAC_CFG_TX_ENB | MAC_CFG_RX_ENB)) != 0) {
-		reg = ~MAC_CFG_TX_ENB | MAC_CFG_RX_ENB;
+		reg = ~(MAC_CFG_TX_ENB | MAC_CFG_RX_ENB);
 		CSR_WRITE_4(sc, ALE_MAC_CFG, reg);
 	}
 
@@ -2015,7 +2015,7 @@
 
 		ETHER_FIRST_MULTI(step, ec, enm);
 		while (enm != NULL) {
-			crc = ether_crc32_le(enm-enm_addrlo, ETHER_ADDR_LEN);
+			crc = ether_crc32_be(enm-enm_addrlo, ETHER_ADDR_LEN);
 			mchash[crc  31] |= 1  ((crc  26)  0x1f);
 			ETHER_NEXT_MULTI(step, enm);
 		}



CVS commit: src/sys/dev

2011-01-22 Thread Christoph Egger
 $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -51,6 +51,7 @@
 
 #include dev/wscons/wsconsio.h
 #include dev/wscons/wsdisplayvar.h
+#include dev/pci/wsdisplay_pci.h
 
 #include opt_vga.h
 
@@ -313,6 +314,10 @@
 		return pci_devioctl(psc-sc_pc, psc-sc_pcitag,
 		cmd, data, flag, l);
 
+	case WSDISPLAYIO_GET_BUSID:
+		return wsdisplayio_busid_pci(vc-softc-sc_dev,
+		psc-sc_pc, psc-sc_pcitag, data);
+
 	default:
 		return EPASSTHROUGH;
 	}

Index: src/sys/dev/pci/wcfb.c
diff -u src/sys/dev/pci/wcfb.c:1.7 src/sys/dev/pci/wcfb.c:1.8
--- src/sys/dev/pci/wcfb.c:1.7	Thu Dec 16 06:45:51 2010
+++ src/sys/dev/pci/wcfb.c	Sat Jan 22 15:14:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wcfb.c,v 1.7 2010/12/16 06:45:51 cegger Exp $ */
+/*	$NetBSD: wcfb.c,v 1.8 2011/01/22 15:14:28 cegger Exp $ */
 
 /*-
  * Copyright (c) 2010 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wcfb.c,v 1.7 2010/12/16 06:45:51 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: wcfb.c,v 1.8 2011/01/22 15:14:28 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -52,6 +52,7 @@
 #include dev/wsfont/wsfont.h
 #include dev/rasops/rasops.h
 #include dev/wscons/wsdisplay_vconsvar.h
+#include dev/pci/wsdisplay_pci.h
 
 #include opt_wsfb.h
 #include opt_wsdisplay_compat.h
@@ -318,6 +319,11 @@
 	case PCI_IOC_CFGWRITE:
 		return pci_devioctl(sc-sc_pc, sc-sc_pcitag,
 		cmd, data, flag, l);
+
+	case WSDISPLAYIO_GET_BUSID:
+		return wsdisplayio_busid_pci(sc-sc_dev, sc-sc_pc,
+		sc-sc_pcitag, data);
+
 	case WSDISPLAYIO_SMODE: {
 		/*int new_mode = *(int*)data, i;*/
 		}

Index: src/sys/dev/wscons/wsconsio.h
diff -u src/sys/dev/wscons/wsconsio.h:1.93 src/sys/dev/wscons/wsconsio.h:1.94
--- src/sys/dev/wscons/wsconsio.h:1.93	Sat Oct  2 00:52:02 2010
+++ src/sys/dev/wscons/wsconsio.h	Sat Jan 22 15:14:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: wsconsio.h,v 1.93 2010/10/02 00:52:02 macallan Exp $ */
+/* $NetBSD: wsconsio.h,v 1.94 2011/01/22 15:14:28 cegger Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -542,4 +542,26 @@
 #define	WSMUXIO_INJECTEVENT	_IOW('W', 100, struct wscons_event)
 #define	WSMUX_INJECTEVENT	WSMUXIO_INJECTEVENT /* XXX compat */
 
+/* Mapping information retrieval. */
+struct wsdisplayio_bus_id {
+u_int bus_type;
+#define WSDISPLAYIO_BUS_PCI	0
+#define WSDISPLAYIO_BUS_SBUS	1
+union bus_data {
+struct bus_pci {
+uint32_t domain;
+uint32_t bus;
+uint32_t device;
+uint32_t function;
+} pci;
+struct bus_sbus {
+uint32_t fb_instance;
+} sbus;
+/* so the size doesn't change if we add more bus types */
+char pad[32];
+} ubus;
+};
+
+#define WSDISPLAYIO_GET_BUSID	_IOR('W', 101, struct wsdisplayio_bus_id)
+
 #endif /* _DEV_WSCONS_WSCONSIO_H_ */

Added files:

Index: src/sys/dev/pci/wsdisplay_pci.c
diff -u /dev/null src/sys/dev/pci/wsdisplay_pci.c:1.1
--- /dev/null	Sat Jan 22 15:14:28 2011
+++ src/sys/dev/pci/wsdisplay_pci.c	Sat Jan 22 15:14:28 2011
@@ -0,0 +1,53 @@
+/*	$NetBSD: wsdisplay_pci.c,v 1.1 2011/01/22 15:14:28 cegger Exp $ */
+/*
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christoph Egger.
+ *
+ * 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/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: wsdisplay_pci.c,v 1.1 2011/01/22 15:14:28 cegger Exp $);
+
+#include sys/param.h
+#include sys/bus.h
+#include dev/pci/pcivar.h
+#include dev/wscons/wsconsio.h
+#include dev/pci/wsdisplay_pci.h
+
+int
+wsdisplayio_busid_pci(device_t self, pci_chipset_tag_t pc,
+pcitag_t tag

CVS commit: xsrc/external/mit/libpciaccess/dist/src

2011-01-22 Thread Christoph Egger
Module Name:xsrc
Committed By:   cegger
Date:   Sat Jan 22 15:18:57 UTC 2011

Modified Files:
xsrc/external/mit/libpciaccess/dist/src: netbsd_pci.c

Log Message:
Implement pci_device_is_boot_vga() for NetBSD using new WSDISPLAYIO_GET_BUSID 
ioctl.
This lets Xorg start on machines with more than one PCI display device
instead of exiting with 'Primary device is not PCI'.

First discussed with macallan@ then public on tech-kern@ and tech-x11@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c

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

Modified files:

Index: xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c
diff -u xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c:1.8 xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c:1.9
--- xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c:1.8	Wed Jan 12 19:03:50 2011
+++ xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c	Sat Jan 22 15:18:57 2011
@@ -40,6 +40,7 @@
 
 
 #include pci.h
+#include dev/wscons/wsconsio.h
 
 #include pciaccess.h
 #include pciaccess_private.h
@@ -247,6 +248,43 @@
 	return 0;
 }
 
+static int
+pci_device_netbsd_boot_vga(struct pci_device *dev)
+{
+	int ret;
+	struct wsdisplayio_bus_id busid;
+	int fd;
+
+	fd = open(/dev/ttyE0, O_RDONLY);
+	if (fd == -1) {
+		fprintf(stderr, failed to open /dev/ttyE0: %s\n,
+		strerror(errno));
+		return 0;
+	}
+
+	ret = ioctl(fd, WSDISPLAYIO_GET_BUSID, busid);
+	close(fd);
+	if (ret == -1) {
+		fprintf(stderr, ioctl WSDISPLAYIO_GET_BUSID failed: %s\n,
+		strerror(errno));
+		return 0;
+	}
+
+	if (busid.bus_type != WSDISPLAYIO_BUS_PCI)
+		return 0;
+
+	if (busid.ubus.pci.domain != dev-domain)
+		return 0;
+	if (busid.ubus.pci.bus != dev-bus)
+		return 0;
+	if (busid.ubus.pci.device != dev-dev)
+		return 0;
+	if (busid.ubus.pci.function != dev-func)
+		return 0;
+
+	return 1;
+}
+
 static void
 pci_system_netbsd_destroy(void)
 {
@@ -479,7 +517,8 @@
 	.unmap_range = pci_device_netbsd_unmap_range,
 	.read = pci_device_netbsd_read,
 	.write = pci_device_netbsd_write,
-	.fill_capabilities = pci_fill_capabilities_generic
+	.fill_capabilities = pci_fill_capabilities_generic,
+	.boot_vga = pci_device_netbsd_boot_vga,
 };
 
 int



CVS commit: src/external/mit/xorg/server/xorg-server/hw/xfree86/common

2011-01-22 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Jan 22 15:21:37 UTC 2011

Modified Files:
src/external/mit/xorg/server/xorg-server/hw/xfree86/common: Makefile

Log Message:
Define HAVE_PCI_DEVICE_IS_BOOT_VGA.
Makes Xorg use of pci_device_is_boot_vga.

First discussed with macallan@ then public on tech-kern@ and tech-x11@


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/common/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/server/xorg-server/hw/xfree86/common/Makefile
diff -u src/external/mit/xorg/server/xorg-server/hw/xfree86/common/Makefile:1.15 src/external/mit/xorg/server/xorg-server/hw/xfree86/common/Makefile:1.16
--- src/external/mit/xorg/server/xorg-server/hw/xfree86/common/Makefile:1.15	Mon Nov 29 09:34:41 2010
+++ src/external/mit/xorg/server/xorg-server/hw/xfree86/common/Makefile	Sat Jan 22 15:21:37 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2010/11/29 09:34:41 skrll Exp $
+#	$NetBSD: Makefile,v 1.16 2011/01/22 15:21:37 cegger Exp $
 
 .include bsd.sys.mk # for HOST_SH
 
@@ -83,7 +83,8 @@
 		-D__XSERVERNAME__='Xorg' -D__XCONFIGFILE__='xorg.conf' \
 		-D__VENDORDWEBSUPPORT__='http://wiki.X.Org;' \
 		-DXVENDORNAME='The X.Org Foundation' \
-		-DHAVE_XORG_CONFIG_H
+		-DHAVE_XORG_CONFIG_H \
+		-DHAVE_PCI_DEVICE_IS_BOOT_VGA
 
 .if ${MACHINE_ARCH} == i386
 CPPFLAGS+=	-DPCCONS_SUPPORT -DPCVT_SUPPORT



CVS commit: src/sys/dev/mii

2011-01-22 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Jan 22 18:26:12 UTC 2011

Modified Files:
src/sys/dev/mii: atphy.c

Log Message:
fix comment. from PR kern/44395


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/mii/atphy.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/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.8 src/sys/dev/mii/atphy.c:1.9
--- src/sys/dev/mii/atphy.c:1.8	Sat Jan 22 08:13:47 2011
+++ src/sys/dev/mii/atphy.c	Sat Jan 22 18:26:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.8 2011/01/22 08:13:47 cegger Exp $ */
+/*	$NetBSD: atphy.c,v 1.9 2011/01/22 18:26:12 cegger Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atphy.c,v 1.8 2011/01/22 08:13:47 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: atphy.c,v 1.9 2011/01/22 18:26:12 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -220,7 +220,7 @@
 		PHY_WRITE(sc, MII_ANAR, anar);
 
 		/*
-		 * Reset the PHY so all changes take effect.
+		 * Start autonegotiation.
 		 */
 		PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
 done:



CVS commit: src/sys/uvm

2011-01-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Jan 21 16:56:38 UTC 2011

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
buildfix: use PRIxPADDR for type paddr_t


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.52 src/sys/uvm/uvm_pglist.c:1.53
--- src/sys/uvm/uvm_pglist.c:1.52	Tue Jan 18 21:43:29 2011
+++ src/sys/uvm/uvm_pglist.c	Fri Jan 21 16:56:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.52 2011/01/18 21:43:29 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.53 2011/01/21 16:56:38 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pglist.c,v 1.52 2011/01/18 21:43:29 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pglist.c,v 1.53 2011/01/21 16:56:38 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -205,7 +205,7 @@
 		 * Found a suitable starting page.  See if the range is free.
 		 */
 #ifdef PGALLOC_VERBOSE
-		printf(%s: ps=%p try=%#x end=%#x skip=%#x, align=%#x,
+		printf(%s: ps=%p try=%#x end=%#x skip=%#x, align=0x%PRIxPADDR,
 		__func__, ps, tryidx, end, skip, alignment);
 #endif
 		/*



CVS commit: src/sys/kern

2011-01-19 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Jan 19 09:02:53 UTC 2011

Modified Files:
src/sys/kern: kern_malloc_debug.c

Log Message:
buildfix: uvm_extern.h - uvm.h


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/kern/kern_malloc_debug.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/kern/kern_malloc_debug.c
diff -u src/sys/kern/kern_malloc_debug.c:1.24 src/sys/kern/kern_malloc_debug.c:1.25
--- src/sys/kern/kern_malloc_debug.c:1.24	Mon Jan 17 07:13:31 2011
+++ src/sys/kern/kern_malloc_debug.c	Wed Jan 19 09:02:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc_debug.c,v 1.24 2011/01/17 07:13:31 uebayasi Exp $	*/
+/*	$NetBSD: kern_malloc_debug.c,v 1.25 2011/01/19 09:02:52 cegger Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Artur Grabowski a...@openbsd.org
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_malloc_debug.c,v 1.24 2011/01/17 07:13:31 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_malloc_debug.c,v 1.25 2011/01/19 09:02:52 cegger Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -65,7 +65,7 @@
 #include sys/systm.h
 #include sys/pool.h
 
-#include uvm/uvm_extern.h
+#include uvm/uvm.h
 
 /*
  * debug_malloc_type and debug_malloc_size define the type and size of



CVS commit: src/sys/arch/xen/include

2011-01-10 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Jan 10 11:13:03 UTC 2011

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
fix typo in ioctl definition


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/xen/include/xenio.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/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.8 src/sys/arch/xen/include/xenio.h:1.9
--- src/sys/arch/xen/include/xenio.h:1.8	Wed Dec 15 14:45:47 2010
+++ src/sys/arch/xen/include/xenio.h	Mon Jan 10 11:13:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.8 2010/12/15 14:45:47 cegger Exp $	*/
+/*	$NetBSD: xenio.h,v 1.9 2011/01/10 11:13:03 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -112,7 +112,7 @@
 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
 _IOR('P', 5, int)
 #define IOCTL_PRIVCMD_MMAPBATCH_V2  \
-_IOW('P, 6, privcmd_mmapbatch_v2_t)
+_IOW('P', 6, privcmd_mmapbatch_v2_t)
 
 /* Interface to /dev/xenevt */
 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */



CVS commit: src/sys/dev/pci

2011-01-10 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Jan 10 14:19:36 UTC 2011

Modified Files:
src/sys/dev/pci: ppb.c

Log Message:
add missing break


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/ppb.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/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.44 src/sys/dev/pci/ppb.c:1.45
--- src/sys/dev/pci/ppb.c:1.44	Mon Jan 10 12:23:21 2011
+++ src/sys/dev/pci/ppb.c	Mon Jan 10 14:19:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.44 2011/01/10 12:23:21 jmcneill Exp $	*/
+/*	$NetBSD: ppb.c,v 1.45 2011/01/10 14:19:36 cegger Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.44 2011/01/10 12:23:21 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.45 2011/01/10 14:19:36 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -101,6 +101,7 @@
 	switch (reg  PCI_PCIE_XCAP_VER_MASK) {
 	case PCI_PCIE_XCAP_VER_1_0:
 		aprint_normal(1.0);
+		break;
 	case PCI_PCIE_XCAP_VER_2_0:
 		aprint_normal(2.0);
 		break;



CVS commit: src/sys/dev/acpi

2011-01-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Jan  7 14:08:29 UTC 2011

Modified Files:
src/sys/dev/acpi: acpi_ec.c

Log Message:
use aprint_error_dev


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/acpi/acpi_ec.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_ec.c
diff -u src/sys/dev/acpi/acpi_ec.c:1.67 src/sys/dev/acpi/acpi_ec.c:1.68
--- src/sys/dev/acpi/acpi_ec.c:1.67	Sun Jun  6 18:56:10 2010
+++ src/sys/dev/acpi/acpi_ec.c	Fri Jan  7 14:08:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_ec.c,v 1.67 2010/06/06 18:56:10 jruoho Exp $	*/
+/*	$NetBSD: acpi_ec.c,v 1.68 2011/01/07 14:08:29 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger jo...@netbsd.org.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_ec.c,v 1.67 2010/06/06 18:56:10 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_ec.c,v 1.68 2011/01/07 14:08:29 cegger Exp $);
 
 #include sys/param.h
 #include sys/callout.h
@@ -735,8 +735,8 @@
 	snprintf(qxx, sizeof(qxx), _Q%02X, (unsigned int)reg);
 	rv = AcpiEvaluateObject(sc-sc_ech, qxx, NULL, NULL);
 	if (rv != AE_OK  rv != AE_NOT_FOUND) {
-		aprint_error(%s: GPE query method %s failed: %s,
-		device_xname(dv), qxx, AcpiFormatException(rv));
+		aprint_error_dev(dv, GPE query method %s failed: %s,
+		qxx, AcpiFormatException(rv));
 	}
 
 	goto loop;



CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2011-01-06 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Jan  6 11:07:49 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: drm_pciids.h

Log Message:
recognize Radeon HD 4200. This lets radeondrm(4) attach.
go ahead macallan@


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h

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

Modified files:

Index: src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h:1.4 src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h:1.5
--- src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h:1.4	Sat Jun 26 23:00:19 2010
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h	Thu Jan  6 11:07:48 2011
@@ -393,6 +393,7 @@
 	{0x1002, 0x9552, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, ATI Mobility Radeon 4300 Series}, \
 	{0x1002, 0x9553, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, ATI Mobility Radeon 4500 Series}, \
 	{0x1002, 0x9555, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, ATI Mobility Radeon 4500 Series}, \
+	{0x1002, 0x9712, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP, ATI Radeon Mobility HD 4200}, \
 	{0, 0, 0, NULL}
 
 #define r128_PCI_IDS \



CVS commit: src/sys/dev/pci

2010-12-23 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Dec 23 21:34:02 UTC 2010

Modified Files:
src/sys/dev/pci: voyagerfb.c

Log Message:
read 32bits instead of 64bits and truncate the upper 32bits


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/voyagerfb.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/pci/voyagerfb.c
diff -u src/sys/dev/pci/voyagerfb.c:1.5 src/sys/dev/pci/voyagerfb.c:1.6
--- src/sys/dev/pci/voyagerfb.c:1.5	Thu Dec 16 06:45:51 2010
+++ src/sys/dev/pci/voyagerfb.c	Thu Dec 23 21:34:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: voyagerfb.c,v 1.5 2010/12/16 06:45:51 cegger Exp $	*/
+/*	$NetBSD: voyagerfb.c,v 1.6 2010/12/23 21:34:02 cegger Exp $	*/
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: voyagerfb.c,v 1.5 2010/12/16 06:45:51 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: voyagerfb.c,v 1.6 2010/12/23 21:34:02 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -207,7 +207,7 @@
 	sc-sc_dataport = bus_space_vaddr(sc-sc_memt, sc-sc_regh);
 	sc-sc_dataport += SM502_DATAPORT;
 
-	reg = bus_space_read_8(sc-sc_memt, sc-sc_regh, SM502_PANEL_DISP_CRTL);
+	reg = bus_space_read_4(sc-sc_memt, sc-sc_regh, SM502_PANEL_DISP_CRTL);
 	switch (reg  SM502_PDC_DEPTH_MASK) {
 		case SM502_PDC_8BIT:
 			sc-sc_depth = 8;



CVS commit: src/sys/arch/xen/include

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec 15 14:28:22 UTC 2010

Added Files:
src/sys/arch/xen/include: xenio_gntdev.h

Log Message:
add gnttab ioctl definitions to implement


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/xen/include/xenio_gntdev.h

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

Added files:

Index: src/sys/arch/xen/include/xenio_gntdev.h
diff -u /dev/null src/sys/arch/xen/include/xenio_gntdev.h:1.1
--- /dev/null	Wed Dec 15 14:28:22 2010
+++ src/sys/arch/xen/include/xenio_gntdev.h	Wed Dec 15 14:28:22 2010
@@ -0,0 +1,119 @@
+/**
+ * gntdev.h
+ * 
+ * Interface to /dev/xen/gntdev.
+ * 
+ * Copyright (c) 2007, D G Murray
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the Software), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_GNTDEV_H__
+#define __XEN_GNTDEV_H__
+
+struct ioctl_gntdev_grant_ref {
+	/* The domain ID of the grant to be mapped. */
+	uint32_t domid;
+	/* The grant reference of the grant to be mapped. */
+	uint32_t ref;
+};
+
+/*
+ * Inserts the grant references into the mapping table of an instance
+ * of gntdev. N.B. This does not perform the mapping, which is deferred
+ * until mmap() is called with @index as the offset.
+ */
+#define IOCTL_GNTDEV_MAP_GRANT_REF\
+	_IOWR('G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
+struct ioctl_gntdev_map_grant_ref {
+	/* IN parameters */
+	/* The number of grants to be mapped. */
+	uint32_t count;
+	uint32_t pad;
+	/* OUT parameters */
+	/* The offset to be used on a subsequent call to mmap(). */
+	uint64_t index;
+	/* Variable IN parameter. */
+	/* Array of grant references, of size @count. */
+	struct ioctl_gntdev_grant_ref refs[1];
+};
+
+/*
+ * Removes the grant references from the mapping table of an instance of
+ * of gntdev. N.B. munmap() must be called on the relevant virtual address(es)
+ * before this ioctl is called, or an error will result.
+ */
+#define IOCTL_GNTDEV_UNMAP_GRANT_REF\
+	_IOW('G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))   
+struct ioctl_gntdev_unmap_grant_ref {
+	/* IN parameters */
+	/* The offset was returned by the corresponding map operation. */
+	uint64_t index;
+	/* The number of pages to be unmapped. */
+	uint32_t count;
+	uint32_t pad;
+};
+
+/*
+ * Returns the offset in the driver's address space that corresponds
+ * to @vaddr. This can be used to perform a munmap(), followed by an
+ * UNMAP_GRANT_REF ioctl, where no state about the offset is retained by
+ * the caller. The number of pages that were allocated at the same time as
+ * @vaddr is returned in @count.
+ *
+ * N.B. Where more than one page has been mapped into a contiguous range, the
+ *  supplied @vaddr must correspond to the start of the range; otherwise
+ *  an error will result. It is only possible to munmap() the entire
+ *  contiguously-allocated range at once, and not any subrange thereof.
+ */
+#define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR			\
+	_IOWR('G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
+struct ioctl_gntdev_get_offset_for_vaddr {
+	/* IN parameters */
+	/* The virtual address of the first mapped page in a range. */
+	uint64_t vaddr;
+	/* OUT parameters */
+	/* The offset that was used in the initial mmap() operation. */
+	uint64_t offset;
+	/* The number of pages mapped in the VM area that begins at @vaddr. */
+	uint32_t count;
+	uint32_t pad;
+};
+
+/*
+ * Sets the maximum number of grants that may mapped at once by this gntdev
+ * instance.
+ *
+ * N.B. This must be called before any other ioctl is 

CVS commit: src/sys/arch/xen/include

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec 15 14:45:47 UTC 2010

Modified Files:
src/sys/arch/xen/include: xenio.h

Log Message:
add privcmd ioctl that got introduced with Xen 4


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/include/xenio.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/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.7 src/sys/arch/xen/include/xenio.h:1.8
--- src/sys/arch/xen/include/xenio.h:1.7	Fri Sep  3 06:07:24 2010
+++ src/sys/arch/xen/include/xenio.h	Wed Dec 15 14:45:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.7 2010/09/03 06:07:24 cegger Exp $	*/
+/*	$NetBSD: xenio.h,v 1.8 2010/12/15 14:45:47 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -58,6 +58,14 @@
 unsigned long *arr; /* array of mfns - top nibble set on err */
 } privcmd_mmapbatch_t; 
 
+typedef struct privcmd_mmapbatch_v2 {
+int num; /* number of pages to populate */
+domid_t dom; /* target domain */
+uint64_t addr;  /* virtual address */
+const xen_pfn_t *arr; /* array of mfns */
+int *err; /* array of error codes */
+} privcmd_mmapbatch_v2_t; 
+
 typedef struct privcmd_blkmsg
 {
 unsigned long op;
@@ -103,6 +111,8 @@
  */
 #define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
 _IOR('P', 5, int)
+#define IOCTL_PRIVCMD_MMAPBATCH_V2  \
+_IOW('P, 6, privcmd_mmapbatch_v2_t)
 
 /* Interface to /dev/xenevt */
 /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */



CVS commit: src/usr.sbin/cpuctl/arch

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Dec 15 17:09:07 UTC 2010

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
beautify printing of SVM features across multiple lines


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/cpuctl/arch/i386.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/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.22 src/usr.sbin/cpuctl/arch/i386.c:1.23
--- src/usr.sbin/cpuctl/arch/i386.c:1.22	Tue Feb 23 08:46:33 2010
+++ src/usr.sbin/cpuctl/arch/i386.c	Wed Dec 15 17:09:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.22 2010/02/23 08:46:33 cegger Exp $	*/
+/*	$NetBSD: i386.c,v 1.23 2010/12/15 17:09:07 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: i386.c,v 1.22 2010/02/23 08:46:33 cegger Exp $);
+__RCSID($NetBSD: i386.c,v 1.23 2010/12/15 17:09:07 cegger Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -1491,9 +1491,14 @@
 			aprint_verbose(%s: SVM Rev. %d\n, cpuname,
 			data[0]  0xf);
 			aprint_verbose(%s: SVM NASID %d\n, cpuname, data[1]);
-			snprintb(buf, sizeof(buf), CPUID_AMD_SVM_FLAGS,
-			data[3]);
-			aprint_verbose(%s: SVM features %s\n, cpuname, buf);
+			snprintb_m(buf, sizeof(buf), CPUID_AMD_SVM_FLAGS,
+   data[3], MAX_FEATURE_LEN);
+			bp = buf;
+			while (*bp != '\0') {
+aprint_verbose(%s: SVM features %s\n,
+cpuname, bp);
+bp += strlen(bp) + 1;
+			}
 		}
 	}
 



CVS commit: src/sys/dev/pci

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Dec 16 06:19:01 UTC 2010

Modified Files:
src/sys/dev/pci: chipsfb.c

Log Message:
ioctl: KNF switch-case


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/chipsfb.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/pci/chipsfb.c
diff -u src/sys/dev/pci/chipsfb.c:1.22 src/sys/dev/pci/chipsfb.c:1.23
--- src/sys/dev/pci/chipsfb.c:1.22	Sat Nov 13 13:52:05 2010
+++ src/sys/dev/pci/chipsfb.c	Thu Dec 16 06:19:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: chipsfb.c,v 1.22 2010/11/13 13:52:05 uebayasi Exp $	*/
+/*	$NetBSD: chipsfb.c,v 1.23 2010/12/16 06:19:01 cegger Exp $	*/
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: chipsfb.c,v 1.22 2010/11/13 13:52:05 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: chipsfb.c,v 1.23 2010/12/16 06:19:01 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -820,44 +820,43 @@
 	struct vcons_screen *ms = vd-active;
 
 	switch (cmd) {
-		case WSDISPLAYIO_GTYPE:
-			*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
-			return 0;
-
-		case WSDISPLAYIO_GINFO:
-			wdf = (void *)data;
-			wdf-height = ms-scr_ri.ri_height;
-			wdf-width = ms-scr_ri.ri_width;
-			wdf-depth = ms-scr_ri.ri_depth;
-			wdf-cmsize = 256;
-			return 0;
-
-		case WSDISPLAYIO_GETCMAP:
-			return chipsfb_getcmap(sc,
-			(struct wsdisplay_cmap *)data);
-
-		case WSDISPLAYIO_PUTCMAP:
-			return chipsfb_putcmap(sc,
-			(struct wsdisplay_cmap *)data);
-
-		/* PCI config read/write passthrough. */
-		case PCI_IOC_CFGREAD:
-		case PCI_IOC_CFGWRITE:
-			return (pci_devioctl(sc-sc_pc, sc-sc_pcitag,
-			cmd, data, flag, l));
-
-		case WSDISPLAYIO_SMODE:
-			{
-int new_mode = *(int*)data;
-if (new_mode != sc-sc_mode) {
-	sc-sc_mode = new_mode;
-	if(new_mode == WSDISPLAYIO_MODE_EMUL) {
-		chipsfb_restore_palette(sc);
-		vcons_redraw_screen(ms);
-	}
-}
+	case WSDISPLAYIO_GTYPE:
+		*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
+		return 0;
+
+	case WSDISPLAYIO_GINFO:
+		wdf = (void *)data;
+		wdf-height = ms-scr_ri.ri_height;
+		wdf-width = ms-scr_ri.ri_width;
+		wdf-depth = ms-scr_ri.ri_depth;
+		wdf-cmsize = 256;
+		return 0;
+
+	case WSDISPLAYIO_GETCMAP:
+		return chipsfb_getcmap(sc,
+		(struct wsdisplay_cmap *)data);
+
+	case WSDISPLAYIO_PUTCMAP:
+		return chipsfb_putcmap(sc,
+		(struct wsdisplay_cmap *)data);
+
+	/* PCI config read/write passthrough. */
+	case PCI_IOC_CFGREAD:
+	case PCI_IOC_CFGWRITE:
+		return pci_devioctl(sc-sc_pc, sc-sc_pcitag,
+		cmd, data, flag, l);
+
+	case WSDISPLAYIO_SMODE: {
+		int new_mode = *(int*)data;
+		if (new_mode != sc-sc_mode) {
+			sc-sc_mode = new_mode;
+			if(new_mode == WSDISPLAYIO_MODE_EMUL) {
+chipsfb_restore_palette(sc);
+vcons_redraw_screen(ms);
 			}
-			return 0;
+		}
+		}
+		return 0;
 	}
 	return EPASSTHROUGH;
 }



CVS commit: src/sys/dev/pci

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Dec 16 06:45:51 UTC 2010

Modified Files:
src/sys/dev/pci: genfb_pci.c machfb.c pm2fb.c r128fb.c radeonfb.c
unichromefb.c vga_pci.c voodoofb.c voyagerfb.c wcfb.c

Log Message:
ioctl: KNF switch-case, remove useless brackets


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/genfb_pci.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/machfb.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/pm2fb.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/r128fb.c \
src/sys/dev/pci/unichromefb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/radeonfb.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/vga_pci.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/voodoofb.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/voyagerfb.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/wcfb.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/pci/genfb_pci.c
diff -u src/sys/dev/pci/genfb_pci.c:1.25 src/sys/dev/pci/genfb_pci.c:1.26
--- src/sys/dev/pci/genfb_pci.c:1.25	Thu Oct  7 07:53:54 2010
+++ src/sys/dev/pci/genfb_pci.c	Thu Dec 16 06:45:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb_pci.c,v 1.25 2010/10/07 07:53:54 macallan Exp $ */
+/*	$NetBSD: genfb_pci.c,v 1.26 2010/12/16 06:45:50 cegger Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfb_pci.c,v 1.25 2010/10/07 07:53:54 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfb_pci.c,v 1.26 2010/12/16 06:45:50 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -188,27 +188,26 @@
 	struct pci_genfb_softc *sc = v;
 
 	switch (cmd) {
-		case WSDISPLAYIO_GTYPE:
-			*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
-			return 0;
-
-		/* PCI config read/write passthrough. */
-		case PCI_IOC_CFGREAD:
-		case PCI_IOC_CFGWRITE:
-			return (pci_devioctl(sc-sc_pc, sc-sc_pcitag,
-			cmd, data, flag, l));
-		case WSDISPLAYIO_SMODE:
-			{
-int new_mode = *(int*)data, i;
-if (new_mode == WSDISPLAYIO_MODE_EMUL) {
-	for (i = 0; i  9; i++)
-		pci_conf_write(sc-sc_pc,
-		 sc-sc_pcitag,
-		 0x10 + (i  2),
-		 sc-sc_bars[i]);
-}
-			}
-			return 0;
+	case WSDISPLAYIO_GTYPE:
+		*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
+		return 0;
+
+	/* PCI config read/write passthrough. */
+	case PCI_IOC_CFGREAD:
+	case PCI_IOC_CFGWRITE:
+		return pci_devioctl(sc-sc_pc, sc-sc_pcitag,
+		cmd, data, flag, l);
+	case WSDISPLAYIO_SMODE: {
+		int new_mode = *(int*)data, i;
+		if (new_mode == WSDISPLAYIO_MODE_EMUL) {
+			for (i = 0; i  9; i++)
+pci_conf_write(sc-sc_pc,
+ sc-sc_pcitag,
+ 0x10 + (i  2),
+ sc-sc_bars[i]);
+		}
+		}
+		return 0;
 	}
 
 	return EPASSTHROUGH;

Index: src/sys/dev/pci/machfb.c
diff -u src/sys/dev/pci/machfb.c:1.61 src/sys/dev/pci/machfb.c:1.62
--- src/sys/dev/pci/machfb.c:1.61	Sat Oct  2 23:54:03 2010
+++ src/sys/dev/pci/machfb.c	Thu Dec 16 06:45:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.61 2010/10/02 23:54:03 macallan Exp $	*/
+/*	$NetBSD: machfb.c,v 1.62 2010/12/16 06:45:50 cegger Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 __KERNEL_RCSID(0, 
-	$NetBSD: machfb.c,v 1.61 2010/10/02 23:54:03 macallan Exp $);
+	$NetBSD: machfb.c,v 1.62 2010/12/16 06:45:50 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1679,58 +1679,55 @@
 	struct vcons_screen *ms = vd-active;
 	
 	switch (cmd) {
-		case WSDISPLAYIO_GTYPE:
-			/* XXX is this the right type to return? */
-			*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;	
-			return 0;
-
-		case WSDISPLAYIO_LINEBYTES:
-			*(u_int *)data = sc-virt_x * sc-bits_per_pixel / 8;
-			return 0;
-
-		case WSDISPLAYIO_GINFO:
-			wdf = (void *)data;
-			wdf-height = sc-virt_y;
-			wdf-width = sc-virt_x;
-			wdf-depth = sc-bits_per_pixel;
-			wdf-cmsize = 256;
-			return 0;
-			
-		case WSDISPLAYIO_GETCMAP:
-			return mach64_getcmap(sc, 
-			(struct wsdisplay_cmap *)data);
-
-		case WSDISPLAYIO_PUTCMAP:
-			return mach64_putcmap(sc, 
-			(struct wsdisplay_cmap *)data);
-			
-		/* PCI config read/write passthrough. */
-		case PCI_IOC_CFGREAD:
-		case PCI_IOC_CFGWRITE:
-			return (pci_devioctl(sc-sc_pc, sc-sc_pcitag,
-			cmd, data, flag, l));
-			
-		case WSDISPLAYIO_SMODE:
-			{
-int new_mode = *(int*)data;
+	case WSDISPLAYIO_GTYPE:
+		/* XXX is this the right type to return? */
+		*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;	
+		return 0;
 
-if (new_mode != sc-sc_mode)
-{
-	sc-sc_mode = new_mode;
-	if ((new_mode == WSDISPLAYIO_MODE_EMUL)
-	 (ms != NULL))
-	{
-		/* restore initial video mode */
-		mach64_init(sc);
-		mach64_init_engine(sc);
-		mach64_init_lut(sc);
-		mach64_modeswitch(sc, sc-sc_my_mode);
-		vcons_redraw_screen(ms);
-	}
-}
+	case WSDISPLAYIO_LINEBYTES:
+		*(u_int *)data = sc-virt_x * 

CVS commit: src/sys/dev/pci

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Dec 16 07:02:07 UTC 2010

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Brdige - Bridge


To generate a diff of this commit:
cvs rdiff -u -r1.1053 -r1.1054 src/sys/dev/pci/pcidevs

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/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1053 src/sys/dev/pci/pcidevs:1.1054
--- src/sys/dev/pci/pcidevs:1.1053	Sat Dec 11 17:45:38 2010
+++ src/sys/dev/pci/pcidevs	Thu Dec 16 07:02:07 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1053 2010/12/11 17:45:38 matt Exp $
+$NetBSD: pcidevs,v 1.1054 2010/12/16 07:02:07 cegger Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -990,7 +990,7 @@
 product AMD RS780_PPB_GFX	0x9602	RS780 PCI-PCI Bridge (int gfx)
 product AMD RS780_PPB_GFX0	0x9603	RS780 PCI-PCI Bridge (ext gfx port 0)
 product AMD RS780_PPB0		0x9604	RS780 PCI-PCIE Bridge (port 0)
-product AMD RS780_PPB1		0x9605	RS780 PCI-PCIE Brdige (port 1)
+product AMD RS780_PPB1		0x9605	RS780 PCI-PCIE Bridge (port 1)
 product AMD RS780_PPB2		0x9606	RS780 PCI-PCIE Bridge (port 2)
 
 /* American Megatrends products */



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

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Dec 16 07:51:22 UTC 2010

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

Log Message:
add PCI VGA drivers


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 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.280 src/sys/arch/i386/conf/ALL:1.281
--- src/sys/arch/i386/conf/ALL:1.280	Sat Nov 27 20:18:46 2010
+++ src/sys/arch/i386/conf/ALL	Thu Dec 16 07:51:21 2010
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.280 2010/11/27 20:18:46 christos Exp $
+# $NetBSD: ALL,v 1.281 2010/12/16 07:51:21 cegger 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.280 $
+#ident 		ALL-$Revision: 1.281 $
 
 maxusers	64		# estimated number of users
 
@@ -576,8 +576,16 @@
 wskbd*		at pckbd? console ?
 wsmouse*	at pms? mux 0
 
-# VIA Unichrome framebuffer console
-unichromefb*	at pci? dev ? function ?
+chipsfb*	at pci? dev ? function ?
+genfb*		at pci? dev ? function ?
+machfb*		at pci? dev ? function ?
+pm2fb*		at pci? dev ? function ?
+r128fb*		at pci? dev ? function ?
+radeonfb*	at pci? dev ? function ?
+unichromefb*	at pci? dev ? function ?  # VIA Unichrome framebuffer console
+voodoofb*	at pci? dev ? function ?
+voyagerfb*	at pci? dev ? function ?
+wcfb*	at pci? dev ? function ?
 wsdisplay*	at unichromefb?
 
 # XBOX framebuffer console



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

2010-12-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Dec 16 07:59:10 UTC 2010

Modified Files:
src/sys/arch/i386/xbox: xboxfb.c

Log Message:
ioctl: KNF switch-case


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/xbox/xboxfb.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/i386/xbox/xboxfb.c
diff -u src/sys/arch/i386/xbox/xboxfb.c:1.13 src/sys/arch/i386/xbox/xboxfb.c:1.14
--- src/sys/arch/i386/xbox/xboxfb.c:1.13	Wed Apr 28 19:17:04 2010
+++ src/sys/arch/i386/xbox/xboxfb.c	Thu Dec 16 07:59:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xboxfb.c,v 1.13 2010/04/28 19:17:04 dyoung Exp $	*/
+/*	$NetBSD: xboxfb.c,v 1.14 2010/12/16 07:59:10 cegger Exp $	*/
 
 /*
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xboxfb.c,v 1.13 2010/04/28 19:17:04 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: xboxfb.c,v 1.14 2010/12/16 07:59:10 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -244,40 +244,39 @@
 	struct vcons_screen *ms = vd-active;
 
 	switch (cmd) {
-		case WSDISPLAYIO_GTYPE:
-			*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
-			return 0;
-
-		case WSDISPLAYIO_GINFO:
-			wdf = (void *)data;
-			wdf-height = xboxfb_console_height;
-			wdf-width = xboxfb_console_width;
-			wdf-depth = ms-scr_ri.ri_depth;
-			wdf-cmsize = 256;
-			return 0;
-
-		case WSDISPLAYIO_GETCMAP:
-			return EINVAL;
-
-		case WSDISPLAYIO_PUTCMAP:
-			return EINVAL;
-
-		case WSDISPLAYIO_LINEBYTES:
-			*(u_int *)data = ms-scr_ri.ri_stride;
-			return 0;
-
-		case WSDISPLAYIO_SMODE:
-			{
-int new_mode = *(int *)data;
-if (new_mode != sc-sc_mode) {
-	sc-sc_mode = new_mode;
-	if (new_mode == WSDISPLAYIO_MODE_EMUL) {
-		xboxfb_clear_fb(sc);
-		vcons_redraw_screen(vd-active);
-	}
+	case WSDISPLAYIO_GTYPE:
+		*(u_int *)data = WSDISPLAY_TYPE_PCIMISC;
+		return 0;
+
+	case WSDISPLAYIO_GINFO:
+		wdf = (void *)data;
+		wdf-height = xboxfb_console_height;
+		wdf-width = xboxfb_console_width;
+		wdf-depth = ms-scr_ri.ri_depth;
+		wdf-cmsize = 256;
+		return 0;
+
+	case WSDISPLAYIO_GETCMAP:
+		return EINVAL;
+
+	case WSDISPLAYIO_PUTCMAP:
+		return EINVAL;
+
+	case WSDISPLAYIO_LINEBYTES:
+		*(u_int *)data = ms-scr_ri.ri_stride;
+		return 0;
+
+	case WSDISPLAYIO_SMODE: {
+			int new_mode = *(int *)data;
+			if (new_mode != sc-sc_mode) {
+sc-sc_mode = new_mode;
+if (new_mode == WSDISPLAYIO_MODE_EMUL) {
+	xboxfb_clear_fb(sc);
+	vcons_redraw_screen(vd-active);
 }
 			}
-			return 0;
+		}
+		return 0;
 	}
 	return EPASSTHROUGH;
 }



CVS commit: src/sys/nfs

2010-12-14 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Dec 14 16:25:19 UTC 2010

Modified Files:
src/sys/nfs: nfs_vnops.c

Log Message:
back out rev. 1.285. The problem I try to hunt down
in PR 42455 is not in the network stack as shown by PR 44206.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/sys/nfs/nfs_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/nfs/nfs_vnops.c
diff -u src/sys/nfs/nfs_vnops.c:1.287 src/sys/nfs/nfs_vnops.c:1.288
--- src/sys/nfs/nfs_vnops.c:1.287	Tue Nov 30 10:43:05 2010
+++ src/sys/nfs/nfs_vnops.c	Tue Dec 14 16:25:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vnops.c,v 1.287 2010/11/30 10:43:05 dholland Exp $	*/
+/*	$NetBSD: nfs_vnops.c,v 1.288 2010/12/14 16:25:18 cegger Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.287 2010/11/30 10:43:05 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.288 2010/12/14 16:25:18 cegger Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -1369,14 +1369,6 @@
 		if (v3) {
 			wccflag = NFSV3_WCCCHK;
 			nfsm_wcc_data(vp, wccflag, NAC_NOTRUNC, !error);
-
-			/* Diagnostic check: The KASSERT hits when PR 42455
-			 * is reproduced.
-			 */
-			if (ctx.nwc_mbufcount = 2) {
-KASSERT(mb-m_next != NULL);
-			}
-
 			if (!error) {
 nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED
 	+ NFSX_V3WRITEVERF);



CVS commit: src/sys/nfs

2010-12-14 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Dec 14 16:58:59 UTC 2010

Modified Files:
src/sys/nfs: nfs_vnops.c

Log Message:
Initialize mutex and cv after sanity checks


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/sys/nfs/nfs_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/nfs/nfs_vnops.c
diff -u src/sys/nfs/nfs_vnops.c:1.288 src/sys/nfs/nfs_vnops.c:1.289
--- src/sys/nfs/nfs_vnops.c:1.288	Tue Dec 14 16:25:18 2010
+++ src/sys/nfs/nfs_vnops.c	Tue Dec 14 16:58:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vnops.c,v 1.288 2010/12/14 16:25:18 cegger Exp $	*/
+/*	$NetBSD: nfs_vnops.c,v 1.289 2010/12/14 16:58:58 cegger Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.288 2010/12/14 16:25:18 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.289 2010/12/14 16:58:58 cegger Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -1278,10 +1278,6 @@
 	int rlen, commit;
 #endif
 
-	mutex_init(ctx.nwc_lock, MUTEX_DRIVER, IPL_VM);
-	cv_init(ctx.nwc_cv, nfsmblk);
-	ctx.nwc_mbufcount = 1;
-
 	if (vp-v_mount-mnt_flag  MNT_RDONLY) {
 		panic(writerpc readonly vp %p, vp);
 	}
@@ -1292,7 +1288,12 @@
 #endif
 	tsiz = uiop-uio_resid;
 	if (uiop-uio_offset + tsiz  nmp-nm_maxfilesize)
-		return (EFBIG);
+		return EFBIG;
+
+	mutex_init(ctx.nwc_lock, MUTEX_DRIVER, IPL_VM);
+	cv_init(ctx.nwc_cv, nfsmblk);
+	ctx.nwc_mbufcount = 1;
+
 retry:
 	origresid = uiop-uio_resid;
 	KASSERT(origresid == uiop-uio_iov-iov_len);



CVS commit: src/usr.sbin/fwctl

2010-12-13 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Dec 13 11:51:23 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwcontrol.c

Log Message:
PR bin/44230: Missing close.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/fwctl/fwcontrol.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/fwctl/fwcontrol.c
diff -u src/usr.sbin/fwctl/fwcontrol.c:1.10 src/usr.sbin/fwctl/fwcontrol.c:1.11
--- src/usr.sbin/fwctl/fwcontrol.c:1.10	Thu Aug 26 07:04:04 2010
+++ src/usr.sbin/fwctl/fwcontrol.c	Mon Dec 13 11:51:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcontrol.c,v 1.10 2010/08/26 07:04:04 cegger Exp $	*/
+/*	$NetBSD: fwcontrol.c,v 1.11 2010/12/13 11:51:23 cegger Exp $	*/
 /*
  * Copyright (C) 2002
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 #include sys/cdefs.h
 //__FBSDID($FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $);
-__RCSID($NetBSD: fwcontrol.c,v 1.10 2010/08/26 07:04:04 cegger Exp $);
+__RCSID($NetBSD: fwcontrol.c,v 1.11 2010/12/13 11:51:23 cegger Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -492,6 +492,7 @@
 		fscanf(file, DUMP_FORMAT, p, p+1, p+2, p+3, p+4, p+5, p+6, p+7);
 		p += 8;
 	}
+	fclose(file);
 }
 
 static void



CVS commit: src/share/man/man9

2010-12-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Dec 11 17:15:03 UTC 2010

Modified Files:
src/share/man/man9: ioctl.9

Log Message:
add pci(4) and ossaudio(3)

yes, be careful. They can easily conflict. Actually when this happens kdump
fails compiling due to 'duplicate case value'


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/man/man9/ioctl.9

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/man9/ioctl.9
diff -u src/share/man/man9/ioctl.9:1.28 src/share/man/man9/ioctl.9:1.29
--- src/share/man/man9/ioctl.9:1.28	Fri May 14 18:39:05 2010
+++ src/share/man/man9/ioctl.9	Sat Dec 11 17:15:03 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: ioctl.9,v 1.28 2010/05/14 18:39:05 joerg Exp $
+.\ $NetBSD: ioctl.9,v 1.29 2010/12/11 17:15:03 cegger Exp $
 .\
 .\ Copyright (c) 1999  The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 7, 2001
+.Dd December 11, 2010
 .Dt IOCTL 9
 .Os
 .Sh NAME
@@ -168,6 +168,10 @@
 .It 'P'
 printer/plotter interface (hp300)
 .It 'P'
+pci(4)
+.It 'P'
+ossaudio(3)
+.It 'P'
 .Xr magma 4
 bpp (sparc)
 .It 'q'



CVS commit: src/share/man/man9

2010-12-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Dec 11 17:32:15 UTC 2010

Modified Files:
src/share/man/man9: ioctl.9

Log Message:
ossaudio(3) - compat/ossaudio and soundcard.h

suggested by Ian Hibbert


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man9/ioctl.9

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/man9/ioctl.9
diff -u src/share/man/man9/ioctl.9:1.29 src/share/man/man9/ioctl.9:1.30
--- src/share/man/man9/ioctl.9:1.29	Sat Dec 11 17:15:03 2010
+++ src/share/man/man9/ioctl.9	Sat Dec 11 17:32:14 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: ioctl.9,v 1.29 2010/12/11 17:15:03 cegger Exp $
+.\ $NetBSD: ioctl.9,v 1.30 2010/12/11 17:32:14 cegger Exp $
 .\
 .\ Copyright (c) 1999  The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -170,7 +170,7 @@
 .It 'P'
 pci(4)
 .It 'P'
-ossaudio(3)
+compat/ossaudio and soundcard.h
 .It 'P'
 .Xr magma 4
 bpp (sparc)



CVS commit: src/sys/kern

2010-11-24 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Nov 24 14:49:18 UTC 2010

Modified Files:
src/sys/kern: uipc_mbuf.c

Log Message:
No need to print '0x' twice in the printing of
the mbuf flags via 'show mbuf'


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/kern/uipc_mbuf.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/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.137 src/sys/kern/uipc_mbuf.c:1.138
--- src/sys/kern/uipc_mbuf.c:1.137	Thu Oct 28 14:21:50 2010
+++ src/sys/kern/uipc_mbuf.c	Wed Nov 24 14:49:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.137 2010/10/28 14:21:50 seanb Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.138 2010/11/24 14:49:18 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_mbuf.c,v 1.137 2010/10/28 14:21:50 seanb Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_mbuf.c,v 1.138 2010/11/24 14:49:18 cegger Exp $);
 
 #include opt_mbuftrace.h
 #include opt_nmbclusters.h
@@ -1600,7 +1600,7 @@
 nextchain:
 	(*pr)(MBUF %p\n, m);
 	snprintb(buf, sizeof(buf), M_FLAGS_BITS, (u_int)m-m_flags);
-	(*pr)(  data=%p, len=%d, type=%d, flags=0x%s\n,
+	(*pr)(  data=%p, len=%d, type=%d, flags=%s\n,
 	m-m_data, m-m_len, m-m_type, buf);
 	(*pr)(  owner=%p, next=%p, nextpkt=%p\n, m-m_owner, m-m_next,
 	m-m_nextpkt);



CVS commit: src/sys/arch/x86/x86

2010-11-24 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Nov 24 14:56:18 UTC 2010

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
when DDB is enabled then use 'db_printf'
for 'call intr_printconfig' to respect the 25 lines on vga output


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/x86/x86/intr.c

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

Modified files:

Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.68 src/sys/arch/x86/x86/intr.c:1.69
--- src/sys/arch/x86/x86/intr.c:1.68	Thu Jun 17 06:40:28 2010
+++ src/sys/arch/x86/x86/intr.c	Wed Nov 24 14:56:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.68 2010/06/17 06:40:28 mrg Exp $	*/
+/*	$NetBSD: intr.c,v 1.69 2010/11/24 14:56:18 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.68 2010/06/17 06:40:28 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.69 2010/11/24 14:56:18 cegger Exp $);
 
 #include opt_intrdebug.h
 #include opt_multiprocessor.h
@@ -176,6 +176,10 @@
 #include dev/pci/ppbreg.h
 #endif
 
+#ifdef DDB
+#include ddb/db_output.h
+#endif
+
 struct pic softintr_pic = {
 	.pic_name = softintr_fakepic,
 	.pic_type = PIC_SOFT,
@@ -1057,6 +1061,11 @@
 }
 
 #if defined(INTRDEBUG) || defined(DDB)
+
+#ifdef DDB
+#define printf db_printf
+#endif
+
 void
 intr_printconfig(void)
 {
@@ -1086,6 +1095,9 @@
 		}
 	}
 }
+#ifdef DDB
+#undef printf
+#endif
 #endif
 
 void



CVS commit: src/sys/uvm

2010-11-18 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Nov 18 11:49:42 UTC 2010

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
build fix: vm_physmem_index is only used with DEBUG.
Fix build when DIAGNOSTIC is enabled but not DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.49 src/sys/uvm/uvm_pglist.c:1.50
--- src/sys/uvm/uvm_pglist.c:1.49	Thu Nov 18 08:41:11 2010
+++ src/sys/uvm/uvm_pglist.c	Thu Nov 18 11:49:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.49 2010/11/18 08:41:11 uebayasi Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.50 2010/11/18 11:49:41 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pglist.c,v 1.49 2010/11/18 08:41:11 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pglist.c,v 1.50 2010/11/18 11:49:41 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -59,7 +59,7 @@
 #define	STAT_DECR(v)
 #endif
 
-#ifdef DIAGNOSTIC
+#ifdef DEBUG
 static int
 vm_physmem_index(struct vm_physseg *ps)
 {



CVS commit: src/sys/external/intel-public/acpica/dist/events

2010-11-18 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Nov 18 14:40:32 UTC 2010

Modified Files:
src/sys/external/intel-public/acpica/dist/events: evxface.c

Log Message:
fix AcpiEnableGpe:
GPEs get enabled at ACPI initialization. AcpiInstallGpeHandler() disables
GPEs using AcpiEvDisableGpe() w/o decrementing RuntimeCount.
So when acpiec(4) enables the GPE after installing the GPE Handler then
AcpiEnableGpe() does not call AcpiEvEnableGpe() because RuntimeCount
says it is already enabled which is wrong.
So decrement the RuntimeCount in AcpiInstallGpeHandler() right
before calling AcpiEvDisableGpe().


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/sys/external/intel-public/acpica/dist/events/evxface.c

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

Modified files:

Index: src/sys/external/intel-public/acpica/dist/events/evxface.c
diff -u src/sys/external/intel-public/acpica/dist/events/evxface.c:1.1.1.3 src/sys/external/intel-public/acpica/dist/events/evxface.c:1.2
--- src/sys/external/intel-public/acpica/dist/events/evxface.c:1.1.1.3	Sun Jun  6 18:17:09 2010
+++ src/sys/external/intel-public/acpica/dist/events/evxface.c	Thu Nov 18 14:40:31 2010
@@ -749,6 +749,7 @@
 
 /* Disable the GPE before installing the handler */
 
+GpeEventInfo-RuntimeCount--;
 Status = AcpiEvDisableGpe (GpeEventInfo);
 if (ACPI_FAILURE (Status))
 {



CVS commit: src/sys/external/intel-public/acpica/dist/events

2010-11-18 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Nov 18 18:16:15 UTC 2010

Modified Files:
src/sys/external/intel-public/acpica/dist/events: evxface.c

Log Message:
previous fixed one HP laptop and broke an other HP laptop.
The one which got fixed RuntimeCount is 1. The one which broke RuntimeCount is 
0.
So only decrement RuntimeCount when RuntimeCount is non-zero.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/intel-public/acpica/dist/events/evxface.c

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

Modified files:

Index: src/sys/external/intel-public/acpica/dist/events/evxface.c
diff -u src/sys/external/intel-public/acpica/dist/events/evxface.c:1.2 src/sys/external/intel-public/acpica/dist/events/evxface.c:1.3
--- src/sys/external/intel-public/acpica/dist/events/evxface.c:1.2	Thu Nov 18 14:40:31 2010
+++ src/sys/external/intel-public/acpica/dist/events/evxface.c	Thu Nov 18 18:16:15 2010
@@ -749,7 +749,8 @@
 
 /* Disable the GPE before installing the handler */
 
-GpeEventInfo-RuntimeCount--;
+if (GpeEventInfo-RuntimeCount)
+GpeEventInfo-RuntimeCount--;
 Status = AcpiEvDisableGpe (GpeEventInfo);
 if (ACPI_FAILURE (Status))
 {



CVS commit: src/sys/arch/x86/include

2010-11-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Nov 15 11:58:10 UTC 2010

Modified Files:
src/sys/arch/x86/include: i82489reg.h

Log Message:
add interrupt EAPIC register definitions


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/include/i82489reg.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/x86/include/i82489reg.h
diff -u src/sys/arch/x86/include/i82489reg.h:1.9 src/sys/arch/x86/include/i82489reg.h:1.10
--- src/sys/arch/x86/include/i82489reg.h:1.9	Sat Jan  9 20:50:11 2010
+++ src/sys/arch/x86/include/i82489reg.h	Mon Nov 15 11:58:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82489reg.h,v 1.9 2010/01/09 20:50:11 cegger Exp $	*/
+/*	$NetBSD: i82489reg.h,v 1.10 2010/11/15 11:58:09 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -143,6 +143,48 @@
 
 #define LAPIC_IRQ_MASK(i)	(1  ((i) + 1))
 
+/* Extended APIC registers, valid when CPUID features4 EAPIC is present */
+#define LEAPIC_FR	0x400/* Feature register */
+#	define LEAPIC_FR_ELC		__BITS(23,16)	/* Ext. Lvt Count RO */
+#	define LEAPIC_FR_EIDCAP		__BIT(2)	/* Ext. Apic ID Cap. RO */
+#	define LEAPIC_FR_SEIOCAP	__BIT(1)	/* Specific EOI Cap. RO */
+#	define LEAPIC_FR_IERCAP		__BIT(0)	/* Intr. Enable Reg. RO */
+
+#define LEAPIC_CR	0x410	/* Control Register */
+#	define LEAPIC_CR_EID_ENABLE	__BIT(2)	/* Ext. Apic ID enable */
+#	define LEAPIC_CR_SEOI_ENABLE	__BIT(1)	/* Specific EOI enable */
+#	define LEAPIC_CR_IER_ENABLE	__BIT(0)	/* Enable writes to IER */
+
+#define LEAPIC_SEOIR	0x420	/* Specific EOI Register */
+#	define LEAPIC_SEOI_VEC	__BITS(7,0)
+
+#define LEAPIC_IER_480	0x480	/* Interrupts 0-31 */
+#define LEAPIC_IER_490	0x490	/* Interrupts 32-63 */
+#define LEAPIC_IER_4B0	0x4B0	/* Interrupts 64-95 */
+#define LEAPIC_IER_4C0	0x4C0	/* Interrupts 96-127 */
+#define LEAPIC_IER_4D0	0x4D0	/* Interrupts 128-159 */
+#define LEAPIC_IER_4E0	0x4E0	/* Interrupts 160-191 */
+#define LEAPIC_IER_4F0	0x4F0	/* Interrupts 192-255 */
+
+/* Extended Local Vector Table Entries */
+#define LEAPIC_LVTR_500	0x500
+#define LEAPIC_LVTR_504	0x504
+#define LEAPIC_LVTR_508	0x508
+#define LEAPIC_LVTR_50C	0x50C
+#define LEAPIC_LVTR_510	0x510
+#define LEAPIC_LVTR_514	0x514
+#define LEAPIC_LVTR_518	0x518
+#define LEAPIC_LVTR_51C	0x51C
+#define LEAPIC_LVTR_520	0x520
+#define LEAPIC_LVTR_524	0x524
+#define LEAPIC_LVTR_528	0x528
+#define LEAPIC_LVTR_52C	0x52C
+#define LEAPIC_LVTR_530	0x530
+#	define LEAPIC_LVTR_MASK		__BIT(16)	/* interrupt masked RW */
+#	define LEAPIC_LVTR_DSTAT	__BIT(12)	/* delivery state RO */
+#	define LEAPIC_LVTR_MSGTYPE	__BITS(10,8)	/* Message type */
+#	define LEAPIC_LVTR_VEC		__BITS(7,0)	/* the intr. vector */
+
 /*
  * Model specific registers
  */



CVS commit: src/sys/dev/pci

2010-11-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Nov 11 14:37:41 UTC 2010

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add AMD RD880, ATI Radeon HD5600, ATI Radeon HD4200 and Atheros AR9285


To generate a diff of this commit:
cvs rdiff -u -r1.1051 -r1.1052 src/sys/dev/pci/pcidevs

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/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1051 src/sys/dev/pci/pcidevs:1.1052
--- src/sys/dev/pci/pcidevs:1.1051	Sat Nov  6 14:20:34 2010
+++ src/sys/dev/pci/pcidevs	Thu Nov 11 14:37:41 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1051 2010/11/06 14:20:34 jakllsch Exp $
+$NetBSD: pcidevs,v 1.1052 2010/11/11 14:37:41 cegger Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -984,6 +984,12 @@
 product AMD PBC8111_AC_756b	0x756b	AMD8111 756b ACPI Controller
 product AMD HUDSON2_IDE		0x780c	HUDSON-2 IDE Controller
 product AMD HUDSON2_SATA	0x7800	HUDSON-2 SATA Controller
+product AMD RS880_HB		0x9601	RS880 Host Bridge
+product AMD RS780_PPB_GFX	0x9602	RS780 PCI-PCI Bridge (int gfx)
+product AMD RS780_PPB_GFX0	0x9603	RS780 PCI-PCI Bridge (ext gfx port 0)
+product AMD RS780_PPB0		0x9604	RS780 PCI-PCIE Bridge (port 0)
+product AMD RS780_PPB1		0x9605	RS780 PCI-PCIE Brdige (port 1)
+product AMD RS780_PPB2		0x9606	RS780 PCI-PCIE Bridge (port 2)
 
 /* American Megatrends products */
 product AMI MEGARAID		0x9010	MegaRAID
@@ -1377,6 +1383,7 @@
 product ATI RADEON_X850XT_S	0x5d72	Radeon X850 XT Secondary
 product ATI RADEON_X700		0x5e4b	Radeon X700 Pro
 product ATI RADEON_X700_S	0x5e6b	Radeon X700 Pro Secondary
+product ATI RADEON_HD5600_RD	0x68c1	Redwood
 product ATI RADEON_X1300	0x7146	Radeon X1300 Series (RV515)
 product ATI RADEON_X1300_S	0x7166	Radeon X1300 Series (RV515) Secondary
 product ATI RADEON_X1600	0x71c5	Radeon Mobility X1600
@@ -1389,9 +1396,11 @@
 product ATI RS690_PPB_7916	0x7916	RS690 PCI to PCI-Express Port 2 Bridge
 product ATI RS690_PPB_7917	0x7917	RS690 PCI to PCI-Express Port 3 Bridge
 product ATI RADEON_HD4250_S	0x95C5	Radeon HD4250 GPU (RV610) Secondary
+product ATI RADEON_HD4200	0x9712	Radeon HD4200 Mobility
 product ATI RADEON_HD4250	0x9715	Radeon HD4250 GPU (RS880)
 product ATI RADEON_HD2600_XT	0x9588 	Radeon HD2600 XT GDDR3
 product ATI RADEON_HD2600_HD	0xaa08	Radeon HD2600 HD Audio Controller
+product ATI RADEON_HD5600_HDMI	0xaa60	Redwood HDMI Audio
 
 /* Auravision products */
 product AURAVISION VXP524	0x01f7	VxP524 PCI Video Processor
@@ -1413,6 +1422,7 @@
 product ATHEROS AR5311		0x0011 AR5211 Wireless LAN
 product ATHEROS AR5211		0x0012 AR5211 Wireless LAN
 product ATHEROS AR5212		0x0013 AR5212 Wireless LAN
+product ATHEROS AR9285		0x002b AR9285 Wireless LAN
 product ATHEROS AR5201_AP	0x0207 AR5201 Wireless LAN Reference Card (Early AP11)
 product ATHEROS AR5201_DEFAULT	0x1107 AR5201 Wireless LAN (no eeprom)
 product ATHEROS AR5212_DEFAULT	0x1113 AR5212 Wireless LAN (no eeprom)



CVS commit: src/sys/nfs

2010-10-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Oct 26 11:44:53 UTC 2010

Modified Files:
src/sys/nfs: nfs_vnops.c

Log Message:
Add diagnostic check which hits when PR 42455 is reproduced.
Idea from hans@


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/nfs/nfs_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/nfs/nfs_vnops.c
diff -u src/sys/nfs/nfs_vnops.c:1.284 src/sys/nfs/nfs_vnops.c:1.285
--- src/sys/nfs/nfs_vnops.c:1.284	Thu Jun 24 13:03:17 2010
+++ src/sys/nfs/nfs_vnops.c	Tue Oct 26 11:44:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vnops.c,v 1.284 2010/06/24 13:03:17 hannken Exp $	*/
+/*	$NetBSD: nfs_vnops.c,v 1.285 2010/10/26 11:44:53 cegger Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.284 2010/06/24 13:03:17 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.285 2010/10/26 11:44:53 cegger Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -1378,6 +1378,14 @@
 		if (v3) {
 			wccflag = NFSV3_WCCCHK;
 			nfsm_wcc_data(vp, wccflag, NAC_NOTRUNC, !error);
+
+			/* Diagnostic check: The KASSERT hits when PR 42455
+			 * is reproduced.
+			 */
+			if (ctx.nwc_mbufcount = 2) {
+KASSERT(mb-m_next != NULL);
+			}
+
 			if (!error) {
 nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED
 	+ NFSX_V3WRITEVERF);



CVS commit: src/sys/dev/ieee1394

2010-09-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Sep  7 07:19:46 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwohci.c

Log Message:
convert tsleep to kpause


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/ieee1394/fwohci.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/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.129 src/sys/dev/ieee1394/fwohci.c:1.130
--- src/sys/dev/ieee1394/fwohci.c:1.129	Sun Aug 29 21:15:26 2010
+++ src/sys/dev/ieee1394/fwohci.c	Tue Sep  7 07:19:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.129 2010/08/29 21:15:26 cegger Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.130 2010/09/07 07:19:45 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwohci.c,v 1.129 2010/08/29 21:15:26 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwohci.c,v 1.130 2010/09/07 07:19:45 cegger Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -882,13 +882,12 @@
 fwohci_irx_disable(struct firewire_comm *fc, int dmach)
 {
 	struct fwohci_softc *sc = (struct fwohci_softc *)fc;
-	int sleepch;
 
 	OWRITE(sc, OHCI_IRCTLCLR(dmach), OHCI_CNTL_DMA_RUN);
 	OWRITE(sc, OHCI_IR_MASKCLR, 1  dmach);
 	OWRITE(sc, OHCI_IR_STATCLR, 1  dmach);
 	/* XXX we cannot free buffers until the DMA really stops */
-	tsleep((void *)sleepch, FWPRI, fwirxd, hz);
+	kpause(fwirxd, true, hz, NULL);
 	fwohci_db_free(sc, sc-ir[dmach]);
 	sc-ir[dmach].xferq.flag = ~FWXFERQ_RUNNING;
 	return 0;
@@ -1016,14 +1015,13 @@
 fwohci_itx_disable(struct firewire_comm *fc, int dmach)
 {
 	struct fwohci_softc *sc = (struct fwohci_softc *)fc;
-	int sleepch;
 
 	OWRITE(sc, OHCI_ITCTLCLR(dmach),
 	OHCI_CNTL_DMA_RUN | OHCI_CNTL_CYCMATCH_S);
 	OWRITE(sc, OHCI_IT_MASKCLR, 1  dmach);
 	OWRITE(sc, OHCI_IT_STATCLR, 1  dmach);
 	/* XXX we cannot free buffers until the DMA really stops */
-	tsleep((void *)sleepch, FWPRI, fwitxd, hz);
+	kpause(fwitxd, true, hz, NULL);
 	fwohci_db_free(sc, sc-it[dmach]);
 	sc-it[dmach].xferq.flag = ~FWXFERQ_RUNNING;
 	return 0;



CVS commit: src/sys/dev/ieee1394

2010-09-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Sep  7 07:26:54 UTC 2010

Modified Files:
src/sys/dev/ieee1394: firewire.c firewirereg.h

Log Message:
do not assume all fw devices speak sbp.
teach the fw attach code to deal with different fw device classes.
this allows other fw drivers than sbp to attach


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ieee1394/firewire.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ieee1394/firewirereg.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/ieee1394/firewire.c
diff -u src/sys/dev/ieee1394/firewire.c:1.37 src/sys/dev/ieee1394/firewire.c:1.38
--- src/sys/dev/ieee1394/firewire.c:1.37	Thu Aug 26 08:56:15 2010
+++ src/sys/dev/ieee1394/firewire.c	Tue Sep  7 07:26:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $	*/
+/*	$NetBSD: firewire.c,v 1.38 2010/09/07 07:26:54 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: firewire.c,v 1.38 2010/09/07 07:26:54 cegger Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -1959,6 +1959,45 @@
 	/* NOTREACHED */
 }
 
+static const char *
+fw_get_devclass(struct fw_device *fwdev)
+{
+	struct crom_context cc;
+	struct csrreg *reg;
+
+	crom_init_context(cc, fwdev-csrrom);
+	reg = crom_search_key(cc, CSRKEY_VER);
+	if (reg == NULL)
+		return null;
+
+	switch (reg-val) {
+	case CSR_PROTAVC:
+		return av/c;
+	case CSR_PROTCAL:
+		return cal;
+	case CSR_PROTEHS:
+		return ehs;
+	case CSR_PROTHAVI:
+		return havi;
+	case CSR_PROTCAM104:
+		return cam104;
+	case CSR_PROTCAM120:
+		return cam120;
+	case CSR_PROTCAM130:
+		return cam130;
+	case CSR_PROTDPP:
+		return printer;
+	case CSR_PROTIICP:
+		return iicp;
+	case CSRVAL_T10SBP2:
+		return sbp;
+	default:
+		if (firewire_debug)
+			printf(%s: reg-val 0x%x\n,
+__func__, reg-val);
+		return sbp;
+	}
+}
 
 /*
  * To attach sub-devices layer onto IEEE1394 bus.
@@ -1973,7 +2012,7 @@
 	struct fw_attach_args fwa;
 	int locs[IEEE1394IFCF_NLOCS];
 
-	fwa.name = sbp;
+	fwa.name = null;
 	fwa.fc = fc;
 
 	mutex_enter(fc-fc_mtx);
@@ -1993,16 +2032,17 @@
 			locs[IEEE1394IFCF_EUIHI] = fwdev-eui.hi;
 			locs[IEEE1394IFCF_EUILO] = fwdev-eui.lo;
 
+			fwa.name = fw_get_devclass(fwdev);
 			fwa.fwdev = fwdev;
-			fwdev-sbp = config_found_sm_loc(sc-dev, ieee1394if,
+			fwdev-dev = config_found_sm_loc(sc-dev, ieee1394if,
 			locs, fwa, firewire_print, config_stdsubmatch);
-			if (fwdev-sbp == NULL) {
+			if (fwdev-dev == NULL) {
 free(devlist, M_DEVBUF);
 break;
 			}
 
 			devlist-fwdev = fwdev;
-			devlist-dev = fwdev-sbp;
+			devlist-dev = fwdev-dev;
 
 			mutex_enter(fc-fc_mtx);
 			if (SLIST_EMPTY(sc-devlist))
@@ -2064,7 +2104,7 @@
 			link);
 			free(devlist, M_DEVBUF);
 
-			if (config_detach(fwdev-sbp, DETACH_FORCE) != 0)
+			if (config_detach(fwdev-dev, DETACH_FORCE) != 0)
 return;
 
 			STAILQ_REMOVE(fc-devices, fwdev, fw_device, link);

Index: src/sys/dev/ieee1394/firewirereg.h
diff -u src/sys/dev/ieee1394/firewirereg.h:1.13 src/sys/dev/ieee1394/firewirereg.h:1.14
--- src/sys/dev/ieee1394/firewirereg.h:1.13	Sun May 23 18:56:58 2010
+++ src/sys/dev/ieee1394/firewirereg.h	Tue Sep  7 07:26:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewirereg.h,v 1.13 2010/05/23 18:56:58 christos Exp $	*/
+/*	$NetBSD: firewirereg.h,v 1.14 2010/09/07 07:26:54 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -63,7 +63,7 @@
 #define FWDEVATTACHED	2
 #define FWDEVINVAL	3
 	STAILQ_ENTRY(fw_device) link;
-	device_t sbp;
+	device_t dev;
 };
 
 struct firewire_softc {



CVS commit: src/sys/arch/xen/include

2010-09-03 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Sep  3 06:07:24 UTC 2010

Modified Files:
src/sys/arch/xen/include: xenio.h xenio3.h

Log Message:
match header protection with filename


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/include/xenio.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/include/xenio3.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/xen/include/xenio.h
diff -u src/sys/arch/xen/include/xenio.h:1.6 src/sys/arch/xen/include/xenio.h:1.7
--- src/sys/arch/xen/include/xenio.h:1.6	Sun Feb 17 16:21:19 2008
+++ src/sys/arch/xen/include/xenio.h	Fri Sep  3 06:07:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenio.h,v 1.6 2008/02/17 16:21:19 bouyer Exp $	*/
+/*	$NetBSD: xenio.h,v 1.7 2010/09/03 06:07:24 cegger Exp $	*/
 
 /**
  * privcmd.h
@@ -27,8 +27,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __XEN_XENIO3_H__
-#define __XEN_XENIO3_H__
+#ifndef __XEN_XENIO_H__
+#define __XEN_XENIO_H__
 
 /* Interface to /proc/xen/privcmd */
 
@@ -112,4 +112,4 @@
 /* EVTCHN_UNBIND: Unbind from the specified event-channel port. */
 #define EVTCHN_UNBIND _IOW('E', 3, unsigned long)
 
-#endif /* __XEN_XENIO3_H__ */
+#endif /* __XEN_XENIO_H__ */

Index: src/sys/arch/xen/include/xenio3.h
diff -u src/sys/arch/xen/include/xenio3.h:1.2 src/sys/arch/xen/include/xenio3.h:1.3
--- src/sys/arch/xen/include/xenio3.h:1.2	Sun Feb 17 16:21:19 2008
+++ src/sys/arch/xen/include/xenio3.h	Fri Sep  3 06:07:24 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: xenio3.h,v 1.2 2008/02/17 16:21:19 bouyer Exp $ */
+/* $NetBSD: xenio3.h,v 1.3 2010/09/03 06:07:24 cegger Exp $ */
 /**
  * evtchn.h
  * 
@@ -28,8 +28,8 @@
  * IN THE SOFTWARE.
  */
 
-#ifndef __XEN_XENIO_H__
-#define __XEN_XENIO_H__
+#ifndef __XEN_XENIO3_H__
+#define __XEN_XENIO3_H__
 
 /*
  * Bind a fresh port to VIRQ @virq.
@@ -86,4 +86,4 @@
 #define IOCTL_EVTCHN_RESET\
 	_IO('E', 9)
 
-#endif /* __XEN_XENIO_H__ */
+#endif /* __XEN_XENIO3_H__ */



CVS commit: src/sys/dev/usb

2010-09-03 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Sep  3 23:15:09 UTC 2010

Modified Files:
src/sys/dev/usb: usbdi.c

Log Message:
fix NULL pointer dereference on detaching:
Attach an USB device that looks like this:
ugen1 at uhub0 port 2
ugen1: detached
ugen1: at uhub0 port 2 (addr 3) disconnected

When unplugging the device:

usb_transfer_complete: xfer=0x8832a800 not busy 0x0055
usb_transfer_complete: bad dequeue 0x8832a800 != 0x0


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/usb/usbdi.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/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.127 src/sys/dev/usb/usbdi.c:1.128
--- src/sys/dev/usb/usbdi.c:1.127	Sat Jan 16 17:03:03 2010
+++ src/sys/dev/usb/usbdi.c	Fri Sep  3 23:15:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.127 2010/01/16 17:03:03 bouyer Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.128 2010/09/03 23:15:09 cegger Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.127 2010/01/16 17:03:03 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: usbdi.c,v 1.128 2010/09/03 23:15:09 cegger Exp $);
 
 #include opt_compat_netbsd.h
 
@@ -800,7 +800,8 @@
 			   xfer, SIMPLEQ_FIRST(pipe-queue));
 		xfer-busy_free = XFER_BUSY;
 #endif
-		SIMPLEQ_REMOVE_HEAD(pipe-queue, next);
+		if (SIMPLEQ_FIRST(pipe-queue) != NULL)
+			SIMPLEQ_REMOVE_HEAD(pipe-queue, next);
 	}
 	DPRINTFN(5,(usb_transfer_complete: repeat=%d new head=%p\n,
 		repeat, SIMPLEQ_FIRST(pipe-queue)));



CVS commit: src/sys/dev/ieee1394

2010-08-29 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Aug 29 21:14:16 UTC 2010

Modified Files:
src/sys/dev/ieee1394: sbp.h

Log Message:
Confilict - Conflict


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ieee1394/sbp.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/ieee1394/sbp.h
diff -u src/sys/dev/ieee1394/sbp.h:1.5 src/sys/dev/ieee1394/sbp.h:1.6
--- src/sys/dev/ieee1394/sbp.h:1.5	Thu Apr 29 06:51:26 2010
+++ src/sys/dev/ieee1394/sbp.h	Sun Aug 29 21:14:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbp.h,v 1.5 2010/04/29 06:51:26 kiyohara Exp $	*/
+/*	$NetBSD: sbp.h,v 1.6 2010/08/29 21:14:16 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -147,7 +147,7 @@
 /* 6: Busy retry limit exceeded: ack_busy_B */
 /* 7-A: Reserved for future standardization */
 /* B: Tardy retry limit exceeded */
-/* C: Confilict error */
+/* C: Conflict error */
 /* D: Data error */
 /* E: Type error */
 /* F: Address error */



CVS commit: src/sys/dev/ieee1394

2010-08-29 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Aug 29 21:15:26 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwohci.c

Log Message:
fix grammar in error message


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/dev/ieee1394/fwohci.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/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.128 src/sys/dev/ieee1394/fwohci.c:1.129
--- src/sys/dev/ieee1394/fwohci.c:1.128	Sun May 23 18:56:58 2010
+++ src/sys/dev/ieee1394/fwohci.c	Sun Aug 29 21:15:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.128 2010/05/23 18:56:58 christos Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.129 2010/08/29 21:15:26 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwohci.c,v 1.128 2010/05/23 18:56:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwohci.c,v 1.129 2010/08/29 21:15:26 cegger Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -2104,7 +2104,7 @@
 #endif
 			OWRITE(sc, FWOHCI_INTMASKCLR, OHCI_INT_CYC_LOST);
 			aprint_error_dev(fc-dev, too many cycle lost, 
-			no cycle master presents?\n);
+			no cycle master present?\n);
 		}
 	}
 	if (stat  OHCI_INT_DMA_ATRQ)



CVS commit: src/usr.sbin/fwctl

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 07:04:05 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwcontrol.c

Log Message:
show crom:
Print calculated crc. When crc does not match then print expected crc.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/fwctl/fwcontrol.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/fwctl/fwcontrol.c
diff -u src/usr.sbin/fwctl/fwcontrol.c:1.9 src/usr.sbin/fwctl/fwcontrol.c:1.10
--- src/usr.sbin/fwctl/fwcontrol.c:1.9	Tue Aug 24 08:41:24 2010
+++ src/usr.sbin/fwctl/fwcontrol.c	Thu Aug 26 07:04:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcontrol.c,v 1.9 2010/08/24 08:41:24 cegger Exp $	*/
+/*	$NetBSD: fwcontrol.c,v 1.10 2010/08/26 07:04:04 cegger Exp $	*/
 /*
  * Copyright (C) 2002
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 #include sys/cdefs.h
 //__FBSDID($FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $);
-__RCSID($NetBSD: fwcontrol.c,v 1.9 2010/08/24 08:41:24 cegger Exp $);
+__RCSID($NetBSD: fwcontrol.c,v 1.10 2010/08/26 07:04:04 cegger Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -401,6 +401,15 @@
 }
 
 static void
+show_crc(uint16_t crc, uint16_t good_crc)
+{
+	if (crc == good_crc)
+		printf((OK)\n);
+	else
+		printf((NG, 0x%x)\n, good_crc);
+}
+
+static void
 show_crom(uint32_t *crom_buf)
 {
 	int i;
@@ -422,16 +431,13 @@
 	if (hdr-info_len == 1) {
 		/* minimum ROM */
 		reg = (struct csrreg *)hdr;
-		printf(verndor ID: 0x%06x\n,  reg-val);
+		printf(vendor ID: 0x%06x\n, reg-val);
 		return;
 	}
-	printf(info_len=%d crc_len=%d crc=0x%04x,
-		hdr-info_len, hdr-crc_len, hdr-crc);
 	crc = crom_crc(crom_buf+1, hdr-crc_len);
-	if (crc == hdr-crc)
-		printf((OK)\n);
-	else
-		printf((NG)\n);
+	printf(info_len=%d crc_len=%d crc=0x%04x ,
+		hdr-info_len, hdr-crc_len, crc);
+	show_crc(crc, hdr-crc);
 	parse_bus_info_block(crom_buf+1);
 
 	crom_init_context(cc, crom_buf);
@@ -440,13 +446,10 @@
 		printf(no root directory - giving up\n);
 		return;
 	}
-	printf(root_directory: len=0x%04x(%d) crc=0x%04x,
-			dir-crc_len, dir-crc_len, dir-crc);
 	crc = crom_crc((uint32_t *)dir-entry[0], dir-crc_len);
-	if (crc == dir-crc)
-		printf((OK)\n);
-	else
-		printf((NG)\n);
+	printf(root_directory: len=0x%04x(%d) crc=0x%04x ,
+			dir-crc_len, dir-crc_len, crc);
+	show_crc(crc, dir-crc);
 	if (dir-crc_len  1)
 		return;
 	while (cc.depth = 0) {



CVS commit: src/sys/dev/ieee1394

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 07:36:53 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwcrom.c iec13213.h

Log Message:
- print expected crc when it does not match
- add and print secondary text leaf. This prints the model name of my webcam.
- add csr keys that are printed as 'unknown' otherwise


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ieee1394/fwcrom.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ieee1394/iec13213.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/ieee1394/fwcrom.c
diff -u src/sys/dev/ieee1394/fwcrom.c:1.12 src/sys/dev/ieee1394/fwcrom.c:1.13
--- src/sys/dev/ieee1394/fwcrom.c:1.12	Sat Apr 24 21:34:29 2010
+++ src/sys/dev/ieee1394/fwcrom.c	Thu Aug 26 07:36:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcrom.c,v 1.12 2010/04/24 21:34:29 cegger Exp $	*/
+/*	$NetBSD: fwcrom.c,v 1.13 2010/08/26 07:36:53 cegger Exp $	*/
 /*-
  * Copyright (c) 2002-2003
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwcrom.c,v 1.12 2010/04/24 21:34:29 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwcrom.c,v 1.13 2010/08/26 07:36:53 cegger Exp $);
 
 #include sys/param.h
 #ifdef _KERNEL
@@ -178,10 +178,16 @@
 		return;
 
 	reg = crom_get(cc);
-	if (reg-key != CROM_TEXTLEAF ||
-	(char *)(reg + reg-val)  CROM_END(cc)) {
-		strncpy(buf, nullstr, len);
-		return;
+	switch (reg-key) {
+	case CROM_TEXTLEAF:
+	case CROM_TEXTLEAF2:
+		break;
+	default:
+		if ((char *)(reg + reg-val)  CROM_END(cc)) {
+			strncpy(buf, nullstr, len);
+			return;
+		}
+		break;
 	}
 	textleaf = (struct csrtext *)(reg + reg-val);
 
@@ -288,7 +294,7 @@
 	switch (reg-key  CSRTYPE_MASK) {
 	case CSRTYPE_I:
 #if 0
-		len -= snprintf(buf, len, %d, reg-val);
+		len -= snprintf(buf, len, 0x%x, reg-val);
 		buf += strlen(buf);
 #else
 		*buf = '\0';
@@ -304,33 +310,43 @@
 	case CSRTYPE_D:
 		dir = (struct csrdirectory *) (reg + reg-val);
 		crc = crom_crc((uint32_t *)dir-entry, dir-crc_len);
-		len -= snprintf(buf, len, len=%d crc=0x%04x(%s) ,
-		dir-crc_len, dir-crc, (crc == dir-crc) ? OK : NG);
+		len -= snprintf(buf, len, len=%d crc=0x%04x ,
+		dir-crc_len, crc);
+		buf += strlen(buf);
+
+		if (crc == dir-crc)
+			len -= snprintf(buf, len, (OK) );
+		else
+			len -= snprintf(buf, len, (NG, 0x%x) ,
+			dir-crc);
 		buf += strlen(buf);
 	}
 	switch (reg-key) {
-	case 0x03:
+	case CSRKEY_VENDOR: /* 0x03 */
 		desc = module_vendor_ID;
 		break;
-	case 0x04:
+	case CSRKEY_HW: /* 0x04 */
 		desc = hardware_version;
 		break;
-	case 0x0c:
+	case CSRKEY_NCAP: /* 0x0c */
 		desc = node_capabilities;
 		break;
-	case 0x12:
+	case CSRKEY_SPEC: /* 0x12 */
 		desc = unit_spec_ID;
 		break;
-	case 0x13:
+	case CSRKEY_VER: /* 0x13 */
 		desc = unit_sw_version;
 		crom_desc_specver(0, reg-val, buf, len);
 		break;
-	case 0x14:
+	case CSRKEY_DINFO: /* 0x14 */
 		desc = logical_unit_number;
 		break;
-	case 0x17:
+	case CSRKEY_MODEL: /* 0x17 */
 		desc = model_ID;
 		break;
+	case CSRKEY_REV: /* 0x21 */
+		desc = revision_ID;
+		break;
 	case 0x38:
 		desc = command_set_spec_ID;
 		break;
@@ -349,13 +365,20 @@
 	case 0x3d:
 		desc = reconnect_timeout;
 		break;
+	case 0x40:
+		desc = command_regs_base;
+		break;
 	case 0x54:
 		desc = management_agent;
 		break;
-	case 0x81:
+	case CROM_TEXTLEAF: /* 0x81 */
+	case CROM_TEXTLEAF2: /* 0x82 */
 		desc = text_leaf;
 		crom_parse_text(cc, buf + strlen(buf), len);
 		break;
+	case CROM_NODEID: /* 0x8d */
+		desc = node_unique_ID;
+		break;
 	case 0xd1:
 		desc = unit_directory;
 		break;

Index: src/sys/dev/ieee1394/iec13213.h
diff -u src/sys/dev/ieee1394/iec13213.h:1.4 src/sys/dev/ieee1394/iec13213.h:1.5
--- src/sys/dev/ieee1394/iec13213.h:1.4	Mon Mar 29 03:05:28 2010
+++ src/sys/dev/ieee1394/iec13213.h	Thu Aug 26 07:36:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: iec13213.h,v 1.4 2010/03/29 03:05:28 kiyohara Exp $	*/
+/*	$NetBSD: iec13213.h,v 1.5 2010/08/26 07:36:53 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -105,8 +105,10 @@
 
 #define CROM_UDIR	(CSRTYPE_D | CSRKEY_UNIT)  /* 0x81 Unit directory */
 #define CROM_TEXTLEAF	(CSRTYPE_L | CSRKEY_DESC)  /* 0x81 Text leaf */
+#define CROM_TEXTLEAF2	(CSRTYPE_L | CSRKEY_BDINFO)/* 0x82 Text leaf2 */
 #define CROM_LUN	(CSRTYPE_I | CSRKEY_DINFO) /* 0x14 Logical unit num. */
 #define CROM_MGM	(CSRTYPE_C | CSRKEY_DINFO) /* 0x54 Management agent */
+#define CROM_NODEID	0x8d /* only valid for IEEE 1394-1995 digital camera */
 
 #define CSRVAL_VENDOR_PRIVATE	0xacde48
 #define CSRVAL_1394TA	0x00a02d



CVS commit: src/sys/dev/ieee1394

2010-08-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Aug 26 08:56:16 UTC 2010

Modified Files:
src/sys/dev/ieee1394: firewire.c

Log Message:
fix crash when detaching/re-attaching a cable where three firewire devices are 
on the bus.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ieee1394/firewire.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/ieee1394/firewire.c
diff -u src/sys/dev/ieee1394/firewire.c:1.36 src/sys/dev/ieee1394/firewire.c:1.37
--- src/sys/dev/ieee1394/firewire.c:1.36	Sat Aug 14 18:28:59 2010
+++ src/sys/dev/ieee1394/firewire.c	Thu Aug 26 08:56:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: firewire.c,v 1.36 2010/08/14 18:28:59 jym Exp $	*/
+/*	$NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: firewire.c,v 1.36 2010/08/14 18:28:59 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -2053,6 +2053,10 @@
 			SLIST_FOREACH(devlist, sc-devlist, link)
 if (devlist-fwdev == fwdev)
 	break;
+
+			if (devlist == NULL)
+continue;
+
 			if (devlist-fwdev != fwdev)
 panic(already detached);
 



CVS commit: src/usr.sbin/fwctl

2010-08-24 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Aug 24 08:41:24 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwcontrol.c fwctl.8 fwdv.c fwmpegts.c

Log Message:
Backport improvements from FreeBSD.
Introduce two new options:
-f : force root node
-i : set priority budget where supported
developped, tested and reviewed by kiyohara@ and me.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fwctl/fwcontrol.c
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/fwctl/fwctl.8
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/fwctl/fwdv.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fwctl/fwmpegts.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/fwctl/fwcontrol.c
diff -u src/usr.sbin/fwctl/fwcontrol.c:1.8 src/usr.sbin/fwctl/fwcontrol.c:1.9
--- src/usr.sbin/fwctl/fwcontrol.c:1.8	Mon Mar 29 10:49:34 2010
+++ src/usr.sbin/fwctl/fwcontrol.c	Tue Aug 24 08:41:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwcontrol.c,v 1.8 2010/03/29 10:49:34 cegger Exp $	*/
+/*	$NetBSD: fwcontrol.c,v 1.9 2010/08/24 08:41:24 cegger Exp $	*/
 /*
  * Copyright (C) 2002
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -32,11 +32,9 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-#if defined(__FreeBSD__)
-
 #include sys/cdefs.h
-__FBSDID($FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $);
-#endif
+//__FBSDID($FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $);
+__RCSID($NetBSD: fwcontrol.c,v 1.9 2010/08/24 08:41:24 cegger Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -45,19 +43,11 @@
 #include sys/socket.h
 #include sys/ioctl.h
 #include sys/errno.h
-#if defined(__FreeBSD__)
-#include sys/eui64.h
-#include dev/firewire/firewire.h
-#include dev/firewire/iec13213.h
-#include dev/firewire/fwphyreg.h
-#include dev/firewire/iec68113.h
-#elif defined(__NetBSD__)
 #include eui64.h
 #include dev/ieee1394/firewire.h
 #include dev/ieee1394/iec13213.h
 #include dev/ieee1394/fwphyreg.h
 #include dev/ieee1394/iec68113.h
-#endif
 
 #include netinet/in.h
 #include fcntl.h
@@ -75,47 +65,44 @@
 usage(void)
 {
 	fprintf(stderr,
-		%s [-prt] [-b pri_req] [-c node] [-d node]
-		 [-g gap_count] [-l file]\n
-		\t[-m EUI64 | hostname] [-o node] [-R filename]
-		 [-S filename]\n
-		\t[-s node] [-u bus_num]\n
-		\t-b: set PRIORITY_BUDGET register on all supported nodes\n
-		\t-c: read configuration ROM\n
-		\t-d: hex dump of configuration ROM\n
-		\t-g: broadcast gap_count by phy_config packet\n
-		\t-l: load and parse hex dump file of configuration ROM\n
-		\t-m: set fwmem target\n
-		\t-o: send link-on packet to the node\n
-		\t-p: dump PHY registers\n
-		\t-R: receive DV or MPEG TS stream\n
-		\t-r: bus reset\n
-		\t-S: send DV stream\n
-		\t-s: write RESET_START register on the node\n
-		\t-t: read topology map\n
-		\t-u: specify bus number\n, getprogname());
+	%s [-prt] [-b pri_req] [-c node] [-d node] [-f force_root ]\n
+	\t[-g gap_count] [-l file] [-M mode] [-m EUI64 | hostname]\n
+	\t[-o node] [-R filename] [-S filename] [-s node] [-u bus_num]\n
+	\n
+	\t-b: set PRIORITY_BUDGET register on all supported nodes\n
+	\t-c: read configuration ROM\n
+	\t-d: hex dump of configuration ROM\n
+	\t-f: force root node\n
+	\t-g: broadcast gap_count by phy_config packet\n
+	\t-l: load and parse hex dump file of configuration ROM\n
+	\t-M: specify dv or mpeg\n
+	\t-m: set fwmem target\n
+	\t-o: send link-on packet to the node\n
+	\t-p: dump PHY registers\n
+	\t-R: receive DV or MPEG TS stream\n
+	\t-r: bus reset\n
+	\t-S: send DV stream\n
+	\t-s: write RESET_START register on the node\n
+	\t-t: read topology map\n
+	\t-u: specify bus number\n, getprogname());
 	exit(EX_USAGE);
 }
 
 static void
 fweui2eui64(const struct fw_eui64 *fweui, struct eui64 *eui)
 {
-	*(u_int32_t*)(eui-octet[0]) = htonl(fweui-hi);
-	*(u_int32_t*)(eui-octet[4]) = htonl(fweui-lo);
+	*(uint32_t*)(eui-octet[0]) = htonl(fweui-hi);
+	*(uint32_t*)(eui-octet[4]) = htonl(fweui-lo);
 }
 
-static struct fw_devlstreq *
-get_dev(int fd)
+static void
+get_dev(int fd, struct fw_devlstreq *data)
 {
-	struct fw_devlstreq *data;
 
-	data = malloc(sizeof(*data));
 	if (data == NULL)
-		err(1, malloc);
-	if( ioctl(fd, FW_GDEVLST, data)  0) {
-   			err(1, ioctl);
-	}
-	return data;
+		err(EX_SOFTWARE, %s: data malloc, __func__);
+	if (ioctl(fd, FW_GDEVLST, data)  0)
+		err(EX_IOERR, %s: ioctl, __func__);
 }
 
 static int
@@ -127,7 +114,7 @@
 	int i, node;
 
 	if (nodestr == '\0')
-		return (-1);
+		return -1;
 
 	/*
 	 * Deal with classic node specifications.
@@ -140,25 +127,33 @@
 	 * Try to get an eui and match it against available nodes.
 	 */
 	if (eui64_hostton(nodestr, eui) != 0  eui64_aton(nodestr, eui) != 0)
-		return (-1);
+		return -1;
 
-	data = get_dev(fd);
+	data = (struct fw_devlstreq 

CVS commit: src/sys/dev/acpi

2010-08-17 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Aug 17 18:49:28 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_cpu_cstate.c

Log Message:
build fix: first initialize sc then KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/acpi/acpi_cpu_cstate.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_cpu_cstate.c
diff -u src/sys/dev/acpi/acpi_cpu_cstate.c:1.29 src/sys/dev/acpi/acpi_cpu_cstate.c:1.30
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.29	Mon Aug 16 17:58:42 2010
+++ src/sys/dev/acpi/acpi_cpu_cstate.c	Tue Aug 17 18:49:28 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.29 2010/08/16 17:58:42 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.30 2010/08/17 18:49:28 cegger Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.29 2010/08/16 17:58:42 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.30 2010/08/17 18:49:28 cegger Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -665,9 +665,9 @@
 	KASSERT(acpicpu_sc != NULL);
 	KASSERT(ci-ci_acpiid  maxcpus);
 	KASSERT(ci-ci_ilevel == IPL_NONE);
-	KASSERT((sc-sc_flags  ACPICPU_FLAG_C) != 0);
 
 	sc = acpicpu_sc[ci-ci_acpiid];
+	KASSERT((sc-sc_flags  ACPICPU_FLAG_C) != 0);
 
 	if (__predict_false(sc == NULL))
 		goto halt;



CVS commit: src/sys/dev/ieee1394

2010-08-16 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Mon Aug 16 06:05:07 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwdev.c

Log Message:
do not hold mutexes when calling tsleep(9).
Fixes LOCKDEBUG panics


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ieee1394/fwdev.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/ieee1394/fwdev.c
diff -u src/sys/dev/ieee1394/fwdev.c:1.22 src/sys/dev/ieee1394/fwdev.c:1.23
--- src/sys/dev/ieee1394/fwdev.c:1.22	Sun May 23 18:56:58 2010
+++ src/sys/dev/ieee1394/fwdev.c	Mon Aug 16 06:05:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwdev.c,v 1.22 2010/05/23 18:56:58 christos Exp $	*/
+/*	$NetBSD: fwdev.c,v 1.23 2010/08/16 06:05:07 cegger Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwdev.c,v 1.22 2010/05/23 18:56:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwdev.c,v 1.23 2010/08/16 06:05:07 cegger Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -248,7 +248,9 @@
 		if (slept == 0) {
 			slept = 1;
 			ir-flag |= FWXFERQ_WAKEUP;
+			mutex_exit(fc-fc_mtx);
 			err = tsleep(ir, FWPRI, fw_read, hz);
+			mutex_enter(fc-fc_mtx);
 			ir-flag = ~FWXFERQ_WAKEUP;
 			if (err == 0)
 goto readloop;
@@ -324,7 +326,9 @@
 			if (err)
 goto out;
 #endif
+			mutex_exit(fc-fc_mtx);
 			err = tsleep(it, FWPRI, fw_write, hz);
+			mutex_enter(fc-fc_mtx);
 			if (err)
 goto out;
 			goto isoloop;



CVS commit: src/share/misc

2010-08-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Aug 15 19:43:03 UTC 2010

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+ OSVW, PAT


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.105 src/share/misc/acronyms.comp:1.106
--- src/share/misc/acronyms.comp:1.105	Sun Aug 15 19:30:33 2010
+++ src/share/misc/acronyms.comp	Sun Aug 15 19:43:03 2010
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.105 2010/08/15 19:30:33 jruoho Exp $
+$NetBSD: acronyms.comp,v 1.106 2010/08/15 19:43:03 cegger Exp $
 
 3WHS	three-way handshake
 ABI	application binary interface
@@ -391,6 +391,7 @@
 OSPF	open shortest path first
 OSS	open source software
 OSS	open sound system
+OSVW	operating system visible workarounds
 OTP	one time password
 OUI	organizationally unique identifier
 OWL	Web ontology language
@@ -400,6 +401,7 @@
 PAE	physical address extension
 PAM	pluggable authentication modules
 PAM	pulse amplitude modulation
+PAT	page attribute table
 PAT	port address translation
 PATA	parallel ATA
 PAX	portable archive exchange



CVS commit: src/usr.sbin/fwctl

2010-08-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Aug 15 21:52:30 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwctl.8

Log Message:
Feed improvements from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/fwctl/fwctl.8

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/fwctl/fwctl.8
diff -u src/usr.sbin/fwctl/fwctl.8:1.10 src/usr.sbin/fwctl/fwctl.8:1.11
--- src/usr.sbin/fwctl/fwctl.8:1.10	Sat Aug 14 16:32:26 2010
+++ src/usr.sbin/fwctl/fwctl.8	Sun Aug 15 21:52:30 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: fwctl.8,v 1.10 2010/08/14 16:32:26 pgoyette Exp $
+.\	$NetBSD: fwctl.8,v 1.11 2010/08/15 21:52:30 cegger Exp $
 .\
 .\ Copyright (c) 2005 KIYOHARA Takashi
 .\ All rights reserved.
@@ -72,9 +72,11 @@
 .It Fl d Ar node
 Hex dump of the configuration ROM.
 .It Fl g Ar gap_count
-Broadcast
+Broadcast new
 .Ar gap_count
 by phy_config packet.
+By default this value is 63 on all nodes.
+Valid values are 0 - 63.
 .It Fl l Ar file
 Load hex dump file of the configuration ROM and parse it.
 .It Fl M Ar mode
@@ -87,9 +89,9 @@
 .Fl R
 option.
 If not specified, the program will try to guess.
-If you get an error complaining about
-.Dq format 0x20 ,
-try to force the
+In case of
+.Dq format 0x20
+error, try to force the
 .Ar mpeg
 mode.
 .It Fl m Ar EUI64 | hostname
@@ -100,8 +102,8 @@
 .It Fl p
 Dump PHY registers.
 .It Fl R Ar filename
-Receive DV or MPEG TS stream and dump it to a file.
-Use Ctrl-C to stop receiving.
+Recieve DV or MPEG TS stream and dump it to a file.
+Use Ctrl-C to stop recieving.
 Some DV cameras seem not to send the stream if a bus manager exits.
 If you cannot get the stream, try the following commands:
 .Bd -literal -offset indent
@@ -133,6 +135,7 @@
 Show the topology map.
 .It Fl u Ar bus_num
 Specify the IEEE1394 bus number to be operated on.
+The default is bus 0.
 .El
 .Sh FILES
 .Bl -tag



CVS commit: src/usr.sbin/fwctl

2010-08-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Aug 15 22:01:58 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwctl.8

Log Message:
spelling fix


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/fwctl/fwctl.8

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/fwctl/fwctl.8
diff -u src/usr.sbin/fwctl/fwctl.8:1.11 src/usr.sbin/fwctl/fwctl.8:1.12
--- src/usr.sbin/fwctl/fwctl.8:1.11	Sun Aug 15 21:52:30 2010
+++ src/usr.sbin/fwctl/fwctl.8	Sun Aug 15 22:01:57 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: fwctl.8,v 1.11 2010/08/15 21:52:30 cegger Exp $
+.\	$NetBSD: fwctl.8,v 1.12 2010/08/15 22:01:57 cegger Exp $
 .\
 .\ Copyright (c) 2005 KIYOHARA Takashi
 .\ All rights reserved.
@@ -71,12 +71,21 @@
 Show the configuration ROM on the node.
 .It Fl d Ar node
 Hex dump of the configuration ROM.
+.It Fl f Ar node
+Force specified
+.Ar node
+to be the root node on the next bus reset by sending a PHY config packet.
+Valid values are 0 - 63.
 .It Fl g Ar gap_count
 Broadcast new
 .Ar gap_count
 by phy_config packet.
 By default this value is 63 on all nodes.
 Valid values are 0 - 63.
+.It Fl i Ar pri_req
+Set the
+.Dv PRIORITY_BUDGET
+register on all supported nodes.
 .It Fl l Ar file
 Load hex dump file of the configuration ROM and parse it.
 .It Fl M Ar mode
@@ -172,7 +181,7 @@
 MPEG-2 stream at 25 Mbps bandwidth.
 .Pp
 To send the stream from the camera over the network using TCP (which
-supprisingly works better with vlc), you can use
+surprisingly works better with vlc), you can use
 .Dl fwctl -R - | nc 192.168.10.11 9000
 with
 .Pa pkgsrc/net/netcat



CVS commit: src/usr.sbin/fwctl

2010-08-15 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sun Aug 15 22:05:14 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwctl.8

Log Message:
backout accidentally committed changes


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/fwctl/fwctl.8

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/fwctl/fwctl.8
diff -u src/usr.sbin/fwctl/fwctl.8:1.12 src/usr.sbin/fwctl/fwctl.8:1.13
--- src/usr.sbin/fwctl/fwctl.8:1.12	Sun Aug 15 22:01:57 2010
+++ src/usr.sbin/fwctl/fwctl.8	Sun Aug 15 22:05:14 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: fwctl.8,v 1.12 2010/08/15 22:01:57 cegger Exp $
+.\	$NetBSD: fwctl.8,v 1.13 2010/08/15 22:05:14 cegger Exp $
 .\
 .\ Copyright (c) 2005 KIYOHARA Takashi
 .\ All rights reserved.
@@ -71,21 +71,12 @@
 Show the configuration ROM on the node.
 .It Fl d Ar node
 Hex dump of the configuration ROM.
-.It Fl f Ar node
-Force specified
-.Ar node
-to be the root node on the next bus reset by sending a PHY config packet.
-Valid values are 0 - 63.
 .It Fl g Ar gap_count
 Broadcast new
 .Ar gap_count
 by phy_config packet.
 By default this value is 63 on all nodes.
 Valid values are 0 - 63.
-.It Fl i Ar pri_req
-Set the
-.Dv PRIORITY_BUDGET
-register on all supported nodes.
 .It Fl l Ar file
 Load hex dump file of the configuration ROM and parse it.
 .It Fl M Ar mode



CVS commit: src/usr.sbin/fwctl

2010-08-14 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Aug 14 16:23:49 UTC 2010

Modified Files:
src/usr.sbin/fwctl: fwctl.8

Log Message:
fwcontrol - fwctl


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fwctl/fwctl.8

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/fwctl/fwctl.8
diff -u src/usr.sbin/fwctl/fwctl.8:1.8 src/usr.sbin/fwctl/fwctl.8:1.9
--- src/usr.sbin/fwctl/fwctl.8:1.8	Mon May 18 11:57:30 2009
+++ src/usr.sbin/fwctl/fwctl.8	Sat Aug 14 16:23:49 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: fwctl.8,v 1.8 2009/05/18 11:57:30 wiz Exp $
+.\	$NetBSD: fwctl.8,v 1.9 2010/08/14 16:23:49 cegger Exp $
 .\
 .\ Copyright (c) 2005 KIYOHARA Takashi
 .\ All rights reserved.
@@ -161,7 +161,7 @@
 with
 .Dq Li bs=144000 .
 .Pp
-.Dl fwcontrol -R file.m2t
+.Dl fwctl -R file.m2t
 .Pp
 Receive an MPEG TS stream from a camera producing MPEG transport stream.
 This has been tested with SONY HDR-FX1E camera that produces HD
@@ -169,7 +169,7 @@
 .Pp
 To send the stream from the camera over the network using TCP (which
 supprisingly works better with vlc), you can use
-.Dl fwcontrol -R - | nc 192.168.10.11 9000
+.Dl fwctl -R - | nc 192.168.10.11 9000
 with
 .Pa pkgsrc/net/netcat
 and to receive the stream, use
@@ -180,7 +180,7 @@
 since vlc is not fast enough to read UDP packets from
 buffers and thus it experiences dropouts when run directly.
 The sending side can use
-.Dl fwcontrol -R - | nc 192.168.10.11 9000
+.Dl fwctl -R - | nc 192.168.10.11 9000
 and to receive the stream, use
 .Dl nc -l -u -p 9000 | buffer -s 10k -b 1000 -m 20m -p 5 | vlc -
 .Pp



CVS commit: src/sys/arch/xen/xen

2010-08-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Aug  7 21:58:34 UTC 2010

Modified Files:
src/sys/arch/xen/xen: hypervisor.c

Log Message:
acpi_madt.h is gone


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/xen/xen/hypervisor.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/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.52 src/sys/arch/xen/xen/hypervisor.c:1.53
--- src/sys/arch/xen/xen/hypervisor.c:1.52	Wed Apr 28 19:17:04 2010
+++ src/sys/arch/xen/xen/hypervisor.c	Sat Aug  7 21:58:34 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.52 2010/04/28 19:17:04 dyoung Exp $ */
+/* $NetBSD: hypervisor.c,v 1.53 2010/08/07 21:58:34 cegger Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hypervisor.c,v 1.52 2010/04/28 19:17:04 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: hypervisor.c,v 1.53 2010/08/07 21:58:34 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -93,7 +93,6 @@
 #include dev/pci/pcivar.h
 #if NACPICA  0
 #include dev/acpi/acpivar.h
-#include dev/acpi/acpi_madt.h   
 #include machine/mpconfig.h
 #include xen/mpacpi.h   
 #endif



CVS commit: src/sys/arch/xen/x86

2010-08-07 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Aug  7 21:59:11 UTC 2010

Modified Files:
src/sys/arch/xen/x86: mainbus.c

Log Message:
acpi_madt.h is gone


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/x86/mainbus.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/xen/x86/mainbus.c
diff -u src/sys/arch/xen/x86/mainbus.c:1.11 src/sys/arch/xen/x86/mainbus.c:1.12
--- src/sys/arch/xen/x86/mainbus.c:1.11	Wed Apr 28 19:17:04 2010
+++ src/sys/arch/xen/x86/mainbus.c	Sat Aug  7 21:59:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.11 2010/04/28 19:17:04 dyoung Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.12 2010/08/07 21:59:11 cegger Exp $	*/
 /*	NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp 	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.11 2010/04/28 19:17:04 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.12 2010/08/07 21:59:11 cegger Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,7 +66,6 @@
 #include dev/pci/pcivar.h
 #if NACPICA  0
 #include dev/acpi/acpivar.h
-#include dev/acpi/acpi_madt.h   
 #include xen/mpacpi.h   
 #endif /* NACPICA  0 */
 #ifdef MPBIOS



CVS commit: src/usr.sbin/fwctl

2010-07-31 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Jul 31 07:05:32 UTC 2010

Modified Files:
src/usr.sbin/fwctl: eui64.c

Log Message:
remove useless brackets. From kiyohara@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fwctl/eui64.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/fwctl/eui64.c
diff -u src/usr.sbin/fwctl/eui64.c:1.2 src/usr.sbin/fwctl/eui64.c:1.3
--- src/usr.sbin/fwctl/eui64.c:1.2	Wed Apr 15 06:02:37 2009
+++ src/usr.sbin/fwctl/eui64.c	Sat Jul 31 07:05:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: eui64.c,v 1.2 2009/04/15 06:02:37 lukem Exp $	*/
+/*	$NetBSD: eui64.c,v 1.3 2010/07/31 07:05:32 cegger Exp $	*/
 /*
  * Copyright 2004 The Aerospace Corporation.  All rights reserved.
  *
@@ -108,7 +108,7 @@
 
 	linehead = strdup(l);
 	if (linehead == NULL)
-		return (-1);
+		return -1;
 	line = linehead;
 
 	/* Find and parse the EUI64 */
@@ -139,11 +139,11 @@
 			goto bad;
 	}
 
-	return (0);
+	return 0;
 
 bad:
 	free(linehead);
-	return (-1);
+	return -1;
 }
 
 /*
@@ -187,7 +187,7 @@
 		goto good;
 	}
 
-	return (-1);
+	return -1;
 
 good:
 e-octet[0]=o0;
@@ -199,7 +199,7 @@
 	e-octet[6]=o6;
 	e-octet[7]=o7;
 
-return (0);
+return 0;
 }
 
 /*
@@ -214,8 +214,8 @@
 	id-octet[0], id-octet[1], id-octet[2], id-octet[3],
 	id-octet[4], id-octet[5], id-octet[6], id-octet[7]);
 if (i  23 || i = (int)len)
-return (-1);
-return (0);
+return -1;
+return 0;
 }
 
 /*
@@ -235,7 +235,7 @@
 	char *yp_domain;
 #endif
 	if ((fp = fopen(_PATH_EUI64, r)) == NULL)
-		return (1);
+		return 1;
 
 	while (fgets(buf,BUFSIZ,fp)) {
 		if (buf[0] == '#')
@@ -261,12 +261,12 @@
 			/* We have a match */
 strcpy(hostname, local_host);
 fclose(fp);
-return(0);
+return 0;
 			}
 		}
 	}
 	fclose(fp);
-	return (1);
+	return 1;
 }
 
 /*
@@ -285,7 +285,7 @@
 	char *yp_domain;
 #endif
 	if ((fp = fopen(_PATH_EUI64, r)) == NULL)
-		return (1);
+		return 1;
 
 	while (fgets(buf,BUFSIZ,fp)) {
 		if (buf[0] == '#')
@@ -309,10 +309,10 @@
 /* We have a match */
 bcopy(local_eui64, id, sizeof(struct eui64));
 fclose(fp);
-return(0);
+return 0;
 			}
 		}
 	}
 	fclose(fp);
-	return (1);
+	return 1;
 }



CVS commit: src/sys/arch/x86/include

2010-07-24 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Sat Jul 24 08:02:46 UTC 2010

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
add AMD OSVW MSRs


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.42 src/sys/arch/x86/include/specialreg.h:1.43
--- src/sys/arch/x86/include/specialreg.h:1.42	Tue Jul  6 20:50:35 2010
+++ src/sys/arch/x86/include/specialreg.h	Sat Jul 24 08:02:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.42 2010/07/06 20:50:35 cegger Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.43 2010/07/24 08:02:46 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -450,6 +450,10 @@
 #define		BU_CFG_WBPFSMCCHKDIS	0x2000ULL
 #define		BU_CFG_WBENHWSBDIS	0x0001ULL
 
+/* AMD Family10h MSRs */
+#define	MSR_OSVW_ID_LENGTH		0xc0010140
+#define	MSR_OSVW_STATUS			0xc0010141
+
 /*
  * Constants related to MTRRs
  */



CVS commit: src/sys/arch/x86/x86

2010-07-23 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Fri Jul 23 22:31:35 UTC 2010

Modified Files:
src/sys/arch/x86/x86: errata.c

Log Message:
use __arraycount


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/errata.c

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

Modified files:

Index: src/sys/arch/x86/x86/errata.c
diff -u src/sys/arch/x86/x86/errata.c:1.18 src/sys/arch/x86/x86/errata.c:1.19
--- src/sys/arch/x86/x86/errata.c:1.18	Sun May 25 15:52:07 2008
+++ src/sys/arch/x86/x86/errata.c	Fri Jul 23 22:31:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: errata.c,v 1.18 2008/05/25 15:52:07 chris Exp $	*/
+/*	$NetBSD: errata.c,v 1.19 2010/07/23 22:31:35 cegger Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: errata.c,v 1.18 2008/05/25 15:52:07 chris Exp $);
+__KERNEL_RCSID(0, $NetBSD: errata.c,v 1.19 2010/07/23 22:31:35 cegger Exp $);
 
 #include sys/types.h
 #include sys/systm.h
@@ -326,7 +326,7 @@
 			break;
 	}
 
-	ex = errata + sizeof(errata) / sizeof(errata[0]);
+	ex = errata + __arraycount(errata);
 	for (upgrade = 0, e = errata; e  ex; e++) {
 		if (e-e_reported)
 			continue;



CVS commit: src/sys/dev/acpi

2010-07-21 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Jul 21 14:59:32 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_cpu.c

Log Message:
ACPI enumerates cpus with 0..n.
Fixes panic reported by Patrick Welche on current-users@
Fixes panic on my own HP Pavilion laptop


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/acpi/acpi_cpu.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_cpu.c
diff -u src/sys/dev/acpi/acpi_cpu.c:1.3 src/sys/dev/acpi/acpi_cpu.c:1.4
--- src/sys/dev/acpi/acpi_cpu.c:1.3	Mon Jul 19 00:59:32 2010
+++ src/sys/dev/acpi/acpi_cpu.c	Wed Jul 21 14:59:31 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.3 2010/07/19 00:59:32 christos Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.4 2010/07/21 14:59:31 cegger Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu.c,v 1.3 2010/07/19 00:59:32 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu.c,v 1.4 2010/07/21 14:59:31 cegger Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -271,10 +271,9 @@
 	CPU_INFO_ITERATOR cii;
 	struct cpu_info *ci;
 
-	KASSERT(id != 0);
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (id - 1 == ci-ci_cpuid)
-			return id - 1;
+		if (id == ci-ci_cpuid)
+			return id;
 	}
 
 	return 0xFF;



CVS commit: src

2010-07-06 Thread Christoph Egger
, npte); /* zap! */
 #if defined(DIAGNOSTIC)
 	/* XXX For now... */
@@ -3961,10 +4025,9 @@
 #endif /* XEN */
 
 	npte = ma | protection_codes[prot] | PG_V;
+	npte |= pmap_pat_flags(flags);
 	if (wired)
 	npte |= PG_W;
-	if (flags  PMAP_NOCACHE)
-		npte |= PG_N;
 	if (va  VM_MAXUSER_ADDRESS)
 		npte |= PG_u;
 	else if (va  VM_MAX_ADDRESS)

Index: src/sys/arch/xen/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.45 src/sys/arch/xen/x86/cpu.c:1.46
--- src/sys/arch/xen/x86/cpu.c:1.45	Mon Jun 28 00:47:53 2010
+++ src/sys/arch/xen/x86/cpu.c	Tue Jul  6 20:50:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.45 2010/06/28 00:47:53 rmind Exp $	*/
+/*	$NetBSD: cpu.c,v 1.46 2010/07/06 20:50:35 cegger Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.45 2010/06/28 00:47:53 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.46 2010/07/06 20:50:35 cegger Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -517,6 +517,7 @@
 		panic(unknown processor type??\n);
 	}
 
+	pat_init(ci);
 	atomic_or_32(cpus_attached, ci-ci_cpumask);
 
 #if 0

Added files:

Index: src/sys/arch/x86/include/pte.h
diff -u /dev/null src/sys/arch/x86/include/pte.h:1.1
--- /dev/null	Tue Jul  6 20:50:36 2010
+++ src/sys/arch/x86/include/pte.h	Tue Jul  6 20:50:35 2010
@@ -0,0 +1,50 @@
+/*	$NetBSD: pte.h,v 1.1 2010/07/06 20:50:35 cegger Exp $	*/
+
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christoph Egger.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _X86_PTE_H
+#define _X86_PTE_H
+
+/* Cacheability bits when we are using PAT */
+#define PGC_WB  0   /* The default */
+#define PGC_WC  PG_WT   /* WT and CD is WC */
+#define PGC_UCMINUS PG_N/* UC but mtrr can override */
+#define PGC_UC  (PG_WT | PG_N)  /* hard UC */
+
+/*
+ * page protection exception bits
+ */
+
+#define PGEX_P		0x01	/* protection violation (vs. no mapping) */
+#define PGEX_W		0x02	/* exception during a write cycle */
+#define PGEX_U		0x04	/* exception while in user mode (upl) */
+#define PGEX_X		0x10	/* exception during instruction fetch */
+
+#endif /* _X86_PTE_H */



  1   2   3   4   >