PERFORCE change 65864 for review

Marcel Moolenaar marcel at FreeBSD.org
Thu Nov 25 11:06:06 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=65864

Change 65864 by marcel at marcel_nfs on 2004/11/25 19:05:53

	IFC @65861

Affected files ...

.. //depot/projects/uart/alpha/alpha/interrupt.c#4 integrate
.. //depot/projects/uart/arm/arm/intr.c#3 integrate
.. //depot/projects/uart/arm/xscale/i80321/uart_bus_i80321.c#2 integrate
.. //depot/projects/uart/arm/xscale/i80321/uart_cpu_i80321.c#2 integrate
.. //depot/projects/uart/boot/Makefile#4 integrate
.. //depot/projects/uart/boot/efi/Makefile#2 integrate
.. //depot/projects/uart/boot/efi/libefi/arch/ia64/ldscript.ia64#4 delete
.. //depot/projects/uart/boot/efi/libefi/arch/ia64/start.S#3 delete
.. //depot/projects/uart/boot/efi/loader/Makefile#3 delete
.. //depot/projects/uart/boot/efi/loader/conf.c#2 delete
.. //depot/projects/uart/boot/efi/loader/main.c#5 delete
.. //depot/projects/uart/boot/efi/loader/version#2 delete
.. //depot/projects/uart/boot/i386/boot0/boot0.S#3 integrate
.. //depot/projects/uart/boot/i386/btx/btx/btx.S#2 integrate
.. //depot/projects/uart/boot/ia64/Makefile#3 integrate
.. //depot/projects/uart/boot/ia64/efi/Makefile#1 branch
.. //depot/projects/uart/boot/ia64/efi/conf.c#1 branch
.. //depot/projects/uart/boot/ia64/efi/ldscript.ia64#1 branch
.. //depot/projects/uart/boot/ia64/efi/main.c#1 branch
.. //depot/projects/uart/boot/ia64/efi/start.S#1 branch
.. //depot/projects/uart/boot/ia64/efi/version#1 branch
.. //depot/projects/uart/conf/files.alpha#8 integrate
.. //depot/projects/uart/conf/files.amd64#9 integrate
.. //depot/projects/uart/conf/files.arm#2 integrate
.. //depot/projects/uart/conf/files.i386#13 integrate
.. //depot/projects/uart/conf/files.ia64#11 integrate
.. //depot/projects/uart/conf/files.pc98#10 integrate
.. //depot/projects/uart/contrib/pf/net/pf.c#3 integrate
.. //depot/projects/uart/ddb/db_command.c#5 integrate
.. //depot/projects/uart/ddb/db_thread.c#3 integrate
.. //depot/projects/uart/dev/acpica/acpi_pci_link.c#5 integrate
.. //depot/projects/uart/dev/acpica/acpi_pcib.c#7 integrate
.. //depot/projects/uart/dev/acpica/acpi_pcib_acpi.c#7 integrate
.. //depot/projects/uart/dev/acpica/acpi_pcib_pci.c#5 integrate
.. //depot/projects/uart/dev/acpica/acpi_pcibvar.h#3 integrate
.. //depot/projects/uart/dev/ata/ata-all.c#10 integrate
.. //depot/projects/uart/dev/ata/ata-lowlevel.c#13 integrate
.. //depot/projects/uart/dev/hme/if_hme.c#6 integrate
.. //depot/projects/uart/dev/hme/if_hme_pci.c#8 integrate
.. //depot/projects/uart/dev/hme/if_hme_sbus.c#7 integrate
.. //depot/projects/uart/dev/hme/if_hmevar.h#3 integrate
.. //depot/projects/uart/dev/mlx/mlx_disk.c#4 integrate
.. //depot/projects/uart/dev/mlx/mlxreg.h#2 integrate
.. //depot/projects/uart/fs/nullfs/null_vfsops.c#4 integrate
.. //depot/projects/uart/fs/nwfs/nwfs_vfsops.c#4 integrate
.. //depot/projects/uart/fs/smbfs/smbfs_vfsops.c#6 integrate
.. //depot/projects/uart/fs/umapfs/umap_vfsops.c#4 integrate
.. //depot/projects/uart/geom/gate/g_gate.c#2 integrate
.. //depot/projects/uart/kern/init_sysent.c#6 integrate
.. //depot/projects/uart/kern/sys_pipe.c#14 integrate
.. //depot/projects/uart/kern/syscalls.c#6 integrate
.. //depot/projects/uart/kern/syscalls.master#6 integrate
.. //depot/projects/uart/kern/vfs_mount.c#9 integrate
.. //depot/projects/uart/net/if.c#8 integrate
.. //depot/projects/uart/netgraph/ng_cisco.c#4 integrate
.. //depot/projects/uart/netgraph/ng_iface.c#3 integrate
.. //depot/projects/uart/netgraph/ng_one2many.c#4 integrate
.. //depot/projects/uart/netgraph/ng_one2many.h#3 integrate
.. //depot/projects/uart/netinet/tcp_input.c#8 integrate
.. //depot/projects/uart/netinet/tcp_subr.c#7 integrate
.. //depot/projects/uart/netinet/tcp_timer.c#5 integrate
.. //depot/projects/uart/sys/jail.h#3 integrate
.. //depot/projects/uart/sys/mount.h#5 integrate
.. //depot/projects/uart/ufs/ffs/ffs_vfsops.c#9 integrate
.. //depot/projects/uart/ufs/ufs/ufs_extern.h#3 integrate
.. //depot/projects/uart/ufs/ufs/ufs_vfsops.c#3 integrate
.. //depot/projects/uart/vm/vm_contig.c#10 integrate

