CVS commit: src/sys/dev/pci

2013-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 17 06:31:15 UTC 2013

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
- Add slot related registers
- Add root port related registers
- Fix the definition of PCI_PCIE_SLCAP_PSN
- Cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/pcireg.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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.100 src/sys/dev/pci/pci_subr.c:1.101
--- src/sys/dev/pci/pci_subr.c:1.100	Wed Apr 17 04:36:27 2013
+++ src/sys/dev/pci/pci_subr.c	Wed Apr 17 06:31:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.100 2013/04/17 04:36:27 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.101 2013/04/17 06:31:15 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.100 2013/04/17 04:36:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.101 2013/04/17 06:31:15 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -859,18 +859,20 @@ pci_print_pcie_L1_latency(uint32_t val)
 static void
 pci_conf_print_pcie_cap(const pcireg_t *regs, int capoff)
 {
-	pcireg_t val;
+	pcireg_t reg; /* for each register */
+	pcireg_t val; /* for each bitfield */
 	bool check_slot = false;
+	bool check_rootport = false;
 	static const char * const linkspeeds[] = {"2.5", "5.0", "8.0"};
 
 	printf("\n  PCI Express Capabilities Register\n");
 	/* Capability Register */
-	printf("Capability register: %04x\n",
-	regs[o2i(capoff)] >> 16);
+	reg = regs[o2i(capoff)];
+	printf("Capability register: %04x\n", reg >> 16);
 	printf("  Capability version: %x\n",
-	(unsigned int)((regs[o2i(capoff)] & 0x000f) >> 16));
+	(unsigned int)((reg & 0x000f) >> 16));
 	printf("  Device type: ");
-	switch ((regs[o2i(capoff)] & 0x00f0) >> 20) {
+	switch ((reg & 0x00f0) >> 20) {
 	case 0x0:
 		printf("PCI Express Endpoint device\n");
 		break;
@@ -880,6 +882,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	case 0x4:
 		printf("Root Port of PCI Express Root Complex\n");
 		check_slot = true;
+		check_rootport = true; /* XXX right? */
 		break;
 	case 0x5:
 		printf("Upstream Port of PCI Express Switch\n");
@@ -887,6 +890,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	case 0x6:
 		printf("Downstream Port of PCI Express Switch\n");
 		check_slot = true;
+		check_rootport = true; /* XXX right? */
 		break;
 	case 0x7:
 		printf("PCI Express to PCI/PCI-X Bridge\n");
@@ -896,6 +900,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		break;
 	case 0x9:
 		printf("Root Complex Integrated Endpoint\n");
+		check_rootport = true; /* XXX right? */
 		break;
 	case 0xa:
 		printf("Root Complex Event Collector\n");
@@ -904,20 +909,18 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		printf("unknown\n");
 		break;
 	}
-	if (check_slot && (regs[o2i(capoff)] & 0x0100) != 0)
+	if (check_slot && (reg & PCI_PCIE_XCAP_SI) != 0)
 		printf("  Slot implemented\n");
 	printf("  Interrupt Message Number: %x\n",
-	(unsigned int)((regs[o2i(capoff)] & PCI_PCIE_XCAP_IRQ) >> 27));
+	(unsigned int)((reg & PCI_PCIE_XCAP_IRQ) >> 27));
 
 	/* Device Capability Register */
-	printf("Device Capabilities Register: 0x%08x\n",
-	regs[o2i(capoff + PCI_PCIE_DCAP)]);
+	reg = regs[o2i(capoff + PCI_PCIE_DCAP)];
+	printf("Device Capabilities Register: 0x%08x\n", reg);
 	printf("  Max Payload Size Supported: %u bytes max\n",
-	(unsigned int)(regs[o2i(capoff + PCI_PCIE_DCAP)]
-		& PCI_PCIE_DCAP_MAX_PAYLOAD) * 256);
+	(unsigned int)(reg & PCI_PCIE_DCAP_MAX_PAYLOAD) * 256);
 	printf("  Phantom Functions Supported: ");
-	switch ((regs[o2i(capoff + PCI_PCIE_DCAP)]
-		& PCI_PCIE_DCAP_PHANTOM_FUNCS) >> 3) {
+	switch ((reg & PCI_PCIE_DCAP_PHANTOM_FUNCS) >> 3) {
 	case 0x0:
 		printf("not available\n");
 		break;
@@ -932,112 +935,82 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		break;
 	}
 	printf("  Extended Tag Field Supported: %dbit\n",
-	(regs[o2i(capoff + PCI_PCIE_DCAP)] & PCI_PCIE_DCAP_EXT_TAG_FIELD)
-	== 0 ? 5 : 8);
+	(reg & PCI_PCIE_DCAP_EXT_TAG_FIELD) == 0 ? 5 : 8);
 	printf("  Endpoint L0 Acceptable Latency: ");
-	pci_print_pcie_L0s_latency((regs[o2i(capoff + PCI_PCIE_DCAP)]
-		& PCI_PCIE_DCAP_L0S_LATENCY) >> 6);
+	pci_print_pcie_L0s_latency((reg & PCI_PCIE_DCAP_L0S_LATENCY) >> 6);
 	printf("  Endpoint L1 Acceptable Latency: ");
