PERFORCE change 94212 for review
John Baldwin
jhb at FreeBSD.org
Tue Mar 28 21:48:43 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94212
Change 94212 by jhb at jhb_slimer on 2006/03/28 21:47:47
IFC @94211.
Affected files ...
.. //depot/projects/smpng/sys/alpha/alpha/clock.c#29 integrate
.. //depot/projects/smpng/sys/alpha/include/cpu.h#16 integrate
.. //depot/projects/smpng/sys/compat/linux/linux_misc.c#63 integrate
.. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_piv.c#7 integrate
.. //depot/projects/smpng/sys/dev/md/md.c#78 integrate
.. //depot/projects/smpng/sys/dev/mfi/mfi.c#2 integrate
.. //depot/projects/smpng/sys/dev/mfi/mfi_disk.c#2 integrate
.. //depot/projects/smpng/sys/geom/raid3/g_raid3.c#25 integrate
.. //depot/projects/smpng/sys/i386/include/atomic.h#46 integrate
.. //depot/projects/smpng/sys/kern/kern_acct.c#43 integrate
.. //depot/projects/smpng/sys/kern/kern_alq.c#12 integrate
.. //depot/projects/smpng/sys/kern/kern_ktrace.c#51 integrate
.. //depot/projects/smpng/sys/kern/kern_sig.c#123 integrate
.. //depot/projects/smpng/sys/kern/syscalls.master#71 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#103 integrate
.. //depot/projects/smpng/sys/kern/vfs_vnops.c#70 integrate
.. //depot/projects/smpng/sys/netinet6/in6.h#20 integrate
.. //depot/projects/smpng/sys/netinet6/ipsec.c#23 integrate
.. //depot/projects/smpng/sys/opencrypto/cryptosoft.c#9 integrate
.. //depot/projects/smpng/sys/sparc64/fhc/clkbrd.c#3 integrate
.. //depot/projects/smpng/sys/sparc64/fhc/clkbrdreg.h#2 integrate
.. //depot/projects/smpng/sys/sparc64/include/bus.h#26 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#79 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/tick.c#18 integrate
.. //depot/projects/smpng/sys/sys/pmc.h#7 integrate
.. //depot/projects/smpng/sys/sys/pmclog.h#4 integrate
.. //depot/projects/smpng/sys/sys/sysproto.h#70 integrate
.. //depot/projects/smpng/sys/sys/umtx.h#14 integrate
Differences ...
==== //depot/projects/smpng/sys/alpha/alpha/clock.c#29 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.44 2006/03/07 22:12:09 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/clock.c,v 1.45 2006/03/28 21:20:11 jhb Exp $");
#include "opt_clock.h"
==== //depot/projects/smpng/sys/alpha/include/cpu.h#16 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/alpha/include/cpu.h,v 1.43 2005/12/22 22:16:04 jhb Exp $ */
+/* $FreeBSD: src/sys/alpha/include/cpu.h,v 1.44 2006/03/28 21:20:12 jhb Exp $ */
/* From: NetBSD: cpu.h,v 1.18 1997/09/23 23:17:49 mjacob Exp */
/*-
==== //depot/projects/smpng/sys/compat/linux/linux_misc.c#63 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.175 2006/03/19 11:10:33 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.177 2006/03/27 23:27:11 avatar Exp $");
#include "opt_compat.h"
#include "opt_mac.h"
@@ -1405,13 +1405,12 @@
int
linux_sethostname(struct thread *td, struct linux_sethostname_args *args)
{
- struct proc *p = td->td_proc;
int name[2];
int error;
name[0] = CTL_KERN;
name[1] = KERN_HOSTNAME;
- if ((error = suser_cred(p->p_ucred, SUSER_ALLOWJAIL)))
+ if ((error = suser_cred(td->td_ucred, SUSER_ALLOWJAIL)))
return (error);
return (userland_sysctl(td, name, 2, 0, 0, 0, args->hostname,
args->len, 0, 0));
==== //depot/projects/smpng/sys/dev/hwpmc/hwpmc_piv.c#7 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_piv.c,v 1.12 2005/12/26 09:27:24 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_piv.c,v 1.13 2006/03/28 14:09:21 jkoshy Exp $");
#include <sys/param.h>
#include <sys/lock.h>
@@ -674,6 +674,7 @@
static int
p4_cleanup(int cpu)
{
+ int i;
struct p4_cpu *pcs;
PMCDBG(MDP,INI,0, "p4-cleanup cpu=%d", cpu);
@@ -681,6 +682,11 @@
if ((pcs = (struct p4_cpu *) pmc_pcpu[cpu]) == NULL)
return 0;
+ /* Turn off all PMCs on this CPU */
+ for (i = 0; i < P4_NPMCS - 1; i++)
+ wrmsr(P4_CCCR_MSR_FIRST + i,
+ rdmsr(P4_CCCR_MSR_FIRST + i) & ~P4_CCCR_ENABLE);
+
/*
* If the CPU is physical we need to teardown the
* full MD state.
==== //depot/projects/smpng/sys/dev/md/md.c#78 (text+ko) ====
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $FreeBSD: src/sys/dev/md/md.c,v 1.163 2006/03/26 23:21:11 wkoszek Exp $
+ * $FreeBSD: src/sys/dev/md/md.c,v 1.164 2006/03/28 21:25:11 jhb Exp $
*
*/
==== //depot/projects/smpng/sys/dev/mfi/mfi.c#2 (text) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi.c,v 1.1 2006/03/25 06:14:32 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi.c,v 1.2 2006/03/28 01:59:11 scottl Exp $");
#include "opt_mfi.h"
@@ -911,6 +911,12 @@
struct mfi_ld *ld;
device_t child;
+ if ((secsize == 0) || (sectors == 0)) {
+ device_printf(sc->mfi_dev, "Invalid capacity parameters for "
+ "logical disk %d\n", id);
+ return (EINVAL);
+ }
+
ld = malloc(sizeof(struct mfi_ld), M_MFIBUF, M_NOWAIT|M_ZERO);
if (ld == NULL) {
device_printf(sc->mfi_dev, "Cannot allocate ld\n");
@@ -929,7 +935,6 @@
device_set_ivars(child, ld);
device_set_desc(child, "MFI Logical Disk");
- TAILQ_INSERT_TAIL(&sc->mfi_ld_tqh, ld, ld_link);
mtx_unlock(&sc->mfi_io_lock);
mtx_lock(&Giant);
bus_generic_attach(sc->mfi_dev);
==== //depot/projects/smpng/sys/dev/mfi/mfi_disk.c#2 (text) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi_disk.c,v 1.1 2006/03/25 06:14:32 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi_disk.c,v 1.2 2006/03/28 01:59:11 scottl Exp $");
#include "opt_mfi.h"
@@ -119,6 +119,7 @@
free(sc->ld_ld, M_MFIBUF);
return (EINVAL);
}
+ TAILQ_INSERT_TAIL(&sc->ld_controller->mfi_ld_tqh, ld, ld_link);
device_printf(dev, "%juMB (%ju sectors) RAID\n",
sectors / (1024 * 1024 / secsize), sectors);
==== //depot/projects/smpng/sys/geom/raid3/g_raid3.c#25 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.58 2006/03/25 23:30:36 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.59 2006/03/28 18:34:36 pjd Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -180,7 +180,7 @@
{
struct g_raid3_zone *sz = arg;
- if (sz->sz_inuse == sz->sz_max)
+ if (sz->sz_max > 0 && sz->sz_inuse == sz->sz_max)
return (ENOMEM);
sz->sz_inuse++;
return (0);
==== //depot/projects/smpng/sys/i386/include/atomic.h#46 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/include/atomic.h,v 1.41 2005/09/27 17:39:10 jhb Exp $
+ * $FreeBSD: src/sys/i386/include/atomic.h,v 1.42 2006/03/28 14:34:48 des Exp $
*/
#ifndef _MACHINE_ATOMIC_H_
#define _MACHINE_ATOMIC_H_
@@ -415,24 +415,42 @@
#define atomic_fetchadd_32 atomic_fetchadd_int
/* Operations on pointers. */
-#define atomic_set_ptr atomic_set_int
-#define atomic_set_acq_ptr atomic_set_acq_int
-#define atomic_set_rel_ptr atomic_set_rel_int
-#define atomic_clear_ptr atomic_clear_int
-#define atomic_clear_acq_ptr atomic_clear_acq_int
-#define atomic_clear_rel_ptr atomic_clear_rel_int
-#define atomic_add_ptr atomic_add_int
-#define atomic_add_acq_ptr atomic_add_acq_int
-#define atomic_add_rel_ptr atomic_add_rel_int
-#define atomic_subtract_ptr atomic_subtract_int
-#define atomic_subtract_acq_ptr atomic_subtract_acq_int
-#define atomic_subtract_rel_ptr atomic_subtract_rel_int
-#define atomic_load_acq_ptr atomic_load_acq_int
-#define atomic_store_rel_ptr atomic_store_rel_int
-#define atomic_cmpset_ptr atomic_cmpset_int
-#define atomic_cmpset_acq_ptr atomic_cmpset_acq_int
-#define atomic_cmpset_rel_ptr atomic_cmpset_rel_int
-#define atomic_readandclear_ptr atomic_readandclear_int
+#define atomic_set_ptr(p, v) \
+ atomic_set_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_set_acq_ptr(p, v) \
+ atomic_set_acq_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_set_rel_ptr(p, v) \
+ atomic_set_rel_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_clear_ptr(p, v) \
+ atomic_clear_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_clear_acq_ptr(p, v) \
+ atomic_clear_acq_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_clear_rel_ptr(p, v) \
+ atomic_clear_rel_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_add_ptr(p, v) \
+ atomic_add_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_add_acq_ptr(p, v) \
+ atomic_add_acq_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_add_rel_ptr(p, v) \
+ atomic_add_rel_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_subtract_ptr(p, v) \
+ atomic_subtract_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_subtract_acq_ptr(p, v) \
+ atomic_subtract_acq_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_subtract_rel_ptr(p, v) \
+ atomic_subtract_rel_int((volatile u_int *)(p), (u_int)(v))
+#define atomic_load_acq_ptr(p) \
+ atomic_load_acq_int((volatile u_int *)(p))
+#define atomic_store_rel_ptr(p, v) \
+ atomic_store_rel_int((volatile u_int *)(p), (v))
+#define atomic_cmpset_ptr(dst, old, new) \
+ atomic_cmpset_int((volatile u_int *)(dst), (u_int)(old), (u_int)(new))
+#define atomic_cmpset_acq_ptr(dst, old, new) \
+ atomic_cmpset_acq_int((volatile u_int *)(dst), (u_int)(old), (u_int)(new))
+#define atomic_cmpset_rel_ptr(dst, old, new) \
+ atomic_cmpset_rel_int((volatile u_int *)(dst), (u_int)(old), (u_int)(new))
+#define atomic_readandclear_ptr(p) \
+ atomic_readandclear_int((volatile u_int *)(p))
#endif /* !defined(WANT_FUNCTIONS) */
#endif /* ! _MACHINE_ATOMIC_H_ */
==== //depot/projects/smpng/sys/kern/kern_acct.c#43 (text+ko) ====
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_acct.c,v 1.80 2006/02/07 18:59:47 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_acct.c,v 1.81 2006/03/28 21:26:59 jhb Exp $");
#include "opt_mac.h"
==== //depot/projects/smpng/sys/kern/kern_alq.c#12 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_alq.c,v 1.14 2006/01/27 11:25:06 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_alq.c,v 1.15 2006/03/28 21:30:22 jhb Exp $");
#include "opt_mac.h"
==== //depot/projects/smpng/sys/kern/kern_ktrace.c#51 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_ktrace.c,v 1.107 2006/01/30 08:19:01 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_ktrace.c,v 1.108 2006/03/28 21:30:22 jhb Exp $");
#include "opt_ktrace.h"
#include "opt_mac.h"
==== //depot/projects/smpng/sys/kern/kern_sig.c#123 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.327 2006/03/09 08:31:51 davidxu Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.328 2006/03/28 21:30:22 jhb Exp $");
#include "opt_compat.h"
#include "opt_ktrace.h"
==== //depot/projects/smpng/sys/kern/syscalls.master#71 (text+ko) ====
@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/kern/syscalls.master,v 1.213 2006/03/23 08:46:41 davidxu Exp $
+ $FreeBSD: src/sys/kern/syscalls.master,v 1.215 2006/03/28 14:32:37 des Exp $
; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94
;
; System call name/number master file.
==== //depot/projects/smpng/sys/kern/vfs_syscalls.c#103 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.412 2006/03/21 23:58:37 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.413 2006/03/28 21:22:08 jhb Exp $");
#include "opt_compat.h"
#include "opt_mac.h"
==== //depot/projects/smpng/sys/kern/vfs_vnops.c#70 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/vfs_vnops.c,v 1.239 2006/03/22 00:00:05 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/vfs_vnops.c,v 1.240 2006/03/28 21:22:08 jhb Exp $");
#include "opt_mac.h"
==== //depot/projects/smpng/sys/netinet6/in6.h#20 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6.h,v 1.43 2006/03/19 02:11:42 suz Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6.h,v 1.44 2006/03/28 12:51:22 dwmalone Exp $ */
/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */
/*-
@@ -77,31 +77,9 @@
#define __KAME_VERSION "FreeBSD"
/*
- * Local port number conventions:
- *
- * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
- * unless a kernel is compiled with IPNOPRIVPORTS defined.
- *
- * When a user does a bind(2) or connect(2) with a port number of zero,
- * a non-conflicting local port address is chosen.
- *
- * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
- * that is settable by sysctl(3); net.inet.ip.anonportmin and
- * net.inet.ip.anonportmax respectively.
- *
- * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
- * default assignment range.
- *
- * The value IP_PORTRANGE_DEFAULT causes the default behavior.
- *
- * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
- * and exists only for FreeBSD compatibility purposes.
- *
- * The value IP_PORTRANGE_LOW changes the range to the "low" are
- * that is (by convention) restricted to privileged processes.
- * This convention is based on "vouchsafe" principles only.
- * It is only secure if you trust the remote host to restrict these ports.
- * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
+ * IPv6 port allocation rules should mirror the IPv4 rules and are controlled
+ * by the the net.inet.ip.portrange sysctl tree. The following defines exist
+ * for compatibility with userland applications that need them.
*/
#if __BSD_VISIBLE
#define IPV6PORT_RESERVED 1024
==== //depot/projects/smpng/sys/netinet6/ipsec.c#23 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/ipsec.c,v 1.43 2005/07/25 12:31:42 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/ipsec.c,v 1.44 2006/03/28 10:16:38 rwatson Exp $ */
/* $KAME: ipsec.c,v 1.207 2004/01/13 03:30:42 itojun Exp $ */
/*-
@@ -3469,15 +3469,6 @@
MGETHDR(mnew, M_DONTWAIT, MT_HEADER);
if (mnew == NULL)
goto fail;
- mnew->m_pkthdr = n->m_pkthdr;
-#if 0
- /* XXX: convert to m_tag or delete? */
- if (n->m_pkthdr.aux) {
- mnew->m_pkthdr.aux =
- m_copym(n->m_pkthdr.aux,
- 0, M_COPYALL, M_DONTWAIT);
- }
-#endif
M_MOVE_PKTHDR(mnew, n);
}
else {
==== //depot/projects/smpng/sys/opencrypto/cryptosoft.c#9 (text+ko) ====
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/opencrypto/cryptosoft.c,v 1.9 2005/03/11 12:37:06 ume Exp $");
+__FBSDID("$FreeBSD: src/sys/opencrypto/cryptosoft.c,v 1.10 2006/03/28 08:33:30 pjd Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1028,3 +1028,12 @@
#undef REGISTER
}
SYSINIT(cryptosoft_init, SI_SUB_PSEUDO, SI_ORDER_ANY, swcr_init, NULL)
+
+static void
+swcr_uninit(void)
+{
+
+ if (swcr_sessions != NULL)
+ FREE(swcr_sessions, M_CRYPTO_DATA);
+}
+SYSUNINIT(cryptosoft_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, swcr_uninit, NULL);
==== //depot/projects/smpng/sys/sparc64/fhc/clkbrd.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/sparc64/fhc/clkbrd.c,v 1.2 2005/11/30 16:13:49 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/sparc64/fhc/clkbrd.c,v 1.3 2006/03/28 19:46:48 marius Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -131,19 +131,20 @@
slots = 4;
r = bus_space_read_1(sc->sc_bt[CLKBRD_CLK], sc->sc_bh[CLKBRD_CLK],
CLK_STS1);
- switch (r & 0xc0) {
- case 0x40:
+ switch (r & CLK_STS1_SLOTS_MASK) {
+ case CLK_STS1_SLOTS_16:
slots = 16;
break;
- case 0xc0:
+ case CLK_STS1_SLOTS_8:
slots = 8;
break;
- case 0x80:
+ case CLK_STS1_SLOTS_4:
if (sc->sc_flags & CLKBRD_HAS_CLKVER) {
r = bus_space_read_1(sc->sc_bt[CLKBRD_CLKVER],
- sc->sc_bh[CLKBRD_CLKVER], 0);
- if (r != 0 && (r & 0x80) == 0)
- slots = 5;
+ sc->sc_bh[CLKBRD_CLKVER], CLKVER_SLOTS);
+ if (r != 0 &&
+ (r & CLKVER_SLOTS_MASK) == CLKVER_SLOTS_PLUS)
+ slots = 5;
}
}
==== //depot/projects/smpng/sys/sparc64/fhc/clkbrdreg.h#2 (text+ko) ====
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2004 Jason L. Wright (jason at thought.net)
+ * Copyright (c) 2006 Marius Strobl <marius at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,23 +26,72 @@
*
* from: OpenBSD: clkbrdreg.h,v 1.2 2004/10/01 15:36:30 jason Exp
*
- * $FreeBSD: src/sys/sparc64/fhc/clkbrdreg.h,v 1.1 2005/03/19 01:04:48 marius Exp $
+ * $FreeBSD: src/sys/sparc64/fhc/clkbrdreg.h,v 1.2 2006/03/28 19:46:48 marius Exp $
*/
-#define CLK_CTRL 0x00
-#define CLK_STS1 0x10
-#define CLK_STS2 0x20
-#define CLK_PSTS1 0x30
-#define CLK_PPRES 0x40
-#define CLK_TEMP 0x50
-#define CLK_IRQ 0x60
-#define CLK_PSTS2 0x70
+#ifndef _SPARC64_FHC_CLKBRDREG_H_
+#define _SPARC64_FHC_CLKBRDREG_H_
+
+/* register bank 0 */
+#define CLK_CF_REG2 0x20 /* clock frequency register 2 */
+#define CLK_CF_REG2_REN_RCONS 0x80 /* reset enable: remote console */
+#define CLK_CF_REG2_REN_GEN 0x40 /* reset enable: frequency change */
+#define CLK_CF_REG2_REN_WDOG 0x20 /* reset enable: watchdog */
+#define CLK_CF_REG2_DIV1 0x10 /* CPU module divisor bit 1 */
+#define CLK_CF_REG2_RANGE 0x0c /* clock range */
+#define CLK_CF_REG2_DIV0 0x02 /* CPU module divisor bit 0 */
+#define CLK_CF_REG2_FREQ8 0x01 /* frequency bit 8 */
+
+/* register bank 1 */
+#define CLK_CTRL 0x00 /* system control register */
+#define CLK_CTRL_IEN_FAN 0x80 /* intr enable: fan failure */
+#define CLK_CTRL_IEN_DC 0x40 /* intr enable: power supply DC */
+#define CLK_CTRL_IEN_AC 0x20 /* intr enable: AC power */
+#define CLK_CTRL_IEN_BRD 0x10 /* intr enable: board insert */
+#define CLK_CTRL_POFF 0x08 /* turn off system power */
+#define CLK_CTRL_LLED 0x04 /* left led (reversed) */
+#define CLK_CTRL_MLED 0x02 /* middle led */
+#define CLK_CTRL_RLED 0x01 /* right led */
+#define CLK_STS1 0x10 /* system status register 1 */
+#define CLK_STS1_SLOTS_MASK 0xc0 /* system status 1 slots mask */
+#define CLK_STS1_SLOTS_16 0x40 /* 16 slots */
+#define CLK_STS1_SLOTS_8 0xc0 /* 8 slots */
+#define CLK_STS1_SLOTS_4 0x80 /* 4 slots */
+#define CLK_STS1_SLOTS_TESTBED 0x00 /* test machine */
+#define CLK_STS1_SECURE 0x20 /* key in position secure (reversed) */
+#define CLK_STS1_FAN 0x10 /* fan tray present (reversed) */
+#define CLK_STS1_BRD 0x08 /* board inserted (reversed) */
+#define CLK_STS1_PS0 0x04 /* power supply 0 present (reversed) */
+#define CLK_STS1_RST_WDOG 0x02 /* rst by: watchdog (reversed) */
+#define CLK_STS1_RST_GEN 0x01 /* rst by: freq change (reversed) */
+#define CLK_STS2 0x20 /* system status register 2 */
+#define CLK_STS2_RST_RCONS 0x80 /* rst by: remote console (reversed) */
+#define CLK_STS2_OK_PS0 0x40 /* ok: power supply 0 */
+#define CLK_STS2_OK_33V 0x20 /* ok: 3.3V on clock board */
+#define CLK_STS2_OK_50V 0x10 /* ok: 5.0V on clock board */
+#define CLK_STS2_FAIL_AC 0x08 /* failed: AC power */
+#define CLK_STS2_FAIL_FAN 0x04 /* failed: rack fans */
+#define CLK_STS2_OK_ACFAN 0x02 /* ok: 4 AC box fans */
+#define CLK_STS2_OK_KEYFAN 0x01 /* ok: keyswitch fans */
+#define CLK_PSTS1 0x30 /* power supply 1 status register */
+#define CLK_PSTS1_PS 0x80 /* power supply 1 present (reversed) */
+#define CLK_PPRES 0x40 /* power supply presence register */
+#define CLK_PPRES_CSHARE 0x80 /* current share backplane */
+#define CLK_PPRES_OK_MASK 0x7f /* precharge and peripheral pwr mask */
+#define CLK_PPRES_OK_P_5V 0x40 /* ok: peripheral 5V */
+#define CLK_PPRES_OK_P_12V 0x20 /* ok: peripheral 12V */
+#define CLK_PPRES_OK_AUX_5V 0x10 /* ok: auxiliary 5V */
+#define CLK_PPRES_OK_PP_5V 0x08 /* ok: peripheral 5V precharge */
+#define CLK_PPRES_OK_PP_12V 0x04 /* ok: peripheral 12V precharge */
+#define CLK_PPRES_OK_SP_3V 0x02 /* ok: system 3.3V precharge */
+#define CLK_PPRES_OK_SP_5V 0x01 /* ok: system 5V precharge */
+#define CLK_TEMP 0x50 /* temperature register */
+#define CLK_IDIAG 0x60 /* interrupt diagnostic register */
+#define CLK_PSTS2 0x70 /* power supply 2 status register */
+
+/* register bank 2 */
+#define CLKVER_SLOTS 0x00 /* clock version slots register */
+#define CLKVER_SLOTS_MASK 0x80 /* clock version slots mask */
+#define CLKVER_SLOTS_PLUS 0x00 /* plus system (reversed) */
-#define CLK_CTRL_IEN_FAN 0x80 /* intr enable: fan failure */
-#define CLK_CTRL_IEN_DC 0x40 /* intr enable: pwr supply DC */
-#define CLK_CTRL_IEN_AC 0x20 /* intr enable: AC pwr supply */
-#define CLK_CTRL_IEN_BRD 0x10 /* intr enable: board insert */
-#define CLK_CTRL_POFF 0x08 /* turn off system power */
-#define CLK_CTRL_LLED 0x04 /* left led (reversed) */
-#define CLK_CTRL_MLED 0x02 /* middle led */
-#define CLK_CTRL_RLED 0x01 /* right led */
+#endif /* !_SPARC64_FHC_CLKBRDREG_H_ */
==== //depot/projects/smpng/sys/sparc64/include/bus.h#26 (text+ko) ====
@@ -69,7 +69,7 @@
* and
* from: FreeBSD: src/sys/alpha/include/bus.h,v 1.9 2001/01/09
*
- * $FreeBSD: src/sys/sparc64/include/bus.h,v 1.37 2005/04/18 21:45:34 imp Exp $
+ * $FreeBSD: src/sys/sparc64/include/bus.h,v 1.38 2006/03/28 19:19:37 marius Exp $
*/
#ifndef _MACHINE_BUS_H_
@@ -318,7 +318,7 @@
static __inline void
bus_space_write_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
- uint8_t *a, size_t c)
+ const uint8_t *a, size_t c)
{
while (c-- > 0)
@@ -327,7 +327,7 @@
static __inline void
bus_space_write_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
- uint16_t *a, size_t c)
+ const uint16_t *a, size_t c)
{
while (c-- > 0)
@@ -336,7 +336,7 @@
static __inline void
bus_space_write_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
- uint32_t *a, size_t c)
+ const uint32_t *a, size_t c)
{
while (c-- > 0)
@@ -345,7 +345,7 @@
static __inline void
bus_space_write_multi_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o,
- uint64_t *a, size_t c)
+ const uint64_t *a, size_t c)
{
while (c-- > 0)
==== //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#79 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/machdep.c,v 1.127 2006/02/14 14:50:11 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/machdep.c,v 1.128 2006/03/28 20:28:31 marius Exp $");
#include "opt_compat.h"
#include "opt_ddb.h"
@@ -321,6 +321,11 @@
break;
}
+ /*
+ * Initialize the tick counter. Must be before the console is inited
+ * in order to provide the low-level console drivers with a working
+ * DELAY().
+ */
OF_getprop(child, "clock-frequency", &clock, sizeof(clock));
tick_init(clock);
@@ -330,7 +335,7 @@
cninit();
/*
- * Panic is there is no metadata. Most likely the kernel was booted
+ * Panic if there is no metadata. Most likely the kernel was booted
* directly, instead of through loader(8).
*/
if (mdp == NULL || kmdp == NULL) {
==== //depot/projects/smpng/sys/sparc64/sparc64/tick.c#18 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/tick.c,v 1.20 2006/02/11 09:33:07 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/sparc64/sparc64/tick.c,v 1.21 2006/03/28 20:25:46 marius Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -146,13 +146,6 @@
tick_freq = clock;
tick_MHz = clock / 1000000;
tick_increment = clock / hz;
- /*
- * Avoid stopping of hardclock in terms of a lost tick interrupt
- * by ensuring that the tick period is at least TICK_GRACE ticks.
- */
- if (tick_increment < TICK_GRACE)
- panic("%s: HZ to high, decrease to at least %ld", __func__,
- clock / TICK_GRACE);
/*
* UltraSparc II[e,i] based systems come up with the tick interrupt
@@ -172,6 +165,18 @@
{
u_long base, s;
+ /*
+ * Avoid stopping of hardclock in terms of a lost tick interrupt
+ * by ensuring that the tick period is at least TICK_GRACE ticks.
+ * This check would be better placed in tick_init(), however we
+ * have to call tick_init() before cninit() in order to provide
+ * the low-level console drivers with a working DELAY() which in
+ * turn means we cannot use panic() in tick_init().
+ */
+ if (tick_increment < TICK_GRACE)
+ panic("%s: HZ too high, decrease to at least %ld", __func__,
+ tick_freq / TICK_GRACE);
+
if (PCPU_GET(cpuid) == 0)
intr_setup(PIL_TICK, tick_hardclock, -1, NULL, NULL);
==== //depot/projects/smpng/sys/sys/pmc.h#7 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/sys/pmc.h,v 1.10 2006/03/26 12:20:54 jkoshy Exp $
+ * $FreeBSD: src/sys/sys/pmc.h,v 1.11 2006/03/28 16:20:29 jkoshy Exp $
*/
#ifndef _SYS_PMC_H_
@@ -533,7 +533,6 @@
#include <sys/malloc.h>
#include <sys/sysctl.h>
-#define PMC_REQUEST_POOL_SIZE 32
#define PMC_HASH_SIZE 16
#define PMC_MTXPOOL_SIZE 32
#define PMC_LOG_BUFFER_SIZE 4
==== //depot/projects/smpng/sys/sys/pmclog.h#4 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/sys/pmclog.h,v 1.3 2006/03/26 12:20:54 jkoshy Exp $
+ * $FreeBSD: src/sys/sys/pmclog.h,v 1.4 2006/03/28 16:20:29 jkoshy Exp $
*/
#ifndef _SYS_PMCLOG_H_
@@ -57,9 +57,6 @@
PMCLOG_TYPE_MAP_OUT
};
-#define PMCLOG_MAPPING_INSERT 0x01 /* obsolete */
-#define PMCLOG_MAPPING_DELETE 0x02 /* obsolete */
-
/*
* A log entry descriptor comprises of a 32 bit header and a 64 bit
* time stamp followed by as many 32 bit words are required to record
==== //depot/projects/smpng/sys/sys/sysproto.h#70 (text+ko) ====
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/sysproto.h,v 1.192 2006/03/23 08:48:37 davidxu Exp $
+ * $FreeBSD: src/sys/sys/sysproto.h,v 1.194 2006/03/28 14:32:38 des Exp $
* created from FreeBSD: src/sys/kern/syscalls.master,v 1.213 2006/03/23 08:46:41 davidxu Exp
*/
==== //depot/projects/smpng/sys/sys/umtx.h#14 (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/sys/sys/umtx.h,v 1.17 2005/10/26 06:55:46 davidxu Exp $
+ * $FreeBSD: src/sys/sys/umtx.h,v 1.19 2006/03/28 14:32:38 des Exp $
*
*/
@@ -52,13 +52,15 @@
#ifndef _KERNEL
/*
- * System calls for acquiring and releasing contested mutexes.
+ * System call for userland mutex operations.
+ */
+int _umtx_op(struct umtx *umtx, int op, long id, void *uaddr, void *uaddr2);
+
+/*
+ * Old (deprecated) userland mutex system calls.
*/
-/* deprecated becaues it can only use thread id */
int _umtx_lock(struct umtx *mtx);
-/* deprecated becaues it can only use thread id */
int _umtx_unlock(struct umtx *mtx);
-int _umtx_op(struct umtx *umtx, int op, long id, void *uaddr, void *uaddr2);
/*
* Standard api. Try uncontested acquire/release and asks the
@@ -100,7 +102,8 @@
{
if (atomic_cmpset_acq_ptr(&umtx->u_owner, (void *)UMTX_UNOWNED,
(void *)id) == 0)
- if (_umtx_op(umtx, UMTX_OP_LOCK, id, 0, (void *)timeout) == -1)
+ if (_umtx_op(umtx, UMTX_OP_LOCK, id, 0,
+ __DECONST(void *, timeout)) == -1)
return (errno);
return (0);
}
@@ -118,7 +121,8 @@
static __inline int
umtx_wait(struct umtx *umtx, long id, const struct timespec *timeout)
{
- if (_umtx_op(umtx, UMTX_OP_WAIT, id, 0, (void *)timeout) == -1)
+ if (_umtx_op(umtx, UMTX_OP_WAIT, id, 0,
+ __DECONST(void *, timeout)) == -1)
return (errno);
return (0);
}
More information about the p4-projects
mailing list