PERFORCE change 150287 for review
Warner Losh
imp at FreeBSD.org
Mon Sep 22 17:13:49 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=150287
Change 150287 by imp at imp_paco-paco on 2008/09/22 17:13:09
IFC @150286
Affected files ...
.. //depot/projects/mips2/src/etc/Makefile#10 integrate
.. //depot/projects/mips2/src/lib/libpmc/pmc.3#9 integrate
.. //depot/projects/mips2/src/lib/libpmc/pmc_allocate.3#2 integrate
.. //depot/projects/mips2/src/lib/libpmc/pmc_capabilities.3#3 integrate
.. //depot/projects/mips2/src/lib/libpmc/pmc_disable.3#2 integrate
.. //depot/projects/mips2/src/lib/libpmc/pmc_start.3#2 integrate
.. //depot/projects/mips2/src/sbin/ipfw/ipfw2.c#13 integrate
.. //depot/projects/mips2/src/share/examples/drivers/make_pseudo_driver.sh#3 integrate
.. //depot/projects/mips2/src/share/man/man4/hwpmc.4#6 integrate
.. //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_ioctl.c#1 branch
.. //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_ioctl.h#1 branch
.. //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_proto.h#14 integrate
.. //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_syscall.h#14 integrate
.. //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_syscalls.c#14 integrate
.. //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_sysent.c#14 integrate
.. //depot/projects/mips2/src/sys/compat/freebsd32/syscalls.master#15 integrate
.. //depot/projects/mips2/src/sys/conf/files.amd64#15 integrate
.. //depot/projects/mips2/src/sys/conf/files.ia64#8 integrate
.. //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_amd.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_mod.c#8 integrate
.. //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_piv.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_ppro.c#3 integrate
.. //depot/projects/mips2/src/sys/dev/jme/if_jme.c#4 integrate
.. //depot/projects/mips2/src/sys/dev/jme/if_jmereg.h#3 integrate
.. //depot/projects/mips2/src/sys/kern/kern_pmc.c#3 integrate
.. //depot/projects/mips2/src/sys/netinet6/udp6_usrreq.c#14 integrate
.. //depot/projects/mips2/src/sys/sys/pmckern.h#3 integrate
Differences ...
==== //depot/projects/mips2/src/etc/Makefile#10 (text+ko) ====
@@ -1,5 +1,5 @@
# from: @(#)Makefile 5.11 (Berkeley) 5/21/91
-# $FreeBSD: src/etc/Makefile,v 1.369 2008/09/21 22:02:26 sam Exp $
+# $FreeBSD: src/etc/Makefile,v 1.370 2008/09/22 15:37:47 sam Exp $
.include <bsd.own.mk>
@@ -84,6 +84,10 @@
BIN1+= pf.os
.endif
+.if ${MK_WIRELESS} != "no"
+BIN1+= regdomain.xml
+.endif
+
# -rwxr-xr-x root:wheel, for the new cron root:wheel
BIN2= netstart pccard_ether rc.suspend rc.resume
==== //depot/projects/mips2/src/lib/libpmc/pmc.3#9 (text+ko) ====
@@ -21,7 +21,7 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $FreeBSD: src/lib/libpmc/pmc.3,v 1.21 2008/09/19 13:21:23 jkoshy Exp $
+.\" $FreeBSD: src/lib/libpmc/pmc.3,v 1.22 2008/09/22 14:31:24 jkoshy Exp $
.\"
.Dd September 16, 2008
.Os
@@ -261,7 +261,14 @@
.It Li PMC_CAP_WRITE
The ability to write to performance counters.
.El
-.Ss Functional Grouping
+.Ss CPU Naming Conventions
+CPUs are named using small integers from zero uptil, but
+excluding, the value returned by function
+.Fn pmc_ncpu .
+On platforms supporting sparsely numbered CPUs not all the numbers in
+this range will denote valid CPUs.
+Operations on non-existent CPUs will return an error.
+.Ss Functional Grouping of the API
This section contains a brief overview of the available functionality
in the PMC library.
Each function listed here is described further in its own manual page.
@@ -342,7 +349,7 @@
Retrieve statistics maintained by
.Xr hwpmc 4 .
.It Fn pmc_ncpu
-Determine the number of CPUs in the system.
+Determine the greatest possible CPU number on the system.
.It Fn pmc_npmc
Return the number of hardware PMCs present in a given CPU.
.It Fn pmc_pmcinfo
==== //depot/projects/mips2/src/lib/libpmc/pmc_allocate.3#2 (text+ko) ====
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007 Joseph Koshy. All rights reserved.
+.\" Copyright (c) 2007-2008 Joseph Koshy. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -21,9 +21,9 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $FreeBSD: src/lib/libpmc/pmc_allocate.3,v 1.1 2007/11/23 11:46:08 jkoshy Exp $
+.\" $FreeBSD: src/lib/libpmc/pmc_allocate.3,v 1.2 2008/09/22 14:31:24 jkoshy Exp $
.\"
-.Dd November 20, 2007
+.Dd September 22, 2008
.Os
.Dt PMC_ALLOCATE 3
.Sh NAME
@@ -156,7 +156,7 @@
.It Bq Er ENXIO
Function
.Fn pmc_allocate
-requested the use of a hardware resource that was previously
+requested the use of a hardware resource that was absent or
administratively disabled.
.It Bq Er EOPNOTSUPP
The underlying hardware does not support the capabilities needed for
==== //depot/projects/mips2/src/lib/libpmc/pmc_capabilities.3#3 (text+ko) ====
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007 Joseph Koshy. All rights reserved.
+.\" Copyright (c) 2007-2008 Joseph Koshy. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -21,9 +21,9 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $FreeBSD: src/lib/libpmc/pmc_capabilities.3,v 1.2 2008/03/12 15:48:59 jkoshy Exp $
+.\" $FreeBSD: src/lib/libpmc/pmc_capabilities.3,v 1.3 2008/09/22 14:31:24 jkoshy Exp $
.\"
-.Dd November 24, 2007
+.Dd September 22, 2008
.Os
.Dt PMC_CAPABILITIES 3
.Sh NAME
@@ -96,8 +96,11 @@
.Pp
Function
.Fn pmc_ncpu
-is a convenience function that returns the number of CPUs in the
-system.
+is a convenience function that returns the maximum CPU number in
+the system.
+On systems that support sparsely numbered CPUs, not all CPUs may
+be physically present.
+Applications need to be prepared to deal with nonexistent CPUs.
.Pp
Function
.Fn pmc_npmc
@@ -201,11 +204,11 @@
.It Bq Er EINVAL
The argument
.Fa cpu
-specified a non-existent CPU.
+was invalid.
.It Bq Er ENXIO
The argument
.Fa cpu
-specified a disabled CPU.
+specified a disabled or absent CPU.
.El
.Pp
A call to function
==== //depot/projects/mips2/src/lib/libpmc/pmc_disable.3#2 (text+ko) ====
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007 Joseph Koshy. All rights reserved.
+.\" Copyright (c) 2007-2008 Joseph Koshy. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -21,9 +21,9 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $FreeBSD: src/lib/libpmc/pmc_disable.3,v 1.1 2007/11/23 12:21:34 jkoshy Exp $
+.\" $FreeBSD: src/lib/libpmc/pmc_disable.3,v 1.2 2008/09/22 14:31:24 jkoshy Exp $
.\"
-.Dd November 20, 2007
+.Dd September 22, 2008
.Os
.Dt PMC_ENABLE 3
.Sh NAME
@@ -85,7 +85,7 @@
.It Bq Er ENXIO
Argument
.Fa cpu
-specified a disabled CPU.
+specified a disabled or absent CPU.
.It Bq Er EPERM
The current process lacks sufficient privilege to perform this
operation.
@@ -96,4 +96,4 @@
.Xr pmc_pmcinfo 3 ,
.Xr hwpmc 4 ,
.Xr pmccontrol 8 ,
-.Xr priv_check 9+.Xr priv_check 9
==== //depot/projects/mips2/src/lib/libpmc/pmc_start.3#2 (text+ko) ====
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007 Joseph Koshy. All rights reserved.
+.\" Copyright (c) 2007-2008 Joseph Koshy. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -21,9 +21,9 @@
.\" out of the use of this software, even if advised of the possibility of
.\" such damage.
.\"
-.\" $FreeBSD: src/lib/libpmc/pmc_start.3,v 1.1 2007/11/25 06:38:55 jkoshy Exp $
+.\" $FreeBSD: src/lib/libpmc/pmc_start.3,v 1.2 2008/09/22 14:31:24 jkoshy Exp $
.\"
-.Dd November 25, 2007
+.Dd September 22, 2008
.Os
.Dt PMC_START 3
.Sh NAME
@@ -69,7 +69,8 @@
.Fn pmc_stop
specified a PMC that was never started.
.It Bq Er ENXIO
-The specified PMC had system scope and its associated CPU was disabled.
+The specified PMC had system scope and its associated CPU was disabled or
+absent.
.El
.Sh SEE ALSO
.Xr pmc 3 ,
==== //depot/projects/mips2/src/sbin/ipfw/ipfw2.c#13 (text+ko) ====
@@ -17,7 +17,7 @@
*
* NEW command line interface for IP firewall facility
*
- * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.127 2008/09/21 21:46:56 rik Exp $
+ * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.128 2008/09/22 04:12:27 keramida Exp $
*/
#include <sys/param.h>
@@ -5874,7 +5874,7 @@
char *p;
uint32_t tables_max;
- len = sizeof(a);
+ len = sizeof(tables_max);
if (sysctlbyname("net.inet.ip.fw.tables_max", &tables_max, &len,
NULL, 0) == -1) {
#ifdef IPFW_TABLES_MAX
==== //depot/projects/mips2/src/share/examples/drivers/make_pseudo_driver.sh#3 (text+ko) ====
@@ -6,7 +6,7 @@
#
# Trust me, RUN THIS SCRIPT :)
#
-# $FreeBSD: src/share/examples/drivers/make_pseudo_driver.sh,v 1.13 2006/08/23 23:51:29 rik Exp $
+# $FreeBSD: src/share/examples/drivers/make_pseudo_driver.sh,v 1.14 2008/09/22 16:10:12 ed Exp $
#
#-------cut here------------------
@@ -344,7 +344,7 @@
${1}_drvinit(void *unused)
{
int unit;
- sc_p scp = sca[unit];
+ sc_p scp;
for (unit = 0; unit < N${UPPER}; unit++) {
/*
@@ -362,7 +362,7 @@
}
SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,
- ${1}_drvinit, NULL)
+ ${1}_drvinit, NULL);
DONE
cat >${TOP}/sys/${1}io.h <<DONE
==== //depot/projects/mips2/src/share/man/man4/hwpmc.4#6 (text+ko) ====
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2003-2007 Joseph Koshy
+.\" Copyright (c) 2003-2008 Joseph Koshy
.\" Copyright (c) 2007 The FreeBSD Foundation
.\" All rights reserved.
.\"
@@ -26,9 +26,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man4/hwpmc.4,v 1.22 2007/12/07 08:29:46 jkoshy Exp $
+.\" $FreeBSD: src/share/man/man4/hwpmc.4,v 1.23 2008/09/22 14:31:24 jkoshy Exp $
.\"
-.Dd November 24, 2007
+.Dd September 22, 2008
.Dt HWPMC 4
.Os
.Sh NAME
@@ -307,8 +307,8 @@
The returned error code reflects any pending error state inside
.Nm .
.It Dv PMC_OP_GETCPUINFO
-Retrieve information about the number of CPUs on the system and
-the number of hardware performance monitoring counters available per-CPU.
+Retrieve information about the highest possible CPU number for the system,
+and the number of hardware performance monitoring counters available per CPU.
.It Dv PMC_OP_GETDRIVERSTATS
Retrieve module statistics (for analyzing the behavior of
.Nm
@@ -490,6 +490,12 @@
.Ss SMP Symmetry
The kernel driver requires all physical CPUs in an SMP system to have
identical performance monitoring counter hardware.
+.Ss Sparse CPU Numbering
+On platforms that sparsely number CPUs and which support hot-plugging
+of CPUs, requests that specify non-existent or disabled CPUs will fail
+with an error.
+Applications allocating system-scope PMCs need to be aware of
+the possibility of such transient failures.
.Ss x86 TSC Handling
Historically, on the x86 architecture,
.Fx
@@ -735,17 +741,19 @@
.It Bq Er ENXIO
A
.Dv PMC_OP_GETPMCINFO
-operation was requested for a disabled CPU.
+operation was requested for an absent or disabled CPU.
.It Bq Er ENXIO
-A system-wide PMC on a disabled CPU was requested to be allocated with
-.Dv PMC_OP_PMCALLOCATE .
+A
+.Dv PMC_OP_PMCALLOCATE
+operation specified allocation of a system-wide PMC on an absent or
+disabled CPU.
.It Bq Er ENXIO
A
.Dv PMC_OP_PMCSTART
or
.Dv PMC_OP_PMCSTOP
-request was issued for a system-wide PMC that was allocated on a
-currently disabled CPU.
+request was issued for a system-wide PMC that was allocated on a CPU
+that is currently absent or disabled.
.It Bq Er EOPNOTSUPP
A
.Dv PMC_OP_PMCALLOCATE
==== //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_proto.h#14 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.91 2008/09/19 15:21:40 obrien Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183188 2008-09-19 15:17:32Z obrien
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.92 2008/09/22 16:09:43 obrien Exp $
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183270 2008-09-22 16:09:16Z obrien
*/
#ifndef _FREEBSD32_SYSPROTO_H_
@@ -63,6 +63,11 @@
char ss_l_[PADL_(struct sigaltstack32 *)]; struct sigaltstack32 * ss; char ss_r_[PADR_(struct sigaltstack32 *)];
char oss_l_[PADL_(struct sigaltstack32 *)]; struct sigaltstack32 * oss; char oss_r_[PADR_(struct sigaltstack32 *)];
};
+struct freebsd32_ioctl_args {
+ char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+ char com_l_[PADL_(uint32_t)]; uint32_t com; char com_r_[PADR_(uint32_t)];
+ char data_l_[PADL_(struct md_ioctl32 *)]; struct md_ioctl32 * data; char data_r_[PADR_(struct md_ioctl32 *)];
+};
struct freebsd32_execve_args {
char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
char argv_l_[PADL_(u_int32_t *)]; u_int32_t * argv; char argv_r_[PADR_(u_int32_t *)];
@@ -383,6 +388,7 @@
int freebsd32_sendmsg(struct thread *, struct freebsd32_sendmsg_args *);
int freebsd32_recvfrom(struct thread *, struct freebsd32_recvfrom_args *);
int freebsd32_sigaltstack(struct thread *, struct freebsd32_sigaltstack_args *);
+int freebsd32_ioctl(struct thread *, struct freebsd32_ioctl_args *);
int freebsd32_execve(struct thread *, struct freebsd32_execve_args *);
int freebsd32_setitimer(struct thread *, struct freebsd32_setitimer_args *);
int freebsd32_getitimer(struct thread *, struct freebsd32_getitimer_args *);
@@ -594,6 +600,7 @@
#define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG
#define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM
#define FREEBSD32_SYS_AUE_freebsd32_sigaltstack AUE_SIGALTSTACK
+#define FREEBSD32_SYS_AUE_freebsd32_ioctl AUE_NULL
#define FREEBSD32_SYS_AUE_freebsd32_execve AUE_EXECVE
#define FREEBSD32_SYS_AUE_freebsd32_setitimer AUE_SETITIMER
#define FREEBSD32_SYS_AUE_freebsd32_getitimer AUE_GETITIMER
==== //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_syscall.h#14 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.90 2008/09/19 15:21:40 obrien Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183188 2008-09-19 15:17:32Z obrien
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.91 2008/09/22 16:09:43 obrien Exp $
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183270 2008-09-22 16:09:16Z obrien
*/
#define FREEBSD32_SYS_syscall 0
@@ -58,7 +58,7 @@
#define FREEBSD32_SYS_acct 51
/* 52 is old freebsd32_sigpending */
#define FREEBSD32_SYS_freebsd32_sigaltstack 53
-#define FREEBSD32_SYS_ioctl 54
+#define FREEBSD32_SYS_freebsd32_ioctl 54
#define FREEBSD32_SYS_reboot 55
#define FREEBSD32_SYS_revoke 56
#define FREEBSD32_SYS_symlink 57
==== //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_syscalls.c#14 (text+ko) ====
@@ -2,8 +2,8 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.81 2008/09/19 15:21:40 obrien Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183188 2008-09-19 15:17:32Z obrien
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.82 2008/09/22 16:09:43 obrien Exp $
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183270 2008-09-22 16:09:16Z obrien
*/
const char *freebsd32_syscallnames[] = {
@@ -61,7 +61,7 @@
"acct", /* 51 = acct */
"compat.freebsd32_sigpending", /* 52 = old freebsd32_sigpending */
"freebsd32_sigaltstack", /* 53 = freebsd32_sigaltstack */
- "ioctl", /* 54 = ioctl */
+ "freebsd32_ioctl", /* 54 = freebsd32_ioctl */
"reboot", /* 55 = reboot */
"revoke", /* 56 = revoke */
"symlink", /* 57 = symlink */
==== //depot/projects/mips2/src/sys/compat/freebsd32/freebsd32_sysent.c#14 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.91 2008/09/19 15:21:40 obrien Exp $
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183188 2008-09-19 15:17:32Z obrien
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.92 2008/09/22 16:09:43 obrien Exp $
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183270 2008-09-22 16:09:16Z obrien
*/
#include "opt_compat.h"
@@ -92,7 +92,7 @@
{ AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0 }, /* 51 = acct */
{ compat(0,freebsd32_sigpending), AUE_SIGPENDING, NULL, 0, 0 }, /* 52 = old freebsd32_sigpending */
{ AS(freebsd32_sigaltstack_args), (sy_call_t *)freebsd32_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0 }, /* 53 = freebsd32_sigaltstack */
- { AS(ioctl_args), (sy_call_t *)ioctl, AUE_IOCTL, NULL, 0, 0 }, /* 54 = ioctl */
+ { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_NULL, NULL, 0, 0 }, /* 54 = freebsd32_ioctl */
{ AS(reboot_args), (sy_call_t *)reboot, AUE_REBOOT, NULL, 0, 0 }, /* 55 = reboot */
{ AS(revoke_args), (sy_call_t *)revoke, AUE_REVOKE, NULL, 0, 0 }, /* 56 = revoke */
{ AS(symlink_args), (sy_call_t *)symlink, AUE_SYMLINK, NULL, 0, 0 }, /* 57 = symlink */
==== //depot/projects/mips2/src/sys/compat/freebsd32/syscalls.master#15 (text+ko) ====
@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.106 2008/09/19 15:17:32 obrien Exp $
+ $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.107 2008/09/22 16:09:16 obrien Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
; from: src/sys/kern/syscalls.master 1.107
;
@@ -134,8 +134,8 @@
53 AUE_SIGALTSTACK STD { int freebsd32_sigaltstack( \
struct sigaltstack32 *ss, \
struct sigaltstack32 *oss); }
-54 AUE_IOCTL NOPROTO { int ioctl(int fd, u_long com, \
- caddr_t data); }
+54 AUE_NULL STD { int freebsd32_ioctl(int fd, uint32_t com, \
+ struct md_ioctl32 *data); }
55 AUE_REBOOT NOPROTO { int reboot(int opt); }
56 AUE_REVOKE NOPROTO { int revoke(char *path); }
57 AUE_SYMLINK NOPROTO { int symlink(char *path, char *link); }
==== //depot/projects/mips2/src/sys/conf/files.amd64#15 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.amd64,v 1.122 2008/08/08 16:26:53 stas Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.123 2008/09/22 16:09:16 obrien Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -220,6 +220,7 @@
amd64/ia32/ia32_signal.c optional compat_ia32
amd64/ia32/ia32_sigtramp.S optional compat_ia32
amd64/ia32/ia32_syscall.c optional compat_ia32
+compat/freebsd32/freebsd32_ioctl.c optional compat_ia32
compat/freebsd32/freebsd32_misc.c optional compat_ia32
compat/freebsd32/freebsd32_syscalls.c optional compat_ia32
compat/freebsd32/freebsd32_sysent.c optional compat_ia32
==== //depot/projects/mips2/src/sys/conf/files.ia64#8 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.ia64,v 1.94 2007/12/02 20:40:31 rwatson Exp $
+# $FreeBSD: src/sys/conf/files.ia64,v 1.95 2008/09/22 16:09:16 obrien Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -28,6 +28,7 @@
no-obj no-implicit-rule before-depend \
clean "ukbdmap.h"
#
+compat/freebsd32/freebsd32_ioctl.c optional compat_ia32
compat/freebsd32/freebsd32_misc.c optional compat_ia32
compat/freebsd32/freebsd32_syscalls.c optional compat_ia32
compat/freebsd32/freebsd32_sysent.c optional compat_ia32
==== //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_amd.c#4 (text+ko) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Joseph Koshy
+ * Copyright (c) 2003-2008 Joseph Koshy
* Copyright (c) 2007 The FreeBSD Foundation
* All rights reserved.
*
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_amd.c,v 1.16 2008/03/18 08:39:11 adrian Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_amd.c,v 1.17 2008/09/22 10:37:02 jkoshy Exp $");
/* Support for the AMD K7 and later processors */
@@ -39,6 +39,7 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/pmc.h>
+#include <sys/pmckern.h>
#include <sys/smp.h>
#include <sys/systm.h>
@@ -269,7 +270,7 @@
const struct pmc_hw *phw;
pmc_value_t tmp;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -327,7 +328,7 @@
const struct pmc_hw *phw;
enum pmc_mode mode;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -374,7 +375,7 @@
PMCDBG(MDP,CFG,1, "cpu=%d ri=%d pm=%p", cpu, ri, pm);
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -456,7 +457,7 @@
(void) cpu;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row index %d", __LINE__, ri));
@@ -550,7 +551,7 @@
(void) pmc;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -582,7 +583,7 @@
struct pmc_hw *phw;
const struct amd_descr *pd;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -631,7 +632,7 @@
const struct amd_descr *pd;
uint64_t config;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -683,7 +684,7 @@
struct pmc_hw *phw;
pmc_value_t v;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] out of range CPU %d", __LINE__, cpu));
PMCDBG(MDP,INT,1, "cpu=%d tf=%p um=%d", cpu, (void *) tf,
@@ -763,7 +764,7 @@
const struct amd_descr *pd;
struct pmc_hw *phw;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < AMD_NPMCS,
("[amd,%d] row-index %d out of range", __LINE__, ri));
@@ -832,7 +833,7 @@
struct amd_cpu *pcs;
struct pmc_hw *phw;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] insane cpu number %d", __LINE__, cpu));
PMCDBG(MDP,INI,1,"amd-init cpu=%d", cpu);
@@ -875,7 +876,7 @@
uint32_t evsel;
struct pmc_cpu *pcs;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] insane cpu number (%d)", __LINE__, cpu));
PMCDBG(MDP,INI,1,"amd-cleanup cpu=%d", cpu);
==== //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_mod.c#8 (text+ko) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Joseph Koshy
+ * Copyright (c) 2003-2008 Joseph Koshy
* Copyright (c) 2007 The FreeBSD Foundation
* All rights reserved.
*
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.33 2008/07/25 05:49:48 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.34 2008/09/22 10:37:02 jkoshy Exp $");
#include <sys/param.h>
#include <sys/eventhandler.h>
@@ -98,8 +98,8 @@
KASSERT(pmc_pmcdisp[(R)] <= 0, ("[pmc,%d] row disposition error", \
__LINE__)); \
atomic_add_int(&pmc_pmcdisp[(R)], -1); \
- KASSERT(pmc_pmcdisp[(R)] >= (-mp_ncpus), ("[pmc,%d] row " \
- "disposition error", __LINE__)); \
+ KASSERT(pmc_pmcdisp[(R)] >= (-pmc_cpu_max_active()), \
+ ("[pmc,%d] row disposition error", __LINE__)); \
} while (0)
#define PMC_UNMARK_ROW_STANDALONE(R) do { \
@@ -637,12 +637,12 @@
static void
pmc_select_cpu(int cpu)
{
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[pmc,%d] bad cpu number %d", __LINE__, cpu));
- /* never move to a disabled CPU */
- KASSERT(pmc_cpu_is_disabled(cpu) == 0, ("[pmc,%d] selecting "
- "disabled CPU %d", __LINE__, cpu));
+ /* Never move to an inactive CPU. */
+ KASSERT(pmc_cpu_is_active(cpu), ("[pmc,%d] selecting inactive "
+ "CPU %d", __LINE__, cpu));
PMCDBG(CPU,SEL,2, "select-cpu cpu=%d", cpu);
thread_lock(curthread);
@@ -1186,7 +1186,7 @@
PMCDBG(CSW,SWI,1, "cpu=%d proc=%p (%d, %s) pp=%p", cpu, p,
p->p_pid, p->p_comm, pp);
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[pmc,%d] wierd CPU id %d", __LINE__, cpu));
pc = pmc_pcpu[cpu];
@@ -1311,7 +1311,7 @@
PMCDBG(CSW,SWO,1, "cpu=%d proc=%p (%d, %s) pp=%p", cpu, p,
p->p_pid, p->p_comm, pp);
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[pmc,%d wierd CPU id %d", __LINE__, cpu));
pc = pmc_pcpu[cpu];
@@ -2038,7 +2038,7 @@
#ifdef DEBUG
volatile int maxloop;
- maxloop = 100 * mp_ncpus;
+ maxloop = 100 * pmc_cpu_max();
#endif
/*
@@ -2499,7 +2499,7 @@
cpu = PMC_TO_CPU(pm);
- if (pmc_cpu_is_disabled(cpu))
+ if (!pmc_cpu_is_active(cpu))
return ENXIO;
pmc_select_cpu(cpu);
@@ -2566,10 +2566,10 @@
cpu = PMC_TO_CPU(pm);
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[pmc,%d] illegal cpu=%d", __LINE__, cpu));
- if (pmc_cpu_is_disabled(cpu))
+ if (!pmc_cpu_is_active(cpu))
return ENXIO;
pmc_select_cpu(cpu);
@@ -2734,7 +2734,7 @@
struct pmc_op_getcpuinfo gci;
gci.pm_cputype = md->pmd_cputype;
- gci.pm_ncpu = mp_ncpus;
+ gci.pm_ncpu = pmc_cpu_max();
gci.pm_npmc = md->pmd_npmc;
gci.pm_nclass = md->pmd_nclass;
bcopy(md->pmd_classes, &gci.pm_classes,
@@ -2802,12 +2802,12 @@
if ((error = copyin(&gpi->pm_cpu, &cpu, sizeof(cpu))) != 0)
break;
- if (cpu >= (unsigned int) mp_ncpus) {
+ if (cpu >= pmc_cpu_max()) {
error = EINVAL;
break;
}
- if (pmc_cpu_is_disabled(cpu)) {
+ if (!pmc_cpu_is_active(cpu)) {
error = ENXIO;
break;
}
@@ -2896,12 +2896,12 @@
cpu = pma.pm_cpu;
- if (cpu < 0 || cpu >= mp_ncpus) {
+ if (cpu < 0 || cpu >= (int) pmc_cpu_max()) {
error = EINVAL;
break;
}
- if (pmc_cpu_is_disabled(cpu)) {
+ if (!pmc_cpu_is_active(cpu)) {
error = ENXIO;
break;
}
@@ -2989,7 +2989,7 @@
if ((mode != PMC_MODE_SS && mode != PMC_MODE_SC &&
mode != PMC_MODE_TS && mode != PMC_MODE_TC) ||
- (cpu != (u_int) PMC_CPU_ANY && cpu >= (u_int) mp_ncpus)) {
+ (cpu != (u_int) PMC_CPU_ANY && cpu >= pmc_cpu_max())) {
error = EINVAL;
break;
}
@@ -3006,10 +3006,10 @@
}
/*
- * Check that a disabled CPU is not being asked for.
+ * Check that an inactive CPU is not being asked for.
*/
- if (PMC_IS_SYSTEM_MODE(mode) && pmc_cpu_is_disabled(cpu)) {
+ if (PMC_IS_SYSTEM_MODE(mode) && !pmc_cpu_is_active(cpu)) {
error = ENXIO;
break;
}
@@ -3522,7 +3522,7 @@
cpu = PMC_TO_CPU(pm);
ri = PMC_TO_ROWINDEX(pm);
- if (pmc_cpu_is_disabled(cpu)) {
+ if (!pmc_cpu_is_active(cpu)) {
error = ENXIO;
break;
}
@@ -4292,6 +4292,7 @@
pmc_initialize(void)
{
int cpu, error, n;
+ unsigned int maxcpu;
struct pmc_binding pb;
struct pmc_sample *ps;
struct pmc_samplebuffer *sb;
@@ -4349,18 +4350,20 @@
if (md == NULL || md->pmd_init == NULL)
return ENOSYS;
+ maxcpu = pmc_cpu_max();
+
/* allocate space for the per-cpu array */
- MALLOC(pmc_pcpu, struct pmc_cpu **, mp_ncpus * sizeof(struct pmc_cpu *),
+ MALLOC(pmc_pcpu, struct pmc_cpu **, maxcpu * sizeof(struct pmc_cpu *),
M_PMC, M_WAITOK|M_ZERO);
/* per-cpu 'saved values' for managing process-mode PMCs */
MALLOC(pmc_pcpu_saved, pmc_value_t *,
- sizeof(pmc_value_t) * mp_ncpus * md->pmd_npmc, M_PMC, M_WAITOK);
+ sizeof(pmc_value_t) * maxcpu * md->pmd_npmc, M_PMC, M_WAITOK);
- /* perform cpu dependent initialization */
+ /* Perform CPU-dependent initialization. */
pmc_save_cpu_binding(&pb);
- for (cpu = 0; cpu < mp_ncpus; cpu++) {
- if (pmc_cpu_is_disabled(cpu))
+ for (cpu = 0; cpu < maxcpu; cpu++) {
+ if (!pmc_cpu_is_active(cpu))
continue;
pmc_select_cpu(cpu);
if ((error = md->pmd_init(cpu)) != 0)
@@ -4372,8 +4375,8 @@
return error;
/* allocate space for the sample array */
- for (cpu = 0; cpu < mp_ncpus; cpu++) {
- if (pmc_cpu_is_disabled(cpu))
+ for (cpu = 0; cpu < maxcpu; cpu++) {
+ if (!pmc_cpu_is_active(cpu))
continue;
MALLOC(sb, struct pmc_samplebuffer *,
sizeof(struct pmc_samplebuffer) +
@@ -4463,6 +4466,7 @@
pmc_cleanup(void)
{
int cpu;
+ unsigned int maxcpu;
struct pmc_ownerhash *ph;
struct pmc_owner *po, *tmp;
struct pmc_binding pb;
@@ -4542,9 +4546,10 @@
KASSERT(pmc_ss_count == 0,
("[pmc,%d] Global SS count not empty", __LINE__));
- /* free the per-cpu sample buffers */
- for (cpu = 0; cpu < mp_ncpus; cpu++) {
- if (pmc_cpu_is_disabled(cpu))
+ /* Free the per-cpu sample buffers. */
+ maxcpu = pmc_cpu_max();
+ for (cpu = 0; cpu < maxcpu; cpu++) {
+ if (!pmc_cpu_is_active(cpu))
continue;
KASSERT(pmc_pcpu[cpu]->pc_sb != NULL,
("[pmc,%d] Null cpu sample buffer cpu=%d", __LINE__,
@@ -4558,14 +4563,14 @@
PMCDBG(MOD,INI,3, "%s", "md cleanup");
if (md) {
pmc_save_cpu_binding(&pb);
- for (cpu = 0; cpu < mp_ncpus; cpu++) {
+ for (cpu = 0; cpu < maxcpu; cpu++) {
PMCDBG(MOD,INI,1,"pmc-cleanup cpu=%d pcs=%p",
cpu, pmc_pcpu[cpu]);
- if (pmc_cpu_is_disabled(cpu))
+ if (!pmc_cpu_is_active(cpu) || pmc_pcpu[cpu] == NULL)
continue;
pmc_select_cpu(cpu);
- if (pmc_pcpu[cpu])
- (void) md->pmd_cleanup(cpu);
+ if (md->pmd_cleanup)
+ md->pmd_cleanup(cpu);
}
FREE(md, M_PMC);
md = NULL;
@@ -4606,8 +4611,8 @@
error = pmc_initialize();
if (error != 0)
break;
- PMCDBG(MOD,INI,1, "syscall=%d ncpus=%d",
- pmc_syscall_num, mp_ncpus);
+ PMCDBG(MOD,INI,1, "syscall=%d maxcpu=%d",
+ pmc_syscall_num, pmc_cpu_max());
break;
==== //depot/projects/mips2/src/sys/dev/hwpmc/hwpmc_piv.c#4 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_piv.c,v 1.15 2007/12/07 08:20:15 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_piv.c,v 1.16 2008/09/22 10:37:02 jkoshy Exp $");
#include <sys/param.h>
#include <sys/lock.h>
@@ -532,8 +532,8 @@
KASSERT(p4_escrdisp[(E)] <= 0, ("[p4,%d] row disposition error",\
__LINE__)); \
atomic_add_int(&p4_escrdisp[(E)], -1); \
- KASSERT(p4_escrdisp[(E)] >= (-mp_ncpus), ("[p4,%d] row " \
- "disposition error", __LINE__)); \
+ KASSERT(p4_escrdisp[(E)] >= (-pmc_cpu_max_active()), \
+ ("[p4,%d] row disposition error", __LINE__)); \
} while (0)
#define P4_ESCR_UNMARK_ROW_STANDALONE(E) do { \
@@ -596,11 +596,11 @@
struct p4_logicalcpu *plcs;
struct pmc_hw *phw;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[p4,%d] insane cpu number %d", __LINE__, cpu));
- PMCDBG(MDP,INI,0, "p4-init cpu=%d logical=%d", cpu,
- pmc_cpu_is_logical(cpu) != 0);
+ PMCDBG(MDP,INI,0, "p4-init cpu=%d is-primary=%d", cpu,
+ pmc_cpu_is_primary(cpu) != 0);
/*
* The two CPUs in an HT pair share their per-cpu state.
@@ -614,7 +614,7 @@
* secondary.
*/
- if (pmc_cpu_is_logical(cpu) && (cpu & 1)) {
+ if (!pmc_cpu_is_primary(cpu) && (cpu & 1)) {
p4_system_has_htt = 1;
@@ -761,7 +761,7 @@
struct pmc_hw *phw;
pmc_value_t tmp;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[p4,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < P4_NPMCS,
("[p4,%d] illegal row-index %d", __LINE__, ri));
@@ -839,7 +839,7 @@
const struct pmc_hw *phw;
const struct p4pmc_descr *pd;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[amd,%d] illegal CPU value %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < P4_NPMCS,
("[amd,%d] illegal row-index %d", __LINE__, ri));
@@ -913,7 +913,7 @@
struct p4_cpu *pc;
int cfgflags, cpuflag;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[p4,%d] illegal CPU %d", __LINE__, cpu));
KASSERT(ri >= 0 && ri < P4_NPMCS,
("[p4,%d] illegal row-index %d", __LINE__, ri));
@@ -1050,7 +1050,7 @@
struct p4_event_descr *pevent;
const struct p4pmc_descr *pd;
- KASSERT(cpu >= 0 && cpu < mp_ncpus,
+ KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
("[p4,%d] illegal CPU %d", __LINE__, cpu));
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list