-	pci_print_pcie_L1_latency((regs[o2i(capoff + PCI_PCIE_DCAP)]
-		& PCI_PCIE_DCAP_L1_LATENCY) >> 9);
+	pci_print_pcie_L1_latency((reg & PCI_PCIE_DCAP_L1_LATENCY) >> 9);
 	printf("  Attention Button Present: %s\n",
-	(regs[o2i(capoff + PCI_PCIE_DCAP)]
-		& PCI_PCIE_DCAP_ATTN_BUTTON) != 0 ? "yes" : "no");
+	(reg & PCI_PCIE_DCAP_ATTN_BUT

CVS commit: src/sys/arch/evbarm/rpi

2013-04-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 17 06:12:43 UTC 2013

Modified Files:
src/sys/arch/evbarm/rpi: vcprop.h

Log Message:
Added __packed in a couple of places to help AEABI


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/rpi/vcprop.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/evbarm/rpi/vcprop.h
diff -u src/sys/arch/evbarm/rpi/vcprop.h:1.7 src/sys/arch/evbarm/rpi/vcprop.h:1.8
--- src/sys/arch/evbarm/rpi/vcprop.h:1.7	Tue Jan  8 15:07:32 2013
+++ src/sys/arch/evbarm/rpi/vcprop.h	Wed Apr 17 06:12:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vcprop.h,v 1.7 2013/01/08 15:07:32 jmcneill Exp $	*/
+/*	$NetBSD: vcprop.h,v 1.8 2013/04/17 06:12:42 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -125,12 +125,12 @@ struct vcprop_tag_boardrev {
 struct vcprop_tag_macaddr {
 	struct vcprop_tag tag;
 	uint64_t addr;
-};
+} __packed;
 
 struct vcprop_tag_boardserial {
 	struct vcprop_tag tag;
 	uint64_t sn;
-};
+} __packed;
 
 #define	VCPROP_CLK_EMMC		1
 #define	VCPROP_CLK_UART		2



CVS commit: src/sys/dev/pci

2013-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 17 04:36:27 UTC 2013

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
Add PCI_CAP_SUBVENDOR (= 0x0d).


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/pci/pcireg.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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.99 src/sys/dev/pci/pci_subr.c:1.100
--- src/sys/dev/pci/pci_subr.c:1.99	Tue Apr 16 15:50:58 2013
+++ src/sys/dev/pci/pci_subr.c	Wed Apr 17 04:36:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.99 2013/04/16 15:50:58 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.100 2013/04/17 04:36:27 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.99 2013/04/16 15:50:58 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.100 2013/04/17 04:36:27 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1353,6 +1353,9 @@ pci_conf_print_caplist(
 		case PCI_CAP_HOTPLUG:
 			printf("Hot-Plug");
 			break;
+		case PCI_CAP_SUBVENDOR:
+			printf("Sub Vendor ID");
+			break;
 		case PCI_CAP_AGP8:
 			printf("AGP 8x");
 			break;

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.80 src/sys/dev/pci/pcireg.h:1.81
--- src/sys/dev/pci/pcireg.h:1.80	Tue Apr 16 15:50:57 2013
+++ src/sys/dev/pci/pcireg.h	Wed Apr 17 04:36:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.80 2013/04/16 15:50:57 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.81 2013/04/17 04:36:27 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -463,6 +463,7 @@ typedef u_int8_t pci_revision_t;
 #define	PCI_CAP_DEBUGPORT	0x0a
 #define	PCI_CAP_CPCI_RSRCCTL	0x0b
 #define	PCI_CAP_HOTPLUG		0x0c
+#define	PCI_CAP_SUBVENDOR	0x0d
 #define	PCI_CAP_AGP8		0x0e
 #define	PCI_CAP_SECURE		0x0f
 #define	PCI_CAP_PCIEXPRESS 	0x10



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

2013-04-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Apr 17 01:36:42 UTC 2013

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

Log Message:
Add ./usr/tests/kernel/t_umountstress to set lists, to fix the build.


To generate a diff of this commit:
cvs rdiff -u -r1.533 -r1.534 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.533 src/distrib/sets/lists/tests/mi:1.534
--- src/distrib/sets/lists/tests/mi:1.533	Sun Apr 14 18:00:48 2013
+++ src/distrib/sets/lists/tests/mi	Wed Apr 17 01:36:41 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.533 2013/04/14 18:00:48 jmmv Exp $
+# $NetBSD: mi,v 1.534 2013/04/17 01:36:41 riz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1601,6 +1601,7 @@
 ./usr/tests/kernel/t_time			tests-obsolete			obsolete
 ./usr/tests/kernel/t_ucontext			tests-obsolete			obsolete
 ./usr/tests/kernel/t_umount			tests-kernel-tests		atf
+./usr/tests/kernel/t_umountstress		tests-kernel-tests		atf
 ./usr/tests/kernel/t_writev			tests-obsolete			obsolete
 ./usr/tests/kernel/ttytests-kernel-tests
 ./usr/tests/kernel/tty/Atffile			tests-kernel-tests		atf,rump



CVS commit: src/sys/arch/evbarm/n900

2013-04-16 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Apr 17 01:10:28 UTC 2013

Modified Files:
src/sys/arch/evbarm/n900: n900_acad.c

Log Message:
Improved n900acad(4) with:
- more readable dmesg output;
- unmapping the GPIO pin upon failure to establish an interrupt;
- some additional cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/n900/n900_acad.c

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

Modified files:

Index: src/sys/arch/evbarm/n900/n900_acad.c
diff -u src/sys/arch/evbarm/n900/n900_acad.c:1.2 src/sys/arch/evbarm/n900/n900_acad.c:1.3
--- src/sys/arch/evbarm/n900/n900_acad.c:1.2	Sun Apr 14 20:18:17 2013
+++ src/sys/arch/evbarm/n900/n900_acad.c	Wed Apr 17 01:10:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: n900_acad.c,v 1.2 2013/04/14 20:18:17 khorben Exp $ */
+/*	$NetBSD: n900_acad.c,v 1.3 2013/04/17 01:10:28 khorben Exp $ */
 
 /*
  * AC adapter driver for the Nokia N900.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: n900_acad.c,v 1.2 2013/04/14 20:18:17 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: n900_acad.c,v 1.3 2013/04/17 01:10:28 khorben Exp $");
 
 #include 
 #include 
@@ -73,6 +73,8 @@ static int	n900acad_detach(device_t, int
 CFATTACH_DECL_NEW(n900acad, sizeof(struct n900acad_softc),
 	n900acad_match, n900acad_attach, n900acad_detach, NULL);
 
+static void	n900acad_refresh(struct n900acad_softc *);
+
 static int	n900acad_intr(void *v);
 
 
@@ -111,7 +113,7 @@ n900acad_attach(device_t parent, device_
 	sc->sc_map.pm_map = sc->sc_map_pins;
 	if (gpio_pin_map(sc->sc_gpio, ga->ga_offset, ga->ga_mask,
 &sc->sc_map)) {
-		aprint_error(": can't map pins\n");
+		aprint_error(": could not map the pins\n");
 		return;
 	}
 
@@ -129,19 +131,23 @@ n900acad_attach(device_t parent, device_
 			IST_EDGE_BOTH, IPL_VM, n900acad_intr, sc);
 	if (sc->sc_intr == NULL) {
 		aprint_error(": could not establish interrupt\n");
+		gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
 		return;
 	}
 
-	aprint_normal("N900 AC adapter sensor\n");
-	aprint_naive("N900 AC adapter sensor\n");
+	aprint_normal(": N900 AC adapter sensor\n");
+	aprint_naive(": N900 AC adapter sensor\n");
 
-	if (!pmf_device_register(sc->sc_dev, NULL, NULL))
+	if (!pmf_device_register(sc->sc_dev, NULL, NULL)) {
 		aprint_error_dev(sc->sc_dev,
 		"could not establish power handler\n");
+	}
 
 	sc->sc_smpsw.smpsw_name = device_xname(self);
 	sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_ACADAPTER;
 	sysmon_pswitch_register(&sc->sc_smpsw);
+
+	n900acad_refresh(sc);
 }
 
 static int
@@ -155,6 +161,7 @@ n900acad_detach(device_t self, int flags
 
 	gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
 	pmf_device_deregister(self);
+
 	return 0;
 }
 
@@ -162,10 +169,17 @@ static int
 n900acad_intr(void *v)
 {
 	struct n900acad_softc *sc = v;
+
+	n900acad_refresh(sc);
+	return 1;
+}
+
+static void
+n900acad_refresh(struct n900acad_softc *sc)
+{
 	int i;
 
 	i = gpio_pin_read(sc->sc_gpio, &sc->sc_map, N900ACAD_PIN_INPUT);
-	sysmon_pswitch_event(&sc->sc_smpsw,
-			i ? PSWITCH_EVENT_RELEASED : PSWITCH_EVENT_PRESSED);
-	return 1;
+	sysmon_pswitch_event(&sc->sc_smpsw, (i == GPIO_PIN_HIGH)
+			? PSWITCH_EVENT_RELEASED : PSWITCH_EVENT_PRESSED);
 }



CVS commit: src/sys/arch/evbarm

2013-04-16 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Apr 17 01:06:14 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf: N900 files.n900
Added Files:
src/sys/arch/evbarm/n900: n900_lckbtn.c

Log Message:
Imported n900lckbtn(4), a driver for the lock button on the Nokia N900
smartphone. Currently reporting events via a hotkey, named after the driver
instance.

Tasted and approved.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/N900
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/files.n900
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/n900/n900_lckbtn.c

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

Modified files:

Index: src/sys/arch/evbarm/conf/N900
diff -u src/sys/arch/evbarm/conf/N900:1.9 src/sys/arch/evbarm/conf/N900:1.10
--- src/sys/arch/evbarm/conf/N900:1.9	Wed Apr 17 00:57:22 2013
+++ src/sys/arch/evbarm/conf/N900	Wed Apr 17 01:06:13 2013
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: N900,v 1.9 2013/04/17 00:57:22 khorben Exp $
+#	$NetBSD: N900,v 1.10 2013/04/17 01:06:13 khorben Exp $
 #
 #	N900 -- Nokia N900 Kernel
 #
@@ -205,9 +205,9 @@ flash2		at nand0 offset 0x3a02040 size 0
 # Interrupt Controller
 omapicu0	at obio0 addr 0x4820 size 0x1000 intrbase 0
 omapgpio0	at obio1 addr 0x4831 size 0x0400 intrbase 96  intr 29
-#omapgpio1	at obio2 addr 0x4905 size 0x0400 intrbase 128 intr 30
-#omapgpio2	at obio2 addr 0x49052000 size 0x0400 intrbase 160 intr 31
-#omapgpio3	at obio2 addr 0x49054000 size 0x0400 intrbase 192 intr 32
+omapgpio1	at obio2 addr 0x4905 size 0x0400 intrbase 128 intr 30
+omapgpio2	at obio2 addr 0x49052000 size 0x0400 intrbase 160 intr 31
+omapgpio3	at obio2 addr 0x49054000 size 0x0400 intrbase 192 intr 32
 omapgpio4	at obio2 addr 0x49056000 size 0x0400 intrbase 224 intr 33
 #omapgpio5	at obio2 addr 0x49058000 size 0x0400 intrbase 256 intr 34
 
@@ -217,6 +217,9 @@ gpio*		at omapgpio?
 # Charging sensor
 n900acad0	at gpio0 offset 7 mask 0x1 #intr 103
 
+# Lock button
+n900lckbtn0	at gpio3 offset 17 mask 0x1 #intr 209
+
 # System Control Module
 omapscm0 	at obio0 addr 0x48002000 size 0x1000
 

Index: src/sys/arch/evbarm/conf/files.n900
diff -u src/sys/arch/evbarm/conf/files.n900:1.2 src/sys/arch/evbarm/conf/files.n900:1.3
--- src/sys/arch/evbarm/conf/files.n900:1.2	Sun Apr 14 19:17:06 2013
+++ src/sys/arch/evbarm/conf/files.n900	Wed Apr 17 01:06:14 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.n900,v 1.2 2013/04/14 19:17:06 khorben Exp $
+#	$NetBSD: files.n900,v 1.3 2013/04/17 01:06:14 khorben Exp $
 #
 # Nokia N900 configuration info
 #
@@ -24,3 +24,8 @@ defparam opt_com.hCONSADDR CONSPEED 
 device n900acad: sysmon_envsys
 attach n900acad at gpio with n900acad
 file	arch/evbarm/n900/n900_acad.c		n900acad
+
+# Lock button
+device n900lckbtn: sysmon_envsys
+attach n900lckbtn at gpio with n900lckbtn
+file	arch/evbarm/n900/n900_lckbtn.c		n900lckbtn

Added files:

Index: src/sys/arch/evbarm/n900/n900_lckbtn.c
diff -u /dev/null src/sys/arch/evbarm/n900/n900_lckbtn.c:1.1
--- /dev/null	Wed Apr 17 01:06:14 2013
+++ src/sys/arch/evbarm/n900/n900_lckbtn.c	Wed Apr 17 01:06:14 2013
@@ -0,0 +1,194 @@
+/*	$NetBSD: n900_lckbtn.c,v 1.1 2013/04/17 01:06:14 khorben Exp $ */
+
+/*
+ * Lock button driver for the Nokia N900.
+ *
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Pierre Pronchery (khor...@defora.org).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: n900_lckbtn.c,v 1.1 2013/04/17 01:06:14 khorben Exp $");
+
+#include 
+#include 
+#include 
+#include 

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

2013-04-16 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Apr 17 00:57:22 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf: N900

Log Message:
Disable com0 for the time being, so that the console defaults to the 
framebuffer.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/N900

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

Modified files:

Index: src/sys/arch/evbarm/conf/N900
diff -u src/sys/arch/evbarm/conf/N900:1.8 src/sys/arch/evbarm/conf/N900:1.9
--- src/sys/arch/evbarm/conf/N900:1.8	Sun Apr 14 19:17:06 2013
+++ src/sys/arch/evbarm/conf/N900	Wed Apr 17 00:57:22 2013
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: N900,v 1.8 2013/04/14 19:17:06 khorben Exp $
+#	$NetBSD: N900,v 1.9 2013/04/17 00:57:22 khorben Exp $
 #
 #	N900 -- Nokia N900 Kernel
 #
@@ -233,9 +233,9 @@ tps65950pm2	at iic0 addr 0x4a
 tps65950pm3	at iic0 addr 0x4b
 
 # On-board 16550 UARTs
-com0		at obio2 addr 0x4902 intr 74 mult 4	# UART3 (console)
+#com0		at obio2 addr 0x4902 intr 74 mult 4	# UART3 (console)
 #options 	CONSADDR=0x4902, CONSPEED=38400
-options 	CONSADDR=0x4902, CONSPEED=115200
+#options 	CONSADDR=0x4902, CONSPEED=115200
 
 # Operating System Timer
 omapmputmr0	at obio2 addr 0x49032000 intr 38	# GP Timer 2



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

2013-04-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Apr 17 00:11:41 UTC 2013

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

Log Message:
Sync DKWEDGE options with XEN3_DOM0.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/conf/XEN3_DOMU

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/XEN3_DOMU
diff -u src/sys/arch/i386/conf/XEN3_DOMU:1.50 src/sys/arch/i386/conf/XEN3_DOMU:1.51
--- src/sys/arch/i386/conf/XEN3_DOMU:1.50	Sat Mar  2 02:42:15 2013
+++ src/sys/arch/i386/conf/XEN3_DOMU	Wed Apr 17 00:11:40 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.50 2013/03/02 02:42:15 christos Exp $
+# $NetBSD: XEN3_DOMU,v 1.51 2013/04/17 00:11:40 riz Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -86,6 +86,13 @@ options 	COMPAT_LINUX	# binary compatibi
 options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)



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

2013-04-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Apr 17 00:09:04 UTC 2013

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOMU

Log Message:
Sync DKWEDGE options with XEN3_DOM0.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/conf/XEN3_DOMU

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.45 src/sys/arch/amd64/conf/XEN3_DOMU:1.46
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.45	Sat Mar  2 02:42:08 2013
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Wed Apr 17 00:09:04 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.45 2013/03/02 02:42:08 christos Exp $
+# $NetBSD: XEN3_DOMU,v 1.46 2013/04/17 00:09:04 riz Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -71,6 +71,13 @@ options 	COMPAT_LINUX32	# req. COMPAT_LI
 options 	EXEC_ELF32
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)



CVS commit: src/sys/compat/linux/common

2013-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 16 23:03:05 UTC 2013

Modified Files:
src/sys/compat/linux/common: linux_futex.c linux_futex.h

Log Message:
Add some more futex gunk and explain why it does not work (yet).
Now skype aborts with a futex timeout, instead of a stack smash leading
to a SEGV.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux/common/linux_futex.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/linux/common/linux_futex.h

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

Modified files:

Index: src/sys/compat/linux/common/linux_futex.c
diff -u src/sys/compat/linux/common/linux_futex.c:1.28 src/sys/compat/linux/common/linux_futex.c:1.29
--- src/sys/compat/linux/common/linux_futex.c:1.28	Thu Nov 17 23:07:44 2011
+++ src/sys/compat/linux/common/linux_futex.c	Tue Apr 16 19:03:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_futex.c,v 1.28 2011/11/18 04:07:44 christos Exp $ */
+/*	$NetBSD: linux_futex.c,v 1.29 2013/04/16 23:03:05 christos Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.28 2011/11/18 04:07:44 christos Exp $");
+__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.29 2013/04/16 23:03:05 christos Exp $");
 
 #include 
 #include 
@@ -67,6 +67,7 @@ struct waiting_proc {
 struct futex {
 	void *f_uaddr;
 	int f_refcount;
+	uint32_t f_bitset;
 	LIST_ENTRY(futex) f_list;
 	TAILQ_HEAD(, waiting_proc) f_waiting_proc;
 	TAILQ_HEAD(, waiting_proc) f_requeue_proc;
@@ -105,7 +106,7 @@ linux_futex_fini(void)
 
 static struct waiting_proc *futex_wp_alloc(void);
 static void futex_wp_free(struct waiting_proc *);
-static struct futex *futex_get(void *);
+static struct futex *futex_get(void *, uint32_t);
 static void futex_ref(struct futex *);
 static void futex_put(struct futex *);
 static int futex_sleep(struct futex **, lwp_t *, int, struct waiting_proc *);
@@ -127,7 +128,7 @@ linux_sys_futex(struct lwp *l, const str
 	struct timespec ts = { 0, 0 };
 	int error;
 
-	if ((SCARG(uap, op) & ~LINUX_FUTEX_PRIVATE_FLAG) == LINUX_FUTEX_WAIT &&
+	if ((SCARG(uap, op) & LINUX_FUTEX_CMD_MASK) == LINUX_FUTEX_WAIT &&
 	SCARG(uap, timeout) != NULL) {
 		if ((error = copyin(SCARG(uap, timeout), 
 		tv_sec,
 		ts->tv_nsec));
 
-		if ((error = itimespecfix(ts)) != 0) {
-			FUTEX_SYSTEM_UNLOCK;
-			return error;
-		}
-		timeout_hz = tstohz(ts);
-
-		/*
-		 * If the user process requests a non null timeout,
-		 * make sure we do not turn it into an infinite
-		 * timeout because timeout_hz is 0.
-		 *
-		 * We use a minimal timeout of 1/hz. Maybe it would make
-		 * sense to just return ETIMEDOUT without sleeping.
-		 */
-		if (SCAR

CVS commit: src/tests/kernel

2013-04-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Apr 16 22:05:45 UTC 2013

Modified Files:
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: t_umountstress.sh

Log Message:
First attempt at stress testing umount of a busy disk.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_umountstress.sh

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

Modified files:

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.32 src/tests/kernel/Makefile:1.33
--- src/tests/kernel/Makefile:1.32	Thu Feb 28 15:31:22 2013
+++ src/tests/kernel/Makefile	Tue Apr 16 22:05:44 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2013/02/28 15:31:22 martin Exp $
+# $NetBSD: Makefile,v 1.33 2013/04/16 22:05:44 mlelstv Exp $
 
 NOMAN=		# defined
 
@@ -16,6 +16,7 @@ TESTS_C+=	t_subr_prf
 TESTS_C+=	t_kauth_pr_47598
 
 TESTS_SH=	t_umount
+TESTS_SH+=	t_umountstress
 TESTS_SH+=	t_ps_strings
 
 BINDIR=		${TESTSDIR}

Added files:

Index: src/tests/kernel/t_umountstress.sh
diff -u /dev/null src/tests/kernel/t_umountstress.sh:1.1
--- /dev/null	Tue Apr 16 22:05:45 2013
+++ src/tests/kernel/t_umountstress.sh	Tue Apr 16 22:05:44 2013
@@ -0,0 +1,113 @@
+# $NetBSD: t_umountstress.sh,v 1.1 2013/04/16 22:05:44 mlelstv Exp $
+#
+# Copyright (c) 2013 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.
+#
+
+TMPMP=umount-stress_mount
+TMPIM=umount-stress.im
+
+VND=vnd0
+BVND=/dev/${VND}
+CVND=/dev/r${VND}
+MPART=a
+
+atf_test_case umountstress cleanup
+umountstress_head()
+{
+	atf_set "descr" "Checks stressing unmounting a busy filesystem"
+	atf_set "require.user" "root"
+}
+umountstress_body()
+{
+	cat >disktab &1); then
+			kill $busypid
+			wait
+			atf_fail "Unmount succeeded while busy"
+		else
+			case $err in
+			*:\ Device\ busy)
+;;
+			*)
+kill $busypid
+wait
+atf_fail "Unmount failed: $err"
+;;
+			esac
+		fi
+	done
+	wait
+}
+umountstress_cleanup()
+{
+	echo "*** Cleaning up ${TMPMP}, ${TMPIM}."
+	umount -f "${TMPMP}"
+	vnconfig -u "${VND}"
+}
+
+atf_init_test_cases()
+{
+	atf_add_test_case umountstress
+}



