CVS commit: src/share/man/man4

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Aug  9 06:36:19 UTC 2010

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

Log Message:
Document P-states. Update notes about C-states. Shorten CAVEATS.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/acpicpu.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/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.1 src/share/man/man4/acpicpu.4:1.2
--- src/share/man/man4/acpicpu.4:1.1	Thu Aug  5 17:31:10 2010
+++ src/share/man/man4/acpicpu.4	Mon Aug  9 06:36:18 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpicpu.4,v 1.1 2010/08/05 17:31:10 jruoho Exp $
+.\ $NetBSD: acpicpu.4,v 1.2 2010/08/09 06:36:18 jruoho Exp $
 .\
 .\ Coyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 23, 2010
+.Dd August 9, 2010
 .Dt ACPICPU 4
 .Os
 .Sh NAME
@@ -46,7 +46,7 @@
 processor functionality is grouped into so-called C, P, and T -states.
 Presently,
 .Nm
-supports only C-states.
+supports C and P -states.
 .Ss C-states
 The processor power states, or C-states,
 are low-power modes that can be used when the
@@ -83,7 +83,7 @@
 .Tn x86
 instructions.
 On a typical processor,
-.Tn C1
+.Dv C1
 turns off the main internal
 .Tn CPU
 clock, leaving
@@ -94,17 +94,18 @@
 is free to temporarily leave the state to deal with important requests.
 .It Dv C2
 The main difference between
-.Tn C1
+.Dv C1
 and
-.Tn C2
+.Dv C2
 lies in the internal hardware entry method of the processor.
 While less power is expected to be consumed than in
-.Tn C1 ,
-the bus interface unit and
+.Dv C1 ,
+the bus interface unit is still running.
+But depending on the processor, the local
 .Tn APIC
-are still running.
+timer may be stopped.
 Like with
-.Tn C1 ,
+.Dv C1 ,
 entering and exiting the state are expected to be fast operations.
 .It Dv C3
 This is the deepest conventional state.
@@ -114,7 +115,7 @@
 The internal
 .Tn CPU
 clock is stopped.
-The
+The local
 .Tn APIC
 timer is stopped.
 Depending on the processor, additional timers such as
@@ -129,11 +130,12 @@
 .El
 .Pp
 Each state has a latency associated with entry and exit.
-Generally, the higher the state, the lower the power consumption, and
+The higher the state, the lower the power consumption, and
 the higher the potential performance costs.
+.Pp
 The
 .Nm
-driver tries to balance these latency
+driver tries to balance the latency
 constraints when choosing the appropriate state.
 One of the checks involves bus master activity;
 if such activity is detected, a lower state is used.
@@ -146,6 +148,44 @@
 support.
 And generally: to save power with C-states, one should
 avoid polling, both in userland and in the kernel.
+.Ss P-states
+The processor performance states, or P-states, are used to
+control the clock frequencies and voltages of a
+.Tn CPU .
+Underneath the abstractions of
+.Tn ACPI ,
+P-states are associated with such technologies as
+.Dq SpeedStep
+.Pq Intel ,
+.Dq PowerNow!
+.Pq Tn AMD ,
+and
+.Dq PowerSaver
+.Pq VIA .
+.Pp
+The
+.Dv P0
+state is always the highest operating frequency sypported by the processor.
+The number of additional P-states may vary across processors and vendors.
+Each higher numbered P-state represents lower
+clock frequencies and hence lower power consumption.
+.Pp
+Unlike in the conventional
+.Tn CPU
+frequency management,
+.Tn ACPI
+provides support for Dynamic Frequency and Voltage Scaling
+.Pq Tn DVFS .
+This means that the firmware may request the implementation to
+dynamically scale the presently supported maximum clock frequency.
+For example, if
+.Xr acpiacad 4
+is disconnected, the maximum available frequency may be lowered.
+Currently the
+.Nx
+implementation reacts to these events by imposing the dynamic maximum, but
+.Nm
+does not take any actions to manipulate the frequencies by itself.
 .Sh SEE ALSO
 .Xr acpi 4 ,
 .Xr cpu_idle 9
@@ -164,34 +204,30 @@
 At least the following caveats can be mentioned.
 .Bl -bullet
 .It
-P-states are not currently supported.
-.It
-The C3 state is not currently supported.
-Even if the C3 state was supported,
-the power savings might be limited compared to other operating systems with a
-.Dq tickless
-kernel.
+It is currently only safe to use
+.Dv C1
+on
+.Nx .
+All other C-states are disabled by default.
 .It
-Nor is a so-called
+The
 .Tn AMD
 .Tn C1E
-extension supported.
+extension is not supported.
 If this extension is available in a vendor
 .Tn BIOS ,
 it is recommended to turn it off, with or without
 .Nm .
 .It
-The algorithm used to choose a C-state is not yet well understood.
-Depending on the processor and firmware,
-the system may experience slowdowns with
-.Nm .
+The use of native instructions in P-states
+is currently supported only on Intel
+.Tn CPUs .
 

CVS commit: src/share/man/man4

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Aug  9 06:40:34 UTC 2010

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

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/acpicpu.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/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.2 src/share/man/man4/acpicpu.4:1.3
--- src/share/man/man4/acpicpu.4:1.2	Mon Aug  9 06:36:18 2010
+++ src/share/man/man4/acpicpu.4	Mon Aug  9 06:40:33 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpicpu.4,v 1.2 2010/08/09 06:36:18 jruoho Exp $
+.\ $NetBSD: acpicpu.4,v 1.3 2010/08/09 06:40:33 jruoho Exp $
 .\
 .\ Coyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -170,7 +170,7 @@
 Each higher numbered P-state represents lower
 clock frequencies and hence lower power consumption.
 .Pp
-Unlike in the conventional
+Unlike conventional
 .Tn CPU
 frequency management,
 .Tn ACPI



CVS commit: src/sys/dev/acpi

2010-08-09 Thread Grégoire Sutre
Module Name:src
Committed By:   gsutre
Date:   Mon Aug  9 09:36:42 UTC 2010

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

Log Message:
acpi_pcidev_scan: attach PCI information only to working devices.

ok jruoho@


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/acpi/acpi_pci.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.c
diff -u src/sys/dev/acpi/acpi.c:1.214 src/sys/dev/acpi/acpi.c:1.215
--- src/sys/dev/acpi/acpi.c:1.214	Sat Aug  7 20:07:25 2010
+++ src/sys/dev/acpi/acpi.c	Mon Aug  9 09:36:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.214 2010/08/07 20:07:25 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.215 2010/08/09 09:36:42 gsutre Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.214 2010/08/07 20:07:25 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.215 2010/08/09 09:36:42 gsutre Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -963,6 +963,8 @@
 		 * functioning properly. However, if a device is enabled,
 		 * it is decoding resources and we should claim these,
 		 * if possible. This requires changes to bus_space(9).