Differences ...

==== //depot/projects/uart/alpha/alpha/interrupt.c#4 (text+ko) ====

@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 /* __KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $");*/
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.82 2004/07/20 06:32:32 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/interrupt.c,v 1.83 2004/11/23 22:11:53 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -474,7 +474,7 @@
 		/*
 		 * Only one processor drives the actual timer.
 		 */
-		if (PCPU_GET(cpuid) == boot_cpu_id) {
+		if (PCPU_GET(cpuid) == 0) {
 #endif
 			(*platform.clockintr)(framep);
 			/* divide hz (1024) by 8 to get stathz (128) */

==== //depot/projects/uart/arm/arm/intr.c#3 (text+ko) ====

@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/intr.c,v 1.4 2004/11/12 21:49:05 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/intr.c,v 1.5 2004/11/23 16:31:16 cognet Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/syslog.h> 
@@ -139,17 +139,16 @@
 			continue;
 		ih = TAILQ_FIRST(&ithd->it_handlers);
 		if (ih && ih->ih_flags & IH_FAST) {
+			oldirqstate = disable_interrupts(I32_bit);
 			TAILQ_FOREACH(ih, &ithd->it_handlers,
 			    ih_next) {
 				ih->ih_handler(ih->ih_argument ?
 				    ih->ih_argument : frame);
 			}
+			restore_interrupts(oldirqstate);
 			arm_unmask_irqs(1 << i);
-		} else if (ih) {
-			oldirqstate = enable_interrupts(I32_bit);
+		} else if (ih)
 			ithread_schedule(ithd);
-			restore_interrupts(oldirqstate);
-		}
 		irqnb |= arm_get_irqnb(frame);
 	}
 	td->td_intr_nesting_level--;

==== //depot/projects/uart/arm/xscale/i80321/uart_bus_i80321.c#2 (text+ko) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/uart_bus_i80321.c,v 1.1 2004/09/23 22:45:36 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/uart_bus_i80321.c,v 1.2 2004/11/23 16:30:50 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -59,7 +59,6 @@
 	sizeof(struct uart_softc),
 };
 
-extern struct uart_class uart_i8251_class;
 extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
 static int
 uart_i80321_probe(device_t dev)
@@ -68,7 +67,7 @@
 
 	sc = device_get_softc(dev);
 	sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs);
-	sc->sc_class = &uart_i8251_class;
+	sc->sc_class = &uart_ns8250_class;
 	bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas));
 	return(uart_bus_probe(dev, 0, 0, 0, 0));
 }