CVS commit: src

2013-04-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 16 21:44:08 UTC 2013

Modified Files:
src/common/lib/libc/stdlib: _strtol.h _strtoul.h strtoll.c strtoull.c
strtoumax.c
src/include: inttypes.h stdlib.h
src/lib/libc: shlib_version
src/lib/libc/citrus: citrus_bcs_strtol.c citrus_bcs_strtoul.c
src/lib/libc/include: namespace.h
src/lib/libc/stdlib: strtoimax.c

Log Message:
Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/stdlib/_strtol.h \
src/common/lib/libc/stdlib/_strtoul.h
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/stdlib/strtoll.c
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/stdlib/strtoull.c \
src/common/lib/libc/stdlib/strtoumax.c
cvs rdiff -u -r1.8 -r1.9 src/include/inttypes.h
cvs rdiff -u -r1.100 -r1.101 src/include/stdlib.h
cvs rdiff -u -r1.239 -r1.240 src/lib/libc/shlib_version
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_bcs_strtol.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_bcs_strtoul.c
cvs rdiff -u -r1.157 -r1.158 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/strtoimax.c

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

Modified files:

Index: src/common/lib/libc/stdlib/_strtol.h
diff -u src/common/lib/libc/stdlib/_strtol.h:1.4 src/common/lib/libc/stdlib/_strtol.h:1.5
--- src/common/lib/libc/stdlib/_strtol.h:1.4	Tue Apr 16 19:34:57 2013
+++ src/common/lib/libc/stdlib/_strtol.h	Tue Apr 16 21:44:06 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtol.h,v 1.4 2013/04/16 19:34:57 joerg Exp $ */
+/* $NetBSD: _strtol.h,v 1.5 2013/04/16 21:44:06 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -41,9 +41,19 @@
  *  __INT_MIN : lower limit of the return type
  *  __INT_MAX : upper limit of the return type
  */
-
+#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
 __INT
 _FUNCNAME(const char *nptr, char **endptr, int base)