+		 * Note: there is a possible race condition, because _STA
+		 * may have changed since di-CurrentStatus was set.
 		 */
 		if (di-Type == ACPI_TYPE_DEVICE) {
 

Index: src/sys/dev/acpi/acpi_pci.c
diff -u src/sys/dev/acpi/acpi_pci.c:1.13 src/sys/dev/acpi/acpi_pci.c:1.14
--- src/sys/dev/acpi/acpi_pci.c:1.13	Sun Aug  8 16:26:47 2010
+++ src/sys/dev/acpi/acpi_pci.c	Mon Aug  9 09:36:42 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.c,v 1.13 2010/08/08 16:26:47 gsutre Exp $ */
+/* $NetBSD: acpi_pci.c,v 1.14 2010/08/09 09:36:42 gsutre Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_pci.c,v 1.13 2010/08/08 16:26:47 gsutre Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_pci.c,v 1.14 2010/08/09 09:36:42 gsutre Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -169,6 +169,16 @@
 	!(ad-ad_devinfo-Valid  ACPI_VALID_ADR))
 		goto rec;
 
+	/*
+	 * We attach PCI information only to devices that are present,
+	 * enabled, and functioning properly.
+	 * Note: there is a possible race condition, because _STA may
+	 * have changed since ad-ad_devinfo-CurrentStatus was set.
+	 */
+	if ((ad-ad_devinfo-Valid  ACPI_VALID_STA) != 0 
+	(ad-ad_devinfo-CurrentStatus  ACPI_STA_OK) != ACPI_STA_OK)
+		goto rec;
+
 	if (ad-ad_devinfo-Flags  ACPI_PCI_ROOT_BRIDGE) {
 
 		ap = kmem_zalloc(sizeof(*ap), KM_SLEEP);



CVS commit: src/share/man/man4

2010-08-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug  9 10:57:23 UTC 2010

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

Log Message:
Group hyphens differently.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/acpicpu.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/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.3 src/share/man/man4/acpicpu.4:1.4
--- src/share/man/man4/acpicpu.4:1.3	Mon Aug  9 06:40:33 2010
+++ src/share/man/man4/acpicpu.4	Mon Aug  9 10:57:23 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpicpu.4,v 1.3 2010/08/09 06:40:33 jruoho Exp $
+.\ $NetBSD: acpicpu.4,v 1.4 2010/08/09 10:57:23 wiz Exp $
 .\
 .\ Coyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -43,10 +43,10 @@
 to function properly.
 Typically the
 .Tn ACPI
-processor functionality is grouped into so-called C, P, and T -states.
+processor functionality is grouped into so-called C-, P-, and T-states.
 Presently,
 .Nm
-supports C and P -states.
+supports C- and P-states.
 .Ss C-states
 The processor power states, or C-states,
 are low-power modes that can be used when the



CVS commit: src/sys

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Aug  9 13:41:39 UTC 2010

Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c
src/sys/dev/acpi: acpi_cpu.h acpi_cpu_cstate.c

Log Message:
Remove a redundant function.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/acpi/acpi_cpu_md.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/acpi/acpi_cpu.h
cvs rdiff -u -r1.17 -r1.18 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/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.7 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.8
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.7	Mon Aug  9 04:27:07 2010
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Mon Aug  9 13:41:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.7 2010/08/09 04:27:07 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.8 2010/08/09 13:41:39 jruoho 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_md.c,v 1.7 2010/08/09 04:27:07 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.8 2010/08/09 13:41:39 jruoho Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -138,22 +138,12 @@
 }
 
 int
-acpicpu_md_idle_init(void)
+acpicpu_md_idle_start(void)
 {
 	const size_t size = sizeof(native_idle_text);
 
 	x86_disable_intr();
 	x86_cpu_idle_get(native_idle, native_idle_text, size);
-	x86_enable_intr();
-
-	return 0;
-}
-
-int
-acpicpu_md_idle_start(void)
-{
-
-	x86_disable_intr();
 	x86_cpu_idle_set(acpicpu_cstate_idle, acpi);
 	x86_enable_intr();
 

Index: src/sys/dev/acpi/acpi_cpu.h
diff -u src/sys/dev/acpi/acpi_cpu.h:1.10 src/sys/dev/acpi/acpi_cpu.h:1.11
--- src/sys/dev/acpi/acpi_cpu.h:1.10	Sun Aug  8 18:47:54 2010
+++ src/sys/dev/acpi/acpi_cpu.h	Mon Aug  9 13:41:38 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.10 2010/08/08 18:47:54 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.11 2010/08/09 13:41:38 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -191,7 +191,6 @@
 uint32_t	acpicpu_md_cap(void);
 uint32_t	acpicpu_md_quirks(void);
 uint32_t	acpicpu_md_cpus_running(void);
-int		acpicpu_md_idle_init(void);
 int		acpicpu_md_idle_start(void);
 int		acpicpu_md_idle_stop(void);
 void		acpicpu_md_idle_enter(int, int);

Index: src/sys/dev/acpi/acpi_cpu_cstate.c
diff -u src/sys/dev/acpi/acpi_cpu_cstate.c:1.17 src/sys/dev/acpi/acpi_cpu_cstate.c:1.18
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.17	Mon Aug  9 05:00:24 2010
+++ src/sys/dev/acpi/acpi_cpu_cstate.c	Mon Aug  9 13:41:38 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.17 2010/08/09 05:00:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.18 2010/08/09 13:41:38 jruoho 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.17 2010/08/09 05:00:24 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.18 2010/08/09 13:41:38 jruoho Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -165,18 +165,12 @@
 {
 	struct acpicpu_softc *sc = device_private(self);
 	static ONCE_DECL(once_start);
-	static ONCE_DECL(once_save);
 	int rv;
 
 	/*
 	 * Save the existing idle-mechanism and claim the idle_loop(9).
 	 * This should be called after all ACPI CPUs have been attached.
 	 */
-	rv = RUN_ONCE(once_save, acpicpu_md_idle_init);
-
-	if (rv != 0)
-		return rv;
-
 	rv = RUN_ONCE(once_start, acpicpu_md_idle_start);
 
 	if (rv == 0)



CVS commit: src/tests/net/config

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 15:07:51 UTC 2010

Modified Files:
src/tests/net/config: netconfig.c

Log Message:
add a simple pingtest


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/config/netconfig.c

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

Modified files:

Index: src/tests/net/config/netconfig.c
diff -u src/tests/net/config/netconfig.c:1.3 src/tests/net/config/netconfig.c:1.4
--- src/tests/net/config/netconfig.c:1.3	Mon Jul 26 14:07:04 2010
+++ src/tests/net/config/netconfig.c	Mon Aug  9 15:07:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netconfig.c,v 1.3 2010/07/26 14:07:04 pooka Exp $	*/
+/*	$NetBSD: netconfig.c,v 1.4 2010/08/09 15:07:51 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: netconfig.c,v 1.3 2010/07/26 14:07:04 pooka Exp $);
+__RCSID($NetBSD: netconfig.c,v 1.4 2010/08/09 15:07:51 pooka Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -39,7 +39,11 @@
 #include arpa/inet.h
 
 #include net/route.h
+
 #include netinet/in.h
+#include netinet/in_systm.h
+#include netinet/ip.h
+#include netinet/ip_icmp.h
 
 #include atf-c.h
 #include errno.h
@@ -162,3 +166,43 @@
 	}
 	rump_sys_close(s);
 }
+
+static bool
+netcfg_rump_pingtest(const char *dst, int ms_timo)
+{
+	struct timeval tv;
+	struct sockaddr_in sin;
+	struct icmp icmp;
+	socklen_t slen;
+	int s;
+
+	s = rump_sys_socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);
+	if (s == -1)
+		return false;
+	tv.tv_sec = ms_timo / 1000;
+	tv.tv_usec = 1000 * (ms_timo % 1000);
+	if (rump_sys_setsockopt(s, SOL_SOCKET, SO_RCVTIMEO,
+	tv, sizeof(tv)) == -1)
+		return false;
+
+	memset(sin, 0, sizeof(sin));
+	sin.sin_len = sizeof(sin);
+	sin.sin_family = AF_INET;
+	sin.sin_addr.s_addr = inet_addr(dst);
+
+	memset(icmp, 0, sizeof(icmp));
+	icmp.icmp_type = ICMP_ECHO;
+	icmp.icmp_id = htons(37); 
+	icmp.icmp_cksum = htons(0xf7da); /* precalc */
+
+	slen = sizeof(sin);
+	if (rump_sys_sendto(s, icmp, sizeof(icmp), 0,
+	(struct sockaddr *)sin, slen) == -1)
+		return false;
+
+	if (rump_sys_recvfrom(s, icmp, sizeof(icmp), 0,
+	(struct sockaddr *)sin, slen) == -1)
+		return false;
+
+	return true;
+}



CVS commit: src/tests/net/icmp

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 15:08:43 UTC 2010

Modified Files:
src/tests/net/icmp: Makefile
Added Files:
src/tests/net/icmp: t_ping.c

Log Message:
test that kernel reponds to ping


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/icmp/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/net/icmp/t_ping.c

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

Modified files:

Index: src/tests/net/icmp/Makefile
diff -u src/tests/net/icmp/Makefile:1.1 src/tests/net/icmp/Makefile:1.2
--- src/tests/net/icmp/Makefile:1.1	Sun Jul  4 19:30:59 2010
+++ src/tests/net/icmp/Makefile	Mon Aug  9 15:08:43 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2010/07/04 19:30:59 pooka Exp $
+# $NetBSD: Makefile,v 1.2 2010/08/09 15:08:43 pooka Exp $
 #
 
 .include bsd.own.mk
@@ -6,6 +6,7 @@
 TESTSDIR=	${TESTSBASE}/net/icmp
 
 TESTS_C=	t_forward
+TESTS_C+=	t_ping
 
 LDADD+=		-lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet
 LDADD+=		-lrump -lrumpuser -lpthread

Added files:

Index: src/tests/net/icmp/t_ping.c
diff -u /dev/null src/tests/net/icmp/t_ping.c:1.1
--- /dev/null	Mon Aug  9 15:08:43 2010
+++ src/tests/net/icmp/t_ping.c	Mon Aug  9 15:08:43 2010
@@ -0,0 +1,101 @@
+/*	$NetBSD: t_ping.c,v 1.1 2010/08/09 15:08:43 pooka Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+#ifndef lint
+__RCSID($NetBSD: t_ping.c,v 1.1 2010/08/09 15:08:43 pooka Exp $);
+#endif /* not lint */
+
+#include sys/types.h
+
+#include atf-c.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include unistd.h
+
+#include rump/rump.h
+
+#include ../../h_macros.h
+#include ../config/netconfig.c
+
+ATF_TC(simpleping);
+ATF_TC_HEAD(simpleping, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, check that kernel responds to ping);
+	atf_tc_set_md_var(tc, use.fs, true);
+	atf_tc_set_md_var(tc, timeout, 2);
+}
+
+ATF_TC_BODY(simpleping, tc)
+{
+	char ifname[IFNAMSIZ];
+	pid_t cpid;
+	int status;
+	bool win, win2;
+
+	cpid = fork();
+	rump_init();
+	netcfg_rump_makeshmif(but-can-i-buy-your-ether-bus, ifname);
+
+	switch (cpid) {
+	case -1:
+		atf_tc_fail_errno(fork failed);
+	case 0:
+		netcfg_rump_if(ifname, 1.1.1.10, 255.255.255.0);
+		pause();
+		break;
+	default:
+		break;
+	}
+
+	netcfg_rump_if(ifname, 1.1.1.20, 255.255.255.0);
+
+	/*
+	 * The beauty of shmif is that we don't have races here.
+	 */
+	win = netcfg_rump_pingtest(1.1.1.10, 500);
+	win2 = netcfg_rump_pingtest(1.1.1.30, 500);
+
+	kill(cpid, SIGKILL);
+
+	if (!win)
+		atf_tc_fail(ping failed);
+	if (win2)
+		atf_tc_fail(non-existent host responded);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, simpleping);
+
+	return atf_no_error();
+}



