Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Oct 2008 05:01:47 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 151200 for review
Message-ID:  <200810100501.m9A51lta084819@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=151200

Change 151200 by imp@imp_paco-paco on 2008/10/10 05:01:46

	IFC @151198

Affected files ...

.. //depot/projects/mips2/src/UPDATING#22 integrate
.. //depot/projects/mips2/src/etc/Makefile#11 integrate
.. //depot/projects/mips2/src/etc/mtree/BSD.usr.dist#8 integrate
.. //depot/projects/mips2/src/games/fortune/datfiles/fortunes#15 integrate
.. //depot/projects/mips2/src/gnu/usr.bin/man/man/man.c#5 integrate
.. //depot/projects/mips2/src/lib/libpmc/libpmc.c#6 integrate
.. //depot/projects/mips2/src/libexec/rtld-elf/rtld.c#10 integrate
.. //depot/projects/mips2/src/release/doc/en_US.ISO8859-1/relnotes/article.sgml#21 integrate
.. //depot/projects/mips2/src/sbin/geom/class/part/gpart.8#4 integrate
.. //depot/projects/mips2/src/share/Makefile#5 integrate
.. //depot/projects/mips2/src/share/man/man4/Makefile#23 integrate
.. //depot/projects/mips2/src/share/man/man4/mmc.4#2 integrate
.. //depot/projects/mips2/src/share/man/man4/ng_netflow.4#3 integrate
.. //depot/projects/mips2/src/share/man/man4/u3g.4#1 branch
.. //depot/projects/mips2/src/share/mk/bsd.kmod.mk#2 integrate
.. //depot/projects/mips2/src/sys/conf/NOTES#26 integrate
.. //depot/projects/mips2/src/sys/conf/files#31 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-all.c#10 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-all.h#13 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-chipset.c#21 delete
.. //depot/projects/mips2/src/sys/dev/ata/ata-dma.c#8 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-pci.c#10 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-pci.h#16 integrate
.. //depot/projects/mips2/src/sys/dev/ata/ata-sata.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-acard.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-acerlabs.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-adaptec.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-ahci.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-amd.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-ati.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-cenatek.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-cypress.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-cyrix.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-highpoint.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-intel.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-ite.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-jmicron.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-marvell.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-micron.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-national.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-netcell.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-nvidia.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-promise.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-serverworks.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-siliconimage.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-sis.c#1 branch
.. //depot/projects/mips2/src/sys/dev/ata/chipsets/ata-via.c#1 branch
.. //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_ppro.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/hwpmc/pmc_events.h#4 integrate
.. //depot/projects/mips2/src/sys/dev/mmc/bridge.h#3 integrate
.. //depot/projects/mips2/src/sys/dev/mmc/mmc.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/mmc/mmcbrvar.h#4 integrate
.. //depot/projects/mips2/src/sys/dev/mmc/mmcreg.h#4 integrate
.. //depot/projects/mips2/src/sys/dev/mmc/mmcsd.c#5 integrate
.. //depot/projects/mips2/src/sys/dev/mmc/mmcvar.h#4 integrate
.. //depot/projects/mips2/src/sys/dev/sio/sio.c#8 integrate
.. //depot/projects/mips2/src/sys/dev/usb/ehci_pci.c#9 integrate
.. //depot/projects/mips2/src/sys/dev/usb/ohci_pci.c#5 integrate
.. //depot/projects/mips2/src/sys/dev/usb/slhci_pccard.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/usb/u3g.c#1 branch
.. //depot/projects/mips2/src/sys/dev/usb/uark.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/usb/ubsa.c#11 integrate
.. //depot/projects/mips2/src/sys/dev/usb/ucom.c#8 integrate
.. //depot/projects/mips2/src/sys/dev/usb/uhci_pci.c#7 integrate
.. //depot/projects/mips2/src/sys/dev/usb/ukbd.c#8 integrate
.. //depot/projects/mips2/src/sys/dev/usb/umass.c#10 integrate
.. //depot/projects/mips2/src/sys/dev/usb/usbdevs#25 integrate
.. //depot/projects/mips2/src/sys/i386/conf/GENERIC#19 integrate
.. //depot/projects/mips2/src/sys/kern/imgact_elf.c#10 integrate
.. //depot/projects/mips2/src/sys/kern/uipc_usrreq.c#12 integrate
.. //depot/projects/mips2/src/sys/libkern/qdivrem.c#2 integrate
.. //depot/projects/mips2/src/sys/modules/Makefile#21 integrate
.. //depot/projects/mips2/src/sys/modules/ata/Makefile#2 integrate
.. //depot/projects/mips2/src/sys/modules/ata/ata/Makefile#2 delete
.. //depot/projects/mips2/src/sys/modules/ata/atacore/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atadevel/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atadevel/ata-devel.c#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/Makefile#2 integrate
.. //depot/projects/mips2/src/sys/modules/ata/atapci/Makefile.inc#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/Makefile.inc#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataacard/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataadaptec/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataahci/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataamd/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataati/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atacenatek/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atacypress/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atacyrix/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataintel/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataite/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atajmicron/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atamarvell/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atamicron/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atanational/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atanetcell/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atanvidia/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atapromise/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atasis/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ata/atapci/chipsets/atavia/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ehci/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/ohci/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/slhci/Makefile#3 integrate
.. //depot/projects/mips2/src/sys/modules/u3g/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/uhci/Makefile#1 branch
.. //depot/projects/mips2/src/sys/modules/usb/Makefile#3 integrate
.. //depot/projects/mips2/src/sys/netgraph/netflow/netflow.c#6 integrate
.. //depot/projects/mips2/src/sys/netgraph/netflow/ng_netflow.c#5 integrate
.. //depot/projects/mips2/src/sys/netgraph/netflow/ng_netflow.h#3 integrate
.. //depot/projects/mips2/src/sys/sys/pmc.h#6 integrate
.. //depot/projects/mips2/src/tools/tools/nanobsd/nanobsd.sh#15 integrate

