struct pci_bus changes in 2.6

Olaf Hering olh at suse.de
Fri Oct 10 22:36:14 EST 2003


 On Thu, Oct 02, Anton Blanchard wrote:

>
> > is this patch still required. If so, why?
>
> Nope. It wasnt in Linus BK but was in ameslab. I'll get rid of it.

Can you, or someone else, revert this part in the ameslab bk tree?
It will make my life easier.


diff -purN linux-2.5-latest/Makefile linuxppc64-2.5-latest/Makefile
--- linux-2.5-latest/Makefile	2003-10-10 13:48:48.000000000 +0200
+++ linuxppc64-2.5-latest/Makefile	2003-10-10 13:55:39.000000000 +0200
@@ -149,7 +149,7 @@ SUBARCH := $(shell uname -m | sed -e s/i
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

 ARCH		?= $(SUBARCH)
-CROSS_COMPILE	?=
+CROSS_COMPILE	?= powerpc64-linux-

 # Architecture as present in compile.h
 UTS_MACHINE := $(ARCH)
@@ -164,6 +164,7 @@ HOSTCXX  	= g++
 HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTCXXFLAGS	= -O2

+
 # 	Decide whether to build built-in, modular, or both.
 #	Normally, just do built-in.

@@ -409,6 +410,11 @@ CFLAGS := $(CPPFLAGS) $(CFLAGS)
 AFLAGS := $(CPPFLAGS) $(AFLAGS)

 core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/
+ifeq ($(CONFIG_KDB),y)
+  # Use ifeq for now because kdb subdirs are not in bk yet
+  # Otherwise make mrproper will die because it also cleans core-n
+  core-y			+= kdb/
+endif

 SUBDIRS		+= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
diff -purN linux-2.5-latest/arch/ppc64/Kconfig linuxppc64-2.5-latest/arch/ppc64/Kconfig
--- linux-2.5-latest/arch/ppc64/Kconfig	2003-10-10 13:48:42.000000000 +0200
+++ linuxppc64-2.5-latest/arch/ppc64/Kconfig	2003-10-10 13:55:31.000000000 +0200
@@ -364,6 +364,20 @@ config XMON_DEFAULT
 	bool "Enable xmon by default"
 	depends on XMON

+config KDB
+	bool "Include kdb kernel debugger"
+	depends on DEBUG_KERNEL
+	help
+	  Include in-kernel hooks for the kdb kernel monitor/debugger.
+	  Unless you are intending to debug the kernel, say N here.
+
+config KDB_OFF
+	bool "Turn KDB off as default."
+	depends on KDB
+	help
+ 	   KDB will remain built into the kernel, but will be turned off.
+	   "cat 1 > /proc/sys/kernel/kdb" to turn it on.
+
 config PPCDBG
 	bool "Include PPCDBG realtime debugging"
 	depends on DEBUG_KERNEL
diff -purN linux-2.5-latest/arch/ppc64/Makefile linuxppc64-2.5-latest/arch/ppc64/Makefile
--- linux-2.5-latest/arch/ppc64/Makefile	2003-10-10 13:48:03.000000000 +0200
+++ linuxppc64-2.5-latest/arch/ppc64/Makefile	2003-10-10 13:55:05.000000000 +0200
@@ -32,6 +32,11 @@ libs-y				+= arch/ppc64/lib/
 core-y				+= arch/ppc64/kernel/
 core-y				+= arch/ppc64/mm/
 core-$(CONFIG_XMON)		+= arch/ppc64/xmon/
+ifeq ($(CONFIG_KDB),y)
+  # Use ifeq for now because kdb subdirs are not in bk yet
+  # Otherwise make mrproper will die because it also cleans core-n
+  core-y			+= arch/ppc64/kdb/
+endif
 drivers-$(CONFIG_OPROFILE)	+= arch/ppc64/oprofile/

 boot := arch/ppc64/boot
diff -purN linux-2.5-latest/drivers/block/Kconfig linuxppc64-2.5-latest/drivers/block/Kconfig
--- linux-2.5-latest/drivers/block/Kconfig	2003-10-10 13:48:12.000000000 +0200
+++ linuxppc64-2.5-latest/drivers/block/Kconfig	2003-10-10 13:55:09.000000000 +0200
@@ -328,6 +328,4 @@ config LBD
 	  your machine, or if you want to have a raid or loopback device
 	  bigger than 2TB.  Otherwise say N.

-source "drivers/s390/block/Kconfig"
-
 endmenu
diff -purN linux-2.5-latest/drivers/pci/probe.c linuxppc64-2.5-latest/drivers/pci/probe.c
--- linux-2.5-latest/drivers/pci/probe.c	2003-10-10 13:48:50.000000000 +0200
+++ linuxppc64-2.5-latest/drivers/pci/probe.c	2003-10-10 13:55:42.000000000 +0200
@@ -572,12 +572,14 @@ int __devinit pci_scan_slot(struct pci_b
 		list_add_tail(&dev->bus_list, &bus->devices);
 		nr++;

+#if 0
 		/*
 		 * If this is a single function device,
 		 * don't scan past the first function.
 		 */
 		if (!dev->multifunction)
 			break;
+#endif
 	}
 	return nr;
 }