CVS commit: src/distrib/sets/lists/tests

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 15:10:20 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
+tp


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.133 src/distrib/sets/lists/tests/mi:1.134
--- src/distrib/sets/lists/tests/mi:1.133	Fri Aug  6 16:17:13 2010
+++ src/distrib/sets/lists/tests/mi	Mon Aug  9 15:10:20 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.133 2010/08/06 16:17:13 pooka Exp $
+# $NetBSD: mi,v 1.134 2010/08/09 15:10:20 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -341,6 +341,7 @@
 ./usr/libdata/debug/usr/tests/net/bpf/t_div-by-zero.debug		tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/icmp	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/icmp/t_forward.debug		tests-net-debug		debug,atf
+./usr/libdata/debug/usr/tests/net/icmp/t_ping.debug		tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/if_loop	tests-net-debug
 ./usr/libdata/debug/usr/tests/net/if_loop/t_pr.debug		tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/sys	tests-net-debug
@@ -1497,6 +1498,7 @@
 ./usr/tests/net/icmptests-net-tests
 ./usr/tests/net/icmp/Atffile			tests-net-tests		atf
 ./usr/tests/net/icmp/t_forward		tests-net-tests		atf
+./usr/tests/net/icmp/t_ping		tests-net-tests		atf
 ./usr/tests/net/if_looptests-net-tests
 ./usr/tests/net/if_loop/Atffile			tests-net-tests		atf
 ./usr/tests/net/if_loop/t_pr		tests-net-tests		atf



CVS commit: src/sys/ufs/ffs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 15:50:13 UTC 2010

Modified Files:
src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
Return error if we try to mount a file system with block size  MAXBSIZE.

Note: there is a billion ways to make the kernel panic by trying
to mount a garbage file system and I don't imagine we'll ever get
close to fixing even half of them.  However, for this one failing
gracefully is a bonus since Xen DomU only does 32k MAXBSIZE and
the 64k MAXBSIZE file systems are out there (PR port-xen/43727).

Tested by compiling sys/rump with CPPFLAGS+=-DMAXPHYS=32768 (all
tests in tests/fs still pass).  I don't know how we're going to
translate this into an easy regression test, though.  Maybe with
a hacked newfs?


To generate a diff of this commit:
cvs rdiff -u -r1.260 -r1.261 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.260 src/sys/ufs/ffs/ffs_vfsops.c:1.261
--- src/sys/ufs/ffs/ffs_vfsops.c:1.260	Wed Jul 21 17:52:13 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c	Mon Aug  9 15:50:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.260 2010/07/21 17:52:13 hannken Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.261 2010/08/09 15:50:13 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.260 2010/07/21 17:52:13 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.261 2010/08/09 15:50:13 pooka Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -828,6 +828,7 @@
 	int32_t *lp;
 	kauth_cred_t cred;
 	u_int32_t sbsize = 8192;	/* keep gcc happy*/
+	int32_t fsbsize;
 
 	dev = devvp-v_rdev;
 	cred = l ? l-l_cred : NOCRED;
@@ -886,21 +887,25 @@
 		if (fs-fs_magic == FS_UFS1_MAGIC) {
 			sbsize = fs-fs_sbsize;
 			fstype = UFS1;
+			fsbsize = fs-fs_bsize;
 #ifdef FFS_EI
 			needswap = 0;
 		} else if (fs-fs_magic == bswap32(FS_UFS1_MAGIC)) {
 			sbsize = bswap32(fs-fs_sbsize);
 			fstype = UFS1;
+			fsbsize = bswap32(fs-fs_bsize);
 			needswap = 1;
 #endif
 		} else if (fs-fs_magic == FS_UFS2_MAGIC) {
 			sbsize = fs-fs_sbsize;
 			fstype = UFS2;
+			fsbsize = fs-fs_bsize;
 #ifdef FFS_EI
 			needswap = 0;
 		} else if (fs-fs_magic == bswap32(FS_UFS2_MAGIC)) {
 			sbsize = bswap32(fs-fs_sbsize);
 			fstype = UFS2;
+			fsbsize = bswap32(fs-fs_bsize);
 			needswap = 1;
 #endif
 		} else
@@ -933,6 +938,13 @@
 		if (sbsize  MAXBSIZE || sbsize  sizeof(struct fs))
 			continue;
 
+		/* Check that we can handle the file system blocksize */
+		if (fsbsize  MAXBSIZE) {
+			printf(ffs_mountfs: block size (%d)  MAXBSIZE (%d),
+			fsbsize, MAXBSIZE);
+			continue;
+		}
+
 		/* Ok seems to be a good superblock */
 		break;
 	}



CVS commit: src/sys/dev/acpi

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Aug  9 15:56:45 UTC 2010

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

Log Message:
On systems where both the existing EST code and the one provided by ACPI are
functional, the previously loaded EST code may have used frequencies that
are not present in the BIOS. This will cause failures since acpicpu(4) will
treat these unknown frequencies as errors. Fix this by initializing the
cached P-state to P0, regardless of what the true state might be.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/acpi/acpi_cpu_pstate.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_pstate.c
diff -u src/sys/dev/acpi/acpi_cpu_pstate.c:1.5 src/sys/dev/acpi/acpi_cpu_pstate.c:1.6
--- src/sys/dev/acpi/acpi_cpu_pstate.c:1.5	Mon Aug  9 04:27:07 2010
+++ src/sys/dev/acpi/acpi_cpu_pstate.c	Mon Aug  9 15:56:45 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.5 2010/08/09 04:27:07 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.6 2010/08/09 15:56:45 jruoho 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_pstate.c,v 1.5 2010/08/09 04:27:07 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_pstate.c,v 1.6 2010/08/09 15:56:45 jruoho Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -81,6 +81,7 @@
 		sc-sc_flags |= ACPICPU_FLAG_P_PPC;
 
 	sc-sc_flags |= ACPICPU_FLAG_P;
+	sc-sc_pstate_current = sc-sc_pstate[0].ps_freq;
 
 	acpicpu_pstate_bios();
 	acpicpu_pstate_attach_print(sc);



CVS commit: src/share/man/man4

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Aug  9 16:13:22 UTC 2010

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

Log Message:
Fix a typo. Sypported indeed.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/acpicpu.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/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.4 src/share/man/man4/acpicpu.4:1.5
--- src/share/man/man4/acpicpu.4:1.4	Mon Aug  9 10:57:23 2010
+++ src/share/man/man4/acpicpu.4	Mon Aug  9 16:13:21 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpicpu.4,v 1.4 2010/08/09 10:57:23 wiz Exp $
+.\ $NetBSD: acpicpu.4,v 1.5 2010/08/09 16:13:21 jruoho Exp $
 .\
 .\ Coyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -165,7 +165,7 @@
 .Pp
 The
 .Dv P0
-state is always the highest operating frequency sypported by the processor.
+state is always the highest operating frequency supported by the processor.
 The number of additional P-states may vary across processors and vendors.
 Each higher numbered P-state represents lower
 clock frequencies and hence lower power consumption.



CVS commit: xsrc/external/mit/xf86-video-nv/dist

2010-08-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Aug  9 16:17:58 UTC 2010

Update of /cvsroot/xsrc/external/mit/xf86-video-nv/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv3739

Log Message:
initial import of xf86-video-nv-2.1.18

Status:

Vendor Tag: xorg
Release Tags:   xf86-video-nv-2-1-18

U xsrc/external/mit/xf86-video-nv/dist/Makefile.am
U xsrc/external/mit/xf86-video-nv/dist/INSTALL
U xsrc/external/mit/xf86-video-nv/dist/depcomp
U xsrc/external/mit/xf86-video-nv/dist/ChangeLog
U xsrc/external/mit/xf86-video-nv/dist/COPYING
U xsrc/external/mit/xf86-video-nv/dist/README
U xsrc/external/mit/xf86-video-nv/dist/configure
U xsrc/external/mit/xf86-video-nv/dist/Makefile.in
U xsrc/external/mit/xf86-video-nv/dist/configure.ac
U xsrc/external/mit/xf86-video-nv/dist/aclocal.m4
U xsrc/external/mit/xf86-video-nv/dist/ltmain.sh
U xsrc/external/mit/xf86-video-nv/dist/config.sub
U xsrc/external/mit/xf86-video-nv/dist/config.h.in
U xsrc/external/mit/xf86-video-nv/dist/README.G80
U xsrc/external/mit/xf86-video-nv/dist/install-sh
U xsrc/external/mit/xf86-video-nv/dist/config.guess
U xsrc/external/mit/xf86-video-nv/dist/missing
U xsrc/external/mit/xf86-video-nv/dist/src/g80_display.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_cursor.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_display.h
U xsrc/external/mit/xf86-video-nv/dist/src/nv_shadow.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_const.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_type.h
U xsrc/external/mit/xf86-video-nv/dist/src/g80_dma.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_hw.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_xaa.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_output.h
C xsrc/external/mit/xf86-video-nv/dist/src/g80_dac.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_cursor.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_dga.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_exa.h
U xsrc/external/mit/xf86-video-nv/dist/src/nv_dma.h
U xsrc/external/mit/xf86-video-nv/dist/src/nv_dga.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_setup.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_type.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_dac.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_include.h
U xsrc/external/mit/xf86-video-nv/dist/src/g80_driver.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_dma.h
U xsrc/external/mit/xf86-video-nv/dist/src/nv_type.h
U xsrc/external/mit/xf86-video-nv/dist/src/Makefile.am
U xsrc/external/mit/xf86-video-nv/dist/src/g80_xaa.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_hw.h
U xsrc/external/mit/xf86-video-nv/dist/src/nv_setup.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_cursor.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_video.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_local.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_xaa.c
U xsrc/external/mit/xf86-video-nv/dist/src/g80_cursor.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_xaa.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_driver.c
C xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_shadow.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_include.h
U xsrc/external/mit/xf86-video-nv/dist/src/Makefile.in
U xsrc/external/mit/xf86-video-nv/dist/src/nv_dac.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_const.h
U xsrc/external/mit/xf86-video-nv/dist/src/nv_local.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_driver.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_tbl.h
U xsrc/external/mit/xf86-video-nv/dist/src/g80_exa.c
U xsrc/external/mit/xf86-video-nv/dist/src/nv_proto.h
U xsrc/external/mit/xf86-video-nv/dist/src/g80_output.c
U xsrc/external/mit/xf86-video-nv/dist/src/riva_proto.h
U xsrc/external/mit/xf86-video-nv/dist/src/riva_hw.c
U xsrc/external/mit/xf86-video-nv/dist/man/Makefile.am
U xsrc/external/mit/xf86-video-nv/dist/man/Makefile.in
U xsrc/external/mit/xf86-video-nv/dist/man/nv.man

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