Differences ...

==== //depot/projects/mips2/src/UPDATING#22 (text+ko) ====

@@ -22,6 +22,11 @@
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20081009:
+	The ABI used by the PMC toolset has changed.  Please keep
+	userland (libpmc(3)) and the kernel module (hwpmc(4)) in
+	sync.
+
 20080820:
 	The TTY subsystem of the kernel has been replaced by a new
 	implementation, which provides better scalability and an
@@ -1131,4 +1136,4 @@
 Contact Warner Losh if you have any questions about your use of
 this document.
 
-$FreeBSD: src/UPDATING,v 1.543 2008/10/08 01:31:00 delphij Exp $
+$FreeBSD: src/UPDATING,v 1.544 2008/10/10 04:23:40 jkoshy Exp $

==== //depot/projects/mips2/src/etc/Makefile#11 (text+ko) ====

@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
-# $FreeBSD: src/etc/Makefile,v 1.370 2008/09/22 15:37:47 sam Exp $
+# $FreeBSD: src/etc/Makefile,v 1.371 2008/10/08 13:28:02 des Exp $
 
 .include <bsd.own.mk>
 
@@ -251,6 +251,7 @@
 .endif
 	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
 	cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* .
+	cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* .
 	cd ${DESTDIR}/usr/share/man; \
 	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
 	while [ $$# -gt 0 ] ; \

==== //depot/projects/mips2/src/etc/mtree/BSD.usr.dist#8 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.335 2008/07/28 17:42:37 antoine Exp $
+# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.336 2008/10/08 13:28:02 des Exp $
 #
 # Please see the file src/etc/mtree/README before making changes to this file.
 #
@@ -740,6 +740,46 @@
                 cat9
                 ..
             ..
+            en.UTF-8        uname=root
+                cat1
+                ..
+                cat1aout
+                ..
+                cat2
+                ..
+                cat3
+                ..
+                cat4
+                    amd64
+                    ..
+                    arm
+                    ..
+                    i386
+                    ..
+                    powerpc
+                    ..
+                    sparc64
+                    ..
+                ..
+                cat5
+                ..
+                cat6
+                ..
+                cat7
+                ..
+                cat8
+                    amd64
+                    ..
+                    i386
+                    ..
+                    powerpc
+                    ..
+                    sparc64
+                    ..
+                ..
+                cat9
+                ..
+            ..
             ja              uname=root
                 cat1
                 ..

==== //depot/projects/mips2/src/games/fortune/datfiles/fortunes#15 (text+ko) ====

@@ -1,5 +1,5 @@
 This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.270 2008/08/02 20:11:56 phk Exp $
+$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.272 2008/10/08 19:39:22 phk Exp $
 %
 =======================================================================
 ||								     ||
@@ -23951,6 +23951,9 @@
 that kidnaped Europa.
 		-- Marcus Tullius Cicero
 %
+I like paying taxes.  With them I buy civilization.
+		-- Oliver Wendell Holmes
+%
 I like to believe that people in the long run are going to do more to
 promote peace than our governments.  Indeed, I think that people want
 peace so much that one of these days governments had better get out of
@@ -26583,6 +26586,9 @@
 %
 If you can lead it to water and force it to drink, it isn't a horse.
 %
+If you can not say it, you can not whistle it, either.
+		-- Wittgenstein
+%
 If you can read this, you're too close.
 %
 If you can survive death, you can probably survive anything.

==== //depot/projects/mips2/src/gnu/usr.bin/man/man/man.c#5 (text+ko) ====

@@ -16,7 +16,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-  "$FreeBSD: src/gnu/usr.bin/man/man/man.c,v 1.68 2008/05/14 17:18:12 ru Exp $";
+  "$FreeBSD: src/gnu/usr.bin/man/man/man.c,v 1.69 2008/10/08 13:16:20 des Exp $";
 #endif /* not lint */
 
 #define MAN_MAIN
@@ -105,6 +105,7 @@
 	{"KOI8-R", "koi8-r"},
 	{"ISO8859-1", "latin1"},
 	{"ISO8859-15", "latin1"},
+	{"UTF-8", "utf8"},
 	{NULL}
 };
 #endif