diff -purN linux-2.5-latest/drivers/scsi/Kconfig linuxppc64-2.5-latest/drivers/scsi/Kconfig
--- linux-2.5-latest/drivers/scsi/Kconfig	2003-10-10 13:48:59.000000000 +0200
+++ linuxppc64-2.5-latest/drivers/scsi/Kconfig	2003-10-10 13:55:55.000000000 +0200
@@ -854,6 +854,22 @@ config SCSI_SYM53C8XX_2
 	  Please read <file:drivers/scsi/sym53c8xx_2/Documentation.txt> for more
 	  information.

+config SCSI_IBMSIS
+	bool "IBM SIS support"
+	help
+	  Support for IBMSIS proprietary SCSI interface.
+	  This driver requires drivers/scsi/ibmsis/ibmsislib64.o to build
+
+config SCSI_ZALON
+	tristate "Zalon SCSI support"
+	depends on GSC && SCSI
+	help
+	  The Zalon is a GSC/HSC bus interface chip that sits between the
+	  PA-RISC processor and the NCR 53c720 SCSI controller on C100,
+	  C110, J200, J210 and some D, K & R-class machines.  It's also
+	  used on the add-in Bluefish, Barracuda & Shrike SCSI cards.
+	  Say Y here if you have one of these machines or cards.
+
 config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
 	int "DMA addressing mode"
 	depends on SCSI_SYM53C8XX_2
diff -purN linux-2.5-latest/drivers/scsi/Makefile linuxppc64-2.5-latest/drivers/scsi/Makefile
--- linux-2.5-latest/drivers/scsi/Makefile	2003-10-10 13:48:55.000000000 +0200
+++ linuxppc64-2.5-latest/drivers/scsi/Makefile	2003-10-10 13:55:49.000000000 +0200
@@ -112,6 +112,7 @@ obj-$(CONFIG_SCSI_FCAL)		+= fcal.o
 obj-$(CONFIG_SCSI_CPQFCTS)	+= cpqfc.o
 obj-$(CONFIG_SCSI_LASI700)	+= lasi700.o 53c700.o
 obj-$(CONFIG_SCSI_NSP32)	+= nsp32.o
+obj-$(CONFIG_SCSI_IBMSIS)	+= ibmsisdd.o ibmsislib64.o

 obj-$(CONFIG_ARM)		+= arm/

diff -purN linux-2.5-latest/drivers/serial/8250.c linuxppc64-2.5-latest/drivers/serial/8250.c
--- linux-2.5-latest/drivers/serial/8250.c	2003-10-10 13:47:42.000000000 +0200
+++ linuxppc64-2.5-latest/drivers/serial/8250.c	2003-10-10 13:54:59.000000000 +0200
@@ -847,6 +847,8 @@ receive_chars(struct uart_8250_port *up,
 				return; // if TTY_DONT_FLIP is set
 		}
 		ch = serial_inp(up, UART_RX);
+		if (uart_handle_kdb(&up->port, ch, regs))
+		    goto ignore_char;
 		*tty->flip.char_buf_ptr = ch;
 		*tty->flip.flag_buf_ptr = TTY_NORMAL;
 		up->port.icount.rx++;
@@ -1984,6 +1986,25 @@ static int __init serial8250_console_set
 		co->index = 0;
 	port = &serial8250_ports[co->index].port;

+
+#ifdef	CONFIG_KDB
+		/*
+		 * Remember the line number of the first serial
+		 * console.  We'll make this the kdb serial console too.
+		 */
+	if (kdb_serial_line == -1) {
+	    kdb_serial_line = co->index;
+	    kdb_serial.io_type = port->iotype;
+	    if (port->iotype == SERIAL_IO_MEM) {
+		kdb_serial.iobase = (int)(port->membase);
+		kdb_serial.ioreg_shift = port->regshift;
+	    } else {
+		kdb_serial.iobase = port->iobase;
+		kdb_serial.ioreg_shift = 0;
+	    }
+	}
+#endif	/* CONFIG_KDB */
+
 	/*
 	 * Temporary fix.
 	 */