cvs checkout -jxorg:yesterday -jxorg 
xsrc/external/mit/xf86-video-nv/dist



CVS commit: xsrc/external/mit/xf86-video-nv/dist

2010-08-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Aug  9 16:18:45 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-nv/dist/src: g80_dac.c g80_sor.c
Removed Files:
xsrc/external/mit/xf86-video-nv/dist/compat: Makefile.am Makefile.in
README
xsrc/external/mit/xf86-video-nv/dist/compat/modes: xf86Crtc.c
xf86Crtc.h xf86Cursors.c xf86DiDGA.c xf86EdidModes.c xf86Modes.c
xf86Modes.h xf86RandR12.c xf86RandR12.h xf86Rename.h xf86Rotate.c
xf86cvt.c xf86gtf.c
xsrc/external/mit/xf86-video-nv/dist/compat/parser: xf86Optrec.h
xf86Parser.h
xsrc/external/mit/xf86-video-nv/dist/src: local_xf86Rename.h

Log Message:
merge xf86-video-nv 2.1.18


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/Makefile.am \
xsrc/external/mit/xf86-video-nv/dist/compat/README
cvs rdiff -u -r1.1.1.3 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/Makefile.in
cvs rdiff -u -r1.1.1.4 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Crtc.c \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Crtc.h \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Cursors.c \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86EdidModes.c \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Modes.c \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Modes.h \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86RandR12.c \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Rotate.c
cvs rdiff -u -r1.1.1.3 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86DiDGA.c \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86RandR12.h \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86gtf.c
cvs rdiff -u -r1.1.1.2 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86Rename.h \
xsrc/external/mit/xf86-video-nv/dist/compat/modes/xf86cvt.c
cvs rdiff -u -r1.1.1.2 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/parser/xf86Optrec.h
cvs rdiff -u -r1.1.1.4 -r0 \
xsrc/external/mit/xf86-video-nv/dist/compat/parser/xf86Parser.h
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xf86-video-nv/dist/src/g80_dac.c \
xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c
cvs rdiff -u -r1.1.1.1 -r0 \
xsrc/external/mit/xf86-video-nv/dist/src/local_xf86Rename.h

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/xf86-video-nv/dist/src/g80_dac.c
diff -u xsrc/external/mit/xf86-video-nv/dist/src/g80_dac.c:1.3 xsrc/external/mit/xf86-video-nv/dist/src/g80_dac.c:1.4
--- xsrc/external/mit/xf86-video-nv/dist/src/g80_dac.c:1.3	Sat May 22 10:12:55 2010
+++ xsrc/external/mit/xf86-video-nv/dist/src/g80_dac.c	Mon Aug  9 16:18:45 2010
@@ -173,7 +173,7 @@
 {
 G80OutputDestroy(output);
 
-xfree(output-driver_private);
+free(output-driver_private);
 output-driver_private = NULL;
 }
 
Index: xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c
diff -u xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c:1.3 xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c:1.4
--- xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c:1.3	Sat May 22 10:12:55 2010
+++ xsrc/external/mit/xf86-video-nv/dist/src/g80_sor.c	Mon Aug  9 16:18:45 2010
@@ -169,7 +169,7 @@
 
 xf86DeleteMode(pPriv-nativeMode, pPriv-nativeMode);
 
-xfree(output-driver_private);
+free(output-driver_private);
 output-driver_private = NULL;
 }
 
@@ -265,7 +265,6 @@
 return xf86DuplicateMode(pPriv-nativeMode);
 }
 
-#ifdef RANDR_12_INTERFACE
 #define MAKE_ATOM(a) MakeAtom((a), sizeof(a) - 1, TRUE);
 
 struct property {
@@ -407,7 +406,6 @@
 
 return TRUE;
 }
-#endif // RANDR_12_INTERFACE
 
 static const xf86OutputFuncsRec G80SorTMDSOutputFuncs = {
 .dpms = G80SorDPMSSet,
@@ -420,10 +418,8 @@
 .mode_set = G80SorModeSet,
 .detect = G80SorDetect,
 .get_modes = G80OutputGetDDCModes,
-#ifdef RANDR_12_INTERFACE
 .create_resources = G80SorCreateResources,
 .set_property = G80SorSetProperty,
-#endif
 .destroy = G80SorDestroy,
 };
 
@@ -438,10 +434,8 @@
 .mode_set = G80SorModeSet,
 .detect = G80SorLVDSDetect,
 .get_modes = G80SorGetLVDSModes,
-#ifdef RANDR_12_INTERFACE
 .create_resources = G80SorCreateResources,
 .set_property = G80SorSetProperty,
-#endif
 .destroy = G80SorDestroy,
 };
 
@@ -505,7 +499,7 @@
 if(!pPriv-nativeMode) {
 xf86DrvMsg(pScrn-scrnIndex, X_WARNING,
Failed to find LVDS native mode\n);
-xfree(pPriv);
+free(pPriv);
 return NULL;
 }
 



CVS commit: src/sys/ufs/ffs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 17:12:18 UTC 2010