==== //depot/projects/mips2/src/lib/libpmc/libpmc.c#6 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.16 2008/09/17 04:13:14 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/lib/libpmc/libpmc.c,v 1.17 2008/10/09 14:55:45 jkoshy Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -59,6 +59,10 @@
 static int p6_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
     struct pmc_op_pmcallocate *_pmc_config);
 #endif
+#if defined(__amd64__) || defined(__i386__)
+static int tsc_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
+    struct pmc_op_pmcallocate *_pmc_config);
+#endif
 
 #define PMC_CALL(cmd, params)				\
 	syscall(pmc_syscall, PMC_OP_##cmd, (params))
@@ -77,23 +81,96 @@
 static const struct pmc_event_alias *pmc_mdep_event_aliases;
 
 /*
- * The pmc_event_descr table maps symbolic names known to the user
+ * The pmc_event_descr structure maps symbolic names known to the user
  * to integer codes used by the PMC KLD.
  */
 struct pmc_event_descr {
 	const char	*pm_ev_name;
 	enum pmc_event	pm_ev_code;
-	enum pmc_class	pm_ev_class;
+};
+
+/*
+ * The pmc_class_descr structure maps class name prefixes for
+ * event names to event tables and other PMC class data.
+ */
+struct pmc_class_descr {
+	const char	*pm_evc_name;
+	size_t		pm_evc_name_size;
+	enum pmc_class	pm_evc_class;
+	const struct pmc_event_descr *pm_evc_event_table;
+	size_t		pm_evc_event_table_size;
+	int		(*pm_evc_allocate_pmc)(enum pmc_event _pe,
+			    char *_ctrspec, struct pmc_op_pmcallocate *_pa);
+};
+
+#define	PMC_TABLE_SIZE(N)	(sizeof(N)/sizeof(N[0]))
+#define	PMC_EVENT_TABLE_SIZE(N)	PMC_TABLE_SIZE(N##_event_table)
+
+#undef	__PMC_EV
+#define	__PMC_EV(C,N) { #N, PMC_EV_ ## C ## _ ## N },
+
+/*
+ * PMC_MDEP_TABLE(NAME, CLASS, ADDITIONAL_CLASSES...)
+ *
+ * Build an event descriptor table and a list of valid PMC classes.
+ */
+#define	PMC_MDEP_TABLE(N,C,...)				\
+	static const struct pmc_event_descr N##_event_table[] =	\
+	{							\
+		__PMC_EV_##C()					\
+	};							\
+	static const enum pmc_class N##_pmc_classes[] = {	\
+		PMC_CLASS_##C, __VA_ARGS__			\
+	}
+
+PMC_MDEP_TABLE(k7, K7, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(k8, K8, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(p4, P4, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(p5, P5, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(p6, P6, PMC_CLASS_TSC);
+
+static const struct pmc_event_descr tsc_event_table[] =
+{
+	__PMC_EV_TSC()
 };
 
-static const struct pmc_event_descr
-pmc_event_table[] =
+#undef	PMC_CLASS_TABLE_DESC
+#define	PMC_CLASS_TABLE_DESC(N, C)	{			\
+		.pm_evc_name  = #N "-",				\
+		.pm_evc_name_size = sizeof(#N "-") - 1,		\
+		.pm_evc_class = PMC_CLASS_##C ,			\
+		.pm_evc_event_table = N##_event_table ,		\
+		.pm_evc_event_table_size = 			\
+			PMC_EVENT_TABLE_SIZE(N),		\
+		.pm_evc_allocate_pmc = N##_allocate_pmc		\
+	}
+
+static const struct pmc_class_descr pmc_class_table[] =
 {
-#undef  __PMC_EV
-#define	__PMC_EV(C,N,EV) { #EV, PMC_EV_ ## C ## _ ## N, PMC_CLASS_ ## C },
-	__PMC_EVENTS()
+#if	defined(__i386__)
+	PMC_CLASS_TABLE_DESC(k7, K7),
+#endif
+#if	defined(__i386__) || defined(__amd64__)
+	PMC_CLASS_TABLE_DESC(k8, K8),
+	PMC_CLASS_TABLE_DESC(p4, P4),
+#endif
+#if	defined(__i386__)
+	PMC_CLASS_TABLE_DESC(p5, P5),
+	PMC_CLASS_TABLE_DESC(p6, P6),
+#endif
+#if	defined(__i386__) || defined(__amd64__)
+	PMC_CLASS_TABLE_DESC(tsc, TSC)
+#endif
 };
 
+static size_t pmc_event_class_table_size =
+    PMC_TABLE_SIZE(pmc_class_table);
+
+#undef	PMC_CLASS_TABLE_DESC
+
+static const enum pmc_class *pmc_mdep_class_list;
+static size_t pmc_mdep_class_list_size;
+
 /*
  * Mapping tables, mapping enumeration values to human readable
  * strings.
@@ -111,9 +188,14 @@
 	__PMC_CLASSES()
 };
 
-static const char * pmc_cputype_names[] = {
+struct pmc_cputype_map {
+	enum pmc_class	pm_cputype;
+	const char	*pm_name;
+};
+
+static const struct pmc_cputype_map pmc_cputype_names[] = {
 #undef	__PMC_CPU
-#define	__PMC_CPU(S, D) #S ,
+#define	__PMC_CPU(S, V, D) { .pm_cputype = PMC_CPU_##S, .pm_name = #S } ,
 	__PMC_CPUS()
 };
 
@@ -139,11 +221,6 @@
 
 static struct pmc_cpuinfo cpu_info;	/* filled in by pmc_init() */
 
-
-/* Architecture dependent event parsing */
-static int (*pmc_mdep_allocate_pmc)(enum pmc_event _pe, char *_ctrspec,
-    struct pmc_op_pmcallocate *_pmc_config);
-
 /* Event masks for events */
 struct pmc_masks {
 	const char	*pm_name;
@@ -167,7 +244,8 @@
 		return (-1);
 	c = 0;			/* count of mask keywords seen */
 	while ((r = strsep(&q, "+")) != NULL) {
-		for (pm = pmask; pm->pm_name && strcmp(r, pm->pm_name); pm++)
+		for (pm = pmask; pm->pm_name && strcasecmp(r, pm->pm_name);
+		    pm++)
 			;
 		if (pm->pm_name == NULL) /* not found */
 			return (-1);
@@ -215,14 +293,7 @@
 	uint32_t	count, unitmask;
 
 	pmc_config->pm_md.pm_amd.pm_amd_config = 0;
-	pmc_config->pm_caps |= PMC_CAP_READ;
-
-	if (pe == PMC_EV_TSC_TSC) {
-		/* TSC events must be unqualified. */
-		if (ctrspec && *ctrspec != '\0')
-			return (-1);
-		return (0);
-	}
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 
 	if (pe == PMC_EV_K7_DC_REFILLS_FROM_L2 ||
 	    pe == PMC_EV_K7_DC_REFILLS_FROM_SYSTEM ||
@@ -232,8 +303,6 @@
 	} else
 		unitmask = has_unitmask = 0;
 
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
-
 	while ((p = strsep(&ctrspec, ",")) != NULL) {
 		if (KWPREFIXMATCH(p, K7_KW_COUNT "=")) {
 			q = strchr(p, '=');
@@ -514,16 +583,9 @@
 	uint32_t	count, evmask;
 	const struct pmc_masks	*pm, *pmask;
 
-	pmc_config->pm_caps |= PMC_CAP_READ;
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 	pmc_config->pm_md.pm_amd.pm_amd_config = 0;
 
-	if (pe == PMC_EV_TSC_TSC) {
-		/* TSC events must be unqualified. */
-		if (ctrspec && *ctrspec != '\0')
-			return (-1);
-		return (0);
-	}
-
 	pmask = NULL;
 	evmask = 0;
 
@@ -597,8 +659,6 @@
 		break;		/* no options defined */
 	}
 
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
-
 	while ((p = strsep(&ctrspec, ",")) != NULL) {
 		if (KWPREFIXMATCH(p, K8_KW_COUNT "=")) {
 			q = strchr(p, '=');
@@ -1005,22 +1065,14 @@
 	uint32_t evmask, cccractivemask;
 	const struct pmc_masks *pm, *pmask;
 
-	pmc_config->pm_caps |= PMC_CAP_READ;
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 	pmc_config->pm_md.pm_p4.pm_p4_cccrconfig =
 	    pmc_config->pm_md.pm_p4.pm_p4_escrconfig = 0;
 
-	if (pe == PMC_EV_TSC_TSC) {
-		/* TSC must not be further qualified */
-		if (ctrspec && *ctrspec != '\0')
-			return (-1);
-		return (0);
-	}
-
 	pmask   = NULL;
 	evmask  = 0;
 	cccractivemask = 0x3;
 	has_tag = has_busreqtype = 0;
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
 
 #define	__P4SETMASK(M) do {				\
 	pmask = p4_mask_##M;				\
@@ -1166,13 +1218,13 @@
 			if (*++q == '\0') /* skip '=' */
 				return (-1);
 
-			if (strcmp(q, P4_KW_ACTIVE_NONE) == 0)
+			if (strcasecmp(q, P4_KW_ACTIVE_NONE) == 0)
 				cccractivemask = 0x0;
-			else if (strcmp(q, P4_KW_ACTIVE_SINGLE) == 0)
+			else if (strcasecmp(q, P4_KW_ACTIVE_SINGLE) == 0)
 				cccractivemask = 0x1;
-			else if (strcmp(q, P4_KW_ACTIVE_BOTH) == 0)
+			else if (strcasecmp(q, P4_KW_ACTIVE_BOTH) == 0)
 				cccractivemask = 0x2;
-			else if (strcmp(q, P4_KW_ACTIVE_ANY) == 0)
+			else if (strcasecmp(q, P4_KW_ACTIVE_ANY) == 0)
 				cccractivemask = 0x3;
 			else
 				return (-1);
@@ -1442,16 +1494,9 @@
 	int count, n;
 	const struct pmc_masks *pm, *pmask;
 
-	pmc_config->pm_caps |= PMC_CAP_READ;
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 	pmc_config->pm_md.pm_ppro.pm_ppro_config = 0;
 
-	if (pe == PMC_EV_TSC_TSC) {
-		if (ctrspec && *ctrspec != '\0')
-			return (-1);
-		return (0);
-	}
-
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
 	evmask = 0;
 
 #define	P6MASKSET(M)	pmask = p6_mask_ ## M
@@ -1638,6 +1683,93 @@
 
 #endif
 
+#if	defined(__i386__) || defined(__amd64__)
+static int
+tsc_allocate_pmc(enum pmc_event pe, char *ctrspec,
+    struct pmc_op_pmcallocate *pmc_config)
+{
+	if (pe != PMC_EV_TSC_TSC)
+		return (-1);
+
+	/* TSC events must be unqualified. */
+	if (ctrspec && *ctrspec != '\0')
+		return (-1);
+
+	pmc_config->pm_md.pm_amd.pm_amd_config = 0;
+	pmc_config->pm_caps |= PMC_CAP_READ;
+
+	return (0);
+}
+#endif
+
+/*
+ * Match an event name `name' with its canonical form.
+ * 
+ * Matches are case insensitive and spaces, underscores and hyphen
+ * characters are considered to match each other.
+ *
+ * Returns 1 for a match, 0 otherwise.
+ */
+
+static int
+pmc_match_event_name(const char *name, const char *canonicalname)
+{
+	int cc, nc;
+	const unsigned char *c, *n;
+
+	c = (const unsigned char *) canonicalname;
+	n = (const unsigned char *) name;
+
+	for (; (nc = *n) && (cc = *c); n++, c++) {
+
+		if (toupper(nc) == cc)
+			continue;
+
+		if ((nc == ' ' || nc == '_' || nc == '-') &&
+		    (cc == ' ' || cc == '_' || cc == '-'))
+			continue;
+
+		return (0);
+	}
+
+	if (*n == '\0' && *c == '\0')
+		return (1);
+
+	return (0);
+}
+
+/*
+ * Match an event name against all the event named supported by a
+ * PMC class.
+ *
+ * Returns an event descriptor pointer on match or NULL otherwise.
+ */
+static const struct pmc_event_descr *
+pmc_match_event_class(const char *name,
+    const struct pmc_class_descr *pcd)
+{
+	size_t n;
+	const struct pmc_event_descr *ev;
+	
+	ev = pcd->pm_evc_event_table;
+	for (n = 0; n < pcd->pm_evc_event_table_size; n++, ev++)
+		if (pmc_match_event_name(name, ev->pm_ev_name))
+			return (ev);
+
+	return (NULL);
+}
+
+static int
+pmc_mdep_is_compatible_class(enum pmc_class pc)
+{
+	size_t n;
+
+	for (n = 0; n < pmc_mdep_class_list_size; n++)
+		if (pmc_mdep_class_list[n] == pc)
+			return (1);
+	return (0);
+}
+
 /*
  * API entry points
  */
@@ -1646,12 +1778,14 @@
 pmc_allocate(const char *ctrspec, enum pmc_mode mode,
     uint32_t flags, int cpu, pmc_id_t *pmcid)
 {
+	size_t n;
 	int retval;
-	enum pmc_event pe;
 	char *r, *spec_copy;
 	const char *ctrname;
-	const struct pmc_event_alias *p;
+	const struct pmc_event_descr *ev;
+	const struct pmc_event_alias *alias;
 	struct pmc_op_pmcallocate pmc_config;
+	const struct pmc_class_descr *pcd;
 
 	spec_copy = NULL;
 	retval    = -1;
@@ -1664,9 +1798,9 @@
 
 	/* replace an event alias with the canonical event specifier */
 	if (pmc_mdep_event_aliases)
-		for (p = pmc_mdep_event_aliases; p->pm_alias; p++)
-			if (!strcmp(ctrspec, p->pm_alias)) {
-				spec_copy = strdup(p->pm_spec);
+		for (alias = pmc_mdep_event_aliases; alias->pm_alias; alias++)
+			if (!strcasecmp(ctrspec, alias->pm_alias)) {
+				spec_copy = strdup(alias->pm_spec);
 				break;
 			}
 
@@ -1676,19 +1810,43 @@
 	r = spec_copy;
 	ctrname = strsep(&r, ",");
 
-	/* look for the given counter name */
-	for (pe = PMC_EVENT_FIRST; pe < (PMC_EVENT_LAST+1); pe++)
-		if (!strcmp(ctrname, pmc_event_table[pe].pm_ev_name))
+	/*
+	 * If a explicit class prefix was given by the user, restrict the
+	 * search for the event to the specified PMC class.
+	 */
+	ev = NULL;
+	for (n = 0; n < pmc_event_class_table_size; n++) {
+		pcd = &pmc_class_table[n];
+		if (pmc_mdep_is_compatible_class(pcd->pm_evc_class) &&
+		    strncasecmp(ctrname, pcd->pm_evc_name,
+				pcd->pm_evc_name_size) == 0) {
+			if ((ev = pmc_match_event_class(ctrname +
+			    pcd->pm_evc_name_size, pcd)) == NULL) {
+				errno = EINVAL;
+				goto out;
+			}
 			break;
+		}
+	}
+
+	/*
+	 * Otherwise, search for this event in all compatible PMC
+	 * classes.
+	 */
+	for (n = 0; ev == NULL && n < pmc_event_class_table_size; n++) {
+		pcd = &pmc_class_table[n];
+		if (pmc_mdep_is_compatible_class(pcd->pm_evc_class))
+			ev = pmc_match_event_class(ctrname, pcd);
+	}
 
-	if (pe > PMC_EVENT_LAST) {
+	if (ev == NULL) {
 		errno = EINVAL;
 		goto out;
 	}
 
 	bzero(&pmc_config, sizeof(pmc_config));
-	pmc_config.pm_ev    = pmc_event_table[pe].pm_ev_code;
-	pmc_config.pm_class = pmc_event_table[pe].pm_ev_class;
+	pmc_config.pm_ev    = ev->pm_ev_code;
+	pmc_config.pm_class = pcd->pm_evc_class;
 	pmc_config.pm_cpu   = cpu;
 	pmc_config.pm_mode  = mode;
 	pmc_config.pm_flags = flags;
@@ -1696,7 +1854,7 @@
 	if (PMC_IS_SAMPLING_MODE(mode))
 		pmc_config.pm_caps |= PMC_CAP_INTERRUPT;
 
-	if (pmc_mdep_allocate_pmc(pe, r, &pmc_config) < 0) {
+ 	if (pcd->pm_evc_allocate_pmc(ev->pm_ev_code, r, &pmc_config) < 0) {
 		errno = EINVAL;
 		goto out;
 	}
@@ -1817,28 +1975,28 @@
 	switch (cl)
 	{
 	case PMC_CLASS_TSC:
-		ev = &pmc_event_table[PMC_EV_TSC_TSC];
-		count = 1;
+		ev = tsc_event_table;
+		count = PMC_EVENT_TABLE_SIZE(tsc);
 		break;
 	case PMC_CLASS_K7:
-		ev = &pmc_event_table[PMC_EV_K7_FIRST];
-		count = PMC_EV_K7_LAST - PMC_EV_K7_FIRST + 1;
+		ev = k7_event_table;
+		count = PMC_EVENT_TABLE_SIZE(k7);
 		break;
 	case PMC_CLASS_K8:
-		ev = &pmc_event_table[PMC_EV_K8_FIRST];
-		count = PMC_EV_K8_LAST - PMC_EV_K8_FIRST + 1;
+		ev = k8_event_table;
+		count = PMC_EVENT_TABLE_SIZE(k8);
+		break;
+	case PMC_CLASS_P4:
+		ev = p4_event_table;
+		count = PMC_EVENT_TABLE_SIZE(p4);
 		break;
 	case PMC_CLASS_P5:
-		ev = &pmc_event_table[PMC_EV_P5_FIRST];
-		count = PMC_EV_P5_LAST - PMC_EV_P5_FIRST + 1;
+		ev = p5_event_table;
+		count = PMC_EVENT_TABLE_SIZE(p5);
 		break;
 	case PMC_CLASS_P6:
-		ev = &pmc_event_table[PMC_EV_P6_FIRST];
-		count = PMC_EV_P6_LAST - PMC_EV_P6_FIRST + 1;
-		break;
-	case PMC_CLASS_P4:
-		ev = &pmc_event_table[PMC_EV_P4_FIRST];
-		count = PMC_EV_P4_LAST - PMC_EV_P4_FIRST + 1;
+		ev = p6_event_table;
+		count = PMC_EVENT_TABLE_SIZE(p6);
 		break;
 	default:
 		errno = EINVAL;
@@ -1937,34 +2095,36 @@
 	for (n = 0; n < cpu_info.pm_nclass; n++)
 		cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n];
 
-	/* set parser pointer */
+#define	PMC_MDEP_INIT(C) do {					\
+		pmc_mdep_event_aliases    = C##_aliases;	\
+		pmc_mdep_class_list  = C##_pmc_classes;		\
+		pmc_mdep_class_list_size =			\
+		    PMC_TABLE_SIZE(C##_pmc_classes);		\
+	} while (0)
+
+	/* Configure the event name parser. */
 	switch (cpu_info.pm_cputype) {
 #if defined(__i386__)
 	case PMC_CPU_AMD_K7:
-		pmc_mdep_event_aliases = k7_aliases;
-		pmc_mdep_allocate_pmc = k7_allocate_pmc;
+		PMC_MDEP_INIT(k7);
 		break;
 	case PMC_CPU_INTEL_P5:
-		pmc_mdep_event_aliases = p5_aliases;
-		pmc_mdep_allocate_pmc = p5_allocate_pmc;
+		PMC_MDEP_INIT(p5);
 		break;
 	case PMC_CPU_INTEL_P6:		/* P6 ... Pentium M CPUs have */
 	case PMC_CPU_INTEL_PII:		/* similar PMCs. */
 	case PMC_CPU_INTEL_PIII:
 	case PMC_CPU_INTEL_PM:
-		pmc_mdep_event_aliases = p6_aliases;
-		pmc_mdep_allocate_pmc = p6_allocate_pmc;
+		PMC_MDEP_INIT(p6);
 		break;
 #endif
 #if defined(__amd64__) || defined(__i386__)
+	case PMC_CPU_AMD_K8:
+		PMC_MDEP_INIT(k8);
+		break;
 	case PMC_CPU_INTEL_PIV:
-		pmc_mdep_event_aliases = p4_aliases;
-		pmc_mdep_allocate_pmc = p4_allocate_pmc;
+		PMC_MDEP_INIT(p4);
 		break;
-	case PMC_CPU_AMD_K8:
-		pmc_mdep_event_aliases = k8_aliases;
-		pmc_mdep_allocate_pmc = k8_allocate_pmc;
-		break;
 #endif
 
 	default:
@@ -2013,9 +2173,12 @@
 const char *
 pmc_name_of_cputype(enum pmc_cputype cp)
 {
-	if ((int) cp >= PMC_CPU_FIRST &&
-	    cp <= PMC_CPU_LAST)
-		return (pmc_cputype_names[cp]);
+	size_t n;
+
+	for (n = 0; n < PMC_TABLE_SIZE(pmc_cputype_names); n++)
+		if (cp == pmc_cputype_names[n].pm_cputype)
+			return (pmc_cputype_names[n].pm_name);
+
 	errno = EINVAL;
 	return (NULL);
 }
@@ -2034,9 +2197,32 @@
 const char *
 pmc_name_of_event(enum pmc_event pe)
 {
-	if ((int) pe >= PMC_EVENT_FIRST &&
-	    pe <= PMC_EVENT_LAST)
-		return (pmc_event_table[pe].pm_ev_name);
+	const struct pmc_event_descr *ev, *evfence;
+
+	ev = evfence = NULL;
+	if (pe >= PMC_EV_K7_FIRST && pe <= PMC_EV_K7_LAST) {
+		ev = k7_event_table;
+		evfence = k7_event_table + PMC_EVENT_TABLE_SIZE(k7);
+	} else if (pe >= PMC_EV_K8_FIRST && pe <= PMC_EV_K8_LAST) {
+		ev = k8_event_table;
+		evfence = k8_event_table + PMC_EVENT_TABLE_SIZE(k8);
+	} else if (pe >= PMC_EV_P4_FIRST && pe <= PMC_EV_P4_LAST) {
+		ev = p4_event_table;
+		evfence = p4_event_table + PMC_EVENT_TABLE_SIZE(p4);
+	} else if (pe >= PMC_EV_P5_FIRST && pe <= PMC_EV_P5_LAST) {
+		ev = p5_event_table;
+		evfence = p5_event_table + PMC_EVENT_TABLE_SIZE(p5);
+	} else if (pe >= PMC_EV_P6_FIRST && pe <= PMC_EV_P6_LAST) {
+		ev = p6_event_table;
+		evfence = p6_event_table + PMC_EVENT_TABLE_SIZE(p6);
+	} else if (pe == PMC_EV_TSC_TSC) {
+		ev = tsc_event_table;
+		evfence = tsc_event_table + PMC_EVENT_TABLE_SIZE(tsc);
+	}
+
+	for (; ev != evfence; ev++)
+		if (pe == ev->pm_ev_code)
+			return (ev->pm_ev_name);
 
 	errno = EINVAL;
 	return (NULL);

==== //depot/projects/mips2/src/libexec/rtld-elf/rtld.c#10 (text+ko) ====

@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.127 2008/09/03 01:05:32 kan Exp $
+ * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.128 2008/10/10 00:16:32 kan Exp $
  */
 
 /*
@@ -1925,7 +1925,7 @@
 {
     DoneList donelist;
     const Obj_Entry *obj, *defobj;
-    const Elf_Sym *def;
+    const Elf_Sym *def, *symp;
     unsigned long hash;
     int lockstate;
 
@@ -1951,9 +1951,26 @@
 	    if (handle == RTLD_NEXT)
 		obj = obj->next;
 	    for (; obj != NULL; obj = obj->next) {
-		if ((def = symlook_obj(name, hash, obj, ve, flags)) != NULL) {
-		    defobj = obj;
-		    break;
+	    	if ((symp = symlook_obj(name, hash, obj, ve, flags)) != NULL) {
+		    if (def == NULL || ELF_ST_BIND(symp->st_info) != STB_WEAK) {
+			def = symp;
+			defobj = obj;
+			if (ELF_ST_BIND(def->st_info) != STB_WEAK)
+			    break;
+		    }
+		}
+	    }
+	    /*
+	     * Search the dynamic linker itself, and possibly resolve the
+	     * symbol from there.  This is how the application links to
+	     * dynamic linker services such as dlopen.  Only the values listed
+	     * in the "exports" array can be resolved from the dynamic linker.
+	     */
+	    if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) {
+		symp = symlook_obj(name, hash, &obj_rtld, ve, flags);
+		if (symp != NULL && is_exported(symp)) {
+		    def = symp;
+		    defobj = &obj_rtld;
 		}
 	    }
 	} else {

==== //depot/projects/mips2/src/release/doc/en_US.ISO8859-1/relnotes/article.sgml#21 (text+ko) ====

@@ -17,7 +17,7 @@
 
   <corpauthor>The &os; Project</corpauthor>
 
-  <pubdate>$FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/article.sgml,v 1.1093 2008/09/08 17:13:18 gshapiro Exp $</pubdate>
+  <pubdate>$FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/article.sgml,v 1.1094 2008/10/08 16:46:36 hrs Exp $</pubdate>
 
   <copyright>
     <year>2000</year>
@@ -445,6 +445,9 @@
     <para><application>ncurses</application> has been updated from
       5.6-20061217 to 5.6-20080503.</para>
 
+    <para role="merged"><application>OpenSSH</application> has been updated
+      from 4.5p1 to 5.1p1.</para>
+
     <para role="merged"><application>OpenPAM</application> has been updated from the
       Figwort release to the Hydrangea release.</para>
 

==== //depot/projects/mips2/src/sbin/geom/class/part/gpart.8#4 (text+ko) ====

@@ -22,9 +22,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/sbin/geom/class/part/gpart.8,v 1.5 2008/06/18 01:46:32 marcel Exp $
+.\" $FreeBSD: src/sbin/geom/class/part/gpart.8,v 1.6 2008/10/09 06:23:04 delphij Exp $
 .\"
-.Dd Jun 17, 2008
+.Dd Oct 9, 2008
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -404,6 +404,41 @@
 action.
 .Sh EXIT STATUS
 Exit status is 0 on success, and 1 if the command fails.
+.Sh EXAMPLES
+Create GPT scheme on
+.Pa ad0 .
+.Bd -literal -offset indent
+/sbin/gpart create -s GPT ad0
+.Ed
+.Pp
+Embed GPT bootstrap code into protective MBR.
+.Bd -literal -offset indent
+/sbin/gpart bootcode -b /boot/pmbr ad0
+.Ed
+.Pp
+Create a dedicated
+.Pa freebsd-boot
+partition that can boot FreeBSD from a
+.Pa freebsd-ufs
+partition, and install bootstrap code into it.
+This partition must be larger than
+.Pa /boot/gptboot ,
+or the GPT boot you are willing to write,
+a size of 15 blocks (7680 bytes) would be sufficient for
+booting from UFS, but let's use 128 blocks (64 KB) here in
+this example, in order to reserve some space for potential
+future need (e.g. from a ZFS partition).
+.Bd -literal -offset indent
+/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0
+/sbin/gpart bootcode -p /boot/gptboot -i 1 ad0
+.Ed
+.Pp
+Create a 512MB-sized
+.Pa freebsd-ufs
+partition that would contain UFS where the system boot from.
+.Bd -literal -offset indent
+/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810100501.m9A51lta084819>