diff -purN linux-2.5-latest/include/linux/pci.h linuxppc64-2.5-latest/include/linux/pci.h
--- linux-2.5-latest/include/linux/pci.h	2003-10-10 13:48:38.000000000 +0200
+++ linuxppc64-2.5-latest/include/linux/pci.h	2003-10-10 13:55:24.000000000 +0200
@@ -461,10 +461,10 @@ struct pci_bus {
 	void		*sysdata;	/* hook for sys-specific extension */
 	struct proc_dir_entry *procdir;	/* directory entry in /proc/bus/pci */

-	unsigned char	number;		/* bus number */
-	unsigned char	primary;	/* number of primary bridge */
-	unsigned char	secondary;	/* number of secondary bridge */
-	unsigned char	subordinate;	/* max number of subordinate buses */
+	unsigned int	number;		/* bus number */
+	unsigned int	primary;	/* number of primary bridge */
+	unsigned int	secondary;	/* number of secondary bridge */
+	unsigned int	subordinate;	/* max number of subordinate buses */

 	char		name[48];

diff -purN linux-2.5-latest/include/linux/serial_core.h linuxppc64-2.5-latest/include/linux/serial_core.h
--- linux-2.5-latest/include/linux/serial_core.h	2003-10-10 13:48:00.000000000 +0200
+++ linuxppc64-2.5-latest/include/linux/serial_core.h	2003-10-10 13:55:04.000000000 +0200
@@ -84,6 +84,32 @@
 #include <linux/circ_buf.h>
 #include <linux/spinlock.h>

+#ifdef	CONFIG_KDB
+#include <linux/kdb.h>
+/*
+ * kdb_serial_line records the serial line number of the first serial console.
+ * NOTE: The kernel ignores characters on the serial line unless a user space
+ * program has opened the line first.  To enter kdb before user space has opened
+ * the serial line, you can use the 'kdb=early' flag to lilo and set the
+ * appropriate breakpoints.
+ *
+ * kdb_serial_str[] is the sequence that the user must enter on the serial
+ * console to invoke kdb.  It can be a single character such as "\001"
+ * (control-A) or multiple characters such as "\eKdB".  NOTE: All except the
+ * last character are passed through to the application reading from the serial
+ * console.
+ *
+ * I tried to make the sequence a CONFIG_ option but most of CML1 cannot cope
+ * with '\' in strings, CML2 should be able to do it.  KAO.
+ */
+
+static int  kdb_serial_line = -1;
+static char kdb_serial_str[] = "startKDB";
+static char *kdb_serial_ptr = kdb_serial_str;
+#endif	/* CONFIG_KDB */
+
+
+
 struct uart_port;
 struct uart_info;
 struct serial_struct;
@@ -362,6 +388,31 @@ uart_handle_sysrq_char(struct uart_port
 #define uart_handle_sysrq_char(port,ch,regs)	(0)
 #endif

+#ifdef	CONFIG_KDB
+static inline int
+uart_handle_kdb(struct uart_port *port, unsigned int ch,
+		struct pt_regs *regs)
+{
+    if ((port->line == kdb_serial_line) && kdb_on) {
+	if (ch == *kdb_serial_ptr) {
+	    if (!(*++kdb_serial_ptr)) {
+		kdb_serial_ptr = kdb_serial_str;
+		kdb(KDB_REASON_KEYBOARD, 0, regs);
+		return 1;
+	    }
+	} else {
+	    kdb_serial_ptr = kdb_serial_str;
+	}
+    }
+
+    return 0;
+}
+#else	/* !CONFIG_KDB */
+#define uart_handle_kdb(port,ch,regs)	(0)
+#endif	/* CONFIG_KDB */
+
+
+
 /*
  * We do the SysRQ and SAK checking like this...
  */
diff -purN linux-2.5-latest/include/linux/sysctl.h linuxppc64-2.5-latest/include/linux/sysctl.h
--- linux-2.5-latest/include/linux/sysctl.h	2003-10-10 13:48:42.000000000 +0200
+++ linuxppc64-2.5-latest/include/linux/sysctl.h	2003-10-10 13:55:31.000000000 +0200
@@ -127,6 +127,7 @@ enum
 	KERN_PANIC_ON_OOPS=57,  /* int: whether we will panic on an oops */
 	KERN_HPPA_PWRSW=58,	/* int: hppa soft-power enable */
 	KERN_HPPA_UNALIGNED=59,	/* int: hppa unaligned-trap enable */
+	KERN_KDB=60,		/* int: kdb on/off */
 };


diff -purN linux-2.5-latest/init/main.c linuxppc64-2.5-latest/init/main.c
--- linux-2.5-latest/init/main.c	2003-10-10 13:48:07.000000000 +0200
+++ linuxppc64-2.5-latest/init/main.c	2003-10-10 13:55:07.000000000 +0200
@@ -56,6 +56,10 @@
 #include <asm/smp.h>
 #endif

+#ifdef CONFIG_KDB
+#include <linux/kdb.h>
+#endif /* CONFIG_KDB */
+
 /*
  * Versions of gcc older than that listed below may actually compile
  * and link okay, but the end product can have subtle run time bugs.
@@ -440,6 +444,12 @@ asmlinkage void __init start_kernel(void
 	if (late_time_init)
 		late_time_init();
 	calibrate_delay();
+#ifdef CONFIG_KDB
+	kdb_init(); /* only call after kmem_cache_sizes_init */
+	if (KDB_FLAG(EARLYKDB)) {
+	    KDB_ENTER();
+	}
+#endif /* CONFIG_KDB */
 	pidmap_init();
 	pgtable_cache_init();
 	pte_chain_init();
diff -purN linux-2.5-latest/kernel/printk.c linuxppc64-2.5-latest/kernel/printk.c
--- linux-2.5-latest/kernel/printk.c	2003-10-10 13:49:05.000000000 +0200
+++ linuxppc64-2.5-latest/kernel/printk.c	2003-10-10 13:56:04.000000000 +0200
@@ -326,6 +326,20 @@ out:
 	return error;
 }