Modified Files:
src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
add a linefeed to the previous


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.261 src/sys/ufs/ffs/ffs_vfsops.c:1.262
--- src/sys/ufs/ffs/ffs_vfsops.c:1.261	Mon Aug  9 15:50:13 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c	Mon Aug  9 17:12:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.261 2010/08/09 15:50:13 pooka Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.262 2010/08/09 17:12:18 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.261 2010/08/09 15:50:13 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.262 2010/08/09 17:12:18 pooka Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -940,7 +940,7 @@
 
 		/* Check that we can handle the file system blocksize */
 		if (fsbsize  MAXBSIZE) {
-			printf(ffs_mountfs: block size (%d)  MAXBSIZE (%d),
+			printf(ffs_mountfs: block size (%d)  MAXBSIZE (%d)\n,
 			fsbsize, MAXBSIZE);
 			continue;
 		}



CVS commit: src/sbin/newfs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 17:20:57 UTC 2010

Modified Files:
src/sbin/newfs: Makefile mkfs.c newfs.8 newfs.c

Log Message:
Add -G, which turns consistency check errors in warnings.  The
current testing purpose is to create a file system with
block size  MAXPHYS.

(the check doesn't make that much sense anyway in these days of
mobile file systems, since we're interested in MAXPHYS where we
attempt to mount the file system, not where we happen to create it)


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/newfs/Makefile
cvs rdiff -u -r1.107 -r1.108 src/sbin/newfs/mkfs.c
cvs rdiff -u -r1.77 -r1.78 src/sbin/newfs/newfs.8
cvs rdiff -u -r1.106 -r1.107 src/sbin/newfs/newfs.c

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

Modified files:

Index: src/sbin/newfs/Makefile
diff -u src/sbin/newfs/Makefile:1.35 src/sbin/newfs/Makefile:1.36
--- src/sbin/newfs/Makefile:1.35	Sun Dec 20 15:21:13 2009
+++ src/sbin/newfs/Makefile	Mon Aug  9 17:20:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2009/12/20 15:21:13 dsl Exp $
+#	$NetBSD: Makefile,v 1.36 2010/08/09 17:20:57 pooka Exp $
 #	@(#)Makefile	8.2 (Berkeley) 3/27/94
 
 .include bsd.own.mk
@@ -12,6 +12,7 @@
 FSCK=${NETBSDSRCDIR}/sbin/fsck
 MOUNT=${NETBSDSRCDIR}/sbin/mount
 CPPFLAGS+=-DMFS -I${.CURDIR} -I${DISKLABEL} -I${FSCK} -I${MOUNT}
+CPPFLAGS+=-DGARBAGE
 
 DPADD+= ${LIBUTIL}
 LDADD+= -lutil

Index: src/sbin/newfs/mkfs.c
diff -u src/sbin/newfs/mkfs.c:1.107 src/sbin/newfs/mkfs.c:1.108
--- src/sbin/newfs/mkfs.c:1.107	Sun Jan 31 16:04:34 2010
+++ src/sbin/newfs/mkfs.c	Mon Aug  9 17:20:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs.c,v 1.107 2010/01/31 16:04:34 mlelstv Exp $	*/
+/*	$NetBSD: mkfs.c,v 1.108 2010/08/09 17:20:57 pooka Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
 #if 0
 static char sccsid[] = @(#)mkfs.c	8.11 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: mkfs.c,v 1.107 2010/01/31 16:04:34 mlelstv Exp $);
+__RCSID($NetBSD: mkfs.c,v 1.108 2010/08/09 17:20:57 pooka Exp $);
 #endif
 #endif /* not lint */
 
@@ -157,6 +157,18 @@
 
 int	fsi, fso;
 
+static void
+fserr(int num)
+{
+#ifdef GARBAGE
+	extern int Gflag;
+
+	if (Gflag)
+		return;
+#endif
+	exit(num);
+}
+
 void
 mkfs(const char *fsys, int fi, int fo,
 mode_t mfsmode, uid_t mfsuid, gid_t mfsgid)
@@ -207,12 +219,12 @@
 	if (sblock.fs_avgfilesize = 0) {
 		printf(illegal expected average file size %d\n,
 		sblock.fs_avgfilesize);
-		exit(14);
+		fserr(14);
 	}
 	if (sblock.fs_avgfpdir = 0) {
 		printf(illegal expected number of files per directory %d\n,
 		sblock.fs_avgfpdir);
-		exit(15);
+		fserr(15);
 	}
 	/*
 	 * collect and verify the block and fragment sizes
@@ -222,32 +234,32 @@
 	if (!powerof2(sblock.fs_bsize)) {
 		printf(block size must be a power of 2, not %d\n,
 		sblock.fs_bsize);
-		exit(16);
+		fserr(16);
 	}
 	if (!powerof2(sblock.fs_fsize)) {
 		printf(fragment size must be a power of 2, not %d\n,
 		sblock.fs_fsize);
-		exit(17);
+		fserr(17);
 	}
 	if (sblock.fs_fsize  sectorsize) {
 		printf(fragment size %d is too small, minimum is %d\n,
 		sblock.fs_fsize, sectorsize);
-		exit(18);
+		fserr(18);
 	}
 	if (sblock.fs_bsize  MINBSIZE) {
 		printf(block size %d is too small, minimum is %d\n,
 		sblock.fs_bsize, MINBSIZE);
-		exit(19);
+		fserr(19);
 	}
 	if (sblock.fs_bsize  MAXBSIZE) {
 		printf(block size %d is too large, maximum is %d\n,
 		sblock.fs_bsize, MAXBSIZE);
-		exit(19);
+		fserr(19);
 	}
 	if (sblock.fs_bsize  sblock.fs_fsize) {
 		printf(block size (%d) cannot be smaller than fragment size (%d)\n,
 		sblock.fs_bsize, sblock.fs_fsize);
-		exit(20);
+		fserr(20);
 	}
 
 	if (maxbsize  bsize || !powerof2(maxbsize)) {
@@ -282,7 +294,7 @@
 			minimum with block size %d is %d\n,
 		sblock.fs_fsize, sblock.fs_bsize,
 		sblock.fs_bsize / MAXFRAG);
-		exit(21);
+		fserr(21);
 	}
 	sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize);
 	sblock.fs_size = dbtofsb(sblock, fssize);
@@ -290,7 +302,7 @@
 		if ((uint64_t)sblock.fs_size = 1ull  31) {
 			printf(Too many fragments (0x% PRIx64
 			) for a FFSv1 filesystem\n, sblock.fs_size);
-			exit(22);
+			fserr(22);
 		}
 		sblock.fs_magic = FS_UFS1_MAGIC;
 		sblock.fs_sblockloc = SBLOCK_UFS1;
@@ -353,7 +365,7 @@
 	if (sblock.fs_size  sblock.fs_iblkno + 3 * sblock.fs_frag) {
 		printf(Filesystem size %lld  minimum size of %d\n,
 		(long long)sblock.fs_size, sblock.fs_iblkno + 3 * sblock.fs_frag);
-		exit(23);
+		fserr(23);
 	}
 	if (num_inodes != 0)
 		inodeblks = howmany(num_inodes, INOPB(sblock));
@@ -420,7 +432,7 @@
 	if ((int)CGSIZE(sblock)  sblock.fs_bsize) {
 		printf(CGSIZE miscalculated %d  %d\n,
 		(int)CGSIZE(sblock), sblock.fs_bsize);
-		exit(24);
+		fserr(24);
 	}
 
 	sblock.fs_dblkno = sblock.fs_iblkno + sblock.fs_ipg / INOPF(sblock);
@@ -574,7 +586,7 @@
 		 */
 		if (fssize = 0) {
 			printf(preposterous size 

CVS commit: src/tests/fs/ffs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 17:42:26 UTC 2010

Modified Files:
src/tests/fs/ffs: t_mount.c

Log Message:
Check that mounting a file system with blocksize  MAXPHYS returns an error.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/ffs/t_mount.c

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

Modified files:

Index: src/tests/fs/ffs/t_mount.c
diff -u src/tests/fs/ffs/t_mount.c:1.7 src/tests/fs/ffs/t_mount.c:1.8
--- src/tests/fs/ffs/t_mount.c:1.7	Fri Jul 30 16:15:05 2010
+++ src/tests/fs/ffs/t_mount.c	Mon Aug  9 17:42:26 2010
@@ -1,6 +1,11 @@
-/*	$NetBSD: t_mount.c,v 1.7 2010/07/30 16:15:05 pooka Exp $	*/
+/*	$NetBSD: t_mount.c,v 1.8 2010/08/09 17:42:26 pooka Exp $	*/
 
 /*
+ * Basic tests for mounting
+ */
+
+/*
+ * 48Kimage:
  * Adapted for rump and atf from a testcase supplied
  * by Hubert Feyrer on netbsd-users@
  */
@@ -14,6 +19,18 @@
 
 #include ../common/h_fsmacros.h
 
+#include sys/types.h
+#include sys/mount.h
+
+#include stdlib.h
+
+#include ufs/ufs/ufsmount.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include ../../h_macros.h
+
 ATF_TC(48Kimage);
 ATF_TC_HEAD(48Kimage, tc)
 {
@@ -41,8 +58,53 @@
 		atf_tc_fail(delfs failed);
 }
 
+ATF_TC(fsbsize2big);
+ATF_TC_HEAD(fsbsize2big, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, mounts file system with 
+	blocksize  MAXPHYS);
+	atf_tc_set_md_var(tc, use.fs, true);
+	/* PR kern/43727 */
+}
+
+#define MYBLOCKSIZE 131072
+#if MAXPHYS = MYBLOCKSIZE
+#error MAXPHYS too large for test to work
+#endif
+ATF_TC_BODY(fsbsize2big, tc)
+{
+	char cmd[1024];
+	struct ufs_args args;
+	struct statvfs svb;
+
+	snprintf(cmd, sizeof(cmd), newfs -G -b %d -F -s 1 
+	ffs.img  /dev/null, MYBLOCKSIZE);
+	if (system(cmd))
+		atf_tc_fail(cannot create file system);
+
+	rump_init();
+	if (rump_pub_etfs_register(/devdisk, ffs.img, RUMP_ETFS_BLK))
+		atf_tc_fail(cannot register rump fake device);
+
+	args.fspec = __UNCONST(/devdisk);
+
+	if (rump_sys_mkdir(/mp, 0777) == -1)
+		atf_tc_fail_errno(create mountpoint);
+
+	/* mount succeeded?  bad omen.  confirm we're in trouble.  */
+	if (rump_sys_mount(MOUNT_FFS, /mp, 0, args, sizeof(args)) != -1) {
+		rump_sys_statvfs1(/mp, svb, ST_WAIT);
+	}
+
+	/* otherwise we're do-ne */
+}
+
 ATF_TP_ADD_TCS(tp)
 {
+
 	ATF_TP_ADD_TC(tp, 48Kimage);
+	ATF_TP_ADD_TC(tp, fsbsize2big);
+
 	return atf_no_error();
 }



CVS commit: src/tests/fs/common

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 19:32:26 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
allow overriding of defaults


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/fs/common/h_fsmacros.h

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

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.17 src/tests/fs/common/h_fsmacros.h:1.18
--- src/tests/fs/common/h_fsmacros.h:1.17	Fri Jul 30 16:15:05 2010
+++ src/tests/fs/common/h_fsmacros.h	Mon Aug  9 19:32:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.17 2010/07/30 16:15:05 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.18 2010/08/09 19:32:26 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -54,9 +54,15 @@
 FSPROTOS(sysvbfs);
 FSPROTOS(tmpfs);
 
+#ifndef FSTEST_IMGNAME
 #define FSTEST_IMGNAME image.fs
+#endif
+#ifndef FSTEST_IMGSIZE
 #define FSTEST_IMGSIZE (1 * 512)
+#endif
+#ifndef FSTEST_MNTNAME
 #define FSTEST_MNTNAME /mnt
+#endif
 
 #define FSTEST_CONSTRUCTOR(_tc_, _fs_, _args_)\
 do {	\



CVS commit: src/tests/fs/ffs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 19:34:59 UTC 2010

Modified Files:
src/tests/fs/ffs: t_mount.c

Log Message:
* convert 48k fs image test to FSTEST_CON/DESTRO
* make sure hugeblocksize doesn't accidentally succeed


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/fs/ffs/t_mount.c

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

Modified files:

Index: src/tests/fs/ffs/t_mount.c
diff -u src/tests/fs/ffs/t_mount.c:1.8 src/tests/fs/ffs/t_mount.c:1.9
--- src/tests/fs/ffs/t_mount.c:1.8	Mon Aug  9 17:42:26 2010
+++ src/tests/fs/ffs/t_mount.c	Mon Aug  9 19:34:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mount.c,v 1.8 2010/08/09 17:42:26 pooka Exp $	*/
+/*	$NetBSD: t_mount.c,v 1.9 2010/08/09 19:34:59 pooka Exp $	*/
 
 /*
  * Basic tests for mounting
@@ -12,11 +12,7 @@
 
 #include atf-c.h
 
-#define IMGNAME image.ffs
-#define IMGSIZE (96 * 512)
-
-#define MNTDIR  /mnt
-
+#define FSTEST_IMGSIZE (96 * 512)
 #include ../common/h_fsmacros.h
 
 #include sys/types.h
@@ -42,20 +38,11 @@
 {
 	void *tmp;
 
-	if (ffs_fstest_newfs(tc, tmp, IMGNAME, IMGSIZE, NULL) != 0)
-		atf_tc_fail(newfs failed);
-
 	atf_tc_expect_fail(PR kern/43573);
-	if (ffs_fstest_mount(tc, tmp, MNTDIR, 0) != 0) {
-		atf_tc_fail(mount failed);
-	}
+	FSTEST_CONSTRUCTOR(tc, ffs, tmp);
 	atf_tc_expect_pass();
 
-	if (ffs_fstest_unmount(tc, MNTDIR, 0) != 0)
-		atf_tc_fail(unmount failed);
-
-	if (ffs_fstest_delfs(tc, tmp) != 0)
-		atf_tc_fail(delfs failed);
+	FSTEST_DESTRUCTOR(tc, ffs, tmp);
 }
 
 ATF_TC(fsbsize2big);
@@ -95,6 +82,7 @@
 	/* mount succeeded?  bad omen.  confirm we're in trouble.  */
 	if (rump_sys_mount(MOUNT_FFS, /mp, 0, args, sizeof(args)) != -1) {
 		rump_sys_statvfs1(/mp, svb, ST_WAIT);
+		atf_tc_fail(not expecting to be alive);
 	}
 
 	/* otherwise we're do-ne */



CVS commit: src/tests/fs/ffs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 19:36:30 UTC 2010

Modified Files:
src/tests/fs/ffs: t_mount.c

Log Message:
add comment saying why the other test doesn't use fstest


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/ffs/t_mount.c

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

Modified files:

Index: src/tests/fs/ffs/t_mount.c
diff -u src/tests/fs/ffs/t_mount.c:1.9 src/tests/fs/ffs/t_mount.c:1.10
--- src/tests/fs/ffs/t_mount.c:1.9	Mon Aug  9 19:34:59 2010
+++ src/tests/fs/ffs/t_mount.c	Mon Aug  9 19:36:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mount.c,v 1.9 2010/08/09 19:34:59 pooka Exp $	*/
+/*	$NetBSD: t_mount.c,v 1.10 2010/08/09 19:36:30 pooka Exp $	*/
 
 /*
  * Basic tests for mounting
@@ -65,6 +65,10 @@
 	struct ufs_args args;
 	struct statvfs svb;
 
+	/*
+	 * We cannot pass newfs parameters via the fstest interface,
+	 * so do things the oldfashioned manual way.
+	 */
 	snprintf(cmd, sizeof(cmd), newfs -G -b %d -F -s 1 
 	ffs.img  /dev/null, MYBLOCKSIZE);
 	if (system(cmd))



CVS commit: src/sbin/newfs

2010-08-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug  9 20:23:20 UTC 2010

Modified Files:
src/sbin/newfs: newfs.8

Log Message:
Sort option descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sbin/newfs/newfs.8

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

Modified files:

Index: src/sbin/newfs/newfs.8
diff -u src/sbin/newfs/newfs.8:1.78 src/sbin/newfs/newfs.8:1.79
--- src/sbin/newfs/newfs.8:1.78	Mon Aug  9 17:20:57 2010
+++ src/sbin/newfs/newfs.8	Mon Aug  9 20:23:20 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: newfs.8,v 1.78 2010/08/09 17:20:57 pooka Exp $
+.\	$NetBSD: newfs.8,v 1.79 2010/08/09 20:23:20 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1987, 1991, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -155,12 +155,12 @@
 .It \*[Gt]= 1024 MB
 2 KB
 .El
-.It Fl g Ar avgfilesize
-The expected average file size for the file system.
 .It Fl G
 Treat garbage parameters as non-fatal.
 Using this option may result in a file system which causes a kernel
 panic and should only be used for testing.
+.It Fl g Ar avgfilesize
+The expected average file size for the file system.
 .It Fl h Ar avgfpdir
 The expected average number of files per directory on the file system.
 .It Fl I
@@ -268,9 +268,6 @@
 Uses information for the specified disk from
 .Pa /etc/disktab
 instead of trying to get the information from the disk label.
-.It Fl v Ar volname
-This specifies that an Apple UFS filesystem should be created
-with the given volume name.
 .It Fl V Ar verbose
 This controls the amount of information written to stdout:
 .Bl -tag -width 3n -offset indent -compact
@@ -292,6 +289,9 @@
 is specified
 .Nm
 stops before outputting the progress bar.
+.It Fl v Ar volname
+This specifies that an Apple UFS filesystem should be created
+with the given volume name.
 .It Fl Z
 Pre-zeros the file system image created with
 .Fl F .



CVS commit: src/sbin/newfs

2010-08-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Aug  9 21:14:26 UTC 2010

Modified Files:
src/sbin/newfs: newfs.c

Log Message:
Add -G to usage, omission pointed out by wiz.  Also, make usage format
nicer on a 80col terminal.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sbin/newfs/newfs.c

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

Modified files:

Index: src/sbin/newfs/newfs.c
diff -u src/sbin/newfs/newfs.c:1.107 src/sbin/newfs/newfs.c:1.108
--- src/sbin/newfs/newfs.c:1.107	Mon Aug  9 17:20:57 2010
+++ src/sbin/newfs/newfs.c	Mon Aug  9 21:14:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs.c,v 1.107 2010/08/09 17:20:57 pooka Exp $	*/
+/*	$NetBSD: newfs.c,v 1.108 2010/08/09 21:14:26 pooka Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1993, 1994
@@ -78,7 +78,7 @@
 #if 0
 static char sccsid[] = @(#)newfs.c	8.13 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: newfs.c,v 1.107 2010/08/09 17:20:57 pooka Exp $);
+__RCSID($NetBSD: newfs.c,v 1.108 2010/08/09 21:14:26 pooka Exp $);
 #endif
 #endif /* not lint */
 
@@ -818,10 +818,11 @@
 } const help_strings[] = {
 	{ NEWFS,	-B byteorder\tbyte order (`be' or `le') },
 	{ NEWFS,	-F \t\tcreate file system image in regular file },
+	{ NEWFS,	-G \t\tmake sanity calculations non-fatal (testing only!) },
 	{ NEWFS,	-I \t\tdo not check that the file system type is '4.2BSD' },
 	{ BOTH,		-N \t\tdo not create file system, just print out 
 			parameters },
-	{ NEWFS,	-O N\t\tfilesystem format: 0 == 4.3BSD, 1 == FFSv1, 2 == FFSv2 },
+	{ NEWFS,	-O N\t\tfilesystem format: 0 = 4.3BSD, 1 = FFSv1, 2 = FFSv2 },
 	{ NEWFS,	-S secsize\tsector size },
 #ifdef COMPAT
 	{ NEWFS,	-T disktype\tdisk type },



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

2010-08-09 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Aug  9 23:07:20 UTC 2010

Modified Files:
src/sys/arch/hpc/include: debug.h

Log Message:
Misc cosmetics.  Refix __func__ fallout fixed in previous by
eliminating the temp completely (__func__ is already an array).

This has been sitting in my tree for years, and I forgot to commit it.
Compile-tested by compiling hpcsh GENERIC with options DEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpc/include/debug.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/hpc/include/debug.h
diff -u src/sys/arch/hpc/include/debug.h:1.10 src/sys/arch/hpc/include/debug.h:1.11
--- src/sys/arch/hpc/include/debug.h:1.10	Sun Aug  8 16:27:30 2010
+++ src/sys/arch/hpc/include/debug.h	Mon Aug  9 23:07:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.h,v 1.10 2010/08/08 16:27:30 chs Exp $	*/
+/*	$NetBSD: debug.h,v 1.11 2010/08/09 23:07:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
@@ -48,75 +48,116 @@
  * #endif
  */
 #ifdef USE_HPC_DPRINTF
-#ifdef __DPRINTF_EXT
-/*
- * debug printf with Function name 
- */
-#define	PRINTF(fmt, args...)	printf(%s:  fmt, __func__ , ##args) 
+
 #ifdef DPRINTF_ENABLE
+
 #ifndef DPRINTF_DEBUG
-#error specify unique debug symbol
+#error specify unique debug variable
 #endif
+
 #ifndef DPRINTF_LEVEL
 #define DPRINTF_LEVEL	1
 #endif
-int	DPRINTF_DEBUG = DPRINTF_LEVEL;
-#define	DPRINTF(fmt, args...)	if (DPRINTF_DEBUG) PRINTF(fmt, ##args)
-#define	_DPRINTF(fmt, args...)	if (DPRINTF_DEBUG) printf(fmt, ##args)
-#define DPRINTFN(n, fmt, args...)	\
-			   	if (DPRINTF_DEBUG  (n)) PRINTF(fmt, ##args)
-#define _DPRINTFN(n, fmt, args...)	\
-			   	if (DPRINTF_DEBUG  (n)) printf(fmt, ##args)
-#else /* DPRINTF_ENABLE */
-#define	DPRINTF(args...)	((void)0)
-#define	_DPRINTF(args...)	((void)0)
-#define DPRINTFN(n, args...)	((void)0)
-#define _DPRINTFN(n, args...)	((void)0)
+
+int DPRINTF_DEBUG = DPRINTF_LEVEL;
 #endif /* DPRINTF_ENABLE */
 
-#else	/* __DPRINTF_EXT */
+
+#ifdef __DPRINTF_EXT
+/*
+ * printf with function name prepended
+ */
+
+#define	PRINTF(fmt, args...)	do {			\
+		printf(%s:  fmt, __func__ , ##args);	\
+	} while (/* CONSTCOND */0)
+
+#ifdef DPRINTF_ENABLE
+
+#define	DPRINTF(fmt, args...)	do {		\
+		if (DPRINTF_DEBUG)		\
+			PRINTF(fmt, ##args);	\
+	} while (/* CONSTCOND */0)
+
+#define	_DPRINTF(fmt, args...)	do {		\
+		if (DPRINTF_DEBUG)		\
+			printf(fmt, ##args);	\
+	} while (/* CONSTCOND */0)
+
+#define DPRINTFN(n, fmt, args...)	do {	\
+		if (DPRINTF_DEBUG  (n))	\
+			PRINTF(fmt, ##args);	\
+	} while (/* CONSTCOND */0)
+
+#define _DPRINTFN(n, fmt, args...) do {		\
+		if (DPRINTF_DEBUG  (n))	\
+			printf(fmt, ##args);	\
+	} while (/* CONSTCOND */0)
+
+#else  /* !DPRINTF_ENABLE */
+#define	DPRINTF(args...)	do {} while (/* CONSTCOND */ 0)
+#define	_DPRINTF(args...)	do {} while (/* CONSTCOND */ 0)
+#define DPRINTFN(n, args...)	do {} while (/* CONSTCOND */ 0)
+#define _DPRINTFN(n, args...)	do {} while (/* CONSTCOND */ 0)
+#endif /* !DPRINTF_ENABLE */
+
+#else  /* !__DPRINTF_EXT */
 /*
  * normal debug printf
  */
+
 #ifdef DPRINTF_ENABLE
-#ifndef DPRINTF_DEBUG
-#error specify unique debug symbol
-#endif
-#ifndef DPRINTF_LEVEL
-#define DPRINTF_LEVEL	1
-#endif
-int	DPRINTF_DEBUG = DPRINTF_LEVEL;
-#define	DPRINTF(arg)		if (DPRINTF_DEBUG) printf arg
-#define DPRINTFN(n, arg)	if (DPRINTF_DEBUG  (n)) printf arg
-#else /* DPRINTF_ENABLE */
-#define	DPRINTF(arg)		((void)0)
-#define DPRINTFN(n, arg)	((void)0)
-#endif /* DPRINTF_ENABLE */
 
-#endif /* __DPRINT_EXT */
+#define	DPRINTF(arg)	do {			\
+		if (DPRINTF_DEBUG)		\
+			printf arg;		\
+	} while (/* CONSTCOND */0)
+
+#define DPRINTFN(n, arg)	do {		\
+		if (DPRINTF_DEBUG  (n))	\
+			printf arg;		\
+	} while (/* CONSTCOND */0)
+
+#else  /* !DPRINTF_ENABLE */
+#define	DPRINTF(arg)		do {} while (/* CONSTCOND */ 0)
+#define DPRINTFN(n, arg)	do {} while (/* CONSTCOND */ 0)
+#endif /* !DPRINTF_ENABLE */
+
+#endif /* !__DPRINT_EXT */
 #endif /* USE_HPC_DPRINTF */
 
+
 /*
  * debug print utility
  */
 #define DBG_BIT_PRINT_COUNT	(1  0)
 #define DBG_BIT_PRINT_QUIET	(1  1)
-#define dbg_bit_print(a)		\
-	__dbg_bit_print((a), sizeof(typeof(a)), 0, 0, 0, DBG_BIT_PRINT_COUNT)
-#define dbg_bit_print_msg(a, m)		\
-	__dbg_bit_print((a), sizeof(typeof(a)), 0, 0, (m), DBG_BIT_PRINT_COUNT)
-#define dbg_bit_display(a)		\
-	__dbg_bit_print((a), sizeof(typeof(a)), 0, 0, 0, DBG_BIT_PRINT_QUIET)
-void __dbg_bit_print(u_int32_t, int, int, int, const char *, int);
-void dbg_bitmask_print(u_int32_t, u_int32_t, const char *);
+
+void __dbg_bit_print(uint32_t, int, int, int, const char *, int);
+
+#define dbg_bit_print(a) do {		\
+		__dbg_bit_print((a), sizeof(typeof(a)), 0, 0, NULL,	\
+			DBG_BIT_PRINT_COUNT);\
+	} while (/* CONSTCOND */0)
+
+#define dbg_bit_print_msg(a, m) do {	\
+		__dbg_bit_print((a), sizeof(typeof(a)), 0, 0, 

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

2010-08-09 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Aug  9 23:09:00 UTC 2010

Modified Files:
src/sys/arch/hpcsh/include: debug.h

Log Message:
Use empty do/while for no-op.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcsh/include/debug.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/hpcsh/include/debug.h
diff -u src/sys/arch/hpcsh/include/debug.h:1.4 src/sys/arch/hpcsh/include/debug.h:1.5
--- src/sys/arch/hpcsh/include/debug.h:1.4	Mon Apr 28 20:23:22 2008
+++ src/sys/arch/hpcsh/include/debug.h	Mon Aug  9 23:08:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.h,v 1.4 2008/04/28 20:23:22 martin Exp $	*/
+/*	$NetBSD: debug.h,v 1.5 2010/08/09 23:08:59 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
@@ -34,6 +34,7 @@
 #include hpc/include/debug.h
 
 #include debug_hpc.h
+
 /*
  * interrupt monitor
  */
@@ -50,6 +51,5 @@
 };
 void __dbg_heart_beat(enum heart_beat);
 #else
-#define __dbg_heart_beat(x)	((void)0)
-#endif /* HPC_DEBUG_INTERRUPT_MONITOR */
-
+#define __dbg_heart_beat(x)	do {} while (/* CONSTCOND */ 0)
+#endif



CVS commit: src/sys/dev/acpi

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Aug 10 02:42:05 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_cpu.h acpi_cpu_cstate.c acpi_cpu_pstate.c

Log Message:
Use evcnt(9) for the counters.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/acpi_cpu.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/acpi/acpi_cpu_cstate.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/acpi/acpi_cpu_pstate.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.h
diff -u src/sys/dev/acpi/acpi_cpu.h:1.11 src/sys/dev/acpi/acpi_cpu.h:1.12
--- src/sys/dev/acpi/acpi_cpu.h:1.11	Mon Aug  9 13:41:38 2010
+++ src/sys/dev/acpi/acpi_cpu.h	Tue Aug 10 02:42:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.11 2010/08/09 13:41:38 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.12 2010/08/10 02:42:05 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -121,7 +121,8 @@
 } __packed;
 
 struct acpicpu_cstate {
-	uint64_t		 cs_stat;
+	struct evcnt		 cs_evcnt;
+	char			 cs_name[EVCNT_STRING_MAX];
 	uint64_t		 cs_addr;
 	uint32_t		 cs_power;	/* mW */
 	uint32_t		 cs_latency;	/* us */
@@ -130,7 +131,8 @@
 };
 
 struct acpicpu_pstate {
-	uint64_t		 ps_stat;
+	struct evcnt		 ps_evcnt;
+	char			 ps_name[EVCNT_STRING_MAX];
 	uint32_t		 ps_freq;	/* MHz */
 	uint32_t		 ps_power;	/* mW */
 	uint32_t		 ps_latency;	/* us */

Index: src/sys/dev/acpi/acpi_cpu_cstate.c
diff -u src/sys/dev/acpi/acpi_cpu_cstate.c:1.18 src/sys/dev/acpi/acpi_cpu_cstate.c:1.19
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.18	Mon Aug  9 13:41:38 2010
+++ src/sys/dev/acpi/acpi_cpu_cstate.c	Tue Aug 10 02:42:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.18 2010/08/09 13:41:38 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.19 2010/08/10 02:42:05 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,11 +27,12 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.18 2010/08/09 13:41:38 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.19 2010/08/10 02:42:05 jruoho Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
 #include sys/device.h
+#include sys/evcnt.h
 #include sys/kernel.h
 #include sys/once.h
 #include sys/mutex.h
@@ -51,10 +52,13 @@
 ACPI_MODULE_NAME	 (acpi_cpu_cstate)
 
 static void		 acpicpu_cstate_attach_print(struct acpicpu_softc *);
+static void		 acpicpu_cstate_attach_evcnt(struct acpicpu_softc *);
+static void		 acpicpu_cstate_detach_evcnt(struct acpicpu_softc *);
 static ACPI_STATUS	 acpicpu_cstate_cst(struct acpicpu_softc *);
 static ACPI_STATUS	 acpicpu_cstate_cst_add(struct acpicpu_softc *,
 		ACPI_OBJECT *);
 static void		 acpicpu_cstate_cst_bios(void);
+static void		 acpicpu_cstate_memset(struct acpicpu_softc *);
 static void		 acpicpu_cstate_fadt(struct acpicpu_softc *);
 static void		 acpicpu_cstate_quirks(struct acpicpu_softc *);
 static int		 acpicpu_cstate_quirks_piix4(struct pci_attach_args *);
@@ -101,6 +105,7 @@
 	}
 
 	acpicpu_cstate_quirks(sc);
+	acpicpu_cstate_attach_evcnt(sc);
 	acpicpu_cstate_attach_print(sc);
 }
 
@@ -143,6 +148,36 @@
 	}
 }
 