==== //depot/projects/uart/arm/xscale/i80321/uart_cpu_i80321.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/uart_cpu_i80321.c,v 1.1 2004/09/23 22:45:36 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/uart_cpu_i80321.c,v 1.2 2004/11/23 16:30:50 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -55,7 +55,7 @@
 int
 uart_cpu_getdev(int devtype, struct uart_devinfo *di)
 {
-	di->ops = uart_i8251_ops;
+	di->ops = uart_ns8250_ops;
 	di->bas.chan = 0;
 	di->bas.bst = &obio_bs_tag;
 	di->bas.regshft = 0;

==== //depot/projects/uart/boot/Makefile#4 (text+ko) ====

@@ -1,10 +1,15 @@
-# $FreeBSD: src/sys/boot/Makefile,v 1.24 2004/08/16 15:45:24 marius Exp $
+# $FreeBSD: src/sys/boot/Makefile,v 1.25 2004/11/23 05:52:00 marcel Exp $
 
 .if !defined(NOFORTH)
 # Build the add-in FORTH interpreter.
 SUBDIR+=		ficl
 .endif
 
+# Build EFI library.
+.if ${MACHINE_ARCH} == "ia64"
+SUBDIR+=		efi
+.endif
+
 # Build Open Firmware library.
 .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
 SUBDIR+=		ofw
@@ -19,9 +24,4 @@
 #SUBDIR+=		arc
 #.endif
 
-# Build EFI executable on ia64.
-.if ${MACHINE_ARCH} == "ia64"
-SUBDIR+=		efi
-.endif
-
 .include <bsd.subdir.mk>

==== //depot/projects/uart/boot/efi/Makefile#2 (text+ko) ====

@@ -1,5 +1,5 @@
-# $FreeBSD: src/sys/boot/efi/Makefile,v 1.1 2001/06/09 16:49:48 dfr Exp $
+# $FreeBSD: src/sys/boot/efi/Makefile,v 1.2 2004/11/23 06:04:51 marcel Exp $
 
-SUBDIR=		libefi loader
+SUBDIR=		libefi
 
 .include <bsd.subdir.mk>

==== //depot/projects/uart/boot/i386/boot0/boot0.S#3 (text+ko) ====

@@ -13,13 +13,13 @@
  * warranties of merchantability and fitness for a particular
  * purpose.
  *
- * $FreeBSD: src/sys/boot/i386/boot0/boot0.S,v 1.11 2004/11/06 06:13:13 keramida Exp $
+ * $FreeBSD: src/sys/boot/i386/boot0/boot0.S,v 1.12 2004/11/24 15:39:04 jhb Exp $
  */
 
 /* A 512-byte boot manager. */
 #ifdef SIO
 /* ... using a serial console on COM1. */
-#endif /* SIO */
+#endif
 
 		.set NHRDRV,0x475		# Number of hard drives
 		.set ORIGIN,0x600		# Execution address
@@ -92,13 +92,13 @@
 		jmp main-LOAD+ORIGIN		# To relocated code
 
 main:
-#ifdef SIO
+#if defined(SIO) && COMSPEED != 0
 /*
  * Initialize the serial port.  bioscom preserves the driver number in DX.
  */
 		movw COMSPEED,%ax		# defined by Makefile
 		callw bioscom
-#endif /* SIO */
+#endif
 /*
  * Check what flags were loaded with us, specifically if a predefined drive
  * number should be used.  If what the bios gives us is bad, use the '0' in
@@ -235,18 +235,18 @@
 		xorb %ah,%ah			# BIOS: Get
 		int $0x16			#  keypress
 		movb %ah,%al			# Scan code
-#else /* SIO */
+#else
 		movb $0x02,%ah			# BIOS: Receive
 		call bioscom
-#endif /* SIO */
+#endif
 /*
  * If it's CR act as if timed out.
  */
 #ifndef SIO
 		cmpb $KEY_ENTER,%al		# Enter pressed?
-#else /* SIO */
+#else
 		cmpb $ASCII_CR,%al		# Enter pressed?
-#endif /* SIO */
+#endif
 		je main.9			# Yes
 /*
  * Otherwise check if legal. If not ask again.
@@ -256,9 +256,9 @@
 		cmpb $0x4,%al			# F1..F5?
 		jna main.12			# Yes
 		subb $(KEY_1 - KEY_F1),%al	# Less #1 scan code
-#else /* SIO */
+#else
 		subb $'1',%al			# Less '1' ascii character
-#endif /* SIO */
+#endif
 		cmpb $0x4,%al			# #1..#5?
 		ja main.10			# No
 /*
@@ -326,7 +326,7 @@
 #ifndef SIO
 		movb $'F',%al			# Display
 		callw putchr			#  'F'
-#endif /* SIO */
+#endif
 		movb $'1',%al			# Prepare
 		addb %dl,%al			#  digit
 		jmp putstr.1			# Display the rest

==== //depot/projects/uart/boot/i386/btx/btx/btx.S#2 (text+ko) ====

@@ -12,7 +12,7 @@
  * warranties of merchantability and fitness for a particular
  * purpose.
  *
- * $FreeBSD: src/sys/boot/i386/btx/btx/btx.S,v 1.37 2004/05/14 20:29:30 ru Exp $
+ * $FreeBSD: src/sys/boot/i386/btx/btx/btx.S,v 1.38 2004/11/24 14:54:33 jhb Exp $
  */
 
 /*
@@ -975,8 +975,9 @@
 		.set SIO_FMT,SIOFMT		# 8N1
 		.set SIO_DIV,(115200/SIOSPD)	# 115200 / SPD
 
+/*
  * void sio_init(void)
-
+ */
 sio_init:	movw $SIO_PRT+0x3,%dx		# Data format reg
 		movb $SIO_FMT|0x80,%al		# Set format
 		outb %al,(%dx)			#  and DLAB
@@ -992,15 +993,17 @@
 		outb %al,(%dx)			#  DTR
 		incl %edx			# Line status reg
 
+/*
  * void sio_flush(void)
-
+ */
 sio_flush.0:	call sio_getc.1 		# Get character
 sio_flush:	call sio_ischar 		# Check for character
 		jnz sio_flush.0 		# Till none
 		ret				# To caller
 
+/*
  * void sio_putc(int c)
-
+ */
 sio_putc:	movw $SIO_PRT+0x5,%dx		# Line status reg
 		xor %ecx,%ecx			# Timeout
 		movb $0x40,%ch			#  counter
@@ -1013,16 +1016,18 @@
 		outb %al,(%dx)			# Write character
 sio_putc.2:	ret $0x4			# To caller
 
+/*
  * int sio_getc(void)
-
+ */
 sio_getc:	call sio_ischar 		# Character available?
 		jz sio_getc			# No
 sio_getc.1:	subb $0x5,%dl			# Receiver buffer reg
 		inb (%dx),%al			# Read character
 		ret				# To caller
 
+/*
  * int sio_ischar(void)
-
+ */
 sio_ischar:	movw $SIO_PRT+0x5,%dx		# Line status register
 		xorl %eax,%eax			# Zero
 		inb (%dx),%al			# Received data

==== //depot/projects/uart/boot/ia64/Makefile#3 (text+ko) ====

@@ -1,5 +1,5 @@
-# $FreeBSD: src/sys/boot/ia64/Makefile,v 1.3 2004/09/24 04:21:14 marcel Exp $
+# $FreeBSD: src/sys/boot/ia64/Makefile,v 1.4 2004/11/23 06:03:03 marcel Exp $
 
-SUBDIR=		ski
+SUBDIR=		efi ski
 
 .include <bsd.subdir.mk>

==== //depot/projects/uart/conf/files.alpha#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.alpha,v 1.114 2004/08/01 11:40:51 markm Exp $
+# $FreeBSD: src/sys/conf/files.alpha,v 1.115 2004/11/23 00:00:43 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -179,7 +179,6 @@
 dev/kbd/atkbd.c			optional	atkbd
 dev/kbd/atkbdc.c		optional	atkbdc
 dev/kbd/kbd.c			optional	atkbd
-dev/kbd/kbd.c			optional	kbd
 dev/kbd/kbd.c			optional	sc
 dev/kbd/kbd.c			optional	ukbd
 dev/ppc/ppc.c			optional        ppc

==== //depot/projects/uart/conf/files.amd64#9 (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.50 2004/09/28 07:29:54 markm Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.51 2004/11/23 00:00:43 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -123,7 +123,6 @@
 dev/kbd/atkbd.c			optional	atkbd
 dev/kbd/atkbdc.c		optional	atkbdc
 dev/kbd/kbd.c			optional	atkbd
-dev/kbd/kbd.c			optional	kbd
 dev/kbd/kbd.c			optional	sc
 dev/kbd/kbd.c			optional	ukbd
 dev/mem/memutil.c		optional	mem

==== //depot/projects/uart/conf/files.arm#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files.arm,v 1.3 2004/05/14 23:42:54 cognet Exp $
+# $FreeBSD: src/sys/conf/files.arm,v 1.4 2004/11/22 22:20:50 cognet Exp $
 arm/arm/autoconf.c	standard
 arm/arm/bcopy_page.S	standard
 arm/arm/bcopyinout.S		standard
@@ -29,6 +29,7 @@
 arm/arm/intr.c			standard
 arm/arm/locore.S		standard	no-obj
 arm/arm/machdep.c		standard
+arm/arm/mem.c			optional	mem
 arm/arm/nexus.c			optional	nexus
 arm/arm/nexus_io.c		optional	nexus
 arm/arm/nexus_io_asm.S		optional	nexus

==== //depot/projects/uart/conf/files.i386#13 (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.i386,v 1.508 2004/11/15 05:54:14 imp Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.509 2004/11/23 00:00:43 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -157,7 +157,6 @@
 dev/kbd/atkbd.c			optional	atkbd
 dev/kbd/atkbdc.c		optional	atkbdc
 dev/kbd/kbd.c			optional	atkbd
-dev/kbd/kbd.c			optional	kbd
 dev/kbd/kbd.c			optional	sc
 dev/kbd/kbd.c			optional	ukbd
 dev/kbd/kbd.c			optional	vt

==== //depot/projects/uart/conf/files.ia64#11 (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.73 2004/09/25 04:27:44 marcel Exp $
+# $FreeBSD: src/sys/conf/files.ia64,v 1.74 2004/11/23 00:00:43 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -55,7 +55,6 @@
 dev/kbd/atkbd.c			optional	atkbd
 dev/kbd/atkbdc.c		optional	atkbdc
 dev/kbd/kbd.c			optional	atkbd
-dev/kbd/kbd.c			optional	kbd
 dev/kbd/kbd.c			optional	sc
 dev/kbd/kbd.c			optional	ukbd
 dev/ppc/ppc.c			optional	ppc isa

==== //depot/projects/uart/conf/files.pc98#10 (text+ko) ====

@@ -3,7 +3,7 @@
 #
 # modified for PC-9801
 #
-# $FreeBSD: src/sys/conf/files.pc98,v 1.306 2004/08/30 23:03:56 peter Exp $
+# $FreeBSD: src/sys/conf/files.pc98,v 1.307 2004/11/23 00:00:43 imp Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -105,7 +105,6 @@
 dev/fb/fb.c			optional	gdc
 dev/fb/splash.c			optional	splash
 dev/fe/if_fe_cbus.c		optional	fe isa
-dev/kbd/kbd.c			optional	kbd
 dev/kbd/kbd.c			optional	sc
 dev/kbd/kbd.c			optional	ukbd
 dev/kbd/kbd.c			optional	pckbd

==== //depot/projects/uart/contrib/pf/net/pf.c#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.22 2004/11/08 20:24:52 ru Exp $	*/
+/*	$FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.23 2004/11/24 00:43:34 dhartmei Exp $	*/
 /*	$OpenBSD: pf.c,v 1.433.2.2 2004/07/17 03:22:34 brad Exp $ */
 /* add	$OpenBSD: pf.c,v 1.448 2004/05/11 07:34:11 dhartmei Exp $ */
 
@@ -2329,7 +2329,7 @@
 					    saddr, pd->af);
 				break;
 			case PF_IN:
-				if (r->rpool.cur->addr.type == PF_ADDR_DYNIFTL){
+				if (r->src.addr.type == PF_ADDR_DYNIFTL) {
 					if (pd->af == AF_INET) {
 						if (r->src.addr.p.dyn->
 						    pfid_acnt4 < 1)

==== //depot/projects/uart/ddb/db_command.c#5 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.57 2004/07/21 05:55:51 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.58 2004/11/23 23:11:47 rwatson Exp $");
 
 #include <sys/param.h>
 #include <sys/linker_set.h>
@@ -630,6 +630,7 @@
 {
 	struct thread *td;
 	db_expr_t radix;
+	pid_t pid;
 	int t;
 
 	/*
@@ -662,5 +663,10 @@
 		}
 	} else
 		td = kdb_thread;
+	if (td->td_proc != NULL)
+		pid = td->td_proc->p_pid;
+	else
+		pid = -1;
+	db_printf("Tracing pid %d tid %ld td %p\n", pid, (long)td->td_tid, td);
 	db_trace_thread(td, count);
 }

==== //depot/projects/uart/ddb/db_thread.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_thread.c,v 1.2 2004/11/01 22:15:14 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_thread.c,v 1.3 2004/11/23 23:07:12 rwatson Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,7 +41,12 @@
 void
 db_print_thread(void)
 {
-	db_printf("[thread %ld]\n", (long)kdb_thread->td_tid);
+	pid_t pid;
+
+	pid = -1;
+	if (kdb_thread->td_proc != NULL)
+		pid = kdb_thread->td_proc->p_pid;
+	db_printf("[thread pid %d tid %ld ]\n", pid, (long)kdb_thread->td_tid);
 }
 
 void

==== //depot/projects/uart/dev/acpica/acpi_pci_link.c#5 (text+ko) ====

@@ -25,17 +25,22 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.33 2004/09/25 06:15:56 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.34 2004/11/23 22:26:44 jhb Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
+#include <sys/bus.h>
 #include <sys/kernel.h>
-#include <sys/bus.h>
+#include <sys/limits.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
 
 #include "acpi.h"
 #include <dev/acpica/acpivar.h>
 #include <dev/acpica/acpi_pcibvar.h>
 
+#include <machine/pci_cfgreg.h>
+#include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 #include "pcib_if.h"
 
@@ -43,1119 +48,714 @@
 #define _COMPONENT	ACPI_BUS
 ACPI_MODULE_NAME("PCI_LINK")
 
-TAILQ_HEAD(acpi_pci_link_entries, acpi_pci_link_entry);
-static struct acpi_pci_link_entries acpi_pci_link_entries;
 ACPI_SERIAL_DECL(pci_link, "ACPI PCI link");
 
-TAILQ_HEAD(acpi_prt_entries, acpi_prt_entry);
-static struct acpi_prt_entries acpi_prt_entries;
+#define NUM_ISA_INTERRUPTS	16
+#define NUM_ACPI_INTERRUPTS	256
+
+/*
+ * An ACPI PCI link device may contain multiple links.  Each link has its
+ * own ACPI resource.  _PRT entries specify which link is being used via
+ * the Source Index.
+ */
+
+struct link;
+
+struct acpi_pci_link_softc {
+	int	pl_num_links;
+	struct link *pl_links;
+};
+
+struct link {
+	struct acpi_pci_link_softc *l_sc;
+	uint8_t	l_bios_irq;
+	uint8_t	l_irq;
+	uint8_t	l_initial_irq;
+	int	l_res_index;
+	int	l_num_irqs;
+	int	*l_irqs;
+	int	l_references;
+	int	l_routed:1;
+	int	l_isa_irq:1;
+	ACPI_RESOURCE l_prs_template;
+};
+
+struct link_res_request {
+	struct acpi_pci_link_softc *sc;
+	int	count;
+};
+
+MALLOC_DEFINE(M_PCI_LINK, "PCI Link", "ACPI PCI Link structures");
 
-static int	irq_penalty[MAX_ACPI_INTERRUPTS];
+static int pci_link_interrupt_weights[NUM_ACPI_INTERRUPTS];
+static int pci_link_bios_isa_irqs;
 
-static int	acpi_pci_link_is_valid_irq(struct acpi_pci_link_entry *link,
-		    UINT8 irq);
-static void	acpi_pci_link_update_irq_penalty(device_t dev, int busno);
-static void	acpi_pci_link_set_bootdisabled_priority(void);
-static void	acpi_pci_link_fixup_bootdisabled_link(void);
+static char *pci_link_ids[] = { "PNP0C0F", NULL };
 
 /*
- * PCI link object management
+ * Fetch the short name associated with an ACPI handle and save it in the
+ * passed in buffer.
  */
-
-static void
-acpi_pci_link_dump_polarity(UINT32 ActiveHighLow)
+static ACPI_STATUS
+acpi_short_name(ACPI_HANDLE handle, char *buffer, size_t buflen)
 {
+	ACPI_BUFFER buf;
 
-	switch (ActiveHighLow) {
-	case ACPI_ACTIVE_HIGH:
-		printf("high,");
-		break;
-	case ACPI_ACTIVE_LOW:
-		printf("low,");
-		break;
-	default:
-		printf("unknown,");
-		break;
-	}
+	buf.Length = buflen;
+	buf.Pointer = buffer;
+	return (AcpiGetName(handle, ACPI_SINGLE_NAME, &buf));
 }
 
-static void
-acpi_pci_link_dump_trigger(UINT32 EdgeLevel)
+static int
+acpi_pci_link_probe(device_t dev)
 {
+	char descr[64], name[10];
 
-	switch (EdgeLevel) {
-	case ACPI_EDGE_SENSITIVE:
-		printf("edge,");
-		break;
-	case ACPI_LEVEL_SENSITIVE:
-		printf("level,");
-		break;
-	default:
-		printf("unknown,");
-		break;
+	/*
+	 * We explicitly do not check _STA since not all systems set it to
+	 * sensible values.
+	 */
+	if (!acpi_disabled("pci_link") &&
+	    ACPI_ID_PROBE(device_get_parent(dev), dev, pci_link_ids) != NULL) {
+		if (ACPI_FAILURE(acpi_short_name(acpi_get_handle(dev), name,
+			    sizeof(name))))
+			device_set_desc(dev, "ACPI PCI Link");
+		else {
+			snprintf(descr, sizeof(descr), "ACPI PCI Link %s",
+			    name);
+			device_set_desc_copy(dev, descr);
+		}
+		return (0);
 	}
+	return (ENXIO);
 }
 
-static void
-acpi_pci_link_dump_sharemode(UINT32 SharedExclusive)
+static ACPI_STATUS
+acpi_count_resources(ACPI_RESOURCE *res, void *context)
 {
+	int *count;
 
-	switch (SharedExclusive) {
-	case ACPI_EXCLUSIVE:
-		printf("exclusive");
-		break;
-	case ACPI_SHARED:
-		printf("sharable");
-		break;
-	default:
-		printf("unknown");
-		break;
-	}
+	count = (int *)context;
+	(*count)++;
+	return (AE_OK);
 }
 
-static void
-acpi_pci_link_entry_dump(struct acpi_prt_entry *entry)
+static ACPI_STATUS
+link_add_crs(ACPI_RESOURCE *res, void *context)
 {
-	UINT8			i;
-	ACPI_RESOURCE_IRQ	*Irq;
-	ACPI_RESOURCE_EXT_IRQ	*ExtIrq;
-	struct acpi_pci_link_entry *link;
+	struct link_res_request *req;
+	struct link *link;
 
-	if (entry == NULL || entry->pci_link == NULL)
-		return;
-	link = entry->pci_link;
-
-	printf("%s irq%c%2d: ", acpi_name(link->handle),
-	    (link->flags & ACPI_LINK_ROUTED) ? '*' : ' ', link->current_irq);
-
-	printf("[");
-	if (link->number_of_interrupts)
-		printf("%2d", link->interrupts[0]);
-	for (i = 1; i < link->number_of_interrupts; i++)
-		printf("%3d", link->interrupts[i]);
-	printf("] %2d+ ", link->initial_irq);
-
-	switch (link->possible_resources.Id) {
+	ACPI_SERIAL_ASSERT(pci_link);
+	req = (struct link_res_request *)context;
+	link = &req->sc->pl_links[req->count];
+	req->count++;
+	switch (res->Id) {
 	case ACPI_RSTYPE_IRQ:
-		Irq = &link->possible_resources.Data.Irq;
-		acpi_pci_link_dump_polarity(Irq->ActiveHighLow);
-		acpi_pci_link_dump_trigger(Irq->EdgeLevel);
-		acpi_pci_link_dump_sharemode(Irq->SharedExclusive);
-		break;
 	case ACPI_RSTYPE_EXT_IRQ:
-		ExtIrq = &link->possible_resources.Data.ExtendedIrq;
-		acpi_pci_link_dump_polarity(ExtIrq->ActiveHighLow);
-		acpi_pci_link_dump_trigger(ExtIrq->EdgeLevel);
-		acpi_pci_link_dump_sharemode(ExtIrq->SharedExclusive);
+		if (res->Id == ACPI_RSTYPE_IRQ) {
+			if (res->Data.Irq.NumberOfInterrupts > 0) {
+				KASSERT(res->Data.Irq.NumberOfInterrupts == 1,
+				    ("%s: too many interrupts", __func__));
+				link->l_irq = res->Data.Irq.Interrupts[0];
+			}
+		} else if (res->Data.ExtendedIrq.NumberOfInterrupts > 0) {
+			KASSERT(res->Data.ExtendedIrq.NumberOfInterrupts == 1,
+			    ("%s: too many interrupts", __func__));
+			link->l_irq = res->Data.ExtendedIrq.Interrupts[0];
+		}
+
+		/*
+		 * An IRQ of zero means that the link isn't routed.
+		 */
+		if (link->l_irq == 0)
+			link->l_irq = PCI_INVALID_IRQ;
 		break;
 	}
-
-	printf(" %d.%d.%d\n", entry->busno,
-	    (int)(ACPI_ADR_PCI_SLOT(entry->prt.Address)),
-	    (int)entry->prt.Pin);
+	return (AE_OK);
 }
 
+/*
+ * Populate the set of possible IRQs for each device.
+ */
 static ACPI_STATUS
-acpi_pci_link_get_object_status(ACPI_HANDLE handle, UINT32 *sta)
+link_add_prs(ACPI_RESOURCE *res, void *context)
 {
-	ACPI_DEVICE_INFO	*devinfo;
-	ACPI_BUFFER		buf;
-	ACPI_STATUS		error;
+	struct link_res_request *req;
+	struct link *link;
+	UINT32 *irqs;
+	int i;
 
-	ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
-
-	if (handle == NULL || sta == NULL) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid argument\n"));
-		return_ACPI_STATUS (AE_BAD_PARAMETER);
-	}
-
-	buf.Pointer = NULL;
-	buf.Length = ACPI_ALLOCATE_BUFFER;
-	error = AcpiGetObjectInfo(handle, &buf);
-	if (ACPI_FAILURE(error)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-		    "couldn't get object info %s - %s\n",
-		    acpi_name(handle), AcpiFormatException(error)));
-		return_ACPI_STATUS (error);
-	}
-
-	devinfo = (ACPI_DEVICE_INFO *)buf.Pointer;
-	if ((devinfo->Valid & ACPI_VALID_HID) == 0 ||
-	    strcmp(devinfo->HardwareId.Value, "PNP0C0F") != 0) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid hardware ID - %s\n",
-		    acpi_name(handle)));
-		AcpiOsFree(buf.Pointer);
-		return_ACPI_STATUS (AE_TYPE);
-	}
-
-	if ((devinfo->Valid & ACPI_VALID_STA) != 0) {
-		*sta = devinfo->CurrentStatus;
-	} else {
-		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "invalid status - %s\n",
-		    acpi_name(handle)));
-		*sta = 0;
-	}
-
-	AcpiOsFree(buf.Pointer);
-	return_ACPI_STATUS (AE_OK);
-}
-
-static ACPI_STATUS
-acpi_pci_link_get_irq_resources(ACPI_RESOURCE *resources,
-    UINT8 *number_of_interrupts, UINT8 interrupts[])
-{
-	UINT8			count;
-	UINT8			i;
-	UINT32			NumberOfInterrupts;
-	UINT32			*Interrupts;
-
-	ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
-
-	if (resources == NULL || number_of_interrupts == NULL) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid argument\n"));
-		return_ACPI_STATUS (AE_BAD_PARAMETER);
-	}
-
-	*number_of_interrupts = 0;
-	NumberOfInterrupts = 0;
-	Interrupts = NULL;
-
-	if (resources->Id == ACPI_RSTYPE_START_DPF)
-		resources = ACPI_NEXT_RESOURCE(resources);
-
-	if (resources->Id != ACPI_RSTYPE_IRQ &&
-	    resources->Id != ACPI_RSTYPE_EXT_IRQ) {
-		printf("acpi link get: resource %d is not an IRQ\n",
-		    resources->Id);
-		return_ACPI_STATUS (AE_TYPE);
-	}
-
-	switch (resources->Id) {
+	ACPI_SERIAL_ASSERT(pci_link);
+	req = (struct link_res_request *)context;
+	link = &req->sc->pl_links[req->count];
+	req->count++;
+	switch (res->Id) {
 	case ACPI_RSTYPE_IRQ:
-		NumberOfInterrupts = resources->Data.Irq.NumberOfInterrupts;
-		Interrupts = resources->Data.Irq.Interrupts;
-		break;
 	case ACPI_RSTYPE_EXT_IRQ:
-		NumberOfInterrupts =
-		    resources->Data.ExtendedIrq.NumberOfInterrupts;
-		Interrupts = resources->Data.ExtendedIrq.Interrupts;
-		break;
-	}
 
-	if (NumberOfInterrupts == 0)
-		return_ACPI_STATUS (AE_NULL_ENTRY);
+		/*
+		 * Stash a copy of the resource for later use when doing
+		 * _SRS.
+		 */
+		bcopy(res, &link->l_prs_template, sizeof(ACPI_RESOURCE));
+		if (res->Id == ACPI_RSTYPE_IRQ) {
+			link->l_num_irqs = res->Data.Irq.NumberOfInterrupts;
+			irqs = res->Data.Irq.Interrupts;
+		} else {
+			link->l_num_irqs =
+			    res->Data.ExtendedIrq.NumberOfInterrupts;
+			irqs = res->Data.ExtendedIrq.Interrupts;
+		}
+		if (link->l_num_irqs == 0)
+			break;
 
-	count = 0;
-	for (i = 0; i < NumberOfInterrupts; i++) {
-		if (i >= MAX_POSSIBLE_INTERRUPTS) {
-			ACPI_DEBUG_PRINT((ACPI_DB_WARN, "too many IRQs (%d)\n",
-			    i));
-			break;
+		/*
+		 * Save a list of the valid IRQs.  Also, if all of the
+		 * valid IRQs are ISA IRQs, then mark this link as
+		 * routed via an ISA interrupt.
+		 */
+		link->l_isa_irq = 1;
+		link->l_irqs = malloc(sizeof(int) * link->l_num_irqs,
+		    M_PCI_LINK, M_WAITOK | M_ZERO);
+		for (i = 0; i < link->l_num_irqs; i++) {
+			link->l_irqs[i] = irqs[i];
+			if (irqs[1] >= NUM_ISA_INTERRUPTS)
+				link->l_isa_irq = 0;
 		}
-		if (Interrupts[i] == 0) {
-			ACPI_DEBUG_PRINT((ACPI_DB_WARN, "invalid IRQ %d\n",
-			    Interrupts[i]));
-			continue;
-		}
-		interrupts[count] = Interrupts[i];
-		count++;
+		break;
 	}
-	*number_of_interrupts = count;
-
-	return_ACPI_STATUS (AE_OK);
+	return (AE_OK);
 }
 
-static ACPI_STATUS
-acpi_pci_link_get_current_irq(struct acpi_pci_link_entry *link, UINT8 *irq)
+static int
+link_valid_irq(struct link *link, int irq)
 {
-	ACPI_STATUS		error;
-	ACPI_BUFFER		buf;
-	ACPI_RESOURCE		*resources;
-	UINT8			number_of_interrupts;
-	UINT8			interrupts[MAX_POSSIBLE_INTERRUPTS];;
+	int i;
 
-	ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
+	ACPI_SERIAL_ASSERT(pci_link);
 
-	if (link == NULL || irq == NULL) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid argument\n"));
-		return_ACPI_STATUS (AE_BAD_PARAMETER);
-	}
+	/* Invalid interrupts are never valid. */
+	if (!PCI_INTERRUPT_VALID(irq))
+		return (0);
 
-	*irq = 0;
-	buf.Pointer = NULL;
-	buf.Length = ACPI_ALLOCATE_BUFFER;
-	error = AcpiGetCurrentResources(link->handle, &buf);
-	if (ACPI_FAILURE(error)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-		    "couldn't get PCI interrupt link device _CRS %s - %s\n",
-		    acpi_name(link->handle), AcpiFormatException(error)));
-		return_ACPI_STATUS (error);
-	}
-	if (buf.Pointer == NULL) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-		    "couldn't allocate memory - %s\n",
-		    acpi_name(link->handle)));
-		return_ACPI_STATUS (AE_NO_MEMORY);
-	}

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


More information about the p4-projects mailing list