PERFORCE change 43251 for review
John Baldwin
jhb at FreeBSD.org
Mon Dec 1 13:36:59 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=43251
Change 43251 by jhb at jhb_blue on 2003/12/01 13:36:01
IFC @43247.
Affected files ...
.. //depot/projects/smpng/sys/alpha/alpha/db_trace.c#7 integrate
.. //depot/projects/smpng/sys/alpha/alpha/mp_machdep.c#24 integrate
.. //depot/projects/smpng/sys/amd64/amd64/amd64_mem.c#4 integrate
.. //depot/projects/smpng/sys/amd64/amd64/autoconf.c#5 integrate
.. //depot/projects/smpng/sys/amd64/amd64/genassym.c#9 integrate
.. //depot/projects/smpng/sys/amd64/amd64/identcpu.c#6 integrate
.. //depot/projects/smpng/sys/amd64/amd64/initcpu.c#3 integrate
.. //depot/projects/smpng/sys/amd64/amd64/legacy.c#3 integrate
.. //depot/projects/smpng/sys/amd64/amd64/machdep.c#17 integrate
.. //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#2 integrate
.. //depot/projects/smpng/sys/amd64/amd64/nexus.c#8 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#17 integrate
.. //depot/projects/smpng/sys/amd64/amd64/support.S#8 integrate
.. //depot/projects/smpng/sys/amd64/amd64/sys_machdep.c#5 integrate
.. //depot/projects/smpng/sys/amd64/amd64/trap.c#14 integrate
.. //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#12 integrate
.. //depot/projects/smpng/sys/amd64/conf/GENERIC#11 integrate
.. //depot/projects/smpng/sys/amd64/include/_limits.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/_stdint.h#2 integrate
.. //depot/projects/smpng/sys/amd64/include/acpica_machdep.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/asmacros.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/atomic.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/bus_dma.h#8 integrate
.. //depot/projects/smpng/sys/amd64/include/limits.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/pcpu.h#3 integrate
.. //depot/projects/smpng/sys/amd64/include/proc.h#2 integrate
.. //depot/projects/smpng/sys/amd64/include/specialreg.h#4 integrate
.. //depot/projects/smpng/sys/amd64/isa/atpic.c#2 integrate
.. //depot/projects/smpng/sys/amd64/isa/clock.c#5 integrate
.. //depot/projects/smpng/sys/amd64/isa/isa.c#3 integrate
.. //depot/projects/smpng/sys/amd64/isa/isa_dma.c#3 integrate
.. //depot/projects/smpng/sys/boot/i386/loader/loader.rc#2 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_all.c#19 integrate
.. //depot/projects/smpng/sys/conf/kern.post.mk#27 integrate
.. //depot/projects/smpng/sys/conf/majors#30 integrate
.. //depot/projects/smpng/sys/conf/newvers.sh#8 integrate
.. //depot/projects/smpng/sys/conf/options.i386#35 integrate
.. //depot/projects/smpng/sys/contrib/dev/acpica/dsmthdat.c#12 integrate
.. //depot/projects/smpng/sys/contrib/dev/acpica/exfldio.c#14 integrate
.. //depot/projects/smpng/sys/contrib/dev/acpica/utdelete.c#13 integrate
.. //depot/projects/smpng/sys/contrib/dev/ath/ah.h#4 integrate
.. //depot/projects/smpng/sys/contrib/dev/ath/freebsd/i386-elf.hal.o.uu#5 integrate
.. //depot/projects/smpng/sys/contrib/dev/ath/version.h#4 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_cpu.c#17 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_pcib.c#18 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/ahc_pci.c#15 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/ahd_pci.c#13 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-all.c#43 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-all.h#20 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-card.c#15 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#23 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-dma.c#33 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-pci.h#15 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-raid.c#25 integrate
.. //depot/projects/smpng/sys/dev/ata/atapi-cd.c#43 integrate
.. //depot/projects/smpng/sys/dev/ath/if_ath.c#12 integrate
.. //depot/projects/smpng/sys/dev/ath/if_ath_pci.c#6 integrate
.. //depot/projects/smpng/sys/dev/ath/if_athioctl.h#4 integrate
.. //depot/projects/smpng/sys/dev/ath/if_athvar.h#7 integrate
.. //depot/projects/smpng/sys/dev/bktr/bktr_core.c#13 integrate
.. //depot/projects/smpng/sys/dev/bktr/bktr_os.c#17 integrate
.. //depot/projects/smpng/sys/dev/bktr/bktr_os.h#5 integrate
.. //depot/projects/smpng/sys/dev/bktr/bktr_reg.h#5 integrate
.. //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#21 integrate
.. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#47 integrate
.. //depot/projects/smpng/sys/dev/ips/ips.c#5 integrate
.. //depot/projects/smpng/sys/dev/ips/ips.h#5 integrate
.. //depot/projects/smpng/sys/dev/ips/ips_commands.c#6 integrate
.. //depot/projects/smpng/sys/dev/led/led.c#2 integrate
.. //depot/projects/smpng/sys/dev/puc/puc_pci.c#5 integrate
.. //depot/projects/smpng/sys/dev/re/if_re.c#5 integrate
.. //depot/projects/smpng/sys/dev/sio/sio_pci.c#12 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/buffer.c#9 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/buffer.h#5 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/channel.c#23 integrate
.. //depot/projects/smpng/sys/dev/uart/uart_bus_pci.c#4 integrate
.. //depot/projects/smpng/sys/dev/usb/ehci_pci.c#7 integrate
.. //depot/projects/smpng/sys/dev/usb/ohci.c#27 integrate
.. //depot/projects/smpng/sys/dev/usb/ohci_pci.c#7 integrate
.. //depot/projects/smpng/sys/dev/usb/uhci_pci.c#7 integrate
.. //depot/projects/smpng/sys/dev/vinum/vinuminterrupt.c#6 integrate
.. //depot/projects/smpng/sys/dev/vinum/vinumio.c#16 integrate
.. //depot/projects/smpng/sys/dev/vinum/vinumrequest.c#14 integrate
.. //depot/projects/smpng/sys/i386/i386/elan-mmcr.c#12 integrate
.. //depot/projects/smpng/sys/i386/i386/machdep.c#69 integrate
.. //depot/projects/smpng/sys/i386/i386/mp_machdep.c#60 integrate
.. //depot/projects/smpng/sys/i386/include/pcpu.h#10 integrate
.. //depot/projects/smpng/sys/ia64/ia64/mp_machdep.c#26 integrate
.. //depot/projects/smpng/sys/kern/subr_smp.c#22 integrate
.. //depot/projects/smpng/sys/kern/vfs_mount.c#22 integrate
.. //depot/projects/smpng/sys/kern/vfs_subr.c#63 integrate
.. //depot/projects/smpng/sys/modules/acpi/Makefile#16 integrate
.. //depot/projects/smpng/sys/net/bpf.h#8 integrate
.. //depot/projects/smpng/sys/net/route.c#16 integrate
.. //depot/projects/smpng/sys/netatalk/at_control.c#8 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.c#40 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.h#26 integrate
.. //depot/projects/smpng/sys/netinet/ip_divert.c#29 integrate
.. //depot/projects/smpng/sys/netinet/ip_dummynet.c#24 integrate
.. //depot/projects/smpng/sys/netinet/ip_fw2.c#25 integrate
.. //depot/projects/smpng/sys/netinet/ip_input.c#46 integrate
.. //depot/projects/smpng/sys/netinet/raw_ip.c#33 integrate
.. //depot/projects/smpng/sys/netinet/tcp_hostcache.c#2 integrate
.. //depot/projects/smpng/sys/netinet/tcp_input.c#43 integrate
.. //depot/projects/smpng/sys/netinet/tcp_subr.c#39 integrate
.. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#23 integrate
.. //depot/projects/smpng/sys/netinet/udp_usrreq.c#35 integrate
.. //depot/projects/smpng/sys/netinet6/ip6_output.c#25 integrate
.. //depot/projects/smpng/sys/netinet6/raw_ip6.c#22 integrate
.. //depot/projects/smpng/sys/netinet6/udp6_usrreq.c#25 integrate
.. //depot/projects/smpng/sys/netkey/key.c#22 integrate
.. //depot/projects/smpng/sys/nfs4client/nfs4_vfsops.c#2 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs.h#13 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_bio.c#23 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_subs.c#15 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_vfsops.c#32 integrate
.. //depot/projects/smpng/sys/nfsclient/nfsmount.h#6 integrate
.. //depot/projects/smpng/sys/nfsclient/nfsnode.h#7 integrate
.. //depot/projects/smpng/sys/pci/if_dc.c#49 integrate
.. //depot/projects/smpng/sys/pci/if_rl.c#40 integrate
.. //depot/projects/smpng/sys/pci/if_sk.c#26 integrate
.. //depot/projects/smpng/sys/pci/if_xl.c#39 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/mp_machdep.c#4 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/mp_machdep.c#20 integrate
.. //depot/projects/smpng/sys/sys/mbuf.h#29 integrate
.. //depot/projects/smpng/sys/sys/pcpu.h#10 integrate
.. //depot/projects/smpng/sys/sys/smp.h#8 integrate
.. //depot/projects/smpng/sys/sys/soundcard.h#8 integrate
.. //depot/projects/smpng/sys/sys/timepps.h#5 integrate
.. //depot/projects/smpng/sys/vm/uma_core.c#39 integrate
Differences ...
==== //depot/projects/smpng/sys/alpha/alpha/db_trace.c#7 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/alpha/alpha/db_trace.c,v 1.15 2003/08/17 06:42:07 marcel Exp $ */
+/* $FreeBSD: src/sys/alpha/alpha/db_trace.c,v 1.16 2003/11/29 11:57:02 jeff Exp $ */
/* $NetBSD: db_trace.c,v 1.9 2000/12/13 03:16:36 mycroft Exp $ */
/*-
@@ -112,7 +112,7 @@
* Decode the function prologue for the function we're in, and note
* which registers are stored where, and how large the stack frame is.
*/
-static void
+static int
decode_prologue(db_addr_t callpc, db_addr_t func,
struct prologue_info *pi)
{
@@ -127,6 +127,7 @@
do { \
if (pi->pi_frame_size != 0) { \
db_printf("frame size botch: adjust register offsets?\n"); \
+ return (1); \
} \
} while (0)
@@ -143,9 +144,11 @@
*/
signed_immediate = (long)ins.mem_format.displacement;
#if 1
- if (signed_immediate > 0)
+ if (signed_immediate > 0) {
db_printf("prologue botch: displacement %ld\n",
signed_immediate);
+ return (1);
+ }
#endif
CHECK_FRAMESIZE;
pi->pi_frame_size += -signed_immediate;
@@ -169,6 +172,7 @@
pi->pi_reg_offset[ins.mem_format.rd] = signed_immediate;
}
}
+ return (0);
}
static int
@@ -363,7 +367,8 @@
*
* XXX How does this interact w/ alloca()?!
*/
- decode_prologue(callpc, symval, &pi);
+ if (decode_prologue(callpc, symval, &pi))
+ return;
if ((pi.pi_regmask & (1 << 26)) == 0) {
/*
* No saved RA found. We might have RA from
==== //depot/projects/smpng/sys/alpha/alpha/mp_machdep.c#24 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.48 2003/08/17 06:42:07 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/mp_machdep.c,v 1.50 2003/11/30 22:08:24 jeff Exp $");
#include "opt_kstack_pages.h"
@@ -64,6 +64,7 @@
u_int boot_cpu_id;
static void release_aps(void *dummy);
+static int smp_cpu_enabled(struct pcs *pcsp);
extern void smp_init_secondary_glue(void);
static int smp_send_secondary_command(const char *command, int cpuid);
static int smp_start_secondary(int cpuid);
@@ -301,10 +302,49 @@
/* Other stuff */
+static int
+smp_cpu_enabled(struct pcs *pcsp)
+{
+
+ /* Is this CPU present? */
+ if ((pcsp->pcs_flags & PCS_PP) == 0)
+ return (0);
+
+ /* Is this CPU available? */
+ if ((pcsp->pcs_flags & PCS_PA) == 0)
+ /*
+ * The TurboLaser PCS_PA bit doesn't seem to be set
+ * correctly.
+ */
+ if (hwrpb->rpb_type != ST_DEC_21000)
+ return (0);
+
+ /* Is this CPU's PALcode valid? */
+ if ((pcsp->pcs_flags & PCS_PV) == 0)
+ return (0);
+
+ return (1);
+}
+
+void
+cpu_mp_setmaxid(void)
+{
+ int i;
+
+ mp_maxid = 0;
+ for (i = 0; i < hwrpb->rpb_pcs_cnt && i < MAXCPU; i++) {
+ if (i == PCPU_GET(cpuid))
+ continue;
+ if (!smp_cpu_enabled(LOCATE_PCS(hwrpb, i)))
+ continue;
+ mp_maxid = i;
+ }
+ mp_maxid++;
+}
+
int
cpu_mp_probe(void)
{
- struct pcs *pcsp;
int i, cpus;
/* XXX: Need to check for valid platforms here. */
@@ -315,33 +355,16 @@
all_cpus = 1 << boot_cpu_id;
mp_ncpus = 1;
- mp_maxid = 0;
/* Make sure we have at least one secondary CPU. */
cpus = 0;
for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
if (i == PCPU_GET(cpuid))
continue;
- pcsp = (struct pcs *)((char *)hwrpb + hwrpb->rpb_pcs_off +
- (i * hwrpb->rpb_pcs_size));
- if ((pcsp->pcs_flags & PCS_PP) == 0) {
+ if (!smp_cpu_enabled(LOCATE_PCS(hwrpb, i)))
continue;
- }
- if ((pcsp->pcs_flags & PCS_PA) == 0) {
- /*
- * The TurboLaser PCS_PA bit doesn't seem to be set
- * correctly.
- */
- if (hwrpb->rpb_type != ST_DEC_21000)
- continue;
- }
- if ((pcsp->pcs_flags & PCS_PV) == 0) {
+ if (i > MAXCPU)
continue;
- }
- if (i > MAXCPU) {
- continue;
- }
- mp_maxid = i;
cpus++;
}
return (cpus);
@@ -359,8 +382,7 @@
if (i == boot_cpu_id)
continue;
- pcsp = (struct pcs *)((char *)hwrpb + hwrpb->rpb_pcs_off +
- (i * hwrpb->rpb_pcs_size));
+ pcsp = LOCATE_PCS(hwrpb, i);
if ((pcsp->pcs_flags & PCS_PP) == 0)
continue;
if ((pcsp->pcs_flags & PCS_PA) == 0) {
==== //depot/projects/smpng/sys/amd64/amd64/amd64_mem.c#4 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/amd64_mem.c,v 1.22 2003/10/21 18:28:33 silby Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/amd64_mem.c,v 1.23 2003/11/22 01:11:07 peter Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -214,13 +214,13 @@
msrv = rdmsr(msr);
mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
amd64_mtrr2mrt(msrv & 0xff);
- mrd->mr_base = msrv & 0x000ffffffffff000L;
+ mrd->mr_base = msrv & 0x000000fffffff000L;
msrv = rdmsr(msr + 1);
mrd->mr_flags = (msrv & 0x800) ?
(mrd->mr_flags | MDF_ACTIVE) :
(mrd->mr_flags & ~MDF_ACTIVE);
/* Compute the range from the mask. Ick. */
- mrd->mr_len = (~(msrv & 0x000ffffffffff000L) & 0x000fffffffffffffL) + 1;
+ mrd->mr_len = (~(msrv & 0x000000fffffff000L) & 0x000000ffffffffffL) + 1;
if (!mrvalid(mrd->mr_base, mrd->mr_len))
mrd->mr_flags |= MDF_BOGUS;
/* If unclaimed and active, must be the BIOS */
@@ -348,7 +348,7 @@
/* base/type register */
omsrv = rdmsr(msr);
if (mrd->mr_flags & MDF_ACTIVE) {
- msrv = mrd->mr_base & 0x000ffffffffff000L;
+ msrv = mrd->mr_base & 0x000000fffffff000L;
msrv |= amd64_mrt2mtrr(mrd->mr_flags, omsrv);
} else {
msrv = 0;
@@ -357,7 +357,7 @@
/* mask/active register */
if (mrd->mr_flags & MDF_ACTIVE) {
- msrv = 0x800 | (~(mrd->mr_len - 1) & 0x000ffffffffff000L);
+ msrv = 0x800 | (~(mrd->mr_len - 1) & 0x000000fffffff000L);
} else {
msrv = 0;
}
@@ -553,7 +553,6 @@
return;
}
nmdesc = mtrrcap & 0xff;
- printf("Pentium Pro MTRR support enabled\n");
/* If fixed MTRRs supported and enabled */
if ((mtrrcap & 0x100) && (mtrrdef & 0x400)) {
==== //depot/projects/smpng/sys/amd64/amd64/autoconf.c#5 (text+ko) ====
@@ -33,11 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)autoconf.c 7.1 (Berkeley) 5/9/91
+ * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/autoconf.c,v 1.176 2003/11/17 08:58:12 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/autoconf.c,v 1.177 2003/11/21 03:01:59 peter Exp $");
/*
* Setup the system to run on the current machine.
==== //depot/projects/smpng/sys/amd64/amd64/genassym.c#9 (text+ko) ====
@@ -33,11 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)genassym.c 5.11 (Berkeley) 5/10/91
+ * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.150 2003/11/17 08:58:12 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.151 2003/11/21 03:01:59 peter Exp $");
#include "opt_compat.h"
#include "opt_kstack_pages.h"
==== //depot/projects/smpng/sys/amd64/amd64/identcpu.c#6 (text+ko) ====
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1992 Terrence R. Lambert.
* Copyright (c) 1982, 1987, 1990 The Regents of the University of California.
* Copyright (c) 1997 KATO Takenori.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.127 2003/11/17 08:58:12 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.128 2003/11/21 03:01:59 peter Exp $");
#include "opt_cpu.h"
==== //depot/projects/smpng/sys/amd64/amd64/initcpu.c#3 (text+ko) ====
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) KATO Takenori, 1997, 1998.
*
* All rights reserved. Unpublished rights reserved under the copyright
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/initcpu.c,v 1.46 2003/07/25 21:15:44 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/initcpu.c,v 1.47 2003/11/21 03:01:59 peter Exp $");
#include "opt_cpu.h"
==== //depot/projects/smpng/sys/amd64/amd64/legacy.c#3 (text+ko) ====
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright 1998 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/legacy.c,v 1.51 2003/07/25 21:15:44 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/legacy.c,v 1.52 2003/11/21 03:01:59 peter Exp $");
/*
* This code implements a system driver for legacy systems that do not
==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#17 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.599 2003/11/17 08:58:12 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.600 2003/11/20 22:54:44 peter Exp $");
#include "opt_atalk.h"
#include "opt_atpic.h"
@@ -121,6 +121,9 @@
#include <sys/ptrace.h>
#include <machine/sigframe.h>
+/* Sanity check for __curthread() */
+CTASSERT(offsetof(struct pcpu, pc_curthread) == 0);
+
extern u_int64_t hammer_time(u_int64_t, u_int64_t);
extern void dblfault_handler(void);
==== //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.226 2003/11/17 08:58:12 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.229 2003/11/30 22:20:40 jeff Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
@@ -130,7 +130,7 @@
} static cpu_info[MAXCPU];
static int cpu_apic_ids[MAXCPU];
-static u_int boot_address;
+static u_int boot_address;
static void set_logical_apic_ids(void);
static int start_all_aps(void);
@@ -179,14 +179,34 @@
cpu_info[apic_id].cpu_bsp = 1;
}
mp_ncpus++;
- if (apic_id > mp_maxid)
- mp_maxid = apic_id;
+ if (apic_id >= mp_maxid)
+ mp_maxid = apic_id + 1;
if (bootverbose)
printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" :
"AP");
}
+void
+cpu_mp_setmaxid(void)
+{
+
+ /*
+ * mp_maxid should be already set by calls to cpu_add().
+ * Just sanity check its value here.
+ */
+ if (mp_ncpus == 0)
+ KASSERT(mp_maxid == 0,
+ ("%s: mp_ncpus is zero, but mp_maxid is not", __func__));
+ else if (mp_ncpus == 1)
+ mp_maxid = 0;
+ else
+ KASSERT(mp_maxid >= mp_ncpus - 1,
+ ("%s: counters out of sync: max %d, count %d", __func__,
+ mp_maxid, mp_ncpus));
+
+}
+
int
cpu_mp_probe(void)
{
@@ -202,8 +222,6 @@
* the variables to represent a system with a single CPU
* with an id of 0.
*/
- KASSERT(mp_maxid == 0,
- ("%s: mp_ncpus is zero, but mp_maxid is not", __func__));
mp_ncpus = 1;
return (0);
}
@@ -219,9 +237,6 @@
}
/* At least two CPUs were found. */
- KASSERT(mp_maxid >= mp_ncpus - 1,
- ("%s: counters out of sync: max %d, count %d", __func__, mp_maxid,
- mp_ncpus));
return (1);
}
==== //depot/projects/smpng/sys/amd64/amd64/nexus.c#8 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.56 2003/11/17 08:58:13 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.57 2003/11/21 03:00:05 peter Exp $");
/*
* This code implements a `root nexus' for Intel Architecture
@@ -135,6 +135,7 @@
static int
nexus_probe(device_t dev)
{
+ int irq, last;
device_quiet(dev); /* suppress attach message for neatness */
@@ -160,12 +161,27 @@
irq_rman.rm_type = RMAN_ARRAY;
irq_rman.rm_descr = "Interrupt request lines";
irq_rman.rm_end = NUM_IO_INTS - 1;
- if (rman_init(&irq_rman)
- || rman_manage_region(&irq_rman,
- irq_rman.rm_start, irq_rman.rm_end))
+ if (rman_init(&irq_rman))
panic("nexus_probe irq_rman");
/*
+ * We search for regions of existing IRQs and add those to the IRQ
+ * resource manager.
+ */
+ last = -1;
+ for (irq = 0; irq < NUM_IO_INTS; irq++)
+ if (intr_lookup_source(irq) != NULL) {
+ if (last == -1)
+ last = irq;
+ } else if (last != -1) {
+ if (rman_manage_region(&irq_rman, last, irq - 1) != 0)
+ panic("nexus_probe irq_rman add");
+ last = -1;
+ }
+ if (last != -1 && rman_manage_region(&irq_rman, last, irq - 1) != 0)
+ panic("nexus_probe irq_rman add");
+
+ /*
* ISA DMA on PCI systems is implemented in the ISA part of each
* PCI->ISA bridge and the channels can be duplicated if there are
* multiple bridges. (eg: laptops with docking stations)
==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#17 (text+ko) ====
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1991 Regents of the University of California.
* All rights reserved.
* Copyright (c) 1994 John S. Dyson
@@ -40,7 +40,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)pmap.c 7.7 (Berkeley) 5/12/91
+ * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
*/
/*-
* Copyright (c) 2003 Networks Associates Technology, Inc.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.446 2003/11/17 08:58:13 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.447 2003/11/21 03:01:59 peter Exp $");
/*
* Manages physical address maps.
==== //depot/projects/smpng/sys/amd64/amd64/support.S#8 (text+ko) ====
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.104 2003/11/17 08:58:13 peter Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.105 2003/11/27 17:20:44 peter Exp $
*/
#include "opt_ddb.h"
@@ -45,7 +45,7 @@
ALIGN_DATA
.globl intrcnt, eintrcnt
intrcnt:
- .space INTRCNT_COUNT * 4
+ .space INTRCNT_COUNT * 8
eintrcnt:
.globl intrnames, eintrnames
==== //depot/projects/smpng/sys/amd64/amd64/sys_machdep.c#5 (text+ko) ====
@@ -31,11 +31,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
+ * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/sys_machdep.c,v 1.86 2003/11/08 04:39:21 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/sys_machdep.c,v 1.87 2003/11/21 03:01:59 peter Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/smpng/sys/amd64/amd64/trap.c#14 (text+ko) ====
@@ -34,11 +34,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)trap.c 7.4 (Berkeley) 5/13/91
+ * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.270 2003/11/17 08:58:13 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.271 2003/11/21 03:01:59 peter Exp $");
/*
* AMD64 Trap and System call handling
==== //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#12 (text+ko) ====
@@ -36,12 +36,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
+ * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.223 2003/11/17 08:58:13 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.224 2003/11/21 03:02:00 peter Exp $");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
==== //depot/projects/smpng/sys/amd64/conf/GENERIC#11 (text+ko) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.398 2003/11/19 18:11:27 peter Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.399 2003/11/21 03:19:59 peter Exp $
machine amd64
cpu HAMMER
@@ -68,6 +68,7 @@
options SMP # Symmetric MultiProcessor Kernel
# Workarounds for some known-to-be-broken chipsets (nVidia nForce3-Pro150)
device atpic # 8259A compatability
+options NO_MIXED_MODE # Don't penalize working chipsets
device acpi
device isa
==== //depot/projects/smpng/sys/amd64/include/_limits.h#3 (text+ko) ====
@@ -31,9 +31,7 @@
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
- * From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
- * From: FreeBSD: src/sys/alpha/include/limits.h,v 1.8 2001/11/02
- * $FreeBSD: src/sys/amd64/include/_limits.h,v 1.7 2003/05/19 20:29:06 kan Exp $
+ * $FreeBSD: src/sys/amd64/include/_limits.h,v 1.8 2003/11/21 03:02:00 peter Exp $
*/
#ifndef _MACHINE__LIMITS_H_
@@ -53,27 +51,26 @@
#define __CHAR_BIT 8 /* number of bits in a char */
#define __SCHAR_MAX 0x7f /* max value for a signed char */
-#define __SCHAR_MIN (-0x7f-1) /* min value for a signed char */
+#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
#define __UCHAR_MAX 0xffU /* max value for an unsigned char */
#define __USHRT_MAX 0xffffU /* max value for an unsigned short */
#define __SHRT_MAX 0x7fff /* max value for a short */
-#define __SHRT_MIN (-0x7fff-1) /* min value for a short */
+#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
#define __UINT_MAX 0xffffffffU /* max value for an unsigned int */
#define __INT_MAX 0x7fffffff /* max value for an int */
-#define __INT_MIN (-0x7fffffff-1) /* min value for an int */
+#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */
#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */
-#define __LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */
+#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */
-/* Long longs and longs are the same size on the alpha. */
- /* max for an unsigned long long */
+ /* max value for an unsigned long long */
#define __ULLONG_MAX 0xffffffffffffffffULL
-#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */
-#define __LLONG_MIN (-0x7fffffffffffffffLL-1) /* min for a long long */
+#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */
+#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
@@ -83,9 +80,9 @@
#define __OFF_MIN __LONG_MIN /* min value for an off_t */
/* Quads and longs are the same on the amd64. Ensure they stay in sync. */
-#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */
-#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */
-#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */
+#define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */
+#define __QUAD_MAX __LONG_MAX /* max value for a quad_t */
+#define __QUAD_MIN __LONG_MIN /* min value for a quad_t */
#define __LONG_BIT 64
#define __WORD_BIT 32
==== //depot/projects/smpng/sys/amd64/include/_stdint.h#2 (text+ko) ====
@@ -34,10 +34,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/_stdint.h,v 1.1 2002/07/29 17:41:23 mike Exp $
+ * $FreeBSD: src/sys/amd64/include/_stdint.h,v 1.2 2003/11/21 03:02:00 peter Exp $
*/
-#ifndef _MACHINE__STDINT_H_
+#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
==== //depot/projects/smpng/sys/amd64/include/acpica_machdep.h#3 (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/amd64/include/acpica_machdep.h,v 1.3 2003/09/22 22:12:46 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/acpica_machdep.h,v 1.4 2003/11/21 03:02:00 peter Exp $
*/
/******************************************************************************
@@ -103,6 +103,6 @@
#define COMPILER_DEPENDENT_INT64 long
#define COMPILER_DEPENDENT_UINT64 unsigned long
-void acpi_SetDefaultIntrModel(int model);
+void acpi_SetDefaultIntrModel(int model);
#endif /* __ACPICA_MACHDEP_H__ */
==== //depot/projects/smpng/sys/amd64/include/asmacros.h#3 (text+ko) ====
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/asmacros.h,v 1.26 2003/11/17 08:58:14 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/asmacros.h,v 1.27 2003/11/21 03:02:00 peter Exp $
*/
#ifndef _MACHINE_ASMACROS_H_
@@ -115,7 +115,7 @@
#define CROSSJUMPTARGET(label) \
ALIGN_TEXT; __CONCAT(to,label): ; MCOUNT; jmp label
#define ENTRY(name) GEN_ENTRY(name) ; 9: ; MCOUNT
-#define FAKE_MCOUNT(caller) pushq caller ; call __mcount ; popl %ecx
+#define FAKE_MCOUNT(caller) pushq caller ; call __mcount ; popq %rcx
#define MCOUNT call __mcount
#define MCOUNT_LABEL(name) GEN_ENTRY(name) ; nop ; ALIGN_TEXT
#define MEXITCOUNT call HIDENAME(mexitcount)
==== //depot/projects/smpng/sys/amd64/include/atomic.h#3 (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/amd64/include/atomic.h,v 1.31 2003/11/17 08:58:14 peter Exp $
+ * $FreeBSD: src/sys/amd64/include/atomic.h,v 1.32 2003/11/21 03:02:00 peter Exp $
*/
#ifndef _MACHINE_ATOMIC_H_
#define _MACHINE_ATOMIC_H_
@@ -99,7 +99,8 @@
__asm __volatile(__XSTRING(MPLOCKED) OP \
: "+m" (*p) \
: CONS (V)); \
-}
+} \
+struct __hack
#else /* !__GNUC__ */
@@ -150,7 +151,7 @@
" movzbq %%al,%0 ; "
"1: "
"# atomic_cmpset_long"
- : "+a" (res) /* 0 (result) %rax, XXX check */
+ : "+a" (res) /* 0 (result) */
: "r" (src), /* 1 */
"m" (*(dst)) /* 2 */
: "memory");
@@ -185,7 +186,8 @@
: "+m" (*p), /* 0 */ \
"+r" (v) /* 1 */ \
: : "memory"); \
-}
+} \
+struct __hack
#else /* !defined(__GNUC__) */
@@ -330,7 +332,11 @@
static __inline void *
atomic_load_acq_ptr(volatile void *p)
{
- return (void *)atomic_load_acq_long((volatile u_long *)p);
+ /*
+ * The apparently-bogus cast to intptr_t in the following is to
+ * avoid a warning from "gcc -Wbad-function-cast".
+ */
+ return ((void *)(intptr_t)atomic_load_acq_long((volatile u_long *)p));
}
static __inline void
==== //depot/projects/smpng/sys/amd64/include/bus_dma.h#8 (text+ko) ====
@@ -67,7 +67,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/amd64/include/bus_dma.h,v 1.25 2003/11/07 23:29:42 scottl Exp $ */
+/* $FreeBSD: src/sys/amd64/include/bus_dma.h,v 1.26 2003/11/21 03:02:00 peter Exp $ */
#ifndef _AMD64_BUS_DMA_H_
#define _AMD64_BUS_DMA_H_
@@ -78,7 +78,7 @@
#define BUS_DMA_WAITOK 0x00 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x01 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x02 /* perform resource allocation now */
-#define BUS_DMA_COHERENT 0x04 /* hint map memory in a coherent way */
+#define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */
#define BUS_DMA_ZERO 0x08 /* allocate zero'ed memory */
#define BUS_DMA_BUS1 0x10 /* placeholders for bus functions... */
#define BUS_DMA_BUS2 0x20
@@ -104,7 +104,7 @@
* A machine-dependent opaque type describing the characteristics
* of how to perform DMA mappings. This structure encapsultes
* information concerning address and alignment restrictions, number
- * of S/G segments, amount of data per S/G segment, etc.
+ * of S/G segments, amount of data per S/G segment, etc.
*/
typedef struct bus_dma_tag *bus_dma_tag_t;
@@ -133,7 +133,7 @@
typedef int bus_dma_filter_t(void *, bus_addr_t);
/*
- * A function that performs driver-specific syncronization on behalf of
+ * A function that performs driver-specific synchronization on behalf of
* busdma.
*/
typedef enum {
@@ -147,7 +147,7 @@
* Allocate a device specific dma_tag encapsulating the constraints of
* the parent tag in addition to other restrictions specified:
*
- * alignment: alignment for segments.
+ * alignment: Alignment for segments.
* boundary: Boundary that segments cannot cross.
* lowaddr: Low restricted address that cannot appear in a mapping.
* highaddr: High restricted address that cannot appear in a mapping.
@@ -184,21 +184,21 @@
int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp);
/*
- * Destroy a handle for mapping from kva/uva/physical
+ * Destroy a handle for mapping from kva/uva/physical
* address space into bus device space.
*/
int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map);
/*
* Allocate a piece of memory that can be efficiently mapped into
- * bus device space based on the constraints lited in the dma tag.
+ * bus device space based on the constraints listed in the dma tag.
* A dmamap to for use with dmamap_load is also allocated.
*/
int bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
bus_dmamap_t *mapp);
/*
- * Free a piece of memory and it's allociated dmamap, that was allocated
+ * Free a piece of memory and its allocated dmamap, that was allocated
* via bus_dmamem_alloc.
*/
void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map);
@@ -218,7 +218,7 @@
/*
* Like bus_dmamap_callback but includes map size in bytes. This is
- * defined as a separate interface to maintain compatiiblity for users
+ * defined as a separate interface to maintain compatibility for users
* of bus_dmamap_callback_t--at some point these interfaces should be merged.
*/
typedef void bus_dmamap_callback2_t(void *, bus_dma_segment_t *, int, bus_size_t, int);
@@ -240,7 +240,7 @@
int flags);
/*
- * Perform a syncronization operation on the given map.
+ * Perform a synchronization operation on the given map.
*/
void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_dmasync_op_t);
#define bus_dmamap_sync(dmat, dmamap, op) \
==== //depot/projects/smpng/sys/amd64/include/limits.h#3 (text+ko) ====
@@ -31,9 +31,7 @@
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
- * From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
- * From: FreeBSD: src/sys/alpha/include/limits.h,v 1.8 2001/11/02
- * $FreeBSD: src/sys/amd64/include/limits.h,v 1.6 2003/05/19 20:29:06 kan Exp $
+ * $FreeBSD: src/sys/amd64/include/limits.h,v 1.7 2003/11/21 03:02:00 peter Exp $
*/
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list