+#else
+#include 
+#include "setlocale_local.h"
+#define INT_FUNCNAME_(pre, name, post)	pre ## name ## post
+#define INT_FUNCNAME(pre, name, post)	INT_FUNCNAME_(pre, name, post)
+
+static __INT
+INT_FUNCNAME(_int_, _FUNCNAME, _l)(const char *nptr, char **endptr,
+   int base, locale_t loc)
+#endif
 {
 	const char *s;
 	__INT acc, cutoff;
@@ -72,9 +82,15 @@ _FUNCNAME(const char *nptr, char **endpt
 	 * assume decimal; if base is already 16, allow 0x.
 	 */
 	s = nptr;
+#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
 	do {
 		c = *s++;
 	} while (isspace(c));
+#else
+	do {
+		c = *s++;
+	} while (isspace_l(c, loc));
+#endif
 	if (c == '-') {
 		neg = 1;
 		c = *s++;
@@ -169,3 +185,19 @@ _FUNCNAME(const char *nptr, char **endpt
 		*endptr = __UNCONST(any ? s - 1 : nptr);
 	return(acc);
 }
+
+#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(HAVE_NBTOOL_CONFIG_H)
+__INT
+_FUNCNAME(const char *nptr, char **endptr, int base)
+{
+	return INT_FUNCNAME(_int_, _FUNCNAME, _l)(nptr, endptr, base, *_current_locale());
+}
+
+__INT
+INT_FUNCNAME(, _FUNCNAME, _l)(const char *nptr, char **endptr, int base, locale_t loc)
+{
+	if (loc == NULL)
+		loc = _C_locale;
+	return INT_FUNCNAME(_int_, _FUNCNAME, _l)(nptr, endptr, base, loc);
+}
+#endif
Index: src/common/lib/libc/stdlib/_strtoul.h
diff -u src/common/lib/libc/stdlib/_strtoul.h:1.4 src/common/lib/libc/stdlib/_strtoul.h:1.5
--- src/common/lib/libc/stdlib/_strtoul.h:1.4	Tue Apr 16 19:34:58 2013
+++ src/common/lib/libc/stdlib/_strtoul.h	Tue Apr 16 21:44:06 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtoul.h,v 1.4 2013/04/16 19:34:58 joerg Exp $ */
+/* $NetBSD: _strtoul.h,v 1.5 2013/04/16 21:44:06 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -40,9 +40,19 @@
  *  __UINT : return type
  *  __UINT_MAX : upper limit of the return type
  */
-
+#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
 __UINT
 _FUNCNAME(const char *nptr, char **endptr, int base)
+#else
+#include 
+#include "setlocale_local.h"
+#define INT_FUNCNAME_(pre, name, post)	pre ## name ## post
+#define INT_FUNCNAME(pre, name, post)	INT_FUNCNAME_(pre, name, post)
+
+static __UINT
+INT_FUNCNAME(_int_, _FUNCNAME, _l)(const char *nptr, char **endptr,
+   int base, locale_t loc)
+#endif
 {
 	const char *s;
 	__UINT acc, cutoff;
@@ -68,9 +78,15 @@ _FUNCNAME(const char *nptr, char **endpt
 	 * assume decimal; if base is already 16, allow 0x.
 	 */
 	s = nptr;
+#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
 	do {
 		c = *s++;
 	} while (isspace(c));
+#else
+	do {
+		c = *s++;
+	} while (isspace_l(c, loc));
+#endif
 	if (c == '-') {
 		neg = 1;
 		c = *s++;
@@ -128,3 +144,19 @@ _FUNCNAME(const char *nptr, char **endpt
 		*endptr = __UNCONST(any ? s - 1 : nptr);
 	return(a

CVS commit: src/sys/kern

2013-04-16 Thread Lars Heidieker
Module Name:src
Committed By:   para
Date:   Tue Apr 16 21:13:39 UTC 2013

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

Log Message:
addresses PR/47512
properly return NULL for failed allocations not 0x8 with size checks enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/subr_kmem.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/subr_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.46 src/sys/kern/subr_kmem.c:1.47
--- src/sys/kern/subr_kmem.c:1.46	Sat Jul 21 11:45:04 2012
+++ src/sys/kern/subr_kmem.c	Tue Apr 16 21:13:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.46 2012/07/21 11:45:04 para Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.47 2013/04/16 21:13:38 para Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.46 2012/07/21 11:45:04 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.47 2013/04/16 21:13:38 para Exp $");
 
 #include 
 #include 
@@ -226,8 +226,10 @@ kmem_intr_alloc(size_t size, km_flag_t k
 		kmem_poison_check(p, size);
 		FREECHECK_OUT(&kmem_freecheck, p);
 		kmem_size_set(p, size);
+
+		return p + SIZE_SIZE;
 	}
-	return p + SIZE_SIZE;
+	return p;
 }
 
 /*



CVS commit: src/sys/dev/scsipi

2013-04-16 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Apr 16 21:01:09 UTC 2013

Modified Files:
src/sys/dev/scsipi: sd.c

Log Message:
Clamp sectors per unit in the default disklabel to the maximum value,
instead of allowing it to wrap, as is already done in wd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 src/sys/dev/scsipi/sd.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/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.298 src/sys/dev/scsipi/sd.c:1.299
--- src/sys/dev/scsipi/sd.c:1.298	Thu Apr 19 17:45:20 2012
+++ src/sys/dev/scsipi/sd.c	Tue Apr 16 21:01:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.298 2012/04/19 17:45:20 bouyer Exp $	*/
+/*	$NetBSD: sd.c,v 1.299 2013/04/16 21:01:09 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.298 2012/04/19 17:45:20 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.299 2013/04/16 21:01:09 jakllsch Exp $");
 
 #include "opt_scsi.h"
 
@@ -1319,7 +1319,10 @@ sdgetdefaultlabel(struct sd_softc *sd, s
 	 */
 	strncpy(lp->d_typename, sd->name, 16);
 	strncpy(lp->d_packname, "fictitious", 16);
-	lp->d_secperunit = sd->params.disksize;
+	if (sd->params.disksize > UINT32_MAX)
+		lp->d_secperunit = UINT32_MAX;
+	else
+		lp->d_secperunit = sd->params.disksize;
 	lp->d_rpm = sd->params.rot_rate;
 	lp->d_interleave = 1;
 	lp->d_flags = sd->sc_periph->periph_flags & PERIPH_REMOVABLE ?



CVS commit: src/common/lib/libc/stdlib

2013-04-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 16 19:34:58 UTC 2013

Modified Files:
src/common/lib/libc/stdlib: _strtol.h _strtoul.h

Log Message:
Do not use isalpha here, since we explicitly only support the Portable
Character Set as base and in theory a locale could define a ASCII
control character as letter, resulting in negations. Also avoid isdigit
here to give the compiler a better chance of deciding whether an
unsigned compare or a jump table is a better option, both are very
likely better choices than the memory indirection.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/stdlib/_strtol.h \
src/common/lib/libc/stdlib/_strtoul.h

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

Modified files:

Index: src/common/lib/libc/stdlib/_strtol.h
diff -u src/common/lib/libc/stdlib/_strtol.h:1.3 src/common/lib/libc/stdlib/_strtol.h:1.4
--- src/common/lib/libc/stdlib/_strtol.h:1.3	Fri Mar  9 15:41:16 2012
+++ src/common/lib/libc/stdlib/_strtol.h	Tue Apr 16 19:34:57 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtol.h,v 1.3 2012/03/09 15:41:16 christos Exp $ */
+/* $NetBSD: _strtol.h,v 1.4 2013/04/16 19:34:57 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -120,10 +120,12 @@ _FUNCNAME(const char *nptr, char **endpt
 		cutlim = -cutlim;
 	}
 	for (acc = 0, any = 0;; c = *s++) {
-		if (isdigit(c))
+		if (c >= '0' && c <= '9')
 			i = c - '0';
-		else if (isalpha(c))
-			i = c - (isupper(c) ? 'A' - 10 : 'a' - 10);
+		else if (c >= 'a' && c <= 'z')
+			i = (c - 'a') + 10;
+		else if (c >= 'A' && c <= 'Z')
+			i = (c - 'A') + 10;
 		else
 			break;
 		if (i >= base)
Index: src/common/lib/libc/stdlib/_strtoul.h
diff -u src/common/lib/libc/stdlib/_strtoul.h:1.3 src/common/lib/libc/stdlib/_strtoul.h:1.4
--- src/common/lib/libc/stdlib/_strtoul.h:1.3	Thu Mar 22 15:57:29 2012
+++ src/common/lib/libc/stdlib/_strtoul.h	Tue Apr 16 19:34:58 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtoul.h,v 1.3 2012/03/22 15:57:29 christos Exp $ */
+/* $NetBSD: _strtoul.h,v 1.4 2013/04/16 19:34:58 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -94,10 +94,12 @@ _FUNCNAME(const char *nptr, char **endpt
 	cutoff = ((__UINT)__UINT_MAX / (__UINT)base);
 	cutlim = (int)((__UINT)__UINT_MAX % (__UINT)base);
 	for (acc = 0, any = 0;; c = *s++) {
-		if (isdigit(c))
+		if (c >= '0' && c <= '9')
 			i = c - '0';
-		else if (isalpha(c))
-			i = c - (isupper(c) ? 'A' - 10 : 'a' - 10);
+		else if (c >= 'a' && c <= 'z')
+			i = (c - 'a') + 10;
+		else if (c >= 'A' && c <= 'Z')
+			i = (c - 'A') + 10;
 		else
 			break;
 		if (i >= base)



CVS commit: src

2013-04-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 16 16:52:13 UTC 2013

Modified Files:
src/include: inttypes.h wchar.h
src/lib/libc/locale: _wcstol.h _wcstoul.h

Log Message:
Add support for wcstoimax_l and friends.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/include/inttypes.h
cvs rdiff -u -r1.31 -r1.32 src/include/wchar.h
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/_wcstol.h \
src/lib/libc/locale/_wcstoul.h

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

Modified files:

Index: src/include/inttypes.h
diff -u src/include/inttypes.h:1.7 src/include/inttypes.h:1.8
--- src/include/inttypes.h:1.7	Sun Nov 15 22:21:03 2009
+++ src/include/inttypes.h	Tue Apr 16 16:52:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: inttypes.h,v 1.7 2009/11/15 22:21:03 christos Exp $	*/
+/*	$NetBSD: inttypes.h,v 1.8 2013/04/16 16:52:13 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -59,6 +59,17 @@ typedef struct {
 } imaxdiv_t;
 
 imaxdiv_t	imaxdiv(intmax_t, intmax_t);
+
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
+#  ifndef __LOCALE_T_DECLARED
+typedef struct _locale		*locale_t;
+#  define __LOCALE_T_DECLARED
+#  endif
+intmax_t	wcstoimax_l(const wchar_t * __restrict,
+		wchar_t ** __restrict, int, locale_t);
+uintmax_t	wcstoumax_l(const wchar_t * __restrict,
+		wchar_t ** __restrict, int, locale_t);
+#endif
 __END_DECLS
 
 #endif /* !_INTTYPES_H_ */

Index: src/include/wchar.h
diff -u src/include/wchar.h:1.31 src/include/wchar.h:1.32
--- src/include/wchar.h:1.31	Tue Apr 16 11:55:02 2013
+++ src/include/wchar.h	Tue Apr 16 16:52:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wchar.h,v 1.31 2013/04/16 11:55:02 joerg Exp $	*/
+/*	$NetBSD: wchar.h,v 1.32 2013/04/16 16:52:13 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -211,6 +211,16 @@ __END_DECLS
 typedef struct _locale		*locale_t;
 #  define __LOCALE_T_DECLARED
 #  endif
+long int wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
+		  locale_t);
+unsigned long int wcstoul_l(const wchar_t * __restrict,
+	wchar_t ** __restrict, int, locale_t);
+/* LONGLONG */
+long long int wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int,
+			locale_t);
+/* LONGLONG */
+unsigned long long int wcstoull_l(const wchar_t * __restrict,
+  wchar_t ** __restrict, int, locale_t);
 int	wcwidth_l(wchar_t, locale_t);
 int	wcswidth_l(const wchar_t *, size_t, locale_t);
 #endif

Index: src/lib/libc/locale/_wcstol.h
diff -u src/lib/libc/locale/_wcstol.h:1.4 src/lib/libc/locale/_wcstol.h:1.5
--- src/lib/libc/locale/_wcstol.h:1.4	Mon Jun 25 22:32:44 2012
+++ src/lib/libc/locale/_wcstol.h	Tue Apr 16 16:52:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _wcstol.h,v 1.4 2012/06/25 22:32:44 abs Exp $ */
+/* $NetBSD: _wcstol.h,v 1.5 2013/04/16 16:52:13 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -44,8 +44,14 @@
  *  __INT_MAX : upper limit of the return type
  */
 
-__INT
-_FUNCNAME(const wchar_t *nptr, wchar_t **endptr, int base)
+#include 
+#include "setlocale_local.h"
+#define INT_FUNCNAME_(pre, name, post)	pre ## name ## post
+#define INT_FUNCNAME(pre, name, post)	INT_FUNCNAME_(pre, name, post)
+
+static __INT
+INT_FUNCNAME(_int_, _FUNCNAME, _l)(const wchar_t *nptr, wchar_t **endptr,
+   int base, locale_t loc)
 {
 	const wchar_t *s;
 	__INT acc, cutoff;
@@ -74,7 +80,7 @@ _FUNCNAME(const wchar_t *nptr, wchar_t *
 	s = nptr;
 	do {
 		wc = (wchar_t) *s++;
-	} while (iswspace(wc));
+	} while (iswspace_l(wc, loc));
 	if (wc == L'-') {
 		neg = 1;
 		wc = *s++;
@@ -139,3 +145,19 @@ _FUNCNAME(const wchar_t *nptr, wchar_t *
 		*endptr = __UNCONST(any ? s - 1 : nptr);
 	return (acc);
 }
+
+__INT
+_FUNCNAME(const wchar_t *nptr, wchar_t **endptr, int base)
+{
+	return INT_FUNCNAME(_int_, _FUNCNAME, _l)(nptr, endptr, base,
+		  *_current_locale());
+}
+
+__INT
+INT_FUNCNAME(, _FUNCNAME, _l)(const wchar_t *nptr, wchar_t **endptr,
+			  int base, locale_t loc)
+{
+	if (loc == NULL)
+		loc = _C_locale;
+	return INT_FUNCNAME(_int_, _FUNCNAME, _l)(nptr, endptr, base, loc);
+}
Index: src/lib/libc/locale/_wcstoul.h
diff -u src/lib/libc/locale/_wcstoul.h:1.4 src/lib/libc/locale/_wcstoul.h:1.5
--- src/lib/libc/locale/_wcstoul.h:1.4	Mon Jun 25 22:32:44 2012
+++ src/lib/libc/locale/_wcstoul.h	Tue Apr 16 16:52:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _wcstoul.h,v 1.4 2012/06/25 22:32:44 abs Exp $ */
+/* $NetBSD: _wcstoul.h,v 1.5 2013/04/16 16:52:13 joerg Exp $ */
 
 /*
  * Copyright (c) 1990, 1993
@@ -43,8 +43,14 @@
  *  __UINT_MAX : upper limit of the return type
  */
 
-__UINT
-_FUNCNAME(const wchar_t *nptr, wchar_t **endptr, int base)
+#include 
+#include "setlocale_local.h"
+#define INT_FUNCNAME_(pre, name, post)	pre ## name ## post
+#define INT_FUNCNAME(pre, name, post)	INT_FUNCNAME_(pre, name, post)
+
+static __UINT
+INT_FUNCNAME(_int_, _FUNCNAME, _l)(const wchar_t *nptr, wchar_t **endptr,
+   int base

CVS commit: src/sys/dev/pci

2013-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 16 15:50:58 UTC 2013

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
Decode some PCIe capability register bits.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/pcireg.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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.98 src/sys/dev/pci/pci_subr.c:1.99
--- src/sys/dev/pci/pci_subr.c:1.98	Tue Apr 16 14:34:34 2013
+++ src/sys/dev/pci/pci_subr.c	Tue Apr 16 15:50:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.98 2013/04/16 14:34:34 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.99 2013/04/16 15:50:58 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.98 2013/04/16 14:34:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.99 2013/04/16 15:50:58 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -809,15 +809,67 @@ pci_conf_print_type0(
 }
 
 static void
+pci_print_pcie_L0s_latency(uint32_t val)
+{
+
+	switch (val) {
+	case 0x0:
+		printf("Less than 64ns\n");
+		break;
+	case 0x1:
+	case 0x2:
+	case 0x3:
+		printf("%dns to less than %dns\n", 32 << val, 32 << (val + 1));
+		break;
+	case 0x4:
+		printf("512ns to less than 1us\n");
+		break;
+	case 0x5:
+		printf("1us to less than 2us\n");
+		break;
+	case 0x6:
+		printf("2us - 4us\n");
+		break;
+	case 0x7:
+		printf("More than 4us\n");
+		break;
+	}
+}
+
+static void
+pci_print_pcie_L1_latency(uint32_t val)
+{
+
+	switch (val) {
+	case 0x0:
+		printf("Less than 1us\n");
+		break;
+	case 0x6:
+		printf("32us - 64us\n");
+		break;
+	case 0x7:
+		printf("More than 64us\n");
+		break;
+	default:
+		printf("%dus to less than %dus\n", 1 << (val - 1), 1 << val);
+		break;
+	}
+}
+
+static void
 pci_conf_print_pcie_cap(const pcireg_t *regs, int capoff)
 {
+	pcireg_t val;
 	bool check_slot = false;
 	static const char * const linkspeeds[] = {"2.5", "5.0", "8.0"};
 
 	printf("\n  PCI Express Capabilities Register\n");
-	printf("Capability version: %x\n",
+	/* Capability Register */
+	printf("Capability register: %04x\n",
+	regs[o2i(capoff)] >> 16);
+	printf("  Capability version: %x\n",
 	(unsigned int)((regs[o2i(capoff)] & 0x000f) >> 16));
-	printf("Device type: ");
+	printf("  Device type: ");
 	switch ((regs[o2i(capoff)] & 0x00f0) >> 20) {
 	case 0x0:
 		printf("PCI Express Endpoint device\n");
@@ -853,9 +905,123 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		break;
 	}
 	if (check_slot && (regs[o2i(capoff)] & 0x0100) != 0)
-		printf("Slot implemented\n");
-	printf("Interrupt Message Number: %x\n",
+		printf("  Slot implemented\n");
+	printf("  Interrupt Message Number: %x\n",
 	(unsigned int)((regs[o2i(capoff)] & PCI_PCIE_XCAP_IRQ) >> 27));
+
+	/* Device Capability Register */
+	printf("Device Capabilities Register: 0x%08x\n",
+	regs[o2i(capoff + PCI_PCIE_DCAP)]);
+	printf("  Max Payload Size Supported: %u bytes max\n",
+	(unsigned int)(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_MAX_PAYLOAD) * 256);
+	printf("  Phantom Functions Supported: ");
+	switch ((regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_PHANTOM_FUNCS) >> 3) {
+	case 0x0:
+		printf("not available\n");
+		break;
+	case 0x1:
+		printf("MSB\n");
+		break;
+	case 0x2:
+		printf("two MSB\n");
+		break;
+	case 0x3:
+		printf("All three bits\n");
+		break;
+	}
+	printf("  Extended Tag Field Supported: %dbit\n",
+	(regs[o2i(capoff + PCI_PCIE_DCAP)] & PCI_PCIE_DCAP_EXT_TAG_FIELD)
+	== 0 ? 5 : 8);
+	printf("  Endpoint L0 Acceptable Latency: ");
+	pci_print_pcie_L0s_latency((regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_L0S_LATENCY) >> 6);
+	printf("  Endpoint L1 Acceptable Latency: ");
+	pci_print_pcie_L1_latency((regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_L1_LATENCY) >> 9);
+	printf("  Attention Button Present: %s\n",
+	(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_ATTN_BUTTON) != 0 ? "yes" : "no");
+	printf("  Attention Indicator Present: %s\n",
+	(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_ATTN_IND) != 0 ? "yes" : "no");
+	printf("  Power Indicator Present: %s\n",
+	(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_PWR_IND) != 0 ? "yes" : "no");
+	printf("  Role-Based Error Report: %s\n",
+	(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_ROLE_ERR_RPT) != 0 ? "yes" : "no");
+	printf("  Captured Slot Power Limit Value: %d\n",
+	(unsigned int)(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_SLOT_PWR_LIM_VAL) >> 18);
+	printf("  Captured Slot Power Limit Scale: %d\n",
+	(unsigned int)(regs[o2i(capoff + PCI_PCIE_DCAP)]
+		& PCI_PCIE_DCAP_SLO

CVS commit: src/sys/modules/compat

2013-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 16 15:30:09 UTC 2013

Modified Files:
src/sys/modules/compat: Makefile

Log Message:
remove dup


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/compat/Makefile

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

Modified files:

Index: src/sys/modules/compat/Makefile
diff -u src/sys/modules/compat/Makefile:1.8 src/sys/modules/compat/Makefile:1.9
--- src/sys/modules/compat/Makefile:1.8	Tue Apr 16 11:21:33 2013
+++ src/sys/modules/compat/Makefile	Tue Apr 16 11:30:09 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2013/04/16 15:21:33 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2013/04/16 15:30:09 christos Exp $
 
 .include "../Makefile.inc"
 
@@ -37,7 +37,6 @@ SRCS+=	vfs_syscalls_43.c vm_12.c vm_43.c
 SRCS+=	sysv_msg_50.c sysv_sem_50.c kern_time_50.c
 SRCS+=	sysv_shm_50.c vfs_syscalls_50.c sysv_ipc_50.c
 SRCS+=	tty_60.c kern_time_60.c
-SRCS+=	kern_time_60.c
 
 .PATH:	${S}/arch/${MACHINE}/${MACHINE}
 .PATH:	${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}



CVS commit: src/sys/modules/compat

2013-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 16 15:21:33 UTC 2013

Modified Files:
src/sys/modules/compat: Makefile

Log Message:
add missing file


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/modules/compat/Makefile

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

Modified files:

Index: src/sys/modules/compat/Makefile
diff -u src/sys/modules/compat/Makefile:1.7 src/sys/modules/compat/Makefile:1.8
--- src/sys/modules/compat/Makefile:1.7	Mon Jan 21 20:48:34 2013
+++ src/sys/modules/compat/Makefile	Tue Apr 16 11:21:33 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2013/01/22 01:48:34 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2013/04/16 15:21:33 christos Exp $
 
 .include "../Makefile.inc"
 
@@ -36,6 +36,8 @@ SRCS+=	vfs_syscalls_20.c vfs_syscalls_30
 SRCS+=	vfs_syscalls_43.c vm_12.c vm_43.c compat_mod.c
 SRCS+=	sysv_msg_50.c sysv_sem_50.c kern_time_50.c
 SRCS+=	sysv_shm_50.c vfs_syscalls_50.c sysv_ipc_50.c
+SRCS+=	tty_60.c kern_time_60.c
+SRCS+=	kern_time_60.c
 
 .PATH:	${S}/arch/${MACHINE}/${MACHINE}
 .PATH:	${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}



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

2013-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 16 15:03:18 UTC 2013

Modified Files:
src/distrib/sets/lists/debug: ad.mips64eb ad.mips64el md.amd64
md.sparc64

Log Message:
fix obsolete npf shared objects


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/debug/ad.mips64eb \
src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/debug/ad.mips64el
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/lists/debug/md.sparc64

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/debug/ad.mips64eb
diff -u src/distrib/sets/lists/debug/ad.mips64eb:1.20 src/distrib/sets/lists/debug/ad.mips64eb:1.21
--- src/distrib/sets/lists/debug/ad.mips64eb:1.20	Thu Apr 11 13:43:19 2013
+++ src/distrib/sets/lists/debug/ad.mips64eb	Tue Apr 16 11:03:18 2013
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.20 2013/04/11 17:43:19 christos Exp $
+# $NetBSD: ad.mips64eb,v 1.21 2013/04/16 15:03:18 christos Exp $
 ./usr/libdata/debug/lib/64/npf/ext_log.so.0.0.debug	comp-npf-debug		debug,compat
 ./usr/libdata/debug/lib/64/npf/ext_normalize.so.0.0.debug	comp-npf-debug		debug,compat
 ./usr/libdata/debug/lib/64/npf/ext_rndblock.so.0.0.debug	comp-npf-debug		debug,compat
@@ -37,6 +37,9 @@
 ./usr/libdata/debug/usr/lib/64/npf/ext_log.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/64/npf/ext_normalise.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/64/npf/ext_rndblock.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/64/npf/libext_log.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/64/npf/libext_normalise.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/64/npf/libext_rndblock.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/64/libamu.so.4.0.debug		comp-amd-debug	debug,compat
 ./usr/libdata/debug/usr/lib/64/libarchive.so.3.1.debug	comp-sys-debug	debug,compat
 ./usr/libdata/debug/usr/lib/64/libasn1.so.8.0.debug		comp-compat-shlib	compat,pic,kerberos,debug,obsolete
@@ -201,6 +204,9 @@
 ./usr/libdata/debug/usr/lib/o32/npf/ext_log.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/o32/npf/ext_normalise.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/o32/npf/ext_rndblock.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/o32/npf/libext_log.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/o32/npf/libext_normalise.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/o32/npf/libext_rndblock.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/o32/libamu.so.4.0.debug		comp-amd-debug	debug,compat
 ./usr/libdata/debug/usr/lib/o32/libarchive.so.3.1.debug	comp-sys-debug	debug,compat
 ./usr/libdata/debug/usr/lib/o32/libasn1.so.8.0.debug		comp-compat-shlib	compat,pic,kerberos,debug,obsolete
Index: src/distrib/sets/lists/debug/md.amd64
diff -u src/distrib/sets/lists/debug/md.amd64:1.20 src/distrib/sets/lists/debug/md.amd64:1.21
--- src/distrib/sets/lists/debug/md.amd64:1.20	Thu Apr 11 13:43:19 2013
+++ src/distrib/sets/lists/debug/md.amd64	Tue Apr 16 11:03:18 2013
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.20 2013/04/11 17:43:19 christos Exp $
+# $NetBSD: md.amd64,v 1.21 2013/04/16 15:03:18 christos Exp $
 ./usr/libdata/debug/lib/i386/npf/ext_log.so.0.0.debug	comp-npf-debug		debug,compat
 ./usr/libdata/debug/lib/i386/npf/ext_normalize.so.0.0.debug	comp-npf-debug		debug,compat
 ./usr/libdata/debug/lib/i386/npf/ext_rndblock.so.0.0.debug	comp-npf-debug		debug,compat
@@ -32,6 +32,9 @@
 ./usr/libdata/debug/usr/lib/i386/npf/ext_log.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/i386/npf/ext_normalise.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/i386/npf/ext_rndblock.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/i386/npf/libext_log.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/i386/npf/libext_normalise.so.0.0.debug	comp-obsolete	obsolete
+./usr/libdata/debug/usr/lib/i386/npf/libext_rndblock.so.0.0.debug	comp-obsolete	obsolete
 ./usr/libdata/debug/usr/lib/i386/libamu.so.4.0.debug	comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/i386/libarchive.so.3.1.debug	comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/i386/libasn1.so.8.0.debug	comp-compat-shlib	compat,pic,kerberos,debug,obsolete

Index: src/distrib/sets/lists/debug/ad.mips64el
diff -u src/distrib/sets/lists/debug/ad.mips64el:1.21 src/distrib/sets/lists/debug/ad.mips64el:1.22
--- src/distrib/sets/lists/debug/ad.mips64el:1.21	Thu Apr 11 13:43:19 2013
+++ src/distrib/sets/lists/debug/ad.mips64el	Tue Apr 16 11:03:18 2013
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.21 2013/04/11 17:43:19 christos Exp $
+# $NetBSD: ad.mips64el,v 1.22 2013/04/16 15:03:18 christos Exp $
 ./usr/libdata/debug/lib/64/npf/ext_log.so.0.0.debug	comp-npf-debug		de

CVS commit: src/sys/dev/pci

2013-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 16 14:34:35 UTC 2013

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

Log Message:
Use macro.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/pci_subr.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/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.97 src/sys/dev/pci/pci_subr.c:1.98
--- src/sys/dev/pci/pci_subr.c:1.97	Tue Apr 16 09:13:04 2013
+++ src/sys/dev/pci/pci_subr.c	Tue Apr 16 14:34:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.97 2013/04/16 09:13:04 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.98 2013/04/16 14:34:34 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.97 2013/04/16 09:13:04 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.98 2013/04/16 14:34:34 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -857,46 +857,51 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	printf("Interrupt Message Number: %x\n",
 	(unsigned int)((regs[o2i(capoff)] & PCI_PCIE_XCAP_IRQ) >> 27));
 	printf("Link Capabilities Register: 0x%08x\n",
-	regs[o2i(capoff + 0x0c)]);
+	regs[o2i(capoff + PCI_PCIE_LCAP)]);
 	printf("  Maximum Link Speed: ");
-	if ((regs[o2i(capoff + 0x0c)] & 0x000f) < 1 ||
-	(regs[o2i(capoff + 0x0c)] & 0x000f) > 3) {
+	if ((regs[o2i(capoff + PCI_PCIE_LCAP)] & 0x000f) < 1 ||
+	(regs[o2i(capoff + PCI_PCIE_LCAP)] & 0x000f) > 3) {
 		printf("unknown %u value\n", 
-		(regs[o2i(capoff + 0x0c)] & 0x000f));
+		(regs[o2i(capoff + PCI_PCIE_LCAP)] & 0x000f));
 	} else {
-		printf("%sGb/s\n", linkspeeds[(regs[o2i(capoff + 0x0c)] & 0x000f) - 1]);
+		printf("%sGb/s\n",
+		linkspeeds[(regs[o2i(capoff + PCI_PCIE_LCAP)] & 0x000f)
+			- 1]);
 	}
 	printf("  Maximum Link Width: x%u lanes\n",
-	(regs[o2i(capoff + 0x0c)] & 0x03f0) >> 4);
-	printf("  Port Number: %u\n", regs[o2i(capoff + 0x0c)] >> 24);
+	(regs[o2i(capoff + PCI_PCIE_LCAP)] & 0x03f0) >> 4);
+	printf("  Port Number: %u\n",
+	regs[o2i(capoff + PCI_PCIE_LCAP)] >> 24);
 	printf("Link Status Register: 0x%04x\n",
-	regs[o2i(capoff + 0x10)] >> 16);
+	regs[o2i(capoff + PCI_PCIE_LCSR)] >> 16);
 	printf("  Negotiated Link Speed: ");
-	if (((regs[o2i(capoff + 0x10)] >> 16) & 0x000f) < 1 ||
-	((regs[o2i(capoff + 0x10)] >> 16) & 0x000f) > 3) {
+	if (((regs[o2i(capoff + PCI_PCIE_LCSR)] >> 16) & 0x000f) < 1 ||
+	((regs[o2i(capoff + PCI_PCIE_LCSR)] >> 16) & 0x000f) > 3) {
 		printf("unknown %u value\n", 
-		(regs[o2i(capoff + 0x10)] >> 16) & 0x000f);
+		(regs[o2i(capoff + PCI_PCIE_LCSR)] >> 16) & 0x000f);
 	} else {
-		printf("%sGb/s\n", linkspeeds[((regs[o2i(capoff + 0x10)] >> 16) & 0x000f) - 1]);
+		printf("%sGb/s\n",
+		linkspeeds[((regs[o2i(capoff + PCI_PCIE_LCSR)] >> 16)
+& 0x000f) - 1]);
 	}
 	printf("  Negotiated Link Width: x%u lanes\n",
-	(regs[o2i(capoff + 0x10)] >> 20) & 0x003f);
-	if ((regs[o2i(capoff + 0x18)] & 0x07ff) != 0) {
+	(regs[o2i(capoff + PCI_PCIE_LCSR)] >> 20) & 0x003f);
+	if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x07ff) != 0) {
 		printf("Slot Control Register:\n");
-		if ((regs[o2i(capoff + 0x18)] & 0x0001) != 0)
+		if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0001) != 0)
 			printf("  Attention Button Pressed Enabled\n");
-		if ((regs[o2i(capoff + 0x18)] & 0x0002) != 0)
+		if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0002) != 0)
 			printf("  Power Fault Detected Enabled\n");
-		if ((regs[o2i(capoff + 0x18)] & 0x0004) != 0)
+		if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0004) != 0)
 			printf("  MRL Sensor Changed Enabled\n");
-		if ((regs[o2i(capoff + 0x18)] & 0x0008) != 0)
+		if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0008) != 0)
 			printf("  Presense Detected Changed Enabled\n");
-		if ((regs[o2i(capoff + 0x18)] & 0x0010) != 0)
+		if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0010) != 0)
 			printf("  Command Completed Interrupt Enabled\n");