+static void
+acpicpu_cstate_attach_evcnt(struct acpicpu_softc *sc)
+{
+	struct acpicpu_cstate *cs;
+	const char *str;
+	int i;
+
+	for (i = 0; i  ACPI_C_STATE_COUNT; i++) {
+
+		cs = sc-sc_cstate[i];
+
+		if (cs-cs_method == 0)
+			continue;
+
+		str = HALT;
+
+		if (cs-cs_method == ACPICPU_C_STATE_FFH)
+			str = MWAIT;
+
+		if (cs-cs_method == ACPICPU_C_STATE_SYSIO)
+			str = I/O;
+
+		(void)snprintf(cs-cs_name, sizeof(cs-cs_name),
+		C%d (%s), i, str);
+
+		evcnt_attach_dynamic(cs-cs_evcnt, EVCNT_TYPE_MISC,
+		NULL, device_xname(sc-sc_dev), cs-cs_name);
+	}
+}
+
 int
 acpicpu_cstate_detach(device_t self)
 {
@@ -156,10 +191,26 @@
 		return rv;
 
 	sc-sc_flags = ~ACPICPU_FLAG_C;
+	acpicpu_cstate_detach_evcnt(sc);
 
 	return 0;
 }
 
+static void
+acpicpu_cstate_detach_evcnt(struct acpicpu_softc *sc)
+{
+	struct acpicpu_cstate *cs;
+	int i;
+
+	for (i = 0; i  ACPI_C_STATE_COUNT; i++) {
+
+		cs = sc-sc_cstate[i];
+
+		if (cs-cs_method != 0)
+			evcnt_detach(cs-cs_evcnt);
+	}
+}
+
 int
 acpicpu_cstate_start(device_t self)
 {
@@ -261,8 +312,7 @@
 		goto out;
 	}
 