+#ifdef	CONFIG_KDB
+	/* kdb dmesg command needs access to the syslog buffer.  do_syslog() uses locks
+	 * so it cannot be used during debugging.  Just tell kdb where the start and
+	 * end of the physical and logical logs are.  This is equivalent to do_syslog(3).
+	 */
+void kdb_syslog_data(char *syslog_data[4])
+{
+    syslog_data[0] = log_buf;
+    syslog_data[1] = log_buf + sizeof(log_buf);
+    syslog_data[2] = log_buf + log_end - (logged_chars < LOG_BUF_LEN ? logged_chars : LOG_BUF_LEN);
+    syslog_data[3] = log_buf + log_end;
+}
+#endif
+
 asmlinkage long sys_syslog(int type, char __user * buf, int len)
 {
 	return do_syslog(type, buf, len);
diff -purN linux-2.5-latest/kernel/softirq.c linuxppc64-2.5-latest/kernel/softirq.c
--- linux-2.5-latest/kernel/softirq.c	2003-10-10 13:48:15.000000000 +0200
+++ linuxppc64-2.5-latest/kernel/softirq.c	2003-10-10 13:55:10.000000000 +0200
@@ -14,7 +14,9 @@
 #include <linux/notifier.h>
 #include <linux/percpu.h>
 #include <linux/cpu.h>
-
+#ifdef CONFIG_KDB
+#include <linux/kdb.h>
+#endif
 /*
    - No shared variables, all the data are CPU local.
    - If a softirq needs serialization, let it serialize itself
@@ -76,6 +78,11 @@ asmlinkage void do_softirq(void)

 	if (in_interrupt())
 		return;
+#ifdef	CONFIG_KDB
+	if (KDB_IS_RUNNING())
+	    return;
+#endif	/*CONFIG_KDB */
+

 	local_irq_save(flags);

diff -purN linux-2.5-latest/kernel/sysctl.c linuxppc64-2.5-latest/kernel/sysctl.c
--- linux-2.5-latest/kernel/sysctl.c	2003-10-10 13:47:58.000000000 +0200
+++ linuxppc64-2.5-latest/kernel/sysctl.c	2003-10-10 13:55:03.000000000 +0200
@@ -43,6 +43,10 @@
 #include <linux/nfs_fs.h>
 #endif

+#ifdef CONFIG_KDB
+#include <linux/kdb.h>
+#endif /* CONFIG_KDB */
+
 #if defined(CONFIG_SYSCTL)

 /* External variables not in a header file. */
--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list