-		if ((regs[o2i(capoff + 0x18)] & 0x0020) != 0)
+		if ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0020) != 0)
 			printf("  Hot-Plug Interrupt Enabled\n");
 		printf("  Attention Indicator Control: ");
-		switch ((regs[o2i(capoff + 0x18)] & 0x00c0) >> 6) {
+		switch ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x00c0) >> 6) {
 		case 0x0:
 			printf("reserved\n");
 			break;
@@ -911,7 +916,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 			break;
 		}
 		printf("  Power Indicator Control: ");
-		switch ((regs[o2i(capoff + 0x18)] & 0x0300) >> 8) {
+		switch ((regs[o2i(capoff + PCI_PCIE_SLCSR)] & 0x0300) >> 8) {
 		case 0x0:
 			printf("reserved\n");
 			break;
@@ -926,7 +931,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 			break;
 		}
 		printf("  Power Controller Control: ");
-		if ((regs[o2i(capoff + 0x18)] &

CVS commit: src/share/misc

2013-04-16 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Tue Apr 16 14:03:34 UTC 2013

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

Log Message:
AMQP OTP


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 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.132 src/share/misc/acronyms.comp:1.133
--- src/share/misc/acronyms.comp:1.132	Fri Feb 22 08:19:50 2013
+++ src/share/misc/acronyms.comp	Tue Apr 16 14:03:33 2013
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.132 2013/02/22 08:19:50 plunky Exp $
+$NetBSD: acronyms.comp,v 1.133 2013/04/16 14:03:33 ginsbach Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -41,6 +41,7 @@ AM	access method
 AM	alignment mask
 AM	amplitude modulation
 AMI	alternate mark inversion
+AMQP	advanced message queuing protocol
 AMT	active management technology
 AN	Arabic number
 ANSI	American National Standards Institute
@@ -803,6 +804,7 @@ OSS	open sound system
 OSS	open source software
 OSVW	operating system visible workarounds
 OTP	one time password
+OTP	open telecom platform
 OU	organizational unit
 OUI	organizationally unique identifier
 OWL	Web Ontology Language



CVS commit: src/lib/libc/arch/arm/softfloat

2013-04-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 16 13:38:34 UTC 2013

Modified Files:
src/lib/libc/arch/arm/softfloat: __aeabi_dcmpge.c __aeabi_dcmpgt.c
__aeabi_fcmpge.c __aeabi_fcmpgt.c

Log Message:
Deal with arguments being NaNs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c \
src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c

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

Modified files:

Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c
diff -u src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c:1.1 src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c:1.2
--- src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c:1.1	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c	Tue Apr 16 13:38:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: __aeabi_dcmpge.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+/* $NetBSD: __aeabi_dcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
 
 /*
  * Written by Ben Harris, 2000.  This file is in the Public Domain.
@@ -10,7 +10,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __aeabi_dcmpge.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+__RCSID("$NetBSD: __aeabi_dcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 int __aeabi_dcmpge(float64, float64);
@@ -19,5 +19,5 @@ int
 __aeabi_dcmpge(float64 a, float64 b)
 {
 
-	return !float64_lt(a, b);
+	return !float64_lt(a, b) && float64_eq(a, a) && float64_eq(b, b);
 }
Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c
diff -u src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c:1.1 src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c:1.2
--- src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c:1.1	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c	Tue Apr 16 13:38:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: __aeabi_dcmpgt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+/* $NetBSD: __aeabi_dcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
 
 /*
  * Written by Ben Harris, 2000.  This file is in the Public Domain.
@@ -10,7 +10,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __aeabi_dcmpgt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+__RCSID("$NetBSD: __aeabi_dcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 int __aeabi_dcmpgt(float64, float64);
@@ -19,5 +19,5 @@ int
 __aeabi_dcmpgt(float64 a, float64 b)
 {
 
-	return !float64_le(a, b);
+	return !float64_le(a, b) && float64_eq(a, a) && float64_eq(b, b);
 }
Index: src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c
diff -u src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c:1.1 src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c:1.2
--- src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c:1.1	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c	Tue Apr 16 13:38:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: __aeabi_fcmpge.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+/* $NetBSD: __aeabi_fcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
 
 /*
  * Written by Ben Harris, 2000.  This file is in the Public Domain.
@@ -10,7 +10,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __aeabi_fcmpge.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+__RCSID("$NetBSD: __aeabi_fcmpge.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 int __aeabi_fcmpge(float32, float32);
@@ -19,5 +19,5 @@ int
 __aeabi_fcmpge(float32 a, float32 b)
 {
 
-	return !float32_lt(a, b);
+	return !float32_lt(a, b) && float32_eq(a, a) && float32_eq(b, b);
 }
Index: src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c
diff -u src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c:1.1 src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c:1.2
--- src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c:1.1	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c	Tue Apr 16 13:38:34 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: __aeabi_fcmpgt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+/* $NetBSD: __aeabi_fcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $ */
 
 /*
  * Written by Ben Harris, 2000.  This file is in the Public Domain.
@@ -10,7 +10,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __aeabi_fcmpgt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+__RCSID("$NetBSD: __aeabi_fcmpgt.c,v 1.2 2013/04/16 13:38:34 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 int __aeabi_fcmpgt(float32, float32);
@@ -19,5 +19,5 @@ int
 __aeabi_fcmpgt(float32 a, float32 b)
 {
 
-	return !float32_le(a, b);
+	return !float32_le(a, b) && float32_eq(a, a) && float32_eq(b, b);
 }



CVS commit: src/lib/libc/softfloat

2013-04-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 16 12:26:29 UTC 2013

Modified Files:
src/lib/libc/softfloat: Makefile.inc

Log Message:
Use MACHINE_ARCH, not MACHINE


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/softfloat/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/lib/libc/softfloat/Makefile.inc
diff -u src/lib/libc/softfloat/Makefile.inc:1.13 src/lib/libc/softfloat/Makefile.inc:1.14
--- src/lib/libc/softfloat/Makefile.inc:1.13	Tue Apr 16 10:54:53 2013
+++ src/lib/libc/softfloat/Makefile.inc	Tue Apr 16 12:26:28 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2013/04/16 10:54:53 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2013/04/16 12:26:28 matt Exp $
 
 SOFTFLOAT_BITS?=64
 .PATH:		${ARCHDIR}/softfloat \
@@ -12,7 +12,7 @@ SRCS.softfloat= softfloat.c
 SRCS.softfloat+=fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c \
 		fpgetsticky.c fpsetsticky.c
 
-.if ${MACHINE:Mearm*} != ""
+.if ${MACHINE_ARCH:Mearm*} != ""
 SRCS.softfloat+=__aeabi_dcmpeq.c __aeabi_fcmpeq.c
 SRCS.softfloat+=__aeabi_dcmpge.c __aeabi_fcmpge.c
 SRCS.softfloat+=__aeabi_dcmpgt.c __aeabi_fcmpgt.c



CVS commit: src/include

2013-04-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 16 11:55:03 UTC 2013

Modified Files:
src/include: wchar.h

Log Message:
Also add prototypes for wcwidth_l and wcswidth_l.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/include/wchar.h

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

Modified files:

Index: src/include/wchar.h
diff -u src/include/wchar.h:1.30 src/include/wchar.h:1.31
--- src/include/wchar.h:1.30	Sun Jul 17 20:54:34 2011
+++ src/include/wchar.h	Tue Apr 16 11:55:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wchar.h,v 1.30 2011/07/17 20:54:34 joerg Exp $	*/
+/*	$NetBSD: wchar.h,v 1.31 2013/04/16 11:55:02 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -206,4 +206,13 @@ __END_DECLS
 #define putwc(wc, f) fputwc((wc), (f))
 #define putwchar(wc) putwc((wc), stdout)
 
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
+#  ifndef __LOCALE_T_DECLARED
+typedef struct _locale		*locale_t;
+#  define __LOCALE_T_DECLARED
+#  endif
+int	wcwidth_l(wchar_t, locale_t);
+int	wcswidth_l(const wchar_t *, size_t, locale_t);
+#endif
+
 #endif /* !_WCHAR_H_ */



CVS commit: src

2013-04-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 16 11:39:13 UTC 2013

Modified Files:
src/include: wctype.h
src/lib/libc/include: namespace.h
src/lib/libc/locale: iswctype_mb.c

Log Message:
Add wcwidth_l, wcswidth_l and the wctype.h family of *_l functions.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/include/wctype.h
cvs rdiff -u -r1.156 -r1.157 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/locale/iswctype_mb.c

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

Modified files:

Index: src/include/wctype.h
diff -u src/include/wctype.h:1.7 src/include/wctype.h:1.8
--- src/include/wctype.h:1.7	Sat Mar 27 22:14:09 2010
+++ src/include/wctype.h	Tue Apr 16 11:39:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wctype.h,v 1.7 2010/03/27 22:14:09 tnozaki Exp $	*/
+/*	$NetBSD: wctype.h,v 1.8 2013/04/16 11:39:13 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -72,6 +72,31 @@ wint_t	towlower(wint_t);
 wint_t	towupper(wint_t);
 wctrans_t wctrans(const char *);
 wctype_t wctype(const char *);
+
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
+#  ifndef __LOCALE_T_DECLARED
+typedef struct _locale		*locale_t;
+#  define __LOCALE_T_DECLARED
+#  endif
+int	iswalnum_l(wint_t, locale_t);
+int	iswalpha_l(wint_t, locale_t);
+int	iswblank_l(wint_t, locale_t);
+int	iswcntrl_l(wint_t, locale_t);
+int	iswdigit_l(wint_t, locale_t);
+int	iswgraph_l(wint_t, locale_t);
+int	iswlower_l(wint_t, locale_t);
+int	iswprint_l(wint_t, locale_t);
+int	iswpunct_l(wint_t, locale_t);
+int	iswspace_l(wint_t, locale_t);
+int	iswupper_l(wint_t, locale_t);
+int	iswxdigit_l(wint_t, locale_t);
+int	iswctype_l(wint_t, wctype_t, locale_t);
+wint_t	towctrans_l(wint_t, wctrans_t, locale_t);
+wint_t	towlower_l(wint_t, locale_t);
+wint_t	towupper_l(wint_t, locale_t);
+wctrans_t wctrans_l(const char *, locale_t);
+wctype_t wctype_l(const char *, locale_t);
+#endif
 __END_DECLS
 
 #endif		/* _WCTYPE_H_ */

Index: src/lib/libc/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.156 src/lib/libc/include/namespace.h:1.157
--- src/lib/libc/include/namespace.h:1.156	Mon Aug 20 21:38:10 2012
+++ src/lib/libc/include/namespace.h	Tue Apr 16 11:39:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.156 2012/08/20 21:38:10 dsl Exp $	*/
+/*	$NetBSD: namespace.h,v 1.157 2013/04/16 11:39:13 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -703,6 +703,7 @@
 #define wcstod			_wcstod
 #define wcstold			_wcstold
 #define wcwidth			_wcwidth
+#define wcwidth_l		_wcwidth_l
 #define xdr_accepted_reply	_xdr_accepted_reply
 #define xdr_array		_xdr_array
 #define xdr_authunix_parms	_xdr_authunix_parms

Index: src/lib/libc/locale/iswctype_mb.c
diff -u src/lib/libc/locale/iswctype_mb.c:1.11 src/lib/libc/locale/iswctype_mb.c:1.12
--- src/lib/libc/locale/iswctype_mb.c:1.11	Sun Jun 13 04:14:57 2010
+++ src/lib/libc/locale/iswctype_mb.c	Tue Apr 16 11:39:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: iswctype_mb.c,v 1.11 2010/06/13 04:14:57 tnozaki Exp $ */
+/* $NetBSD: iswctype_mb.c,v 1.12 2013/04/16 11:39:13 joerg Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: iswctype_mb.c,v 1.11 2010/06/13 04:14:57 tnozaki Exp $");
+__RCSID("$NetBSD: iswctype_mb.c,v 1.12 2013/04/16 11:39:13 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,20 +47,29 @@ __RCSID("$NetBSD: iswctype_mb.c,v 1.11 2
 #include "_wctype_local.h"
 #include "_wctrans_local.h"
 
-#define _RUNE_LOCALE() ((_RuneLocale const *) \
-(*_current_locale())->part_impl[(size_t)LC_CTYPE])
+#define _RUNE_LOCALE(loc) ((_RuneLocale const *) \
+(loc)->part_impl[(size_t)LC_CTYPE])
 
 #define _ISWCTYPE_FUNC(name, index)			\
 int			\
-isw##name(wint_t wc)	\
+isw##name##_l(wint_t wc, locale_t loc)			\
 {			\
 	_RuneLocale const *rl;\
 	_WCTypeEntry const *te;\
 			\
-	rl = _RUNE_LOCALE();\
+	if (loc == NULL)\
+		loc = _C_locale;			\
+			\
+	rl = _RUNE_LOCALE(loc);\
 	te = &rl->rl_wctype[index];			\
 	return _iswctype_priv(rl, wc, te);		\
+}			\
+int			\
+isw##name(wint_t wc)	\
+{			\
+	return isw##name##_l(wc, *_current_locale());	\
 }
+
 _ISWCTYPE_FUNC(alnum,  _WCTYPE_INDEX_ALNUM)
 _ISWCTYPE_FUNC(alpha,  _WCTYPE_INDEX_ALPHA)
 _ISWCTYPE_FUNC(blank,  _WCTYPE_INDEX_BLANK)
@@ -76,25 +85,36 @@ _ISWCTYPE_FUNC(xdigit, _WCTYPE_INDEX_XDI
 
 #define _TOWCTRANS_FUNC(name, index)			\
 wint_t			\
-tow##name(wint_t wc)	\
+tow##name##_l(wint_t wc, locale_t loc)			\
 {			\
 	_RuneLocale const *rl;\
 	_WCTransEntry const *te;			\
 			\
-	rl = _RUNE_LOCALE();\
+	if (loc == NULL)\
+		loc = _C_locale;			\
+			\
+	rl = _RUNE_LOCALE(loc);\
 	te = &rl->rl_wctrans[index];			\
 	return _towctrans_priv(wc, te);			\
+}			\
+wint_t			\

CVS commit: src

2013-04-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 16 11:29:13 UTC 2013

Modified Files:
src/include: ctype.h
src/lib/libc/gen: isctype.c

Log Message:
Add isalpha_l and friends.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/include/ctype.h
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/gen/isctype.c

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

Modified files:

Index: src/include/ctype.h
diff -u src/include/ctype.h:1.31 src/include/ctype.h:1.32
--- src/include/ctype.h:1.31	Tue Jun  1 13:52:08 2010
+++ src/include/ctype.h	Tue Apr 16 11:29:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctype.h,v 1.31 2010/06/01 13:52:08 tnozaki Exp $	*/
+/*	$NetBSD: ctype.h,v 1.32 2013/04/16 11:29:12 joerg Exp $	*/
 
 /*
  * Copyright (c) 1989 The Regents of the University of California.
@@ -57,6 +57,28 @@ int	isxdigit(int);
 int	tolower(int);
 int	toupper(int);
 
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
+#  ifndef __LOCALE_T_DECLARED
+typedef struct _locale		*locale_t;
+#  define __LOCALE_T_DECLARED
+#  endif
+
+int	isalnum_l(int, locale_t);
+int	isalpha_l(int, locale_t);
+int	isblank_l(int, locale_t);
+int	iscntrl_l(int, locale_t);
+int	isdigit_l(int, locale_t);
+int	isgraph_l(int, locale_t);
+int	islower_l(int, locale_t);
+int	isprint_l(int, locale_t);
+int	ispunct_l(int, locale_t);
+int	isspace_l(int, locale_t);
+int	isupper_l(int, locale_t);
+int	isxdigit_l(int, locale_t);
+int	tolower_l(int, locale_t);
+int	toupper_l(int, locale_t);
+#endif
+
 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
 int	isascii(int);
 int	toascii(int);

Index: src/lib/libc/gen/isctype.c
diff -u src/lib/libc/gen/isctype.c:1.22 src/lib/libc/gen/isctype.c:1.23
--- src/lib/libc/gen/isctype.c:1.22	Sat Apr 13 10:21:20 2013
+++ src/lib/libc/gen/isctype.c	Tue Apr 16 11:29:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: isctype.c,v 1.22 2013/04/13 10:21:20 joerg Exp $ */
+/* $NetBSD: isctype.c,v 1.23 2013/04/16 11:29:13 joerg Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: isctype.c,v 1.22 2013/04/13 10:21:20 joerg Exp $");
+__RCSID("$NetBSD: isctype.c,v 1.23 2013/04/16 11:29:13 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -53,6 +53,13 @@ int \
 is##name(int c) \
 { \
 	return (int)(_CTYPE_TAB(ctype_tab, c) & (bit)); \
+} \
+int \
+is##name ## _l(int c, locale_t loc) \
+{ \
+	if (loc == NULL) \
+		loc = _C_locale; \
+	return (int)(((loc->cache->ctype_tab + 1)[c]) & (bit)); \
 }
 
 _ISCTYPE_FUNC(alnum, (_CTYPE_A|_CTYPE_D))
@@ -75,12 +82,28 @@ toupper(int c)
 }
 
 int
+toupper_l(int c, locale_t loc)
+{
+	if (loc == NULL)
+		loc = _C_locale;
+	return (int)(((loc->cache->toupper_tab + 1)[c]));
+}
+
+int
 tolower(int c)
 {
 	return (int)_CTYPE_TAB(tolower_tab, c);
 }
 
 int
+tolower_l(int c, locale_t loc)
+{
+	if (loc == NULL)
+		loc = _C_locale;
+	return (int)(((loc->cache->tolower_tab + 1)[c]));
+}
+
+int
 _toupper(int c)
 {
 	return (c - 'a' + 'A');



CVS commit: src/lib/libc/softfloat

2013-04-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 16 10:54:53 UTC 2013

Modified Files:
src/lib/libc/softfloat: Makefile.inc softfloat-for-gcc.h

Log Message:
ARM EABI needs different floating point comparision functions.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/softfloat/Makefile.inc
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/softfloat/softfloat-for-gcc.h

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

Modified files:

Index: src/lib/libc/softfloat/Makefile.inc
diff -u src/lib/libc/softfloat/Makefile.inc:1.12 src/lib/libc/softfloat/Makefile.inc:1.13
--- src/lib/libc/softfloat/Makefile.inc:1.12	Fri Nov 16 12:38:09 2012
+++ src/lib/libc/softfloat/Makefile.inc	Tue Apr 16 10:54:53 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2012/11/16 12:38:09 he Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2013/04/16 10:54:53 matt Exp $
 
 SOFTFLOAT_BITS?=64
 .PATH:		${ARCHDIR}/softfloat \
@@ -12,10 +12,19 @@ SRCS.softfloat= softfloat.c
 SRCS.softfloat+=fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c \
 		fpgetsticky.c fpsetsticky.c
 
+.if ${MACHINE:Mearm*} != ""
+SRCS.softfloat+=__aeabi_dcmpeq.c __aeabi_fcmpeq.c
+SRCS.softfloat+=__aeabi_dcmpge.c __aeabi_fcmpge.c
+SRCS.softfloat+=__aeabi_dcmpgt.c __aeabi_fcmpgt.c
+SRCS.softfloat+=__aeabi_dcmple.c __aeabi_fcmple.c
+SRCS.softfloat+=__aeabi_dcmplt.c __aeabi_fcmplt.c
+SRCS.softfloat+=__aeabi_dcmpun.c __aeabi_fcmpun.c
+.else
 SRCS.softfloat+=eqsf2.c nesf2.c gtsf2.c gesf2.c ltsf2.c lesf2.c negsf2.c \
 		eqdf2.c nedf2.c gtdf2.c gedf2.c ltdf2.c ledf2.c negdf2.c \
 		eqtf2.c netf2.c gttf2.c getf2.c lttf2.c letf2.c negtf2.c \
 		nexf2.c gtxf2.c gexf2.c negxf2.c unordsf2.c unorddf2.c
+.endif
 
 SRCS+=		${SRCS.softfloat}
 

Index: src/lib/libc/softfloat/softfloat-for-gcc.h
diff -u src/lib/libc/softfloat/softfloat-for-gcc.h:1.9 src/lib/libc/softfloat/softfloat-for-gcc.h:1.10
--- src/lib/libc/softfloat/softfloat-for-gcc.h:1.9	Sun Aug  5 04:27:42 2012
+++ src/lib/libc/softfloat/softfloat-for-gcc.h	Tue Apr 16 10:54:53 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat-for-gcc.h,v 1.9 2012/08/05 04:27:42 matt Exp $ */
+/* $NetBSD: softfloat-for-gcc.h,v 1.10 2013/04/16 10:54:53 matt Exp $ */
 
 /*
  * Move private identifiers with external linkage into implementation
@@ -208,19 +208,4 @@
 #define __extendsfdf2			__aeabi_f2d
 #define __truncdfsf2			__aeabi_d2f
 
-#define __eqsf2__aeabi_fcmpeq
-#define __eqdf2__aeabi_dcmpeq
-
-#define __ltsf2__aeabi_fcmplt
-#define __ltdf2__aeabi_dcmplt
-
-#define __lesf2__aeabi_fcmple
-#define __ledf2__aeabi_dcmple
-
-#define __gtsf2__aeabi_fcmpgt
-#define __gtdf2__aeabi_dcmpgt
-
-#define __gesf2__aeabi_fcmpge
-#define __gedf2__aeabi_dcmpge
-
 #endif /* __ARM_EABI__ */



CVS commit: src/lib/libc/arch/arm/softfloat

2013-04-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 16 10:37:39 UTC 2013

Added Files:
src/lib/libc/arch/arm/softfloat: __aeabi_dcmpeq.c __aeabi_dcmpge.c
__aeabi_dcmpgt.c __aeabi_dcmple.c __aeabi_dcmplt.c __aeabi_dcmpun.c
__aeabi_fcmpeq.c __aeabi_fcmpge.c __aeabi_fcmpgt.c __aeabi_fcmple.c
__aeabi_fcmplt.c __aeabi_fcmpun.c

Log Message:
aeabi floating compare ops are different from the normal gcc softfloat ones.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/arm/softfloat/__aeabi_dcmpeq.c \
src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c \
src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c \
src/lib/libc/arch/arm/softfloat/__aeabi_dcmple.c \
src/lib/libc/arch/arm/softfloat/__aeabi_dcmplt.c \
src/lib/libc/arch/arm/softfloat/__aeabi_dcmpun.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmpeq.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmpge.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmpgt.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmple.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmplt.c \
src/lib/libc/arch/arm/softfloat/__aeabi_fcmpun.c

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

Added files:

Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmpeq.c
diff -u /dev/null src/lib/libc/arch/arm/softfloat/__aeabi_dcmpeq.c:1.1
--- /dev/null	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmpeq.c	Tue Apr 16 10:37:39 2013
@@ -0,0 +1,23 @@
+/* $NetBSD: __aeabi_dcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/*
+ * Written by Ben Harris, 2000.  This file is in the Public Domain.
+ */
+
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpeq.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+int __aeabi_dcmpeq(float64, float64);
+
+int
+__aeabi_dcmpeq(float64 a, float64 b)
+{
+
+	return float64_eq(a, b);
+}
Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c
diff -u /dev/null src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c:1.1
--- /dev/null	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmpge.c	Tue Apr 16 10:37:39 2013
@@ -0,0 +1,23 @@
+/* $NetBSD: __aeabi_dcmpge.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/*
+ * Written by Ben Harris, 2000.  This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpge.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmpge(float64, float64);
+
+int
+__aeabi_dcmpge(float64 a, float64 b)
+{
+
+	return !float64_lt(a, b);
+}
Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c
diff -u /dev/null src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c:1.1
--- /dev/null	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmpgt.c	Tue Apr 16 10:37:39 2013
@@ -0,0 +1,23 @@
+/* $NetBSD: __aeabi_dcmpgt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/*
+ * Written by Ben Harris, 2000.  This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmpgt.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmpgt(float64, float64);
+
+int
+__aeabi_dcmpgt(float64 a, float64 b)
+{
+
+	return !float64_le(a, b);
+}
Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmple.c
diff -u /dev/null src/lib/libc/arch/arm/softfloat/__aeabi_dcmple.c:1.1
--- /dev/null	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmple.c	Tue Apr 16 10:37:39 2013
@@ -0,0 +1,23 @@
+/* $NetBSD: __aeabi_dcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/*
+ * Written by Ben Harris, 2000.  This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __aeabi_dcmple.c,v 1.1 2013/04/16 10:37:39 matt Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+int __aeabi_dcmple(float64, float64);
+
+int
+__aeabi_dcmple(float64 a, float64 b)
+{
+
+	return float64_le(a, b);
+}
Index: src/lib/libc/arch/arm/softfloat/__aeabi_dcmplt.c
diff -u /dev/null src/lib/libc/arch/arm/softfloat/__aeabi_dcmplt.c:1.1
--- /dev/null	Tue Apr 16 10:37:39 2013
+++ src/lib/libc/arch/arm/softfloat/__aeabi_dcmplt.c	Tue Apr 16 10:37:39 2013
@@ -0,0 +1,23 @@
+/* $NetBSD: __aeabi_dcmplt.c,v 1.1 2013/04/16 10:37:39 matt Exp $ */
+
+/*
+ * Written by Ben Harris, 2000.  This file is in the Public Domain.
+ */
+
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
+#include "softfloat.h"
+
+#include 
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: __ae

CVS commit: src/sys/dev/pci

2013-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 16 09:13:05 UTC 2013

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
 Fix a bug that IRQ(MSI) bits in PCIe capability register is incorrectly
decoded. The bit field is not 0x4e00 but 0x3e00.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/pci/pcireg.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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.96 src/sys/dev/pci/pci_subr.c:1.97
--- src/sys/dev/pci/pci_subr.c:1.96	Mon Apr 15 18:51:29 2013
+++ src/sys/dev/pci/pci_subr.c	Tue Apr 16 09:13:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.96 2013/04/15 18:51:29 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.97 2013/04/16 09:13:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.96 2013/04/15 18:51:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.97 2013/04/16 09:13:04 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -855,7 +855,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	if (check_slot && (regs[o2i(capoff)] & 0x0100) != 0)
 		printf("Slot implemented\n");
 	printf("Interrupt Message Number: %x\n",
-	(unsigned int)((regs[o2i(capoff)] & 0x4e00) >> 27));
+	(unsigned int)((regs[o2i(capoff)] & PCI_PCIE_XCAP_IRQ) >> 27));
 	printf("Link Capabilities Register: 0x%08x\n",
 	regs[o2i(capoff + 0x0c)]);
 	printf("  Maximum Link Speed: ");

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.78 src/sys/dev/pci/pcireg.h:1.79
--- src/sys/dev/pci/pcireg.h:1.78	Mon Apr 15 18:48:36 2013
+++ src/sys/dev/pci/pcireg.h	Tue Apr 16 09:13:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.78 2013/04/15 18:48:36 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.79 2013/04/16 09:13:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -647,6 +647,7 @@ struct pci_msix_table_entry {
 #define	 PCI_PCIE_XCAP_TYPE_ROOT_INTEP	__SHIFTIN(0x9, PCI_PCIE_XCAP_TYPE_MASK)
 #define	 PCI_PCIE_XCAP_TYPE_ROOT_EVNTC	__SHIFTIN(0xa, PCI_PCIE_XCAP_TYPE_MASK)
 #define PCI_PCIE_XCAP_SI	__SHIFTIN(__BIT(8), PCI_PCIE_XCAP_MASK)		/* Slot Implemented */
+#define PCI_PCIE_XCAP_IRQ	__SHIFTIN(__BITS(13, 9), PCI_PCIE_XCAP_MASK)
 #define PCI_PCIE_DCAP		0x04	/* Device Capabilities Register */
 #define PCI_PCIE_DCAP_MAX_PAYLOAD	__BITS(2, 0)
 #define PCI_PCIE_DCAP_PHANTHOM_FUNCS	__BITS(4, 3)



CVS commit: src/sys/dev/pci/voyager

2013-04-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Apr 16 09:04:24 UTC 2013

Modified Files:
src/sys/dev/pci/voyager: pwmclock.c

Log Message:
unscrew this again


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/voyager/pwmclock.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/voyager/pwmclock.c
diff -u src/sys/dev/pci/voyager/pwmclock.c:1.7 src/sys/dev/pci/voyager/pwmclock.c:1.8
--- src/sys/dev/pci/voyager/pwmclock.c:1.7	Mon Apr 15 19:46:16 2013
+++ src/sys/dev/pci/voyager/pwmclock.c	Tue Apr 16 09:04:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pwmclock.c,v 1.7 2013/04/15 19:46:16 christos Exp $	*/
+/*	$NetBSD: pwmclock.c,v 1.8 2013/04/16 09:04:24 macallan Exp $	*/
 
 /*
  * Copyright (c) 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pwmclock.c,v 1.7 2013/04/15 19:46:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pwmclock.c,v 1.8 2013/04/16 09:04:24 macallan Exp $");
 
 #include 
 #include 
@@ -157,10 +157,9 @@ pwmclock_attach(device_t parent, device_
 	/* ok, let's see how far the cycle counter gets between interrupts */
 	DPRINTF("calibrating CPU timer...\n");
 	for (clk = 1; clk < 8; clk++) {
-#if 0
+
 		REGVAL(LS2F_CHIPCFG0) =
 		(REGVAL(LS2F_CHIPCFG0) & ~LS2FCFG_FREQSCALE_MASK) | clk;
-#endif
 		bus_space_write_4(sc->sc_memt, sc->sc_regh, SM502_PWM1,
 		sc->sc_reg);
 		acc = 0;
@@ -236,10 +235,8 @@ pwmclock_shutdown(void *cookie)
 	/* just in case the interrupt handler runs again after this */
 	sc->sc_step_wanted = 7;
 	/* set the clock to full speed */
-#if 0
 	REGVAL(LS2F_CHIPCFG0) =
 	(REGVAL(LS2F_CHIPCFG0) & ~LS2FCFG_FREQSCALE_MASK) | 7;
-#endif
 }
 
 void
@@ -296,11 +293,10 @@ pwmclock_intr(void *cookie)
 	 *   we only change sc_step after doing that
 	 */
 	if (sc->sc_step_wanted != sc->sc_step) {
-#if 0
+
 		REGVAL(LS2F_CHIPCFG0) =
 		(REGVAL(LS2F_CHIPCFG0) & ~LS2FCFG_FREQSCALE_MASK) |
 		 sc->sc_step_wanted;
-#endif
 	}
 
 	now = mips3_cp0_count_read();		



CVS commit: src/sys/arch/mips/bonito

2013-04-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Apr 16 09:02:32 UTC 2013

Modified Files:
src/sys/arch/mips/bonito: bonitoreg.h

Log Message:
add definitions for Loongson 2F Chip Config register


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/bonito/bonitoreg.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/mips/bonito/bonitoreg.h
diff -u src/sys/arch/mips/bonito/bonitoreg.h:1.7 src/sys/arch/mips/bonito/bonitoreg.h:1.8
--- src/sys/arch/mips/bonito/bonitoreg.h:1.7	Sat Aug 27 12:59:17 2011
+++ src/sys/arch/mips/bonito/bonitoreg.h	Tue Apr 16 09:02:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bonitoreg.h,v 1.7 2011/08/27 12:59:17 bouyer Exp $	*/
+/*	$NetBSD: bonitoreg.h,v 1.8 2013/04/16 09:02:32 macallan Exp $	*/
 
 /*
  * Bonito Register Map
@@ -221,6 +221,12 @@
 #define BONITO_PCIDATA			BONITO(BONITO_REGBASE + 0x64)
 */
 
+#define LS2F_CHIPCFG0			BONITO(BONITO_REGBASE + 0x80)
+#define LS2FCFG_FREQSCALE_MASK		0x0007
+#define LS2FCFG_DISABLE_SCACHE		0x0008	/* disable secondary cache */
+#define LS2FCFG_BUFFER_CPU_TO_RAM	0x0020
+#define LS2FCFG_BUFFER_PCI_TO_RAM	0x0040
+
 /* 7. IDE DMA & Copier */
 
 #define BONITO_CONFIGBASE		0x000
@@ -521,4 +527,5 @@
 
 #define	BONITO_DIRECT_MASK(imask)	((imask) & ((1L << BONITO_NDIRECT) - 1))
 #define	BONITO_ISA_MASK(imask)		((imask) >> BONITO_NDIRECT)
+
 #endif /* _BONITO_H_ */



CVS commit: src/sys/arch/sparc/stand/ofwboot

2013-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 16 07:45:37 UTC 2013

Modified Files:
src/sys/arch/sparc/stand/ofwboot: ofdev.c

Log Message:
Make a "panic" message slightly more verbose


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sparc/stand/ofwboot/ofdev.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/sparc/stand/ofwboot/ofdev.c
diff -u src/sys/arch/sparc/stand/ofwboot/ofdev.c:1.33 src/sys/arch/sparc/stand/ofwboot/ofdev.c:1.34
--- src/sys/arch/sparc/stand/ofwboot/ofdev.c:1.33	Mon Jul 16 11:26:27 2012
+++ src/sys/arch/sparc/stand/ofwboot/ofdev.c	Tue Apr 16 07:45:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofdev.c,v 1.33 2012/07/16 11:26:27 tsutsui Exp $	*/
+/*	$NetBSD: ofdev.c,v 1.34 2013/04/16 07:45:37 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -374,7 +374,7 @@ devopen(struct open_file *of, const char
 	int error = 0;
 
 	if (ofdev.handle != -1)
-		panic("devopen");
+		panic("devopen: ofdev already in use");
 	if (of->f_flags != F_READ)
 		return EPERM;
 	DPRINTF(("devopen: you want %s\n", name));