-	(void)memset(sc-sc_cstate, 0,
-	sizeof(*sc-sc_cstate) * ACPI_C_STATE_COUNT);
+	acpicpu_cstate_memset(sc);
 
 	CTASSERT(ACPI_STATE_C0 == 0  ACPI_STATE_C1 == 1);
 	CTASSERT(ACPI_STATE_C2 == 2  ACPI_STATE_C3 == 3);
@@ -471,11 +521,28 @@
 }
 
 static void
+acpicpu_cstate_memset(struct acpicpu_softc *sc)
+{
+	int i = 0;
+
+	while (i  ACPI_C_STATE_COUNT) {
+
+		sc-sc_cstate[i].cs_addr = 0;
+		sc-sc_cstate[i].cs_power = 0;
+		sc-sc_cstate[i].cs_flags = 0;
+		sc-sc_cstate[i].cs_method = 0;
+		sc-sc_cstate[i].cs_latency = 0;
+
+		i++;
+	}
+}
+
+static void
 acpicpu_cstate_fadt(struct acpicpu_softc *sc)
 {
 	struct acpicpu_cstate *cs = sc-sc_cstate;
 
-	(void)memset(cs, 

CVS commit: src/share/man/man4

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Aug 10 02:43:50 UTC 2010

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

Log Message:
Note the gathered statistics. One CAVEAT down.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/acpicpu.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/acpicpu.4
diff -u src/share/man/man4/acpicpu.4:1.5 src/share/man/man4/acpicpu.4:1.6
--- src/share/man/man4/acpicpu.4:1.5	Mon Aug  9 16:13:21 2010
+++ src/share/man/man4/acpicpu.4	Tue Aug 10 02:43:50 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpicpu.4,v 1.5 2010/08/09 16:13:21 jruoho Exp $
+.\ $NetBSD: acpicpu.4,v 1.6 2010/08/10 02:43:50 jruoho Exp $
 .\
 .\ Coyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd August 9, 2010
+.Dd August 10, 2010
 .Dt ACPICPU 4
 .Os
 .Sh NAME
@@ -186,6 +186,16 @@
 implementation reacts to these events by imposing the dynamic maximum, but
 .Nm
 does not take any actions to manipulate the frequencies by itself.
+.Ss Statistics
+The
+.Nm
+driver uses event counters to track the times
+a processor has entered a given state.
+It is possible to view the statistics by using
+.Xr vmstat 1
+(with the argument
+.Ar -e ) .
+Note that valid per-CPU data is available only for C-states.
 .Sh SEE ALSO
 .Xr acpi 4 ,
 .Xr cpu_idle 9
@@ -237,11 +247,4 @@
 It is only possible to control the
 .Tn CPU
 frequencies from userland.
-.It
-There are currently no proper ways to export
-statistical and other information from
-.Nm .
-This applies to
-.Tn ACPI
-generally.
 .El



CVS commit: xsrc/external/mit/xf86-video-ati/dist/src/AtomBios

2010-08-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Tue Aug 10 02:57:44 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-ati/dist/src/AtomBios: CD_Operations.c

Log Message:
pull across a patch from git 11005146d6defa876a988daad587ae558f04ecbb:

From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 10 Aug 2010 02:18:53 +
Subject: atom: upstream parser update

fixes digital output problems on evergreen asics


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/xf86-video-ati/dist/src/AtomBios/CD_Operations.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/xf86-video-ati/dist/src/AtomBios/CD_Operations.c
diff -u xsrc/external/mit/xf86-video-ati/dist/src/AtomBios/CD_Operations.c:1.1.1.3 xsrc/external/mit/xf86-video-ati/dist/src/AtomBios/CD_Operations.c:1.2
--- xsrc/external/mit/xf86-video-ati/dist/src/AtomBios/CD_Operations.c:1.1.1.3	Sun May 23 06:09:26 2010
+++ xsrc/external/mit/xf86-video-ati/dist/src/AtomBios/CD_Operations.c	Tue Aug 10 02:57:44 2010
@@ -505,13 +505,16 @@
 
 VOID ProcessMask(PARSER_TEMP_DATA STACK_BASED * pParserTempData)
 {
+UINT8 src;
 
 pParserTempData-DestData32=GetDestination[pParserTempData-ParametersType.Destination](pParserTempData);
+src = pParserTempData-CD_Mask.SrcAlignment;
 pParserTempData-SourceData32=GetParametersDirect(pParserTempData);
 pParserTempData-Index=GetSource[pParserTempData-ParametersType.Source](pParserTempData);
 pParserTempData-SourceData32 = DestinationAlignmentShift[pParserTempData-CD_Mask.DestAlignment];
 pParserTempData-SourceData32 |= ~(AlignmentMask[pParserTempData-CD_Mask.SrcAlignment]  DestinationAlignmentShift[pParserTempData-CD_Mask.DestAlignment]);
 pParserTempData-DestData32   = pParserTempData-SourceData32;
+pParserTempData-Index= SourceAlignmentShift[src];
 pParserTempData-Index= AlignmentMask[pParserTempData-CD_Mask.SrcAlignment];
 pParserTempData-Index= DestinationAlignmentShift[pParserTempData-CD_Mask.DestAlignment];
 pParserTempData-DestData32   |= pParserTempData-Index;



CVS commit: src/sys/dev/acpi

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Aug 10 04:38:06 UTC 2010

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

Log Message:
Add a XXX-comment as a TODO. From jmcneill@:

/*
 * XXX: The pci_find_device(9) function only deals with
 *  attached devices. Change this to use something like
 *  pci_device_foreach(), and implement it for IA-64.
 */


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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.19 src/sys/dev/acpi/acpi_cpu_cstate.c:1.20
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.19	Tue Aug 10 02:42:05 2010
+++ src/sys/dev/acpi/acpi_cpu_cstate.c	Tue Aug 10 04:38:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.19 2010/08/10 02:42:05 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.20 2010/08/10 04:38:06 jruoho 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.19 2010/08/10 02:42:05 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.20 2010/08/10 04:38:06 jruoho Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -630,6 +630,11 @@
 acpicpu_cstate_quirks_piix4(struct pci_attach_args *pa)
 {
 
+	/*
+	 * XXX: The pci_find_device(9) function only deals with
+	 *	attached devices. Change this to use something like
+	 *	pci_device_foreach(), and implement it for IA-64.
+	 */
 	if (PCI_VENDOR(pa-pa_id) != PCI_VENDOR_INTEL)
 		return 0;
 



CVS commit: src/sys/dev/acpi

2010-08-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Aug 10 05:22:07 UTC 2010

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

Log Message:
Fix xref in a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 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.20 src/sys/dev/acpi/acpi_cpu_cstate.c:1.21
--- src/sys/dev/acpi/acpi_cpu_cstate.c:1.20	Tue Aug 10 04:38:06 2010
+++ src/sys/dev/acpi/acpi_cpu_cstate.c	Tue Aug 10 05:22:07 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.20 2010/08/10 04:38:06 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.21 2010/08/10 05:22:07 jruoho 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.20 2010/08/10 04:38:06 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_cstate.c,v 1.21 2010/08/10 05:22:07 jruoho Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -219,7 +219,7 @@
 	int rv;
 
 	/*
-	 * Save the existing idle-mechanism and claim the idle_loop(9).
+	 * Save the existing idle-mechanism and claim the cpu_idle(9).
 	 * This should be called after all ACPI CPUs have been attached.
 	 */
 	rv = RUN_ONCE(once_start, acpicpu_md_idle_start);