## Automatically generated incremental diff
## From:   linux-2.5.64-bk10
## To:     linux-2.5.64-bk11
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.5.64-bk10/Documentation/cpu-freq/cpu-drivers.txt linux-2.5.64-bk11/Documentation/cpu-freq/cpu-drivers.txt
--- linux-2.5.64-bk10/Documentation/cpu-freq/cpu-drivers.txt	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/Documentation/cpu-freq/cpu-drivers.txt	Mon Mar 31 12:34:55 2003
@@ -54,7 +54,7 @@
 cpufreq_driver.init -		A pointer to the per-CPU initialization 
 				function.
 
-cpufreq_driver.verify -		A pointer to a "verification" funciton.
+cpufreq_driver.verify -		A pointer to a "verification" function.
 
 cpufreq_driver.setpolicy _or_ 
 cpufreq_driver.target -		See below on the differences.
diff -urN linux-2.5.64-bk10/Makefile linux-2.5.64-bk11/Makefile
--- linux-2.5.64-bk10/Makefile	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/Makefile	Mon Mar 31 12:34:55 2003
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 64
-EXTRAVERSION = -bk10
+EXTRAVERSION = -bk11
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -198,7 +198,7 @@
 comma := ,
 depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
 
-noconfig_targets := xconfig menuconfig config oldconfig randconfig \
+noconfig_targets := xconfig gconfig menuconfig config oldconfig randconfig \
 		    defconfig allyesconfig allnoconfig allmodconfig \
 		    clean mrproper distclean rpm \
 		    help tags TAGS cscope sgmldocs psdocs pdfdocs htmldocs \
@@ -604,15 +604,18 @@
 # Kernel configuration
 # ---------------------------------------------------------------------------
 
-.PHONY: oldconfig xconfig menuconfig config \
+.PHONY: oldconfig xconfig gconfig menuconfig config \
 	make_with_config rpm
 
-scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf: scripts/fixdep FORCE
+scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf scripts/kconfig/gconf: scripts/fixdep FORCE
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
 xconfig: scripts/kconfig/qconf
 	./scripts/kconfig/qconf arch/$(ARCH)/Kconfig
 
+gconfig: scripts/kconfig/gconf
+	./scripts/kconfig/gconf arch/$(ARCH)/Kconfig
+
 menuconfig: scripts/kconfig/mconf
 	$(Q)$(MAKE) $(build)=scripts/lxdialog
 	./scripts/kconfig/mconf arch/$(ARCH)/Kconfig
diff -urN linux-2.5.64-bk10/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c linux-2.5.64-bk11/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
--- linux-2.5.64-bk10/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c	Mon Mar 31 12:34:55 2003
@@ -444,7 +444,7 @@
 
 /* 
  * cpufreq_gx_init:
- *   MediaGX/Geode GX initilize cpufreq driver
+ *   MediaGX/Geode GX initialize cpufreq driver
  */
 static struct cpufreq_driver gx_suspmod_driver = {
 	.verify		= cpufreq_gx_verify,
diff -urN linux-2.5.64-bk10/arch/i386/kernel/cpu/cpufreq/longhaul.c linux-2.5.64-bk11/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- linux-2.5.64-bk10/arch/i386/kernel/cpu/cpufreq/longhaul.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/i386/kernel/cpu/cpufreq/longhaul.c	Mon Mar 31 12:34:55 2003
@@ -40,18 +40,15 @@
 #define dprintk(msg...) do { } while(0);
 #endif
 
-static int numscales=16, numvscales;
+static unsigned int numscales=16, numvscales;
 static int minvid, maxvid;
 static int can_scale_voltage;
-static int can_scale_fsb;
 static int vrmrev;
 
 
 /* Module parameters */
-static int prefer_slow_fsb;
 static int dont_scale_voltage;
-static int dont_scale_fsb;
-static int current_fsb;
+static unsigned int fsb;
 
 #define __hlt()     __asm__ __volatile__("hlt": : :"memory")
 
@@ -231,14 +228,6 @@
 	145, /* 1111 -> 14.5x */
 };
 
-/* fsb values as defined in CPU */
-static unsigned int eblcr_fsb_table[] = { 66, 133, 100, -1 };
-/* fsb values to favour low fsb speed (lower power) */
-static unsigned int power_fsb_table[] = { 66, 100, 133, -1 };
-/* fsb values to favour high fsb speed (for e.g. if lowering CPU 
-   freq because of heat, but want to maintain highest performance possible) */
-static unsigned int perf_fsb_table[] = { 133, 100, 66, -1 };
-
 /* Voltage scales. Div by 1000 to get actual voltage. */
 static int __initdata vrm85scales[32] = {
 	1250, 1200, 1150, 1100, 1050, 1800, 1750, 1700,
@@ -258,21 +247,22 @@
 static int clock_ratio[32];
 static int eblcr_table[32];
 static int voltage_table[32];
-static int highest_speed, lowest_speed; /* kHz */
+static unsigned int highest_speed, lowest_speed; /* kHz */
 static int longhaul; /* version. */
 static struct cpufreq_frequency_table *longhaul_table;
 
 
 static int longhaul_get_cpu_fsb (void)
 {
+	unsigned int eblcr_fsb_table[] = { 66, 133, 100, -1 };
 	unsigned long invalue=0,lo, hi;
 
-	if (current_fsb == 0) {
+	if (fsb == 0) {
 		rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi);
 		invalue = (lo & (1<<18|1<<19)) >>18;
 		return eblcr_fsb_table[invalue];
 	} else {
-		return current_fsb;
+		return fsb;
 	}
 }
 
@@ -294,12 +284,11 @@
 /**
  * longhaul_set_cpu_frequency()
  * @clock_ratio_index : index of clock_ratio[] for new frequency
- * @newfsb: the new FSB
  *
  * Sets a new clock ratio, and -if applicable- a new Front Side Bus
  */
 
-static void longhaul_setstate (unsigned int clock_ratio_index, unsigned int newfsb)
+static void longhaul_setstate (unsigned int clock_ratio_index)
 {
 	unsigned long lo, hi;
 	unsigned int bits;
@@ -307,24 +296,21 @@
 	int vidindex, i;
 	struct cpufreq_freqs freqs;
 	
-	if (!newfsb || (clock_ratio[clock_ratio_index] == -1))
-		return;
-
-	if ((!can_scale_fsb) && (newfsb != current_fsb))
+	if (clock_ratio[clock_ratio_index] == -1)
 		return;
 
-	if (((clock_ratio[clock_ratio_index] * newfsb * 100) > highest_speed) ||
-	    ((clock_ratio[clock_ratio_index] * newfsb * 100) < lowest_speed))
+	if (((clock_ratio[clock_ratio_index] * fsb * 100) > highest_speed) ||
+	    ((clock_ratio[clock_ratio_index] * fsb * 100) < lowest_speed))
 		return;
 
 	freqs.old = longhaul_get_cpu_mult() * longhaul_get_cpu_fsb() * 100;
-	freqs.new = clock_ratio[clock_ratio_index] * newfsb * 100;
+	freqs.new = clock_ratio[clock_ratio_index] * fsb * 100;
 	freqs.cpu = 0; /* longhaul.c is UP only driver */
 	
 	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
-	dprintk (KERN_INFO "longhaul: New FSB:%d Mult(x10):%d\n",
-				newfsb, clock_ratio[clock_ratio_index]);
+	dprintk (KERN_INFO "longhaul: FSB:%d Mult(x10):%d\n",
+				fsb * 100, clock_ratio[clock_ratio_index]);
 
 	bits = clock_ratio_index;
 	/* "bits" contains the bitpattern of the new multiplier.
@@ -358,14 +344,9 @@
 		lo |= revkey;
 
 		if (can_scale_voltage) {
-			if (can_scale_fsb==1) {
-				dprintk (KERN_INFO "longhaul: Voltage scaling + FSB scaling not done yet.\n");
-				goto bad_voltage;
-			} else {
-				/* PB: TODO fix this up */
-				vidindex = (((highest_speed-lowest_speed) / (newfsb/2)) -
-						((highest_speed-((clock_ratio[clock_ratio_index] * newfsb * 100)/1000)) / (newfsb/2)));
-			}
+			/* PB: TODO fix this up */
+			vidindex = (((highest_speed-lowest_speed) / (fsb/2)) -
+					((highest_speed-((clock_ratio[clock_ratio_index] * fsb * 100)/1000)) / (fsb/2)));
 			for (i=0;i<32;i++) {
 				dprintk (KERN_INFO "VID hunting. Looking for %d, found %d\n",
 						minvid+(vidindex*25), voltage_table[i]);
@@ -403,17 +384,6 @@
 		lo |= (1<<8);	/* EnableSoftBusRatio */
 		lo |= revkey;
 
-		/* Set FSB */
-		if (can_scale_fsb==1) {
-			lo &= ~(1<<28|1<<29);
-			switch (newfsb) {
-				case 66:	lo |= (1<<28|1<<29); /* 11 */
-							break;
-				case 100:	lo |= 1<<28;	/* 01 */
-							break;
-				case 133:	break;	/* 00*/
-			}
-		}
 		wrmsr (MSR_VIA_LONGHAUL, lo, hi);
 		__hlt();
 
@@ -431,14 +401,11 @@
 static int __init longhaul_get_ranges (void)
 {
 	unsigned long lo, hi, invalue;
-	unsigned int minmult=0, maxmult=0, minfsb=0, maxfsb=0;
+	unsigned int minmult=0, maxmult=0;
 	unsigned int multipliers[32]= {
 		50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65,
 		-1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 };
-	unsigned int fsb_table[4] = { 133, 100, -1, 66 };
-	unsigned int fsbcount = 1;
-	unsigned int i, j, k = 0;
-	static unsigned int *fsb_search_table;
+	unsigned int j, k = 0;
 
 	switch (longhaul) {
 	case 1:
@@ -446,7 +413,6 @@
 		   Assume min=3.0x & max = whatever we booted at. */
 		minmult = 30;
 		maxmult = longhaul_get_cpu_mult();
-		minfsb = maxfsb = current_fsb;
 		break;
 
 	case 2 ... 3:
@@ -465,55 +431,30 @@
 #else
 		minmult = 30; /* as per spec */
 #endif
-
-		if (can_scale_fsb==1) {
-			invalue = (hi & (1<<9|1<<10)) >> 9;
-			maxfsb = fsb_table[invalue];
-
-			invalue = (hi & (1<<25|1<<26)) >> 25;
-			minfsb = fsb_table[invalue];
-
-			dprintk (KERN_INFO "longhaul: Min FSB=%d Max FSB=%d\n",
-				minfsb, maxfsb);
-			fsbcount = 0;
-			for (i=0;i<4;i++) {
-				if((fsb_table[i] >= minfsb) && (fsb_table[i] <= maxfsb))
-					fsbcount++;
-			}
-		} else {
-			minfsb = maxfsb = current_fsb;
-		}
 		break;
 	}
 
-	highest_speed = maxmult * maxfsb * 100;
-	lowest_speed = minmult * minfsb * 100;
+	highest_speed = maxmult * fsb * 100;
+	lowest_speed = minmult * fsb * 100;
 	dprintk (KERN_INFO "longhaul: MinMult(x10)=%d MaxMult(x10)=%d\n",
 		 minmult, maxmult);
 	dprintk (KERN_INFO "longhaul: Lowestspeed=%d Highestspeed=%d\n",
 		 lowest_speed, highest_speed);
 
-	longhaul_table = kmalloc((numscales * fsbcount + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL);
+	longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL);
 	if(!longhaul_table)
 		return -ENOMEM;
 
-	if (prefer_slow_fsb) 
-		fsb_search_table = perf_fsb_table;   // yep, this is right: the last entry is preferred by cpufreq_frequency_table_* ...
-	else
-		fsb_search_table = power_fsb_table;
-
-	for (i=0; (i<4); i++) {
-		if ((fsb_search_table[i] > maxfsb) || (fsb_search_table[i] < minfsb) || (fsb_search_table[i] == -1))
+	for (j=0; (j<numscales); j++) {
+		if (clock_ratio[j] == -1)
 			continue;
-		for (j=0; (j<numscales); j++) {
-			if ((clock_ratio[j] > maxmult) || (clock_ratio[j] < minmult) || (clock_ratio[j] == -1))
-				continue;
-			longhaul_table[k].frequency= clock_ratio[j] * fsb_search_table[i] * 100;
-			longhaul_table[k].index	= (j << 8) | (i);
-			k++;
-		}
+		if (((unsigned int)clock_ratio[j] > maxmult) || ((unsigned int)clock_ratio[j] < minmult))
+			continue;
+		longhaul_table[k].frequency= clock_ratio[j] * fsb * 100;
+		longhaul_table[k].index	= (j << 8);
+		k++;
 	}
-	
+
 	longhaul_table[k].frequency = CPUFREQ_TABLE_END;
 	if (!k)
 		return -EINVAL;
@@ -568,16 +509,14 @@
 			    unsigned int relation)
 {
 	unsigned int    table_index = 0;
- 	unsigned int    new_fsb = 0;
  	unsigned int    new_clock_ratio = 0;
 
 	if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, relation, &table_index))
 		return -EINVAL;
 
 	new_clock_ratio = longhaul_table[table_index].index & 0xFF;
-	new_fsb = power_fsb_table[(longhaul_table[table_index].index & 0xFF00) >> 8];
  
-	longhaul_setstate(new_clock_ratio, new_fsb);
+	longhaul_setstate(new_clock_ratio);
 
 	return 0;
 }
@@ -628,9 +567,6 @@
 		rdmsr (MSR_VIA_LONGHAUL, lo, hi);
 		if ((lo & (1<<0)) && (dont_scale_voltage==0))
 			longhaul_setup_voltagescaling (lo, hi);
-
-		if ((lo & (1<<1)) && (dont_scale_fsb==0) && (current_fsb==0))
-			can_scale_fsb = 1;
 	}
 
 	if (longhaul_get_ranges())
@@ -639,7 +575,7 @@
  	policy->policy = CPUFREQ_POLICY_PERFORMANCE;
  	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 
-        policy->cur = (unsigned int) (longhaul_get_cpu_fsb() * longhaul_get_cpu_mult() * 100);
+	policy->cur = (unsigned int) (longhaul_get_cpu_fsb() * longhaul_get_cpu_mult() * 100);
 
 	return cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
 }
@@ -677,10 +613,7 @@
 	kfree(longhaul_table);
 }
 
-MODULE_PARM (dont_scale_fsb, "i");
 MODULE_PARM (dont_scale_voltage, "i");
-MODULE_PARM (current_fsb, "i");
-MODULE_PARM (prefer_slow_fsb, "i");
 
 MODULE_AUTHOR ("Dave Jones <davej@suse.de>");
 MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
diff -urN linux-2.5.64-bk10/arch/i386/kernel/cpu/cpufreq/powernow-k7.c linux-2.5.64-bk11/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
--- linux-2.5.64-bk10/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/i386/kernel/cpu/cpufreq/powernow-k7.c	Mon Mar 31 12:34:55 2003
@@ -151,7 +151,7 @@
 	}
 
 	if (!(edx & (1 << 1 | 1 << 2))) {
-		printk (" nothing.\n");
+		printk ("nothing.\n");
 		return 0;
 	}
 
@@ -162,9 +162,8 @@
 
 static int get_ranges (unsigned char *pst)
 {
-	int j;
+	unsigned int j, speed;
 	u8 fid, vid;
-	unsigned int speed;
 
 	powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
 	if (!powernow_table)
@@ -258,7 +257,7 @@
 }
 
 
-int powernow_decode_bios (int maxfid, int startvid)
+static int powernow_decode_bios (int maxfid, int startvid)
 {
 	struct psb_s *psb;
 	struct pst_s *pst;
diff -urN linux-2.5.64-bk10/arch/ppc/boot/common/util.S linux-2.5.64-bk11/arch/ppc/boot/common/util.S
--- linux-2.5.64-bk10/arch/ppc/boot/common/util.S	Tue Mar  4 19:29:56 2003
+++ linux-2.5.64-bk11/arch/ppc/boot/common/util.S	Mon Mar 31 12:34:55 2003
@@ -14,7 +14,7 @@
  *	   trini@mvista.com
  * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
  *
- * 2001 (c) MontaVista, Software, Inc.  This file is licensed under
+ * 2001-2003 (c) MontaVista, Software, Inc.  This file is licensed under
  * the terms of the GNU General Public License version 2.  This program
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
@@ -98,7 +98,7 @@
 	isync
 	mfspr	r8,L2CR
 	rlwinm	r8,r8,0,1,31
-	oris	r8,r8,0x0020
+	oris	r8,r8,L2CR_L2I@h
 	sync
 	isync
 	mtspr	L2CR,r8
@@ -106,17 +106,58 @@
 	isync
 
 	/* Wait for the invalidation to complete */
-1:	mfspr	r8,L2CR
-	rlwinm.	r9,r8,0,31,31
+	mfspr   r8,PVR
+	srwi    r8,r8,16
+	cmpli	cr0,r8,0x8000			/* 7450 */
+	cmpli	cr1,r8,0x8001			/* 7455 */
+	cmpli	cr2,r8,0x8002			/* 7457 */
+	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq	/* Now test if any are true. */
+	cror	4*cr0+eq,4*cr0+eq,4*cr2+eq
+	bne     2f
+
+1:	mfspr	r8,L2CR		/* On 745x, poll L2I bit (bit 10) */
+	rlwinm.	r9,r8,0,10,10
 	bne	1b
+	b	3f
+
+2:      mfspr   r8,L2CR		/* On 75x & 74[01]0, poll L2IP bit (bit 31) */
+	rlwinm. r9,r8,0,31,31
+	bne     2b
 
-	rlwinm	r8,r8,0,11,9		/* Turn off L2I bit */
+3:	rlwinm	r8,r8,0,11,9	/* Turn off L2I bit */
 	sync
 	isync
 	mtspr	L2CR,r8
 	sync
 	isync
 	blr
+
+	.globl	_setup_L3CR
+_setup_L3CR:
+	/* Invalidate/disable L3 cache */
+	sync
+	isync
+	mfspr	r8,L3CR
+	rlwinm	r8,r8,0,1,31
+	ori	r8,r8,L3CR_L3I@l
+	sync
+	isync
+	mtspr	L3CR,r8
+	sync
+	isync
+
+	/* Wait for the invalidation to complete */
+1:	mfspr	r8,L3CR
+	rlwinm.	r9,r8,0,21,21
+	bne	1b
+
+	rlwinm	r8,r8,0,22,20		/* Turn off L3I bit */
+	sync
+	isync
+	mtspr	L3CR,r8
+	sync
+	isync
+	blr
 
 
 /*
diff -urN linux-2.5.64-bk10/arch/ppc/boot/simple/head.S linux-2.5.64-bk11/arch/ppc/boot/simple/head.S
--- linux-2.5.64-bk10/arch/ppc/boot/simple/head.S	Tue Mar  4 19:29:30 2003
+++ linux-2.5.64-bk11/arch/ppc/boot/simple/head.S	Mon Mar 31 12:34:55 2003
@@ -7,7 +7,7 @@
  *	   trini@mvista.com
  * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
  *
- * 2001 (c) MontaVista, Software, Inc.  This file is licensed under
+ * 2001-2003 (c) MontaVista, Software, Inc.  This file is licensed under
  * the terms of the GNU General Public License version 2.  This program
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
@@ -74,6 +74,17 @@
 #if defined(CONFIG_FORCE) || defined(CONFIG_K2)		\
 		|| defined(CONFIG_EV64260) || defined(CONFIG_PAL4)
 	bl	_setup_L2CR
+
+	/* If 745x, turn off L3CR as well */
+	mfspr	r8,PVR
+	srwi	r8,r8,16
+
+	cmpli	cr0,r8,0x8000			/* 7450 */
+	cmpli	cr1,r8,0x8001			/* 7455 */
+	cmpli	cr2,r8,0x8002			/* 7457 */
+	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq	/* Now test if any are true. */
+	cror	4*cr0+eq,4*cr0+eq,4*cr2+eq
+	beql	_setup_L3CR
 #endif
 #endif
 
diff -urN linux-2.5.64-bk10/arch/ppc/kernel/irq.c linux-2.5.64-bk11/arch/ppc/kernel/irq.c
--- linux-2.5.64-bk10/arch/ppc/kernel/irq.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/ppc/kernel/irq.c	Mon Mar 31 12:34:55 2003
@@ -375,7 +375,7 @@
 		seq_printf(p, "%s", (irq_desc[i].status & IRQ_LEVEL) ? "Level " : "Edge  ");
 		seq_printf(p, "    %s", action->name);
 		for (action = action->next; action; action = action->next)
-				seq_printf(p, ", %s", action->name);
+			seq_printf(p, ", %s", action->name);
 		seq_putc(p, '\n');
 skip:
 		spin_unlock_irqrestore(&irq_desc[i].lock, flags);
@@ -684,7 +684,7 @@
 	struct proc_dir_entry *entry;
 	char name [MAX_NAMELEN];
 
-	if (!root_irq_dir || (irq_desc[irq].handler == NULL))
+	if (!root_irq_dir || (irq_desc[irq].handler == NULL) || irq_dir[irq])
 		return;
 
 	memset(name, 0, MAX_NAMELEN);
diff -urN linux-2.5.64-bk10/arch/ppc/kernel/ppc-stub.c linux-2.5.64-bk11/arch/ppc/kernel/ppc-stub.c
--- linux-2.5.64-bk10/arch/ppc/kernel/ppc-stub.c	Tue Mar  4 19:29:35 2003
+++ linux-2.5.64-bk11/arch/ppc/kernel/ppc-stub.c	Mon Mar 31 12:34:55 2003
@@ -420,18 +420,6 @@
 	flush_instruction_cache();
 }
 
-static inline int get_msr(void)
-{
-	int msr;
-	asm volatile("mfmsr %0" : "=r" (msr):);
-	return msr;
-}
-
-static inline void set_msr(int msr)
-{
-	asm volatile("mtmsr %0" : : "r" (msr));
-}
-
 /* Set up exception handlers for tracing and breakpoints
  * [could be called kgdb_init()]
  */
@@ -598,8 +586,8 @@
 
 	kgdb_interruptible(0);
 	lock_kernel();
-	msr = get_msr();
-	set_msr(msr & ~MSR_EE);	/* disable interrupts */
+	msr = mfmsr();
+	mtmsr(msr & ~MSR_EE);	/* disable interrupts */
 
 	if (regs->nip == (unsigned long)breakinst) {
 		/* Skip over breakpoint trap insn */
@@ -626,7 +614,7 @@
 	*ptr++ = hexchars[SP_REGNUM >> 4];
 	*ptr++ = hexchars[SP_REGNUM & 0xf];
 	*ptr++ = ':';
-	ptr = mem2hex(((char *)&regs) + SP_REGNUM*4, ptr, 4);
+	ptr = mem2hex(((char *)regs) + SP_REGNUM*4, ptr, 4);
 	*ptr++ = ';';
 #endif
 
@@ -786,7 +774,7 @@
 			strcpy(remcomOutBuffer, "OK");
 			putpacket(remcomOutBuffer);
 #endif
-			set_msr(msr);
+			mtmsr(msr);
 
 			kgdb_interruptible(1);
 			unlock_kernel();
@@ -802,10 +790,9 @@
 #if defined(CONFIG_40x)
 			regs->msr |= MSR_DE;
 			regs->dbcr0 |= (DBCR0_IDM | DBCR0_IC);
-			set_msr(msr);
+			mtmsr(msr);
 #else
 			regs->msr |= MSR_SE;
-			set_msr(msr | MSR_SE);
 #endif
 			unlock_kernel();
 			kgdb_active = 0;
diff -urN linux-2.5.64-bk10/arch/ppc/kernel/process.c linux-2.5.64-bk11/arch/ppc/kernel/process.c
--- linux-2.5.64-bk10/arch/ppc/kernel/process.c	Tue Mar  4 19:29:18 2003
+++ linux-2.5.64-bk11/arch/ppc/kernel/process.c	Mon Mar 31 12:34:55 2003
@@ -321,6 +321,24 @@
 }
 
 /*
+ * This gets called before we allocate a new thread and copy
+ * the current task into it.
+ */
+void prepare_to_copy(struct task_struct *tsk)
+{
+	struct pt_regs *regs = tsk->thread.regs;
+
+	if (regs == NULL)
+		return;
+	if (regs->msr & MSR_FP)
+		giveup_fpu(current);
+#ifdef CONFIG_ALTIVEC
+	if (regs->msr & MSR_VEC)
+		giveup_altivec(current);
+#endif /* CONFIG_ALTIVEC */
+}
+
+/*
  * Copy a thread..
  */
 int
@@ -348,6 +366,8 @@
 	} else {
 		childregs->gpr[1] = usp;
 		p->thread.regs = childregs;
+		if (clone_flags & CLONE_SETTLS)
+			childregs->gpr[2] = childregs->gpr[6];
 	}
 	childregs->gpr[3] = 0;  /* Result from fork() */
 	sp -= STACK_FRAME_OVERHEAD;
@@ -367,29 +387,6 @@
 	p->thread.ksp = sp;
 	kregs->nip = (unsigned long)ret_from_fork;
 
-	/*
-	 * copy fpu info - assume lazy fpu switch now always
-	 *  -- Cort
-	 */
-	if (regs->msr & MSR_FP) {
-		giveup_fpu(current);
-		childregs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
-	}
-	memcpy(&p->thread.fpr, &current->thread.fpr, sizeof(p->thread.fpr));
-	p->thread.fpscr = current->thread.fpscr;
-
-#ifdef CONFIG_ALTIVEC
-	/*
-	 * copy altiVec info - assume lazy altiVec switch
-	 * - kumar
-	 */
-	if (regs->msr & MSR_VEC)
-		giveup_altivec(current);
-	memcpy(&p->thread.vr, &current->thread.vr, sizeof(p->thread.vr));
-	p->thread.vscr = current->thread.vscr;
-	childregs->msr &= ~MSR_VEC;
-#endif /* CONFIG_ALTIVEC */
-
 	p->thread.last_syscall = -1;
 
 	return 0;
@@ -444,15 +441,17 @@
 	return put_user(val, (unsigned int *) adr);
 }
 
-int sys_clone(int p1, int p2, int p3, int p4, int p5, int p6,
+int sys_clone(unsigned long clone_flags, unsigned long usp, int *parent_tidp,
+	      void *child_threadptr, int *child_tidp, int p6,
 	      struct pt_regs *regs)
 {
  	struct task_struct *p;
 
 	CHECK_FULL_REGS(regs);
-	if (p2 == 0)
-		p2 = regs->gpr[1];	/* stack pointer for child */
- 	p = do_fork(p1 & ~CLONE_IDLETASK, p2, regs, 0, (int *)p3, (int *)p4);
+	if (usp == 0)
+		usp = regs->gpr[1];	/* stack pointer for child */
+ 	p = do_fork(clone_flags & ~CLONE_IDLETASK, usp, regs, 0,
+		    parent_tidp, child_tidp);
  	return IS_ERR(p) ? PTR_ERR(p) : p->pid;
 }
 
diff -urN linux-2.5.64-bk10/arch/ppc/mm/fault.c linux-2.5.64-bk11/arch/ppc/mm/fault.c
--- linux-2.5.64-bk10/arch/ppc/mm/fault.c	Tue Mar  4 19:29:04 2003
+++ linux-2.5.64-bk11/arch/ppc/mm/fault.c	Mon Mar 31 12:34:55 2003
@@ -57,6 +57,41 @@
 extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
 
 /*
+ * Check whether the instruction at regs->nip is a store using
+ * an update addressing form which will update r1.
+ */
+static int store_updates_sp(struct pt_regs *regs)
+{
+	unsigned int inst;
+
+	if (get_user(inst, (unsigned int *)regs->nip))
+		return 0;
+	/* check for 1 in the rA field */
+	if (((inst >> 16) & 0x1f) != 1)
+		return 0;
+	/* check major opcode */
+	switch (inst >> 26) {
+	case 37:	/* stwu */
+	case 39:	/* stbu */
+	case 45:	/* sthu */
+	case 53:	/* stfsu */
+	case 55:	/* stfdu */
+		return 1;
+	case 31:
+		/* check minor opcode */
+		switch ((inst >> 1) & 0x3ff) {
+		case 183:	/* stwux */
+		case 247:	/* stbux */
+		case 439:	/* sthux */
+		case 695:	/* stfsux */
+		case 759:	/* stfdux */
+			return 1;
+		}
+	}
+	return 0;
+}
+
+/*
  * For 600- and 800-family processors, the error_code parameter is DSISR
  * for a data fault, SRR1 for an instruction fault. For 400-family processors
  * the error_code parameter is ESR for a data fault, 0 for an instruction
@@ -112,6 +147,40 @@
 		goto good_area;
 	if (!(vma->vm_flags & VM_GROWSDOWN))
 		goto bad_area;
+	if (!is_write)
+                goto bad_area;
+
+	/*
+	 * N.B. The rs6000/xcoff ABI allows programs to access up to
+	 * a few hundred bytes below the stack pointer.
+	 * The kernel signal delivery code writes up to about 1.5kB
+	 * below the stack pointer (r1) before decrementing it.
+	 * The exec code can write slightly over 640kB to the stack
+	 * before setting the user r1.  Thus we allow the stack to
+	 * expand to 1MB without further checks.
+	 */
+	if (address + 0x100000 < vma->vm_end) {
+		/* get user regs even if this fault is in kernel mode */
+		struct pt_regs *uregs = current->thread.regs;
+		if (uregs == NULL)
+			goto bad_area;
+
+		/*
+		 * A user-mode access to an address a long way below
+		 * the stack pointer is only valid if the instruction
+		 * is one which would update the stack pointer to the
+		 * address accessed if the instruction completed,
+		 * i.e. either stwu rs,n(r1) or stwux rs,r1,rb
+		 * (or the byte, halfword, float or double forms).
+		 *
+		 * If we don't check this then any write to the area
+		 * between the last mapped region and the stack will
+		 * expand the stack rather than segfaulting.
+		 */
+		if (address + 2048 < uregs->gpr[1]
+		    && (!user_mode(regs) || !store_updates_sp(regs)))
+			goto bad_area;
+	}
 	if (expand_stack(vma, address))
 		goto bad_area;
 
diff -urN linux-2.5.64-bk10/arch/ppc/mm/init.c linux-2.5.64-bk11/arch/ppc/mm/init.c
--- linux-2.5.64-bk10/arch/ppc/mm/init.c	Tue Mar  4 19:29:03 2003
+++ linux-2.5.64-bk11/arch/ppc/mm/init.c	Mon Mar 31 12:34:55 2003
@@ -338,6 +338,7 @@
 
 	min_low_pfn = start >> PAGE_SHIFT;
 	max_low_pfn = (PPC_MEMSTART + total_lowmem) >> PAGE_SHIFT;
+	max_pfn = (PPC_MEMSTART + total_memory) >> PAGE_SHIFT;
 	boot_mapsize = init_bootmem_node(&contig_page_data, min_low_pfn,
 					 PPC_MEMSTART >> PAGE_SHIFT,
 					 max_low_pfn);
diff -urN linux-2.5.64-bk10/arch/ppc/platforms/lopec_setup.c linux-2.5.64-bk11/arch/ppc/platforms/lopec_setup.c
--- linux-2.5.64-bk10/arch/ppc/platforms/lopec_setup.c	Tue Mar  4 19:29:21 2003
+++ linux-2.5.64-bk11/arch/ppc/platforms/lopec_setup.c	Mon Mar 31 12:34:55 2003
@@ -324,7 +324,7 @@
         	ROOT_DEV = Root_SDA1;
 #endif
 
-#ifdef CONFIG_DUMMY_CONSOLE
+#ifdef CONFIG_VT
 	conswitchp = &dummy_con;
 #endif
 #ifdef CONFIG_PPCBUG_NVRAM
@@ -378,7 +378,7 @@
 	ppc_md.nvram_read_val = todc_direct_read_val;
 	ppc_md.nvram_write_val = todc_direct_write_val;
 
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_ID_MODULE)
+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
 	ppc_ide_md.default_irq = lopec_ide_default_irq;
 	ppc_ide_md.default_io_base = lopec_ide_default_io_base;
 	ppc_ide_md.ide_init_hwif = lopec_ide_init_hwif_ports;
diff -urN linux-2.5.64-bk10/arch/ppc/syslib/open_pic.c linux-2.5.64-bk11/arch/ppc/syslib/open_pic.c
--- linux-2.5.64-bk10/arch/ppc/syslib/open_pic.c	Tue Mar  4 19:29:23 2003
+++ linux-2.5.64-bk11/arch/ppc/syslib/open_pic.c	Mon Mar 31 12:34:55 2003
@@ -580,14 +580,19 @@
 	if (OpenPIC == NULL)
 		return;
 
+	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
-		    openpic_ipi_action, 0, "IPI0 (call function)", 0);
+		    openpic_ipi_action, SA_INTERRUPT,
+		    "IPI0 (call function)", 0);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
-		    openpic_ipi_action, 0, "IPI1 (reschedule)", 0);
+		    openpic_ipi_action, SA_INTERRUPT,
+		    "IPI1 (reschedule)", 0);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
-		    openpic_ipi_action, 0, "IPI2 (invalidate tlb)", 0);
+		    openpic_ipi_action, SA_INTERRUPT,
+		    "IPI2 (invalidate tlb)", 0);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
-		    openpic_ipi_action, 0, "IPI3 (xmon break)", 0);
+		    openpic_ipi_action, SA_INTERRUPT,
+		    "IPI3 (xmon break)", 0);
 
 	for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
 		openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
diff -urN linux-2.5.64-bk10/arch/ppc64/Makefile linux-2.5.64-bk11/arch/ppc64/Makefile
--- linux-2.5.64-bk10/arch/ppc64/Makefile	Tue Mar  4 19:28:59 2003
+++ linux-2.5.64-bk11/arch/ppc64/Makefile	Mon Mar 31 12:34:55 2003
@@ -18,9 +18,8 @@
 LDFLAGS		:= -m elf64ppc
 LDFLAGS_vmlinux	= -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
 LDFLAGS_BLOB	:= --format binary --oformat elf64-powerpc
-CFLAGS		+= -msoft-float -pipe \
-		-Wno-uninitialized -mminimal-toc -mtraceback=full \
-		-finline-limit-2000 -mcpu=power4
+CFLAGS		+= -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
+		-mtraceback=full -mcpu=power4
 
 head-y := arch/ppc64/kernel/head.o
 
diff -urN linux-2.5.64-bk10/arch/ppc64/boot/main.c linux-2.5.64-bk11/arch/ppc64/boot/main.c
--- linux-2.5.64-bk10/arch/ppc64/boot/main.c	Tue Mar  4 19:29:56 2003
+++ linux-2.5.64-bk11/arch/ppc64/boot/main.c	Mon Mar 31 12:34:55 2003
@@ -12,12 +12,11 @@
 #include "ppc32-types.h"
 #include "zlib.h"
 #include <linux/elf.h>
+#include <linux/string.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/bootinfo.h>
 
-void memmove(void *dst, void *im, int len);
-
 extern void *finddevice(const char *);
 extern int getprop(void *, const char *, void *, int);
 extern void printk(char *fmt, ...);
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/chrp_setup.c linux-2.5.64-bk11/arch/ppc64/kernel/chrp_setup.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/chrp_setup.c	Tue Mar  4 19:28:59 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/chrp_setup.c	Mon Mar 31 12:34:55 2003
@@ -72,6 +72,7 @@
 
 extern void find_and_init_phbs(void);
 extern void pSeries_pcibios_fixup(void);
+extern void pSeries_pcibios_fixup_bus(struct pci_bus *bus);
 extern void iSeries_pcibios_fixup(void);
 
 extern void pSeries_get_rtc_time(struct rtc_time *rtc_time);
@@ -245,6 +246,7 @@
 
  	#ifndef CONFIG_PPC_ISERIES
  		ppc_md.pcibios_fixup = pSeries_pcibios_fixup;
+ 		ppc_md.pcibios_fixup_bus = pSeries_pcibios_fixup_bus;
  	#else 
  		ppc_md.pcibios_fixup = NULL;
  		// ppc_md.pcibios_fixup = iSeries_pcibios_fixup;
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/eeh.c linux-2.5.64-bk11/arch/ppc64/kernel/eeh.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/eeh.c	Tue Mar  4 19:29:30 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/eeh.c	Mon Mar 31 12:34:55 2003
@@ -26,6 +26,7 @@
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <linux/bootmem.h>
+#include <linux/mm.h>
 #include <asm/paca.h>
 #include <asm/processor.h>
 #include <asm/naca.h>
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/entry.S linux-2.5.64-bk11/arch/ppc64/kernel/entry.S
--- linux-2.5.64-bk10/arch/ppc64/kernel/entry.S	Tue Mar  4 19:28:53 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/entry.S	Mon Mar 31 12:34:55 2003
@@ -344,8 +344,8 @@
 recheck:
 	mfmsr	r10		/* Get current interrupt state */
 	li	r4,0
-	ori	r4,r4,MSR_EE|MSR_RI
-	andc	r10,r10,r4	/* clear MSR_EE and MSR_RI */
+	ori	r4,r4,MSR_EE
+	andc	r10,r10,r4	/* clear MSR_EE */
 	mtmsrd	r10,1		/* Update machine state */
 
 #ifdef CONFIG_PPC_ISERIES
@@ -396,7 +396,7 @@
 	mfmsr	r0
 	li	r2, MSR_RI
 	andc	r0,r0,r2
-	mtmsrd	r0
+	mtmsrd	r0,1
 
 	ld	r0,_MSR(r1)
 	mtspr	SRR1,r0
@@ -422,7 +422,7 @@
 /* Note: this must change if we start using the  TIF_NOTIFY_RESUME bit */
 do_work:
 	/* Enable interrupts */
-	ori	r10,r10,MSR_EE|MSR_RI
+	ori	r10,r10,MSR_EE
 	mtmsrd	r10,1
 
 	andi.	r0,r3,_TIF_NEED_RESCHED
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/head.S linux-2.5.64-bk11/arch/ppc64/kernel/head.S
--- linux-2.5.64-bk10/arch/ppc64/kernel/head.S	Tue Mar  4 19:29:19 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/head.S	Mon Mar 31 12:34:55 2003
@@ -562,7 +562,7 @@
 	mfmsr	r20
 	li	r21, MSR_RI
 	andc	r20,r20,r21
-	mtmsrd	r20
+	mtmsrd	r20,1
 
 	mtspr   SRR1,r23
 	mtspr   SRR0,r22
@@ -989,7 +989,7 @@
 	mfmsr	r22
 	li	r23, MSR_RI
 	andc	r22,r22,r23
-	mtmsrd	r22
+	mtmsrd	r22,1
 
 	ld	r22,EX_SRR0(r21)	/* Get SRR0 from exc. frame */
 	ld	r23,EX_SRR1(r21)	/* Get SRR1 from exc. frame */
@@ -1094,7 +1094,7 @@
 	mfmsr	r22
 	li	r23, MSR_RI
 	andc	r22,r22,r23
-	mtmsrd	r22
+	mtmsrd	r22,1
 
 	ld	r22,EX_SRR0(r21)	/* Get SRR0 from exc. frame */
 	ld	r23,EX_SRR1(r21)	/* Get SRR1 from exc. frame */
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/htab.c linux-2.5.64-bk11/arch/ppc64/kernel/htab.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/htab.c	Tue Mar  4 19:29:23 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/htab.c	Mon Mar 31 12:34:55 2003
@@ -18,7 +18,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/irq.c linux-2.5.64-bk11/arch/ppc64/kernel/irq.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/irq.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/irq.c	Mon Mar 31 12:34:55 2003
@@ -398,81 +398,6 @@
 	local_irq_disable();
 }
 
-#ifdef CONFIG_SMP
-extern unsigned long irq_affinity [NR_IRQS];
-
-typedef struct {
-	unsigned long cpu;
-	unsigned long timestamp;
-} ____cacheline_aligned irq_balance_t;
-
-static irq_balance_t irq_balance[NR_IRQS] __cacheline_aligned
-			= { [ 0 ... NR_IRQS-1 ] = { 0, 0 } };
-
-#define IDLE_ENOUGH(cpu,now) \
-		(idle_cpu(cpu) && ((now) - irq_stat[(cpu)].idle_timestamp > 1))
-
-#define IRQ_ALLOWED(cpu,allowed_mask) \
-		((1UL << cpu) & (allowed_mask))
-
-#define IRQ_BALANCE_INTERVAL (HZ/50)
-
-static unsigned long move(unsigned long curr_cpu, unsigned long allowed_mask,
-			  unsigned long now, int direction)
-{
-	int search_idle = 1;
-	int cpu = curr_cpu;
-
-	goto inside;
-
-	do {
-		if (unlikely(cpu == curr_cpu))
-			search_idle = 0;
-inside:
-		if (direction == 1) {
-			cpu++;
-			if (cpu >= NR_CPUS)
-				cpu = 0;
-		} else {
-			cpu--;
-			if (cpu == -1)
-				cpu = NR_CPUS-1;
-		}
-	} while (!cpu_online(cpu) || !IRQ_ALLOWED(cpu,allowed_mask) ||
-			(search_idle && !IDLE_ENOUGH(cpu,now)));
-
-	return cpu;
-}
-
-static inline void balance_irq(int irq)
-{
-	irq_balance_t *entry = irq_balance + irq;
-	unsigned long now = jiffies;
-
-	if (unlikely(time_after(now, entry->timestamp + IRQ_BALANCE_INTERVAL))) {
-		unsigned long allowed_mask;
-		unsigned int new_cpu;
-		unsigned long random_number;
-
-		if (!irq_desc[irq].handler->set_affinity)
-			return;
-
-		random_number = mftb();
-		random_number &= 1;
-
-		allowed_mask = cpu_online_map & irq_affinity[irq];
-		entry->timestamp = now;
-		new_cpu = move(entry->cpu, allowed_mask, now, random_number);
-		if (entry->cpu != new_cpu) {
-			entry->cpu = new_cpu;
-			irq_desc[irq].handler->set_affinity(irq, 1UL << new_cpu);
-		}
-	}
-}
-#else
-#define balance_irq(irq) do { } while (0)
-#endif
-
 /*
  * Eventually, this should take an array of interrupts and an array size
  * so it can dispatch multiple interrupts.
@@ -484,10 +409,6 @@
 	int cpu = smp_processor_id();
 	irq_desc_t *desc = irq_desc + irq;
 
-	/* XXX This causes bad performance and lockups on XICS - Anton */
-	if (naca->interrupt_controller == IC_OPEN_PIC)
-		balance_irq(irq);
-
 	kstat_cpu(cpu).irqs[irq]++;
 	spin_lock(&desc->lock);
 	ack_irq(irq);	
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/misc.S linux-2.5.64-bk11/arch/ppc64/kernel/misc.S
--- linux-2.5.64-bk10/arch/ppc64/kernel/misc.S	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/misc.S	Mon Mar 31 12:34:55 2003
@@ -557,7 +557,7 @@
 	.llong .sys32_umount
 	.llong .sys_ni_syscall		/* old lock syscall */
 	.llong .sys32_ioctl
-	.llong .sys32_fcntl		/* 55 */
+	.llong .compat_sys_fcntl	/* 55 */
 	.llong .sys_ni_syscall		/* old mpx syscall */
 	.llong .sys32_setpgid
 	.llong .sys_ni_syscall		/* old ulimit syscall */
@@ -706,7 +706,7 @@
 	.llong .sys_ni_syscall		/* reserved for MacOnLinux */
 	.llong .sys_getdents64
 	.llong .sys_pivot_root
-	.llong .sys32_fcntl64
+	.llong .compat_sys_fcntl64
 	.llong .sys_madvise		/* 205 */
 	.llong .sys_mincore
 	.llong .sys_gettid
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/pSeries_pci.c linux-2.5.64-bk11/arch/ppc64/kernel/pSeries_pci.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/pSeries_pci.c	Tue Mar  4 19:29:57 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/pSeries_pci.c	Mon Mar 31 12:34:55 2003
@@ -43,12 +43,6 @@
 #include "open_pic.h"
 #include "pci.h"
 
-/*******************************************************************
- * Forward declares of prototypes. 
- *******************************************************************/
-struct pci_controller *alloc_phb(struct device_node *dev, char *model,
-				 unsigned int addr_size_words) ;
-
 /* RTAS tokens */
 static int read_pci_config;
 static int write_pci_config;
@@ -144,242 +138,173 @@
  * openfirmware and sets it in the pci_dev and pci_config line.
  *
  ******************************************************************/
-int 
-pci_read_irq_line(struct pci_dev *Pci_Dev)
+int pci_read_irq_line(struct pci_dev *pci_dev)
 {
-	u8 InterruptPin;
-	struct device_node *Node;
+	u8 intpin;
+	struct device_node *node;
+
+    	pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intpin);
 
-    	pci_read_config_byte(Pci_Dev, PCI_INTERRUPT_PIN, &InterruptPin);
-	if (InterruptPin == 0) {
-		PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s No Interrupt used by device.\n",Pci_Dev->slot_name);
+	if (intpin == 0) {
+		PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s No Interrupt used by device.\n", pci_dev->slot_name);
 		return 0;	
 	}
-	Node = pci_device_to_OF_node(Pci_Dev);
-	if ( Node == NULL) { 
-		PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s Device Node not found.\n",Pci_Dev->slot_name);
+
+	node = pci_device_to_OF_node(pci_dev);
+	if (node == NULL) { 
+		PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s Device Node not found.\n",
+		       pci_dev->slot_name);
 		return -1;	
 	}
-	if (Node->n_intrs == 0) 	{
-		PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s No Device OF interrupts defined.\n",Pci_Dev->slot_name);
+	if (node->n_intrs == 0) 	{
+		PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s No Device OF interrupts defined.\n", pci_dev->slot_name);
 		return -1;	
 	}
-	Pci_Dev->irq = Node->intrs[0].line;
+	pci_dev->irq = node->intrs[0].line;
 
 	if (s7a_workaround) {
-		if (Pci_Dev->irq > 16)
-			Pci_Dev->irq -= 3;
+		if (pci_dev->irq > 16)
+			pci_dev->irq -= 3;
 	}
 
-	pci_write_config_byte(Pci_Dev, PCI_INTERRUPT_LINE, Pci_Dev->irq);
+	pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq);
 	
-	PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s pci_dev->irq = 0x%02X\n",Pci_Dev->slot_name,Pci_Dev->irq);
+	PPCDBG(PPCDBG_BUSWALK,"\tDevice: %s pci_dev->irq = 0x%02X\n",
+	       pci_dev->slot_name, pci_dev->irq);
 	return 0;
 }
 
-/******************************************************************
- * Find all PHBs in the system and initialize a set of data 
- * structures to represent them.
- ******************************************************************/
-unsigned long __init
-find_and_init_phbs(void)
-{
-        struct device_node *Pci_Node;
-        struct pci_controller *phb;
-        unsigned int root_addr_size_words = 0, this_addr_size_words = 0;
-	unsigned int this_addr_count = 0, range_stride;
-        unsigned int *ui_ptr = NULL, *ranges;
-        char *model;
-	struct pci_range64 range;
+static void __init pci_process_bridge_OF_ranges(struct pci_controller *hose,
+						struct device_node *dev,
+						int primary)
+{
+	unsigned int *ranges;
+	unsigned long size;
+	int rlen = 0;
+	int memno = 0;
 	struct resource *res;
-	unsigned int memno, rlen, i, index;
-	unsigned int *opprop;
-	int has_isa = 0;
-        PPCDBG(PPCDBG_PHBINIT, "find_and_init_phbs\n"); 
+	int np, na = prom_n_addr_cells(dev);
+	unsigned long pci_addr, cpu_phys_addr;
 
-	read_pci_config = rtas_token("read-pci-config");
-	write_pci_config = rtas_token("write-pci-config");
-	ibm_read_pci_config = rtas_token("ibm,read-pci-config");
-	ibm_write_pci_config = rtas_token("ibm,write-pci-config");
+	np = na + 5;
 
-	if (naca->interrupt_controller == IC_OPEN_PIC) {
-		opprop = (unsigned int *)get_property(find_path_device("/"),
-				"platform-open-pic", NULL);
-	}
+	/*
+	 * The ranges property is laid out as an array of elements,
+	 * each of which comprises:
+	 *   cells 0 - 2:	a PCI address
+	 *   cells 3 or 3+4:	a CPU physical address
+	 *			(size depending on dev->n_addr_cells)
+	 *   cells 4+5 or 5+6:	the size of the range
+	 */
+	rlen = 0;
+	hose->io_base_phys = 0;
+	ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
+	while ((rlen -= np * sizeof(unsigned int)) >= 0) {
+		res = NULL;
+		pci_addr = (unsigned long)ranges[1] << 32 | ranges[2];
+
+		cpu_phys_addr = ranges[3];
+		if (na == 2)
+			cpu_phys_addr = cpu_phys_addr << 32 | ranges[4];
+
+		size = (unsigned long)ranges[na+3] << 32 | ranges[na+4];
+
+		switch (ranges[0] >> 24) {
+		case 1:		/* I/O space */
+			hose->io_base_phys = cpu_phys_addr;
+			hose->io_base_virt = __ioremap(hose->io_base_phys,
+						       size, _PAGE_NO_CACHE);
+			if (primary) {
+				pci_io_base = (unsigned long)hose->io_base_virt;
+				if (find_type_devices("isa"))
+					isa_io_base = pci_io_base;
+			}
 
-	/* Get the root address word size. */
-	ui_ptr = (unsigned int *) get_property(find_path_device("/"), 
-					       "#size-cells", NULL);
-	if (ui_ptr) {
-		root_addr_size_words = *ui_ptr;
-	} else {
-		PPCDBG(PPCDBG_PHBINIT, "\tget #size-cells failed.\n"); 
-		return(-1);
+			res = &hose->io_resource;
+			res->flags = IORESOURCE_IO;
+			res->start = pci_addr;
+			res->start += (unsigned long)hose->io_base_virt -
+				pci_io_base;
+			break;
+		case 2:		/* memory space */
+			memno = 0;
+			while (memno < 3 && hose->mem_resources[memno].flags)
+				++memno;
+
+			if (memno == 0)
+				hose->pci_mem_offset = cpu_phys_addr - pci_addr;
+			if (memno < 3) {
+				res = &hose->mem_resources[memno];
+				res->flags = IORESOURCE_MEM;
+				res->start = cpu_phys_addr;
+			}
+			break;
+		}
+		if (res != NULL) {
+			res->name = dev->full_name;
+			res->end = res->start + size - 1;
+			res->parent = NULL;
+			res->sibling = NULL;
+			res->child = NULL;
+		}
+		ranges += np;
 	}
+}
 
-	if (find_type_devices("isa")) {
-		has_isa = 1;
-		PPCDBG(PPCDBG_PHBINIT, "\tFound an ISA bus.\n"); 
-	}
+static void python_countermeasures(unsigned long addr)
+{
+	void *chip_regs;
+	volatile u32 *tmp, i;
 
-	index = 0;
+	/* Python's register file is 1 MB in size. */
+	chip_regs = ioremap(addr & ~(0xfffffUL), 0x100000); 
 
-	/******************************************************************
-	* Find all PHB devices and create an object for them.
-	******************************************************************/
-	for (Pci_Node = find_devices("pci"); Pci_Node != NULL; Pci_Node = Pci_Node->next) {
-		model = (char *) get_property(Pci_Node, "model", NULL);
-		if (model != NULL)  {
-			phb = alloc_phb(Pci_Node, model, root_addr_size_words);
-			if (phb == NULL) return(-1);
-		}
-		else {
-         		continue;
-		}
-		
-		/* Get this node's address word size. */
-		ui_ptr = (unsigned int *) get_property(Pci_Node, "#size-cells", NULL);
-		if (ui_ptr)
-			this_addr_size_words = *ui_ptr;
-		else
-			this_addr_size_words = 1;
-		/* Get this node's address word count. */
-		ui_ptr = (unsigned int *) get_property(Pci_Node, "#address-cells", NULL);
-		if (ui_ptr)
-			this_addr_count = *ui_ptr;
-		else
-			this_addr_count = 3;
-		
-		range_stride = this_addr_count + root_addr_size_words + this_addr_size_words;
-	      
-		memno = 0;
-		phb->io_base_phys = 0;
-         
-		ranges = (unsigned int *) get_property(Pci_Node, "ranges", &rlen);
-		PPCDBG(PPCDBG_PHBINIT, "\trange_stride = 0x%lx, rlen = 0x%x\n", range_stride, rlen);
-                
-		for (i = 0; i < (rlen/sizeof(*ranges)); i+=range_stride) {
-		  	/* Put the PCI addr part of the current element into a 
-			 * '64' struct. 
-			 */
-		  	range = *((struct pci_range64 *)(ranges + i));
-
-			/* If this is a '32' element, map into a 64 struct. */
-			if ((range_stride * sizeof(int)) == 
-			   sizeof(struct pci_range32)) {
-				range.parent_addr = 
-					(unsigned long)(*(ranges + i + 3));
-				range.size = 
-					(((unsigned long)(*(ranges + i + 4)))<<32) | 
-					(*(ranges + i + 5));
-			} else {
-				range.parent_addr = 
-					(((unsigned long)(*(ranges + i + 3)))<<32) | 
-					(*(ranges + i + 4));
-				range.size = 
-					(((unsigned long)(*(ranges + i + 5)))<<32) | 
-					(*(ranges + i + 6));
-			}
-			
-			PPCDBG(PPCDBG_PHBINIT, "\trange.parent_addr    = 0x%lx\n", 
-			       range.parent_addr);
-			PPCDBG(PPCDBG_PHBINIT, "\trange.child_addr.hi  = 0x%lx\n", 
-			       range.child_addr.a_hi);
-			PPCDBG(PPCDBG_PHBINIT, "\trange.child_addr.mid = 0x%lx\n", 
-			       range.child_addr.a_mid);
-			PPCDBG(PPCDBG_PHBINIT, "\trange.child_addr.lo  = 0x%lx\n", 
-			       range.child_addr.a_lo);
-			PPCDBG(PPCDBG_PHBINIT, "\trange.size           = 0x%lx\n", 
-			       range.size);
-
-			res = NULL;
-		        switch ((range.child_addr.a_hi >> 24) & 0x3) {
-			case 1:		/* I/O space */
-				PPCDBG(PPCDBG_PHBINIT, "\tIO Space\n");
-				phb->io_base_phys = range.parent_addr;
-				res = &phb->io_resource;
-				res->name = Pci_Node->full_name;
-				res->flags = IORESOURCE_IO;
-				phb->io_base_virt = __ioremap(phb->io_base_phys, range.size, _PAGE_NO_CACHE);
-				if (!pci_io_base) {
-					pci_io_base = (unsigned long)phb->io_base_virt;
-					if (has_isa)
-						isa_io_base = pci_io_base;
-				}
-				res->start = ((((unsigned long) range.child_addr.a_mid) << 32) | (range.child_addr.a_lo));
-				res->start += (unsigned long)phb->io_base_virt - pci_io_base;
-				res->end =   res->start + range.size - 1;
-				res->parent = NULL;
-				res->sibling = NULL;
-				res->child = NULL;
-				phb->pci_io_offset = range.parent_addr - 
-					((((unsigned long)
-					   range.child_addr.a_mid) << 32) | 
-					 (range.child_addr.a_lo));
-				PPCDBG(PPCDBG_PHBINIT, "\tpci_io_offset  = 0x%lx\n", 
-				       phb->pci_io_offset);
-			  	break;
-			case 2:		/* mem space */
-				PPCDBG(PPCDBG_PHBINIT, "\tMem Space\n");
-				phb->pci_mem_offset = range.parent_addr - 
-					((((unsigned long)
-					   range.child_addr.a_mid) << 32) | 
-					 (range.child_addr.a_lo));
-				PPCDBG(PPCDBG_PHBINIT, "\tpci_mem_offset = 0x%lx\n", 
-				       phb->pci_mem_offset);
-				if (memno < sizeof(phb->mem_resources)/sizeof(phb->mem_resources[0])) {
-					res = &(phb->mem_resources[memno]);
-					++memno;
-					res->name = Pci_Node->full_name;
-					res->flags = IORESOURCE_MEM;
-					res->start = range.parent_addr;
-					res->end =   range.parent_addr + range.size - 1;
-					res->parent = NULL;
-					res->sibling = NULL;
-					res->child = NULL;
-				}
-			  	break;
-			}
-		}
-		PPCDBG(PPCDBG_PHBINIT, "\tphb->io_base_phys   = 0x%lx\n", 
-		       phb->io_base_phys); 
-		PPCDBG(PPCDBG_PHBINIT, "\tphb->pci_mem_offset = 0x%lx\n", 
-		       phb->pci_mem_offset); 
+	/* 
+	 * Firmware doesn't always clear this bit which is critical
+	 * for good performance - Anton
+	 */
 
-		if (naca->interrupt_controller == IC_OPEN_PIC) {
-			int addr = root_addr_size_words * (index + 2) - 1;
-			openpic_setup_ISU(index, opprop[addr]); 
-		}
-		index++;
+#define PRG_CL_RESET_VALID 0x00010000
+
+	tmp = (u32 *)((unsigned long)chip_regs + 0xf6030);
+
+	if (*tmp & PRG_CL_RESET_VALID) {
+		printk(KERN_INFO "Python workaround: ");
+		*tmp &= ~PRG_CL_RESET_VALID;
+		/*
+		 * We must read it back for changes to
+		 * take effect
+		 */
+		i = *tmp;
+		printk("reg0: %x\n", i);
 	}
-	pci_devs_phb_init();
-	return 0;	 /*Success */
+
+	iounmap(chip_regs);
 }
 
-/******************************************************************
- *
- * Allocate and partially initialize a structure to represent a PHB.
- *
- ******************************************************************/
-struct pci_controller *
-alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
+struct pci_controller *alloc_phb(struct device_node *dev,
+				 unsigned int addr_size_words)
 {
 	struct pci_controller *phb;
 	unsigned int *ui_ptr = NULL, len;
 	struct reg_property64 reg_struct;
 	int *bus_range;
 	int *buid_vals;
+	char *model;
+	enum phb_types phb_type;
+
+	model = (char *)get_property(dev, "model", NULL);
+
+	if (!model) {
+		printk(KERN_ERR "alloc_phb: phb has no model property\n");
+		model = "<empty>";
+	}
 
-	PPCDBG(PPCDBG_PHBINIT, "alloc_phb: %s\n", dev->full_name); 
-	PPCDBG(PPCDBG_PHBINIT, "\tdev             = 0x%lx\n", dev); 
-	PPCDBG(PPCDBG_PHBINIT, "\tmodel           = 0x%lx\n", model); 
-	PPCDBG(PPCDBG_PHBINIT, "\taddr_size_words = 0x%lx\n", addr_size_words); 
-  
 	/* Found a PHB, now figure out where his registers are mapped. */
 	ui_ptr = (unsigned int *) get_property(dev, "reg", &len);
 	if (ui_ptr == NULL) {
 		PPCDBG(PPCDBG_PHBINIT, "\tget reg failed.\n"); 
-		return(NULL);
+		return NULL;
 	}
 
 	if (addr_size_words == 1) {
@@ -389,83 +314,30 @@
 		reg_struct = *((struct reg_property64 *)ui_ptr);
 	}
 
-	PPCDBG(PPCDBG_PHBINIT, "\treg_struct.address = 0x%lx\n", reg_struct.address);
-	PPCDBG(PPCDBG_PHBINIT, "\treg_struct.size    = 0x%lx\n", reg_struct.size); 
-
-	/***************************************************************
-	* Set chip specific data in the phb, including types & 
-	* register pointers.
-	***************************************************************/
-
-	/****************************************************************
-	* Python
-	***************************************************************/
 	if (strstr(model, "Python")) {
-		void *chip_regs;
-		volatile u32 *tmp, i;
-
-		PPCDBG(PPCDBG_PHBINIT, "\tCreate python\n");
-
-		phb = pci_alloc_pci_controller("PHB PY", phb_type_python);
-		if (phb == NULL)
-			return NULL;
-
-		/* Python's register file is 1 MB in size. */
-		chip_regs = ioremap(reg_struct.address & ~(0xfffffUL),
-				    0x100000); 
-
-		/* 
-		 * Firmware doesn't always clear this bit which is critical
-		 * for good performance - Anton
-		 */
-
-#define PRG_CL_RESET_VALID 0x00010000
-
-		tmp = (u32 *)((unsigned long)chip_regs + 0xf6030);
-
-		if (*tmp & PRG_CL_RESET_VALID) {
-			printk("Python workaround: ");
-			*tmp &= ~PRG_CL_RESET_VALID;
-			/*
-			 * We must read it back for changes to
-			 * take effect
-			 */
-			i = *tmp;
-			printk("reg0: %x\n", i);
-		}
+		phb_type = phb_type_python;
+	} else if (strstr(model, "Speedwagon")) {
+		phb_type = phb_type_speedwagon;
+	} else if (strstr(model, "Winnipeg")) {
+		phb_type = phb_type_winnipeg;
+	} else {
+		printk(KERN_ERR "alloc_phb: unknown PHB %s\n", model);
+		phb_type = phb_type_unknown;
+	}
 
-	/***************************************************************
-	* Speedwagon
-	*   include Winnipeg as well for the time being.
-	***************************************************************/
-	} else if ((strstr(model, "Speedwagon")) || 
-		   (strstr(model, "Winnipeg"))) {
-		PPCDBG(PPCDBG_PHBINIT, "\tCreate speedwagon\n");
-	        phb = pci_alloc_pci_controller("PHB SW", phb_type_speedwagon);
-		if (phb == NULL)
-			return NULL;
-
-		phb->local_number = ((reg_struct.address >> 12) & 0xf) - 0x8;
-
-	/***************************************************************
-	* Trying to build a known just gets the code in trouble.
-	***************************************************************/
-	} else { 
-		PPCDBG(PPCDBG_PHBINIT, "\tUnknown PHB Type!\n");
-		printk("PCI: Unknown Phb Type!\n");
+	phb = pci_alloc_pci_controller(phb_type);
+	if (phb == NULL)
 		return NULL;
-	}
+
+	if (phb_type == phb_type_python)
+		python_countermeasures(reg_struct.address);
 
 	bus_range = (int *) get_property(dev, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
-		PPCDBG(PPCDBG_PHBINIT, "Can't get bus-range for %s\n", dev->full_name);
 		kfree(phb);
-		return(NULL);
+		return NULL;
 	}
 
-	/***************************************************************
-	* Finished with the initialization
-	***************************************************************/
 	phb->first_busno =  bus_range[0];
 	phb->last_busno  =  bus_range[1];
 
@@ -473,7 +345,7 @@
 	phb->ops = &rtas_pci_ops;
 
 	buid_vals = (int *) get_property(dev, "ibm,fw-phb-id", &len);
-	
+
 	if (buid_vals == NULL) {
 		phb->buid = 0;
 	} else {
@@ -486,24 +358,71 @@
 			panic("pSeries_pci:  this system has large bus numbers and the kernel was not\n"
 			      "built with the patch that fixes include/linux/pci.h struct pci_bus so\n"
 			      "number, primary, secondary and subordinate are ints.\n");
-    }
-    
-	if (len < 2 * sizeof(int))
-		phb->buid = (unsigned long)buid_vals[0];  // Support for new OF that only has 1 integer for buid.
-	else
-		phb->buid = (((unsigned long)buid_vals[0]) << 32UL) |
-			(((unsigned long)buid_vals[1]) & 0xffffffff);
-  	
+		}
+
+		if (len < 2 * sizeof(int))
+			// Support for new OF that only has 1 integer for buid.
+			phb->buid = (unsigned long)buid_vals[0];
+		else
+			phb->buid = (((unsigned long)buid_vals[0]) << 32UL) |
+				(((unsigned long)buid_vals[1]) & 0xffffffff);
+
 		phb->first_busno += (phb->global_number << 8);
 		phb->last_busno += (phb->global_number << 8);
 	}
 
 	/* Dump PHB information for Debug */
-	PPCDBGCALL(PPCDBG_PHBINIT,dumpPci_Controller(phb) );
+	PPCDBGCALL(PPCDBG_PHBINIT, dumpPci_Controller(phb));
 
 	return phb;
 }
 
+unsigned long __init find_and_init_phbs(void)
+{
+	struct device_node *node;
+	struct pci_controller *phb;
+	unsigned int root_size_cells = 0;
+	unsigned int index;
+	unsigned int *opprop;
+	struct device_node *root = find_path_device("/");
+
+	read_pci_config = rtas_token("read-pci-config");
+	write_pci_config = rtas_token("write-pci-config");
+	ibm_read_pci_config = rtas_token("ibm,read-pci-config");
+	ibm_write_pci_config = rtas_token("ibm,write-pci-config");
+
+	if (naca->interrupt_controller == IC_OPEN_PIC) {
+		opprop = (unsigned int *)get_property(root,
+				"platform-open-pic", NULL);
+	}
+
+	root_size_cells = prom_n_size_cells(root);
+
+	index = 0;
+
+	for (node = root->child; node != NULL; node = node->sibling) {
+		if (node->type == NULL || strcmp(node->type, "pci") != 0)
+			continue;
+
+		phb = alloc_phb(node, root_size_cells);
+		if (!phb)
+			continue;
+
+		pci_process_bridge_OF_ranges(phb, node, index == 0);
+
+		if (naca->interrupt_controller == IC_OPEN_PIC) {
+			int addr = root_size_cells * (index + 2) - 1;
+			openpic_setup_ISU(index, opprop[addr]); 
+		}
+
+		index++;
+	}
+
+	pci_devs_phb_init();
+
+	return 0;
+}
+
 void 
 fixup_resources(struct pci_dev *dev)
 {
@@ -581,6 +500,55 @@
  	}
 }   
 
+void __init pSeries_pcibios_fixup_bus(struct pci_bus *bus)
+{
+	struct pci_controller *phb = PCI_GET_PHB_PTR(bus);
+	struct resource *res;
+	int i;
+
+	if (bus->parent == NULL) {
+		/* This is a host bridge - fill in its resources */
+		phb->bus = bus;
+		bus->resource[0] = res = &phb->io_resource;
+		if (!res->flags)
+			BUG();	/* No I/O resource for this PHB? */
+
+		for (i = 0; i < 3; ++i) {
+			res = &phb->mem_resources[i];
+			if (!res->flags) {
+				if (i == 0)
+					BUG();	/* No memory resource for this PHB? */
+			}
+			bus->resource[i+1] = res;
+		}
+	} else {
+		/* This is a subordinate bridge */
+		pci_read_bridge_bases(bus);
+
+		for (i = 0; i < 4; ++i) {
+			if ((res = bus->resource[i]) == NULL)
+				continue;
+			if (!res->flags)
+				continue;
+			if (res == pci_find_parent_resource(bus->self, res)) {
+				/* Transparent resource -- don't try to "fix" it. */
+				continue;
+			}
+			if (res->flags & IORESOURCE_IO) {
+				unsigned long offset = (unsigned long)phb->io_base_virt - pci_io_base;
+				res->start += offset;
+				res->end += offset;
+			} else if (phb->pci_mem_offset
+				   && (res->flags & IORESOURCE_MEM)) {
+				if (res->start < phb->pci_mem_offset) {
+					res->start += phb->pci_mem_offset;
+					res->end += phb->pci_mem_offset;
+				}
+			}
+		}
+	}
+}
+
 static void check_s7a(void)
 {
 	struct device_node *root;
@@ -629,17 +597,6 @@
 	return NULL;
 }
 
-/*********************************************************************** 
- * ppc64_pcibios_init
- *  
- * Chance to initialize and structures or variable before PCI Bus walk.
- *  
- ***********************************************************************/
-void 
-pSeries_pcibios_init(void)
-{
-}
-
 /*
  * This is called very early before the page table is setup.
  */
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/pci.c linux-2.5.64-bk11/arch/ppc64/kernel/pci.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/pci.c	Tue Mar  4 19:29:34 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/pci.c	Mon Mar 31 12:34:55 2003
@@ -49,7 +49,6 @@
 void fixup_resources(struct pci_dev* dev);
 
 void   iSeries_pcibios_init(void);
-void   pSeries_pcibios_init(void);
 
 struct pci_controller* hose_head;
 struct pci_controller** hose_tail = &hose_head;
@@ -363,16 +362,33 @@
  * Allocate pci_controller(phb) initialized common variables. 
  */
 struct pci_controller * __init
-pci_alloc_pci_controller(char *model, enum phb_types controller_type)
+pci_alloc_pci_controller(enum phb_types controller_type)
 {
         struct pci_controller *hose;
-        PPCDBG(PPCDBG_PHBINIT, "PCI: Allocate pci_controller for %s\n",model);
+	char *model;
+
         hose = (struct pci_controller *)alloc_bootmem(sizeof(struct pci_controller));
         if(hose == NULL) {
                 printk(KERN_ERR "PCI: Allocate pci_controller failed.\n");
                 return NULL;
         }
         memset(hose, 0, sizeof(struct pci_controller));
+
+	switch(controller_type) {
+	case phb_type_python:
+		model = "PHB PY";
+		break;
+	case phb_type_speedwagon:
+		model = "PHB SW";
+		break;
+	case phb_type_winnipeg:
+		model = "PHB WP";
+		break;
+	default:
+		model = "PHB UK";
+		break;
+	}
+
         if(strlen(model) < 8)
 		strcpy(hose->what,model);
         else
@@ -393,9 +409,7 @@
 	struct pci_bus *bus;
 	int next_busno;
 
-#ifndef CONFIG_PPC_ISERIES
-	pSeries_pcibios_init();
-#else
+#ifdef CONFIG_PPC_ISERIES
 	iSeries_pcibios_init(); 
 #endif
 
@@ -450,54 +464,7 @@
 
 void __init pcibios_fixup_bus(struct pci_bus *bus)
 {
-#ifndef CONFIG_PPC_ISERIES
-	struct pci_controller *phb = PCI_GET_PHB_PTR(bus);
-	struct resource *res;
-	int i;
-
-	if (bus->parent == NULL) {
-		/* This is a host bridge - fill in its resources */
-		phb->bus = bus;
-		bus->resource[0] = res = &phb->io_resource;
-		if (!res->flags)
-			BUG();	/* No I/O resource for this PHB? */
-
-		for (i = 0; i < 3; ++i) {
-			res = &phb->mem_resources[i];
-			if (!res->flags) {
-				if (i == 0)
-					BUG();	/* No memory resource for this PHB? */
-			}
-			bus->resource[i+1] = res;
-		}
-	} else {
-		/* This is a subordinate bridge */
-		pci_read_bridge_bases(bus);
-
-		for (i = 0; i < 4; ++i) {
-			if ((res = bus->resource[i]) == NULL)
-				continue;
-			if (!res->flags)
-				continue;
-			if (res == pci_find_parent_resource(bus->self, res)) {
-				/* Transparent resource -- don't try to "fix" it. */
-				continue;
-			}
-			if (res->flags & IORESOURCE_IO) {
-				unsigned long offset = (unsigned long)phb->io_base_virt - pci_io_base;
-				res->start += offset;
-				res->end += offset;
-			} else if (phb->pci_mem_offset
-				   && (res->flags & IORESOURCE_MEM)) {
-				if (res->start < phb->pci_mem_offset) {
-					res->start += phb->pci_mem_offset;
-					res->end += phb->pci_mem_offset;
-				}
-			}
-		}
-	}
-#endif	
-	if ( ppc_md.pcibios_fixup_bus )
+	if (ppc_md.pcibios_fixup_bus)
 		ppc_md.pcibios_fixup_bus(bus);
 }
 
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/pci.h linux-2.5.64-bk11/arch/ppc64/kernel/pci.h
--- linux-2.5.64-bk10/arch/ppc64/kernel/pci.h	Tue Mar  4 19:28:53 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/pci.h	Mon Mar 31 12:34:55 2003
@@ -14,7 +14,7 @@
 
 extern unsigned long isa_io_base;
 
-extern struct pci_controller* pci_alloc_pci_controller(char *model, enum phb_types controller_type);
+extern struct pci_controller* pci_alloc_pci_controller(enum phb_types controller_type);
 extern struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node);
 
 extern struct pci_controller* hose_head;
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/pci_dma.c linux-2.5.64-bk11/arch/ppc64/kernel/pci_dma.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/pci_dma.c	Tue Mar  4 19:29:23 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/pci_dma.c	Mon Mar 31 12:34:55 2003
@@ -21,6 +21,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/slab.h>
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/prom.c linux-2.5.64-bk11/arch/ppc64/kernel/prom.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/prom.c	Tue Mar  4 19:29:31 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/prom.c	Mon Mar 31 12:34:55 2003
@@ -2040,11 +2040,11 @@
 	if ( bi_recs == NULL || bi_recs->tag != BI_FIRST )
 		return NULL;
 
-	last = (struct bi_record *)bi_recs->data[0];
+	last = (struct bi_record *)(long)bi_recs->data[0];
 	if ( last == NULL || last->tag != BI_LAST )
 		return NULL;
 
-	first = (struct bi_record *)last->data[0];
+	first = (struct bi_record *)(long)last->data[0];
 	if ( first == NULL || first != bi_recs )
 		return NULL;
 
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/rtc.c linux-2.5.64-bk11/arch/ppc64/kernel/rtc.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/rtc.c	Tue Mar  4 19:29:22 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/rtc.c	Mon Mar 31 12:34:55 2003
@@ -21,6 +21,7 @@
 
 #define RTC_VERSION		"1.1"
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/sys32.S linux-2.5.64-bk11/arch/ppc64/kernel/sys32.S
--- linux-2.5.64-bk10/arch/ppc64/kernel/sys32.S	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/sys32.S	Mon Mar 31 12:34:55 2003
@@ -25,287 +25,3 @@
 	extsw		r4,r4		/* sign extend off_t offset parm */
 	b		.sys_lseek
 
-_GLOBAL(compat_sys_socketcall)	/* r3=call, r4=args */
-	cmpwi		r3, 1
-	blt-		.do_einval
-	cmpwi		r3, 17
-	bgt-		.do_einval
-	subi		r3, r3, 1	/* index into socketcall_table vectors and jmp */
-	sldi		r3, r3, 3	/* each entry is 8 bytes */
-	LOADADDR(r10,.socketcall_table_begin)
-	ldx		r10, r10, r3
-	mtctr		r10
-	bctr
-
-/* Socket function vectored fix ups for 32 bit */
-_STATIC(do_sys_socket) /* sys_socket(int, int, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwa		r4,4(r10)
-3:	lwa		r5,8(r10)
-	b		.sys_socket
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_bind) /* sys_bind(int fd, struct sockaddr *, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwa		r5,8(r10)
-	b		.sys_bind
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_connect) /* sys_connect(int, struct sockaddr *, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwa		r5,8(r10)
-	b		.sys_connect
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_listen) /* sys_listen(int, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwa		r4,4(r10)
-	b		.sys_listen
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.previous
-
-_STATIC(do_sys_accept) /* sys_accept(int, struct sockaddr *, int *) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-	b		.sys_accept
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_getsockname) /* sys_getsockname(int, struct sockaddr *, int *) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-	b		.sys_getsockname
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_getpeername) /* sys_getpeername(int, struct sockaddr *, int *) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-	b		.sys_getpeername
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_socketpair) /* sys_socketpair(int, int, int, int *) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwa		r4,4(r10)
-3:	lwa		r5,8(r10)
-4:	lwz		r6,12(r10)
-	b		.sys_socketpair
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.previous
-
-_STATIC(do_sys_send) /* sys_send(int, void *, size_t, unsigned int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-4:	lwz		r6,12(r10)
-	b		.sys_send
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.previous
-
-_STATIC(do_sys_recv) /* sys_recv(int, void *, size_t, unsigned int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-4:	lwz		r6,12(r10)
-	b		.sys_recv
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.previous
-
-_STATIC(do_sys_sendto) /* sys32_sendto(int, u32, compat_size_t, unsigned int, u32, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-4:	lwz		r6,12(r10)
-5:	lwz		r7,16(r10)
-6:	lwz		r8,20(r10)
-	b		.sys_sendto
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.llong		5b,.do_efault
-	.llong		6b,.do_efault
-	.previous
-
-_STATIC(do_sys_recvfrom) /* sys32_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwz		r5,8(r10)
-4:	lwz		r6,12(r10)
-5:	lwz		r7,16(r10)
-6:	lwz		r8,20(r10)
-	b		.sys_recvfrom
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.llong		5b,.do_efault
-	.llong		6b,.do_efault
-	.previous
-
-_STATIC(do_sys_shutdown) /* sys_shutdown(int, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwa		r4,4(r10)
-	b		.sys_shutdown
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.previous
-
-_STATIC(do_sys_setsockopt) /* compat_sys_setsockopt(int, int, int, char *, int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwa		r4,4(r10)
-3:	lwa		r5,8(r10)
-4:	lwz		r6,12(r10)
-5:	lwa		r7,16(r10)
-	b		.compat_sys_setsockopt
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.llong		5b,.do_efault
-	.previous
-
-_STATIC(do_sys_getsockopt) /* compat_sys_getsockopt(int, int, int, u32, u32) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwa		r4,4(r10)
-3:	lwa		r5,8(r10)
-4:	lwz		r6,12(r10)
-5:	lwz		r7,16(r10)
-	b		.compat_sys_getsockopt
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.llong		4b,.do_efault
-	.llong		5b,.do_efault
-	.previous
-
-_STATIC(do_sys_sendmsg) /* compat_sys_sendmsg(int, struct compat_msghdr *, unsigned int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwa		r5,8(r10)
-	b		.compat_sys_sendmsg
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_sys_recvmsg) /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int) */
-	mr		r10,r4
-1:	lwa		r3,0(r10)
-2:	lwz		r4,4(r10)
-3:	lwa		r5,8(r10)
-	b		.compat_sys_recvmsg
-	.section	__ex_table,"a"
-	.align		3
-	.llong		1b,.do_efault
-	.llong		2b,.do_efault
-	.llong		3b,.do_efault
-	.previous
-
-_STATIC(do_einval)
-	li	r3,-EINVAL
-	blr
-
-_STATIC(do_efault)
-	li	r3,-EFAULT
-	blr
-
-	.balign	8
-_GLOBAL(socketcall_table_begin)
-	.llong		.do_sys_socket
-	.llong		.do_sys_bind
-	.llong		.do_sys_connect
-	.llong		.do_sys_listen
-	.llong		.do_sys_accept
-	.llong		.do_sys_getsockname
-	.llong		.do_sys_getpeername
-	.llong		.do_sys_socketpair
-	.llong		.do_sys_send
-	.llong		.do_sys_recv
-	.llong		.do_sys_sendto
-	.llong		.do_sys_recvfrom
-	.llong		.do_sys_shutdown
-	.llong		.do_sys_setsockopt
-	.llong		.do_sys_getsockopt
-	.llong		.do_sys_sendmsg
-	.llong		.do_sys_recvmsg
-_GLOBAL(socketcall_table_end)
diff -urN linux-2.5.64-bk10/arch/ppc64/kernel/sys_ppc32.c linux-2.5.64-bk11/arch/ppc64/kernel/sys_ppc32.c
--- linux-2.5.64-bk10/arch/ppc64/kernel/sys_ppc32.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/arch/ppc64/kernel/sys_ppc32.c	Mon Mar 31 12:34:55 2003
@@ -15,7 +15,6 @@
  */
 
 #include <asm/ptrace.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fs.h> 
@@ -246,32 +245,6 @@
 	return ret;
 }
 
-extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
-asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	switch (cmd) {
-	case F_GETLK:
-	case F_SETLK:
-	case F_SETLKW:
-	{
-		struct flock f;
-		mm_segment_t old_fs;
-		long ret;
-
-		if(get_compat_flock(&f, (struct compat_flock *)arg))
-			return -EFAULT;
-		old_fs = get_fs(); set_fs (KERNEL_DS);
-		ret = sys_fcntl(fd, cmd, (unsigned long)&f);
-		set_fs (old_fs);
-		if(put_compat_flock(&f, (struct compat_flock *)arg))
-			return -EFAULT;
-		return ret;
-	}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
 struct ncp_mount_data32_v3 {
         int version;
         unsigned int ncp_fd;
@@ -2848,13 +2821,6 @@
 	return sys_umount(name, (int)flags);
 }
 
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
-		return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 struct __sysctl_args32 {
 	u32 name;
 	int nlen;
diff -urN linux-2.5.64-bk10/arch/ppc64/mm/extable.c linux-2.5.64-bk11/arch/ppc64/mm/extable.c
--- linux-2.5.64-bk10/arch/ppc64/mm/extable.c	Tue Mar  4 19:29:15 2003
+++ linux-2.5.64-bk11/arch/ppc64/mm/extable.c	Mon Mar 31 12:34:55 2003
@@ -9,7 +9,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
diff -urN linux-2.5.64-bk10/arch/ppc64/xmon/xmon.c linux-2.5.64-bk11/arch/ppc64/xmon/xmon.c
--- linux-2.5.64-bk10/arch/ppc64/xmon/xmon.c	Tue Mar  4 19:29:34 2003
+++ linux-2.5.64-bk11/arch/ppc64/xmon/xmon.c	Mon Mar 31 12:34:55 2003
@@ -1381,16 +1381,23 @@
 	char *p, *q;
 
 	n = 0;
-	if( setjmp(bus_error_jmp) == 0 ){
+	if (setjmp(bus_error_jmp) == 0) {
 		debugger_fault_handler = handle_fault;
 		sync();
-		p = (char *) adrs;
-		q = (char *) buf;
+		p = (char *)adrs;
+		q = (char *)buf;
 		switch (size) {
-		case 2: *(short *)q = *(short *)p;	break;
-		case 4: *(int *)q = *(int *)p;		break;
+		case 2:
+			*(short *)q = *(short *)p;
+			break;
+		case 4:
+			*(int *)q = *(int *)p;
+			break;
+		case 8:
+			*(long *)q = *(long *)p;
+			break;
 		default:
-			for( ; n < size; ++n ) {
+			for( ; n < size; ++n) {
 				*q++ = *p++;
 				sync();
 			}
@@ -1411,16 +1418,23 @@
 	char *p, *q;
 
 	n = 0;
-	if( setjmp(bus_error_jmp) == 0 ){
+	if (setjmp(bus_error_jmp) == 0) {
 		debugger_fault_handler = handle_fault;
 		sync();
 		p = (char *) adrs;
 		q = (char *) buf;
 		switch (size) {
-		case 2: *(short *)p = *(short *)q;	break;
-		case 4: *(int *)p = *(int *)q;		break;
+		case 2:
+			*(short *)p = *(short *)q;
+			break;
+		case 4:
+			*(int *)p = *(int *)q;
+			break;
+		case 8:
+			*(long *)p = *(long *)q;
+			break;
 		default:
-			for( ; n < size; ++n ) {
+			for ( ; n < size; ++n) {
 				*p++ = *q++;
 				sync();
 			}
diff -urN linux-2.5.64-bk10/drivers/char/tty_io.c linux-2.5.64-bk11/drivers/char/tty_io.c
--- linux-2.5.64-bk10/drivers/char/tty_io.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/drivers/char/tty_io.c	Mon Mar 31 12:34:55 2003
@@ -2235,14 +2235,19 @@
 };
 EXPORT_SYMBOL(tty_devclass);
 
+static int __init tty_devclass_init(void)
+{
+	return devclass_register(&tty_devclass);
+}
+
+postcore_initcall(tty_devclass_init);
+
 /*
  * Ok, now we can initialize the rest of the tty devices and can count
  * on memory allocations, interrupts etc..
  */
 void __init tty_init(void)
 {
-	devclass_register(&tty_devclass);
-
 	/*
 	 * dev_tty_driver and dev_console_driver are actually magic
 	 * devices which get redirected at open time.  Nevertheless,
diff -urN linux-2.5.64-bk10/drivers/serial/8250.c linux-2.5.64-bk11/drivers/serial/8250.c
--- linux-2.5.64-bk10/drivers/serial/8250.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/drivers/serial/8250.c	Mon Mar 31 12:34:56 2003
@@ -93,13 +93,15 @@
 #ifdef CONFIG_SERIAL_8250_MULTIPORT
 #define CONFIG_SERIAL_MULTIPORT 1
 #endif
+#ifdef CONFIG_SERIAL_8250_MANY_PORTS
+#define CONFIG_SERIAL_MANY_PORTS 1
+#endif
 
 /*
  * HUB6 is always on.  This will be removed once the header
  * files have been cleaned.
  */
 #define CONFIG_HUB6 1
-#define CONFIG_SERIAL_MANY_PORTS 1
 
 #include <asm/serial.h>
 
@@ -2095,6 +2097,28 @@
 	}
 }
 
+/**
+ *	serial8250_suspend_port - suspend one serial port
+ *	@line: serial line number
+ *
+ *	Suspend one serial port.
+ */
+void serial8250_suspend_port(int line, u32 level)
+{
+	uart_suspend_port(&serial8250_reg, &serial8250_ports[line].port, level);
+}
+
+/**
+ *	serial8250_resume_port - resume one serial port
+ *	@line: serial line number
+ *
+ *	Resume one serial port.
+ */
+void serial8250_resume_port(int line, u32 level)
+{
+	uart_resume_port(&serial8250_reg, &serial8250_ports[line].port, level);
+}
+
 static int __init serial8250_init(void)
 {
 	int ret, i;
@@ -2128,6 +2152,8 @@
 EXPORT_SYMBOL(register_serial);
 EXPORT_SYMBOL(unregister_serial);
 EXPORT_SYMBOL(serial8250_get_irq_map);
+EXPORT_SYMBOL(serial8250_suspend_port);
+EXPORT_SYMBOL(serial8250_resume_port);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $");
diff -urN linux-2.5.64-bk10/drivers/serial/8250.h linux-2.5.64-bk11/drivers/serial/8250.h
--- linux-2.5.64-bk10/drivers/serial/8250.h	Tue Mar  4 19:28:53 2003
+++ linux-2.5.64-bk11/drivers/serial/8250.h	Mon Mar 31 12:34:56 2003
@@ -27,6 +27,8 @@
 int serial8250_register_probe(struct serial8250_probe *probe);
 void serial8250_unregister_probe(struct serial8250_probe *probe);
 void serial8250_get_irq_map(unsigned int *map);
+void serial8250_suspend_port(int line, u32 level);
+void serial8250_resume_port(int line, u32 level);
 
 struct old_serial_port {
 	unsigned int uart;
diff -urN linux-2.5.64-bk10/drivers/serial/8250_acorn.c linux-2.5.64-bk11/drivers/serial/8250_acorn.c
--- linux-2.5.64-bk10/drivers/serial/8250_acorn.c	Tue Mar  4 19:29:33 2003
+++ linux-2.5.64-bk11/drivers/serial/8250_acorn.c	Mon Mar 31 12:34:56 2003
@@ -1,7 +1,7 @@
 /*
  *  linux/drivers/serial/acorn.c
  *
- *  Copyright (C) 1996-2002 Russell King.
+ *  Copyright (C) 1996-2003 Russell King.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -9,6 +9,8 @@
  */
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/tty.h>
+#include <linux/serial_core.h>
 #include <linux/serial.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
@@ -16,6 +18,7 @@
 #include <linux/device.h>
 #include <linux/init.h>
 
+#include <asm/io.h>
 #include <asm/ecard.h>
 #include <asm/string.h>
 
@@ -24,36 +27,41 @@
 struct serial_card_type {
 	unsigned int	num_ports;
 	unsigned int	baud_base;
-	int		type;
-	int		speed;
-	int		offset[MAX_PORTS];
+	unsigned int	type;
+	unsigned int	offset[MAX_PORTS];
 };
 
 struct serial_card_info {
 	unsigned int	num_ports;
 	int		ports[MAX_PORTS];
-	unsigned long	base[MAX_PORTS];
 };
 
-static inline int serial_register_onedev(unsigned long port, int irq, unsigned int baud_base)
+static inline int
+serial_register_onedev(unsigned long baddr, void *vaddr, int irq, unsigned int baud_base)
 {
 	struct serial_struct req;
 
 	memset(&req, 0, sizeof(req));
-	req.baud_base = baud_base;
-	req.irq = irq;
-	req.port = port;
-	req.flags = 0;
+	req.irq			= irq;
+	req.flags		= UPF_AUTOPROBE | UPF_RESOURCES |
+				  UPF_SHARE_IRQ;
+	req.baud_base		= baud_base;
+	req.io_type		= UPIO_MEM;
+	req.iomem_base		= vaddr;
+	req.iomem_reg_shift	= 2;
+	req.iomap_base		= baddr;
 
 	return register_serial(&req);
 }
 
-static int __devinit serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
+static int __devinit
+serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
 {
 	struct serial_card_info *info;
 	struct serial_card_type *type = id->data;
-	unsigned long cardaddr, address;
-	int port;
+	unsigned long bus_addr;
+	unsigned char *virt_addr;
+	unsigned int port;
 
 	info = kmalloc(sizeof(struct serial_card_info), GFP_KERNEL);
 	if (!info)
@@ -64,20 +72,19 @@
 
 	ecard_set_drvdata(ec, info);
 
-	cardaddr = ecard_address(ec, type->type, type->speed);
+	bus_addr = ec->resource[type->type].start;
+	virt_addr = ioremap(bus_addr, ec->resource[type->type].end - bus_addr + 1);
+	if (!virt_addr) {
+		kfree(info);
+		return -ENOMEM;
+	}
 
 	for (port = 0; port < info->num_ports; port ++) {
-		address = cardaddr + type->offset[port];
-
-		info->ports[port] = -1;
-		info->base[port] = address;
+		unsigned long baddr = bus_addr + type->offset[port];
+		unsigned char *vaddr = virt_addr + type->offset[port];
 
-		if (!request_region(address, 8, "acornserial"))
-			continue;
-
-		info->ports[port] = serial_register_onedev(address, ec->irq, type->baud_base);
-		if (info->ports[port] < 0)
-			break;
+		info->ports[port] = serial_register_onedev(baddr, vaddr,
+						ec->irq, type->baud_base);
 	}
 
 	return 0;
@@ -90,12 +97,9 @@
 
 	ecard_set_drvdata(ec, NULL);
 
-	for (i = 0; i < info->num_ports; i++) {
-		if (info->ports[i] > 0) {
+	for (i = 0; i < info->num_ports; i++)
+		if (info->ports[i] > 0)
 			unregister_serial(info->ports[i]);
-			release_region(info->base[i], 8);
-		}
-	}
 
 	kfree(info);
 }
@@ -103,17 +107,15 @@
 static struct serial_card_type atomwide_type = {
 	.num_ports	= 3,
 	.baud_base	= 7372800 / 16,
-	.type		= ECARD_IOC,
-	.speed		= ECARD_SLOW,
-	.offset		= { 0xa00, 0x900, 0x800 },
+	.type		= ECARD_RES_IOCSLOW,
+	.offset		= { 0x2800, 0x2400, 0x2000 },
 };
 
 static struct serial_card_type serport_type = {
 	.num_ports	= 2,
 	.baud_base	= 3686400 / 16,
-	.type		= ECARD_IOC,
-	.speed		= ECARD_SLOW,
-	.offset		= { 0x800, 0x808 },
+	.type		= ECARD_RES_IOCSLOW,
+	.offset		= { 0x2000, 0x2020 },
 };
 
 static const struct ecard_id serial_cids[] = {
@@ -127,7 +129,8 @@
 	.remove 	= __devexit_p(serial_card_remove),
 	.id_table	= serial_cids,
 	.drv = {
-		.name	= "acornserial",
+		.devclass	= &tty_devclass,
+		.name		= "8250_acorn",
 	},
 };
 
@@ -142,6 +145,7 @@
 }
 
 MODULE_AUTHOR("Russell King");
+MODULE_DESCRIPTION("Acorn 8250-compatible serial port expansion card driver");
 MODULE_LICENSE("GPL");
 
 module_init(serial_card_init);
diff -urN linux-2.5.64-bk10/drivers/serial/8250_pci.c linux-2.5.64-bk11/drivers/serial/8250_pci.c
--- linux-2.5.64-bk10/drivers/serial/8250_pci.c	Tue Mar  4 19:29:32 2003
+++ linux-2.5.64-bk11/drivers/serial/8250_pci.c	Mon Mar 31 12:34:56 2003
@@ -20,8 +20,9 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/tty.h>
 #include <linux/serial.h>
-#include <linux/serialP.h>
+#include <linux/serial_core.h>
 
 #include <asm/bitops.h>
 #include <asm/byteorder.h>
@@ -30,174 +31,213 @@
 
 #include "8250.h"
 
+/*
+ * Definitions for PCI support.
+ */
+#define FL_BASE_MASK		0x0007
+#define FL_BASE0		0x0000
+#define FL_BASE1		0x0001
+#define FL_BASE2		0x0002
+#define FL_BASE3		0x0003
+#define FL_BASE4		0x0004
+#define FL_GET_BASE(x)		(x & FL_BASE_MASK)
+
+#define FL_IRQ_MASK		(0x0007 << 4)
+#define FL_IRQBASE0		(0x0000 << 4)
+#define FL_IRQBASE1		(0x0001 << 4)
+#define FL_IRQBASE2		(0x0002 << 4)
+#define FL_IRQBASE3		(0x0003 << 4)
+#define FL_IRQBASE4		(0x0004 << 4)
+#define FL_GET_IRQBASE(x)	((x & FL_IRQ_MASK) >> 4)
+
+/* Use successive BARs (PCI base address registers),
+   else use offset into some specified BAR */
+#define FL_BASE_BARS		0x0008
 
-#ifndef IS_PCI_REGION_IOPORT
-#define IS_PCI_REGION_IOPORT(dev, r) (pci_resource_flags((dev), (r)) & \
-				      IORESOURCE_IO)
-#endif
-#ifndef IS_PCI_REGION_IOMEM
-#define IS_PCI_REGION_IOMEM(dev, r) (pci_resource_flags((dev), (r)) & \
-				      IORESOURCE_MEM)
-#endif
-#ifndef PCI_IRQ_RESOURCE
-#define PCI_IRQ_RESOURCE(dev, r) ((dev)->irq_resource[r].start)
-#endif
+/* Use the irq resource table instead of dev->irq */
+#define FL_IRQRESOURCE		0x0080
 
-#ifndef pci_get_subvendor
-#define pci_get_subvendor(dev) ((dev)->subsystem_vendor)
-#define pci_get_subdevice(dev)  ((dev)->subsystem_device)
-#endif
+/* Use the Base address register size to cap number of ports */
+#define FL_REGION_SZ_CAP	0x0100
 
-struct serial_private {
-	unsigned int nr;
-	struct pci_board *board;
-	int line[0];
+struct pci_board {
+	unsigned int flags;
+	unsigned int num_ports;
+	unsigned int base_baud;
+	unsigned int uart_offset;
+	unsigned int reg_shift;
+	unsigned int first_offset;
 };
 
 /*
- * init_fn returns:
+ * init function returns:
  *  > 0 - number of ports
  *  = 0 - use board->num_ports
  *  < 0 - error
  */
-struct pci_board {
-	int flags;
-	int num_ports;
-	int base_baud;
-	int uart_offset;
-	int reg_shift;
-	int (*init_fn)(struct pci_dev *dev, int enable);
-	int first_uart_offset;
+struct pci_serial_quirk {
+	u32	vendor;
+	u32	device;
+	u32	subvendor;
+	u32	subdevice;
+	int	(*init)(struct pci_dev *dev);
+	int	(*setup)(struct pci_dev *dev, struct pci_board *board,
+			 struct serial_struct *req, int idx);
+	void	(*exit)(struct pci_dev *dev);
+};
+
+#define PCI_NUM_BAR_RESOURCES	6
+
+struct serial_private {
+	unsigned int		nr;
+	void			*remapped_bar[PCI_NUM_BAR_RESOURCES];
+	struct pci_serial_quirk	*quirk;
+	int			line[0];
 };
 
+static void moan_device(const char *str, struct pci_dev *dev)
+{
+	printk(KERN_WARNING "%s: %s\n"
+	       KERN_WARNING "Please send the output of lspci -vv, this\n"
+	       KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
+	       KERN_WARNING "manufacturer and name of serial board or\n"
+	       KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n",
+	       dev->slot_name, str, dev->vendor, dev->device,
+	       dev->subsystem_vendor, dev->subsystem_device);
+}
+
 static int
-get_pci_port(struct pci_dev *dev, struct pci_board *board,
-	     struct serial_struct *req, int idx)
+setup_port(struct pci_dev *dev, struct serial_struct *req,
+	   int bar, int offset, int regshift)
 {
-	unsigned long port;
-	int base_idx;
-	int max_port;
-	int offset;
+	struct serial_private *priv = pci_get_drvdata(dev);
+	unsigned long port, len;
+
+	if (bar >= PCI_NUM_BAR_RESOURCES)
+		return -EINVAL;
 
-	base_idx = SPCI_FL_GET_BASE(board->flags);
-	if (board->flags & SPCI_FL_BASE_TABLE)
-		base_idx += idx;
-
-	if (board->flags & SPCI_FL_REGION_SZ_CAP) {
-		max_port = pci_resource_len(dev, base_idx) / 8;
-		if (idx >= max_port)
-			return 1;
+	if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
+		port = pci_resource_start(dev, bar);
+		len =  pci_resource_len(dev, bar);
+
+		if (!priv->remapped_bar[bar])
+			priv->remapped_bar[bar] = ioremap(port, len);
+		if (!priv->remapped_bar[bar])
+			return -ENOMEM;
+
+		req->io_type = UPIO_MEM;
+		req->iomap_base = port;
+		req->iomem_base = priv->remapped_bar[bar] + offset;
+		req->iomem_reg_shift = regshift;
+	} else {
+		port = pci_resource_start(dev, bar) + offset;
+		req->io_type = UPIO_PORT;
+		req->port = port;
+		if (HIGH_BITS_OFFSET)
+			req->port_high = port >> HIGH_BITS_OFFSET;
 	}
-			
-	offset = board->first_uart_offset;
+	return 0;
+}
 
-	/*
-	 * Timedia/SUNIX uses a mixture of BARs and offsets
-	 * Ugh, this is ugly as all hell --- TYT
-	 */
-	if (dev->vendor == PCI_VENDOR_ID_TIMEDIA)
-		switch(idx) {
-		case 0:
-			base_idx = 0;
-			break;
-		case 1:
-			base_idx = 0;
-			offset = 8;
-			break;
-		case 2:
-			base_idx = 1; 
-			break;
-		case 3:
-			base_idx = 1;
-			offset = 8;
-			break;
-		case 4: /* BAR 2 */
-		case 5: /* BAR 3 */
-		case 6: /* BAR 4 */
-		case 7: /* BAR 5 */
-			base_idx = idx - 2;
-		}
+/*
+ * AFAVLAB uses a different mixture of BARs and offsets
+ * Not that ugly ;) -- HW
+ */
+static int
+afavlab_setup(struct pci_dev *dev, struct pci_board *board,
+	      struct serial_struct *req, int idx)
+{
+	unsigned int bar, offset = board->first_offset;
+	
+	bar = FL_GET_BASE(board->flags);
+	if (idx < 4)
+		bar += idx;
+	else
+		offset += (idx - 4) * board->uart_offset;
 
-	/* AFAVLAB uses a different mixture of BARs and offsets */
-	/* Not that ugly ;) -- HW */
-	if (dev->vendor == PCI_VENDOR_ID_AFAVLAB && idx >= 4) {
-		base_idx = 4;
-		offset = (idx - 4) * 8;
-	}
+	return setup_port(dev, req, bar, offset, board->reg_shift);
+}
 
-	/* Some Titan cards are also a little weird */
-	if (dev->vendor == PCI_VENDOR_ID_TITAN &&
-	    (dev->device == PCI_DEVICE_ID_TITAN_400L ||
-	     dev->device == PCI_DEVICE_ID_TITAN_800L)) {
-		switch (idx) {
-		case 0: base_idx = 1;
-			break;
-		case 1: base_idx = 2;
-			break;
-		default:
-			base_idx = 4;
-			offset = 8 * (idx - 2);
-		}
-	}
+/*
+ * HP's Remote Management Console.  The Diva chip came in several
+ * different versions.  N-class, L2000 and A500 have two Diva chips, each
+ * with 3 UARTs (the third UART on the second chip is unused).  Superdome
+ * and Keystone have one Diva chip with 3 UARTs.  Some later machines have
+ * one Diva chip, but it has been expanded to 5 UARTs.
+ */
+static int __devinit pci_hp_diva_init(struct pci_dev *dev)
+{
+	int rc = 0;
 
-	/* HP's Diva chip puts the 4th/5th serial port further out, and
-	 * some serial ports are supposed to be hidden on certain models.
-	 */
-	if (dev->vendor == PCI_VENDOR_ID_HP &&
-	    dev->device == PCI_DEVICE_ID_HP_DIVA) {
-		switch (dev->subsystem_device) {
-		case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
-			if (idx == 3)
-				idx++;
-			break;
-		case PCI_DEVICE_ID_HP_DIVA_EVEREST:
-			if (idx > 0)
-				idx++;
-			if (idx > 2)
-				idx++;
-			break;
-		}
-		if (idx > 2) {
-			offset = 0x18;
-		}
+	switch (dev->subsystem_device) {
+	case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
+	case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
+	case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
+	case PCI_DEVICE_ID_HP_DIVA_EVEREST:
+		rc = 3;
+		break;
+	case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
+		rc = 2;
+		break;
+	case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
+		rc = 4;
+		break;
+	case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
+		rc = 1;
+		break;
 	}
 
-	port =  pci_resource_start(dev, base_idx) + offset;
+	return rc;
+}
 
-	if ((board->flags & SPCI_FL_BASE_TABLE) == 0)
-		port += idx * (board->uart_offset ? board->uart_offset : 8);
+/*
+ * HP's Diva chip puts the 4th/5th serial port further out, and
+ * some serial ports are supposed to be hidden on certain models.
+ */
+static int
+pci_hp_diva_setup(struct pci_dev *dev, struct pci_board *board,
+	      struct serial_struct *req, int idx)
+{
+	unsigned int offset = board->first_offset;
+	unsigned int bar = FL_GET_BASE(board->flags);
 
-	if (IS_PCI_REGION_IOPORT(dev, base_idx)) {
-		req->port = port;
-		if (HIGH_BITS_OFFSET)
-			req->port_high = port >> HIGH_BITS_OFFSET;
-		else
-			req->port_high = 0;
-		return 0;
+	switch (dev->subsystem_device) {
+	case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
+		if (idx == 3)
+			idx++;
+		break;
+	case PCI_DEVICE_ID_HP_DIVA_EVEREST:
+		if (idx > 0)
+			idx++;
+		if (idx > 2)
+			idx++;
+		break;
 	}
-	req->io_type = SERIAL_IO_MEM;
-	req->iomap_base = port;
-	req->iomem_base = ioremap(port, board->uart_offset);
-	if (req->iomem_base == NULL)
-		return -ENOMEM;
-	req->iomem_reg_shift = board->reg_shift;
-	req->port = 0;
-	return 0;
+	if (idx > 2)
+		offset = 0x18;
+
+	offset += idx * board->uart_offset;
+
+	return setup_port(dev, req, bar, offset, board->reg_shift);
 }
 
-static _INLINE_ int
-get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx)
+/*
+ * Added for EKF Intel i960 serial boards
+ */
+static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
 {
-	int base_idx;
+	unsigned long oldval;
 
-	if ((board->flags & SPCI_FL_IRQRESOURCE) == 0)
-		return dev->irq;
+	if (!(dev->subsystem_device & 0x1000))
+		return -ENODEV;
 
-	base_idx = SPCI_FL_GET_IRQBASE(board->flags);
-	if (board->flags & SPCI_FL_IRQ_TABLE)
-		base_idx += idx;
-	
-	return PCI_IRQ_RESOURCE(dev, base_idx);
+	/* is firmware started? */
+	pci_read_config_dword(dev, 0x44, (void*) &oldval); 
+	if (oldval == 0x00001000L) { /* RESET value */ 
+		printk(KERN_DEBUG "Local i960 firmware missing");
+		return -ENODEV;
+	}
+	return 0;
 }
 
 /*
@@ -206,26 +246,29 @@
  * seems to be mainly needed on card using the PLX which also use I/O
  * mapped memory.
  */
-static int __devinit pci_plx9050_fn(struct pci_dev *dev, int enable)
+static int __devinit pci_plx9050_init(struct pci_dev *dev)
 {
-	u8 *p, irq_config = 0;
+	u8 *p, irq_config;
 
-	if (enable) {
-		irq_config = 0x41;
-		if (dev->vendor == PCI_VENDOR_ID_PANACOM)
-			irq_config = 0x43;
-		if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
-		    (dev->device == PCI_DEVICE_ID_PLX_ROMULUS)) {
-			/*
-			 * As the megawolf cards have the int pins active
-			 * high, and have 2 UART chips, both ints must be
-			 * enabled on the 9050. Also, the UARTS are set in
-			 * 16450 mode by default, so we have to enable the
-			 * 16C950 'enhanced' mode so that we can use the
-			 * deep FIFOs
-			 */
-			irq_config = 0x5b;
-		}
+	if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
+		moan_device("no memory in bar 0", dev);
+		return 0;
+	}
+
+	irq_config = 0x41;
+	if (dev->vendor == PCI_VENDOR_ID_PANACOM)
+		irq_config = 0x43;
+	if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
+	    (dev->device == PCI_DEVICE_ID_PLX_ROMULUS)) {
+		/*
+		 * As the megawolf cards have the int pins active
+		 * high, and have 2 UART chips, both ints must be
+		 * enabled on the 9050. Also, the UARTS are set in
+		 * 16450 mode by default, so we have to enable the
+		 * 16C950 'enhanced' mode so that we can use the
+		 * deep FIFOs
+		 */
+		irq_config = 0x5b;
 	}
 
 	/*
@@ -245,6 +288,27 @@
 	return 0;
 }
 
+static void __devexit pci_plx9050_exit(struct pci_dev *dev)
+{
+	u8 *p;
+
+	if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
+		return;
+
+	/*
+	 * disable interrupts
+	 */
+	p = ioremap(pci_resource_start(dev, 0), 0x80);
+	if (p != NULL) {
+		writel(0, p + 0x4c);
+
+		/*
+		 * Read the register back to ensure that it took effect.
+		 */
+		readl(p + 0x4c);
+		iounmap(p);
+	}
+}
 
 /*
  * SIIG serial cards have an PCI interface chip which also controls
@@ -270,23 +334,20 @@
 #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
 #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
 
-int pci_siig10x_fn(struct pci_dev *dev, int enable)
+static int pci_siig10x_init(struct pci_dev *dev)
 {
 	u16 data, *p;
 
-	if (!enable)
-		return 0;
-
 	switch (dev->device & 0xfff8) {
-		case PCI_DEVICE_ID_SIIG_1S_10x:	/* 1S */
-			data = 0xffdf;
-			break;
-		case PCI_DEVICE_ID_SIIG_2S_10x:	/* 2S, 2S1P */
-			data = 0xf7ff;
-			break;
-		default:			/* 1S1P, 4S */
-			data = 0xfffb;
-			break;
+	case PCI_DEVICE_ID_SIIG_1S_10x:	/* 1S */
+		data = 0xffdf;
+		break;
+	case PCI_DEVICE_ID_SIIG_2S_10x:	/* 2S, 2S1P */
+		data = 0xf7ff;
+		break;
+	default:			/* 1S1P, 4S */
+		data = 0xfffb;
+		break;
 	}
 
 	p = ioremap(pci_resource_start(dev, 0), 0x80);
@@ -294,22 +355,18 @@
 		return -ENOMEM;
 
 	writew(readw((unsigned long) p + 0x28) & data, (unsigned long) p + 0x28);
+	readw((unsigned long)p + 0x28);
 	iounmap(p);
 	return 0;
 }
 
-EXPORT_SYMBOL(pci_siig10x_fn);
-
 #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
 #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
 
-int pci_siig20x_fn(struct pci_dev *dev, int enable)
+static int pci_siig20x_init(struct pci_dev *dev)
 {
 	u8 data;
 
-	if (!enable)
-		return 0;
-
 	/* Change clock frequency for the first UART. */
 	pci_read_config_byte(dev, 0x6f, &data);
 	pci_write_config_byte(dev, 0x6f, data & 0xef);
@@ -323,28 +380,25 @@
 	return 0;
 }
 
-EXPORT_SYMBOL(pci_siig20x_fn);
-
-/* Added for EKF Intel i960 serial boards */
-static int __devinit pci_inteli960ni_fn(struct pci_dev *dev, int enable)
+int pci_siig10x_fn(struct pci_dev *dev, int enable)
 {
-	unsigned long oldval;
-
-	if (!(pci_get_subdevice(dev) & 0x1000))
-		return -ENODEV;
+	int ret = 0;
+	if (enable)
+		ret = pci_siig10x_init(dev);
+	return ret;
+}
 
-	if (!enable) /* is there something to deinit? */
-		return 0;
-   
-	/* is firmware started? */
-	pci_read_config_dword(dev, 0x44, (void*) &oldval); 
-	if (oldval == 0x00001000L) { /* RESET value */ 
-		printk(KERN_DEBUG "Local i960 firmware missing");
-		return -ENODEV;
-	}
-	return 0;
+int pci_siig20x_fn(struct pci_dev *dev, int enable)
+{
+	int ret = 0;
+	if (enable)
+		ret = pci_siig20x_init(dev);
+	return ret;
 }
 
+EXPORT_SYMBOL(pci_siig10x_fn);
+EXPORT_SYMBOL(pci_siig20x_fn);
+
 /*
  * Timedia has an explosion of boards, and to avoid the PCI table from
  * growing *huge*, we use this function to collapse some 70 entries
@@ -385,78 +439,453 @@
 	{ 0, 0 }
 };
 
-static int __devinit pci_timedia_fn(struct pci_dev *dev, int enable)
+static int __devinit pci_timedia_init(struct pci_dev *dev)
 {
-	int	i, j;
 	unsigned short *ids;
-
-	if (!enable)
-		return 0;
+	int i, j;
 
 	for (i = 0; timedia_data[i].num; i++) {
 		ids = timedia_data[i].ids;
 		for (j = 0; ids[j]; j++)
-			if (pci_get_subdevice(dev) == ids[j])
+			if (dev->subsystem_device == ids[j])
 				return timedia_data[i].num;
 	}
 	return 0;
 }
 
 /*
- * HP's Remote Management Console.  The Diva chip came in several
- * different versions.  N-class, L2000 and A500 have two Diva chips, each
- * with 3 UARTs (the third UART on the second chip is unused).  Superdome
- * and Keystone have one Diva chip with 3 UARTs.  Some later machines have
- * one Diva chip, but it has been expanded to 5 UARTs.
+ * Timedia/SUNIX uses a mixture of BARs and offsets
+ * Ugh, this is ugly as all hell --- TYT
  */
-static int __devinit pci_hp_diva(struct pci_dev *dev, int enable)
+static int
+pci_timedia_setup(struct pci_dev *dev, struct pci_board *board,
+		  struct serial_struct *req, int idx)
 {
-	int rc = 0;
-
-	if (!enable)
-		return 0;
+	unsigned int bar = 0, offset = board->first_offset;
 
-	switch (dev->subsystem_device) {
-	case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
-	case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
-	case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
-	case PCI_DEVICE_ID_HP_DIVA_EVEREST:
-		rc = 3;
+	switch (idx) {
+	case 0:
+		bar = 0;
 		break;
-	case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
-		rc = 2;
+	case 1:
+		offset = board->uart_offset;
+		bar = 0;
 		break;
-	case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
-		rc = 4;
-		break;
-	case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
-		rc = 1;
+	case 2:
+		bar = 1;
 		break;
+	case 3:
+		offset = board->uart_offset;
+		bar = 1;
+	case 4: /* BAR 2 */
+	case 5: /* BAR 3 */
+	case 6: /* BAR 4 */
+	case 7: /* BAR 5 */
+		bar = idx - 2;
 	}
 
-	return rc;
+	return setup_port(dev, req, bar, offset, board->reg_shift);
 }
 
+/*
+ * Some Titan cards are also a little weird
+ */
+static int
+titan_400l_800l_setup(struct pci_dev *dev, struct pci_board *board,
+		      struct serial_struct *req, int idx)
+{
+	unsigned int bar, offset = board->first_offset;
 
-static int __devinit pci_xircom_fn(struct pci_dev *dev, int enable)
+	switch (idx) {
+	case 0:
+		bar = 1;
+		break;
+	case 1:
+		bar = 2;
+		break;
+	default:
+		bar = 4;
+		offset = (idx - 2) * board->uart_offset;
+	}
+
+	return setup_port(dev, req, bar, offset, board->reg_shift);
+}
+
+static int __devinit pci_xircom_init(struct pci_dev *dev)
 {
 	__set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(HZ/10);
 	return 0;
 }
 
+static int
+pci_default_setup(struct pci_dev *dev, struct pci_board *board,
+		  struct serial_struct *req, int idx)
+{
+	unsigned int bar, offset = board->first_offset, maxnr;
+
+	bar = FL_GET_BASE(board->flags);
+	if (board->flags & FL_BASE_BARS)
+		bar += idx;
+	else
+		offset += idx * board->uart_offset;
+
+	maxnr = (pci_resource_len(dev, bar) - board->uart_offset) /
+		(8 << board->reg_shift);
+
+	if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
+		return 1;
+			
+	return setup_port(dev, req, bar, offset, board->reg_shift);
+}
+
+/*
+ * Master list of serial port init/setup/exit quirks.
+ * This does not describe the general nature of the port.
+ * (ie, baud base, number and location of ports, etc)
+ *
+ * This list is ordered alphabetically by vendor then device.
+ * Specific entries must come before more generic entries.
+ */
+static struct pci_serial_quirk pci_serial_quirks[] = {
+	/*
+	 * AFAVLAB cards.
+	 *  It is not clear whether this applies to all products.
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_AFAVLAB,
+		.device		= PCI_ANY_ID,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= afavlab_setup,
+	},
+	/*
+	 * HP Diva
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_HP,
+		.device		= PCI_DEVICE_ID_HP_DIVA,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_hp_diva_init,
+		.setup		= pci_hp_diva_setup,
+	},
+	/*
+	 * Intel
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_80960_RP,
+		.subvendor	= 0xe4bf,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_inteli960ni_init,
+		.setup		= pci_default_setup,
+	},
+	/*
+	 * Panacom
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_PANACOM,
+		.device		= PCI_DEVICE_ID_PANACOM_QUADMODEM,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_plx9050_init,
+		.setup		= pci_default_setup,
+		.exit		= __devexit_p(pci_plx9050_exit),
+	},		
+	{
+		.vendor		= PCI_VENDOR_ID_PANACOM,
+		.device		= PCI_DEVICE_ID_PANACOM_DUALMODEM,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_plx9050_init,
+		.setup		= pci_default_setup,
+		.exit		= __devexit_p(pci_plx9050_exit),
+	},
+	/*
+	 * PLX
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_PLX,
+		.device		= PCI_DEVICE_ID_PLX_9050,
+		.subvendor	= PCI_SUBVENDOR_ID_KEYSPAN,
+		.subdevice	= PCI_SUBDEVICE_ID_KEYSPAN_SX2,
+		.init		= pci_plx9050_init,
+		.setup		= pci_default_setup,
+		.exit		= __devexit_p(pci_plx9050_exit),
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_PLX,
+		.device		= PCI_DEVICE_ID_PLX_ROMULUS,
+		.subvendor	= PCI_VENDOR_ID_PLX,
+		.subdevice	= PCI_DEVICE_ID_PLX_ROMULUS,
+		.init		= pci_plx9050_init,
+		.setup		= pci_default_setup,
+		.exit		= __devexit_p(pci_plx9050_exit),
+	},
+	/*
+	 * SIIG cards.
+	 *  It is not clear whether these could be collapsed.
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_1S_10x_550,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_1S_10x_650,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_1S_10x_850,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_2S_10x_550,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_2S_10x_650,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_2S_10x_850,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_4S_10x_550,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_4S_10x_650,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_4S_10x_850,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig10x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_1S_20x_550,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_1S_20x_650,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_1S_20x_850,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_2S_20x_550,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{	.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_2S_20x_650,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_2S_20x_850,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_4S_20x_550,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_4S_20x_650,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_SIIG,
+		.device		= PCI_DEVICE_ID_SIIG_4S_20x_850,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_siig20x_init,
+		.setup		= pci_default_setup,
+	},
+	/*
+	 * Titan cards
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_TITAN,
+		.device		= PCI_DEVICE_ID_TITAN_400L,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= titan_400l_800l_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_TITAN,
+		.device		= PCI_DEVICE_ID_TITAN_800L,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= titan_400l_800l_setup,
+	},
+	/*
+	 * Timedia cards
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_TIMEDIA,
+		.device		= PCI_DEVICE_ID_TIMEDIA_1889,
+		.subvendor	= PCI_VENDOR_ID_TIMEDIA,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_timedia_init,
+		.setup		= pci_timedia_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_TIMEDIA,
+		.device		= PCI_ANY_ID,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= pci_timedia_setup,
+	},
+	/*
+	 * Xircom cards
+	 */
+	{
+		.vendor		= PCI_VENDOR_ID_XIRCOM,
+		.device		= PCI_DEVICE_ID_XIRCOM_X3201_MDM,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.init		= pci_xircom_init,
+		.setup		= pci_default_setup,
+	},
+	/*
+	 * Default "match everything" terminator entry
+	 */
+	{
+		.vendor		= PCI_ANY_ID,
+		.device		= PCI_ANY_ID,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= pci_default_setup,
+	}
+};
+
+static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
+{
+	return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
+}
+
+static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
+{
+	struct pci_serial_quirk *quirk;
+
+	for (quirk = pci_serial_quirks; ; quirk++)
+		if (quirk_id_matches(quirk->vendor, dev->vendor) &&
+		    quirk_id_matches(quirk->device, dev->device) &&
+		    quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
+		    quirk_id_matches(quirk->subdevice, dev->subsystem_device))
+		 	break;
+	return quirk;
+}
+
+static _INLINE_ int
+get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx)
+{
+	int base_idx;
+
+	if ((board->flags & FL_IRQRESOURCE) == 0)
+		return dev->irq;
+
+	base_idx = FL_GET_IRQBASE(board->flags);
+
+	if (base_idx > DEVICE_COUNT_IRQ)
+		return 0;
+	
+	return dev->irq_resource[base_idx].start;
+}
+
 /*
  * This is the configuration table for all of the PCI serial boards
  * which we support.  It is directly indexed by the pci_board_num_t enum
  * value, which is encoded in the pci_device_id PCI probe table's
  * driver_data member.
+ *
+ * The makeup of these names are:
+ *  pbn_bn{_bt}_n_baud
+ *
+ *  bn   = PCI BAR number
+ *  bt   = Index using PCI BARs
+ *  n    = number of serial ports
+ *  baud = baud rate
+ *
+ * Please note: in theory if n = 1, _bt infix should make no difference.
+ * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
  */
 enum pci_board_num_t {
-	pbn_b0_1_115200,
 	pbn_default = 0,
 
+	pbn_b0_1_115200,
 	pbn_b0_2_115200,
 	pbn_b0_4_115200,
+	pbn_b0_5_115200,
 
 	pbn_b0_1_921600,
 	pbn_b0_2_921600,
@@ -465,171 +894,465 @@
 	pbn_b0_bt_1_115200,
 	pbn_b0_bt_2_115200,
 	pbn_b0_bt_8_115200,
+
 	pbn_b0_bt_1_460800,
 	pbn_b0_bt_2_460800,
 
+	pbn_b0_bt_1_921600,
+	pbn_b0_bt_2_921600,
+	pbn_b0_bt_4_921600,
+	pbn_b0_bt_8_921600,
+
 	pbn_b1_1_115200,
 	pbn_b1_2_115200,
 	pbn_b1_4_115200,
 	pbn_b1_8_115200,
 
+	pbn_b1_1_921600,
 	pbn_b1_2_921600,
 	pbn_b1_4_921600,
 	pbn_b1_8_921600,
 
+	pbn_b1_bt_2_921600,
+
 	pbn_b1_2_1382400,
 	pbn_b1_4_1382400,
 	pbn_b1_8_1382400,
 
 	pbn_b2_1_115200,
 	pbn_b2_8_115200,
+
+	pbn_b2_1_460800,
 	pbn_b2_4_460800,
 	pbn_b2_8_460800,
 	pbn_b2_16_460800,
+
+	pbn_b2_1_921600,
 	pbn_b2_4_921600,
 	pbn_b2_8_921600,
 
 	pbn_b2_bt_1_115200,
 	pbn_b2_bt_2_115200,
 	pbn_b2_bt_4_115200,
+
 	pbn_b2_bt_2_921600,
+	pbn_b2_bt_4_921600,
+
+	pbn_b3_4_115200,
+	pbn_b3_8_115200,
 
+	/*
+	 * Board-specific versions.
+	 */
 	pbn_panacom,
 	pbn_panacom2,
 	pbn_panacom4,
 	pbn_plx_romulus,
 	pbn_oxsemi,
-	pbn_timedia,
 	pbn_intel_i960,
 	pbn_sgi_ioc3,
-	pbn_hp_diva,
 	pbn_nec_nile4,
-
-	pbn_dci_pccom4,
-	pbn_dci_pccom8,
-
-	pbn_xircom_combo,
-
-	pbn_siig10x_0,
-	pbn_siig10x_1,
-	pbn_siig10x_2,
-	pbn_siig10x_4,
-	pbn_siig20x_0,
-	pbn_siig20x_2,
-	pbn_siig20x_4,
-	
 	pbn_computone_4,
 	pbn_computone_6,
 	pbn_computone_8,
 };
 
 static struct pci_board pci_boards[] __devinitdata = {
+	[pbn_default] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_1_115200] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_2_115200] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 2,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_4_115200] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 4,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_5_115200] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 5,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b0_1_921600] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 1,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_2_921600] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_4_921600] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b0_bt_1_115200] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_bt_2_115200] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_bt_8_115200] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 8,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b0_bt_1_460800] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 460800,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_bt_2_460800] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 460800,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b0_bt_1_921600] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_bt_2_921600] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_bt_4_921600] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b0_bt_8_921600] = {
+		.flags		= FL_BASE0|FL_BASE_BARS,
+		.num_ports	= 8,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b1_1_115200] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_2_115200] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 2,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_4_115200] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 4,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_8_115200] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 8,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b1_1_921600] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 1,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_2_921600] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_4_921600] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_8_921600] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 8,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b1_bt_2_921600] = {
+		.flags		= FL_BASE1|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b1_2_1382400] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 2,
+		.base_baud	= 1382400,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_4_1382400] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 4,
+		.base_baud	= 1382400,
+		.uart_offset	= 8,
+	},
+	[pbn_b1_8_1382400] = {
+		.flags		= FL_BASE1,
+		.num_ports	= 8,
+		.base_baud	= 1382400,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b2_1_115200] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_8_115200] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 8,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b2_1_460800] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 1,
+		.base_baud	= 460800,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_4_460800] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 4,
+		.base_baud	= 460800,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_8_460800] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 8,
+		.base_baud	= 460800,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_16_460800] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 16,
+		.base_baud	= 460800,
+		.uart_offset	= 8,
+	 },
+
+	[pbn_b2_1_921600] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 1,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_4_921600] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_8_921600] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 8,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b2_bt_1_115200] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_bt_2_115200] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_bt_4_115200] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 4,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b2_bt_2_921600] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+	[pbn_b2_bt_4_921600] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 8,
+	},
+
+	[pbn_b3_4_115200] = {
+		.flags		= FL_BASE3,
+		.num_ports	= 4,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[pbn_b3_8_115200] = {
+		.flags		= FL_BASE3,
+		.num_ports	= 8,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+
 	/*
-	 * PCI Flags, Number of Ports, Base (Maximum) Baud Rate,
-	 * Offset to get to next UART's registers,
-	 * Register shift to use for memory-mapped I/O,
-	 * Initialization function, first UART offset
-	 */
-
-	/* Generic serial board, pbn_b0_1_115200, pbn_default */
-	{ SPCI_FL_BASE0, 1, 115200 },		/* pbn_b0_1_115200,
-						   pbn_default */
-
-	{ SPCI_FL_BASE0, 2, 115200 },		/* pbn_b0_2_115200 */
-	{ SPCI_FL_BASE0, 4, 115200 },		/* pbn_b0_4_115200 */
-
-	{ SPCI_FL_BASE0, 1, 921600 },		/* pbn_b0_1_921600 */
-	{ SPCI_FL_BASE0, 2, 921600 },		/* pbn_b0_2_921600 */
-	{ SPCI_FL_BASE0, 4, 921600 },		/* pbn_b0_4_921600 */
-
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 }, /* pbn_b0_bt_1_115200 */
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 }, /* pbn_b0_bt_2_115200 */
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 8, 115200 }, /* pbn_b0_bt_8_115200 */
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 460800 }, /* pbn_b0_bt_1_460800 */
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 460800 }, /* pbn_b0_bt_2_460800 */
-
-	{ SPCI_FL_BASE1, 1, 115200 },		/* pbn_b1_1_115200 */
-	{ SPCI_FL_BASE1, 2, 115200 },		/* pbn_b1_2_115200 */
-	{ SPCI_FL_BASE1, 4, 115200 },		/* pbn_b1_4_115200 */
-	{ SPCI_FL_BASE1, 8, 115200 },		/* pbn_b1_8_115200 */
-
-	{ SPCI_FL_BASE1, 2, 921600 },		/* pbn_b1_2_921600 */
-	{ SPCI_FL_BASE1, 4, 921600 },		/* pbn_b1_4_921600 */
-	{ SPCI_FL_BASE1, 8, 921600 },		/* pbn_b1_8_921600 */
-
-	{ SPCI_FL_BASE1, 2, 1382400 },		/* pbn_b1_2_1382400 */
-	{ SPCI_FL_BASE1, 4, 1382400 },		/* pbn_b1_4_1382400 */
-	{ SPCI_FL_BASE1, 8, 1382400 },		/* pbn_b1_8_1382400 */
-
-	{ SPCI_FL_BASE2, 1, 115200 },		/* pbn_b2_1_115200 */
-	{ SPCI_FL_BASE2, 8, 115200 },		/* pbn_b2_8_115200 */
-	{ SPCI_FL_BASE2, 4, 460800 },		/* pbn_b2_4_460800 */
-	{ SPCI_FL_BASE2, 8, 460800 },		/* pbn_b2_8_460800 */
-	{ SPCI_FL_BASE2, 16, 460800 },		/* pbn_b2_16_460800 */
-	{ SPCI_FL_BASE2, 4, 921600 },		/* pbn_b2_4_921600 */
-	{ SPCI_FL_BASE2, 8, 921600 },		/* pbn_b2_8_921600 */
-
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 1, 115200 }, /* pbn_b2_bt_1_115200 */
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 115200 }, /* pbn_b2_bt_2_115200 */
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 115200 }, /* pbn_b2_bt_4_115200 */
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600 }, /* pbn_b2_bt_2_921600 */
-
-	{ SPCI_FL_BASE2, 2, 921600, /* IOMEM */		   /* pbn_panacom */
-		0x400, 7, pci_plx9050_fn },
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600,   /* pbn_panacom2 */
-		0x400, 7, pci_plx9050_fn },
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 921600,   /* pbn_panacom4 */
-		0x400, 7, pci_plx9050_fn },
-	{ SPCI_FL_BASE2, 4, 921600,			   /* pbn_plx_romulus */
-		0x20, 2, pci_plx9050_fn, 0x03 },
+	 * Entries following this are board-specific.
+	 */
+
+	/*
+	 * Panacom - IOMEM
+	 */
+	[pbn_panacom] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 0x400,
+		.reg_shift	= 7,
+	},
+	[pbn_panacom2] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 2,
+		.base_baud	= 921600,
+		.uart_offset	= 0x400,
+		.reg_shift	= 7,
+	},
+	[pbn_panacom4] = {
+		.flags		= FL_BASE2|FL_BASE_BARS,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 0x400,
+		.reg_shift	= 7,
+	},
+
+	/* I think this entry is broken - the first_offset looks wrong --rmk */
+	[pbn_plx_romulus] = {
+		.flags		= FL_BASE2,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 8 << 2,
+		.reg_shift	= 2,
+		.first_offset	= 0x03,
+	},
 
 	/*
 	 * This board uses the size of PCI Base region 0 to
 	 * signal now many ports are available
 	 */
-	{ SPCI_FL_BASE0 | SPCI_FL_REGION_SZ_CAP, 32, 115200 }, /* pbn_oxsemi */
-	{ SPCI_FL_BASE_TABLE, 1, 921600,		   /* pbn_timedia */
-		0, 0, pci_timedia_fn },
-	/* EKF addition for i960 Boards form EKF with serial port */
-	{ SPCI_FL_BASE0, 32, 921600, /* max 256 ports */   /* pbn_intel_i960 */
-		8<<2, 2, pci_inteli960ni_fn, 0x10000},
-	{ SPCI_FL_BASE0 | SPCI_FL_IRQRESOURCE,		   /* pbn_sgi_ioc3 */
-		1, 458333, 0, 0, 0, 0x20178 },
-	{ SPCI_FL_BASE0, 5, 115200, 8, 0, pci_hp_diva, 0 },/* pbn_hp_diva */
+	[pbn_oxsemi] = {
+		.flags		= FL_BASE0|FL_REGION_SZ_CAP,
+		.num_ports	= 32,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
 
 	/*
-	 * NEC Vrc-5074 (Nile 4) builtin UART.
+	 * EKF addition for i960 Boards form EKF with serial port.
+	 * Max 256 ports.
 	 */
-	{ SPCI_FL_BASE0, 1, 520833,			   /* pbn_nec_nile4 */
-		64, 3, NULL, 0x300 },
-
-	{ SPCI_FL_BASE3, 4, 115200, 8 },		   /* pbn_dci_pccom4 */
-	{ SPCI_FL_BASE3, 8, 115200, 8 },		   /* pbn_dci_pccom8 */
+	[pbn_intel_i960] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 32,
+		.base_baud	= 921600,
+		.uart_offset	= 8 << 2,
+		.reg_shift	= 2,
+		.first_offset	= 0x10000,
+	},
+	[pbn_sgi_ioc3] = {
+		.flags		= FL_BASE0|FL_IRQRESOURCE,
+		.num_ports	= 1,
+		.base_baud	= 458333,
+		.uart_offset	= 8,
+		.reg_shift	= 0,
+		.first_offset	= 0x20178,
+	},
 
-	{ SPCI_FL_BASE0, 1, 115200,			   /* pbn_xircom_combo */
-		0, 0, pci_xircom_fn },
+	/*
+	 * NEC Vrc-5074 (Nile 4) builtin UART.
+	 */
+	[pbn_nec_nile4] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 1,
+		.base_baud	= 520833,
+		.uart_offset	= 8 << 3,
+		.reg_shift	= 3,
+		.first_offset	= 0x300,
+	},
 
-	{ SPCI_FL_BASE2, 1, 460800,			   /* pbn_siig10x_0 */
-		0, 0, pci_siig10x_fn },
-	{ SPCI_FL_BASE2, 1, 921600,			   /* pbn_siig10x_1 */
-		0, 0, pci_siig10x_fn },
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600,   /* pbn_siig10x_2 */
-		0, 0, pci_siig10x_fn },
-	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 921600,   /* pbn_siig10x_4 */
-		0, 0, pci_siig10x_fn },
-	{ SPCI_FL_BASE0, 1, 921600,			   /* pbn_siix20x_0 */
-		0, 0, pci_siig20x_fn },
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600,   /* pbn_siix20x_2 */
-		0, 0, pci_siig20x_fn },
-	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 4, 921600,   /* pbn_siix20x_4 */
-		0, 0, pci_siig20x_fn },
-
-	{ SPCI_FL_BASE0, 4, 921600, /* IOMEM */		   /* pbn_computone_4 */
-		0x40, 2, NULL, 0x200 },
-	{ SPCI_FL_BASE0, 6, 921600, /* IOMEM */		   /* pbn_computone_6 */
-		0x40, 2, NULL, 0x200 },
-	{ SPCI_FL_BASE0, 8, 921600, /* IOMEM */		   /* pbn_computone_8 */
-		0x40, 2, NULL, 0x200 },
+	/*
+	 * Computone - uses IOMEM.
+	 */
+	[pbn_computone_4] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 4,
+		.base_baud	= 921600,
+		.uart_offset	= 0x40,
+		.reg_shift	= 2,
+		.first_offset	= 0x200,
+	},
+	[pbn_computone_6] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 6,
+		.base_baud	= 921600,
+		.uart_offset	= 0x40,
+		.reg_shift	= 2,
+		.first_offset	= 0x200,
+	},
+	[pbn_computone_8] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 8,
+		.base_baud	= 921600,
+		.uart_offset	= 0x40,
+		.reg_shift	= 2,
+		.first_offset	= 0x200,
+	},
 };
 
 /*
@@ -640,8 +1363,7 @@
 static int __devinit
 serial_pci_guess_board(struct pci_dev *dev, struct pci_board *board)
 {
-	int num_iomem = 0, num_port = 0, first_port = -1;
-	int i;
+	int num_iomem, num_port, first_port = -1, i;
 	
 	/*
 	 * If it is not a communications device or the programming
@@ -655,36 +1377,63 @@
 	    (dev->class & 0xff) > 6)
 		return -ENODEV;
 
-	for (i = 0; i < 6; i++) {
-		if (IS_PCI_REGION_IOPORT(dev, i)) {
+	num_iomem = num_port = 0;
+	for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
+		if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
 			num_port++;
 			if (first_port == -1)
 				first_port = i;
 		}
-		if (IS_PCI_REGION_IOMEM(dev, i))
+		if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
 			num_iomem++;
 	}
 
 	/*
-	 * If there is 1 or 0 iomem regions, and exactly one port, use
-	 * it.
+	 * If there is 1 or 0 iomem regions, and exactly one port,
+	 * use it.  We guess the number of ports based on the IO
+	 * region size.
 	 */
 	if (num_iomem <= 1 && num_port == 1) {
 		board->flags = first_port;
+		board->num_ports = pci_resource_len(dev, first_port) / 8;
 		return 0;
 	}
+
+	/*
+	 * Now guess if we've got a board which indexes by BARs.
+	 * Each IO BAR should be 8 bytes, and they should follow
+	 * consecutively.
+	 */
+	first_port = -1;
+	num_port = 0;
+	for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
+		if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
+		    pci_resource_len(dev, i) == 8 &&
+		    (first_port == -1 || (first_port + num_port) == i)) {
+			num_port++;
+			if (first_port == -1)
+				first_port = i;
+		}
+	}
+
+	if (num_port > 1) {
+		board->flags = first_port | FL_BASE_BARS;
+		board->num_ports = num_port;
+		return 0;
+	}
+
 	return -ENODEV;
 }
 
 static inline int
-serial_pci_matches(struct pci_board *board, int index)
+serial_pci_matches(struct pci_board *board, struct pci_board *guessed)
 {
 	return
-	    board->base_baud == pci_boards[index].base_baud &&
-	    board->num_ports == pci_boards[index].num_ports &&
-	    board->uart_offset == pci_boards[index].uart_offset &&
-	    board->reg_shift == pci_boards[index].reg_shift &&
-	    board->first_uart_offset == pci_boards[index].first_uart_offset;
+	    board->num_ports == guessed->num_ports &&
+	    board->base_baud == guessed->base_baud &&
+	    board->uart_offset == guessed->uart_offset &&
+	    board->reg_shift == guessed->reg_shift &&
+	    board->first_offset == guessed->first_offset;
 }
 
 /*
@@ -692,10 +1441,11 @@
  * to the arrangement of serial ports on a PCI card.
  */
 static int __devinit
-pci_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
+pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
 {
 	struct serial_private *priv;
 	struct pci_board *board, tmp;
+	struct pci_serial_quirk *quirk;
 	struct serial_struct serial_req;
 	int base_baud, rc, nr_ports, i;
 
@@ -732,92 +1482,109 @@
 		 * detect this boards settings with our heuristic,
 		 * then we no longer need this entry.
 		 */
+		memcpy(&tmp, &pci_boards[pbn_default], sizeof(struct pci_board));
 		rc = serial_pci_guess_board(dev, &tmp);
-		if (rc == 0 && serial_pci_matches(board, pbn_default)) {
-			printk(KERN_INFO
-		"Redundant entry in serial pci_table.  Please send the output\n"
-		"of lspci -vv, this message (0x%04x,0x%04x,0x%04x,0x%04x),\n"
-		"the manufacturer and name of serial board or modem board to\n"
-		"rmk@arm.linux.org.uk.\n",
-			       dev->vendor, dev->device,
-			       pci_get_subvendor(dev), pci_get_subdevice(dev));
-		}
+		if (rc == 0 && serial_pci_matches(board, &tmp))
+			moan_device("Redundant entry in serial pci_table.",
+				    dev);
 	}
 
 	nr_ports = board->num_ports;
 
 	/*
-	 * Run the initialization function, if any.  The initialization
-	 * function returns:
+	 * Find an init and setup quirks.
+	 */
+	quirk = find_quirk(dev);
+
+	/*
+	 * Run the new-style initialization function.
+	 * The initialization function returns:
 	 *  <0  - error
 	 *   0  - use board->num_ports
 	 *  >0  - number of ports
 	 */
-	if (board->init_fn) {
-		rc = board->init_fn(dev, 1);
+	if (quirk->init) {
+		rc = quirk->init(dev);
 		if (rc < 0)
 			goto disable;
-
 		if (rc)
 			nr_ports = rc;
 	}
 
 	priv = kmalloc(sizeof(struct serial_private) +
-			      sizeof(unsigned int) * nr_ports,
-			      GFP_KERNEL);
+		       sizeof(unsigned int) * nr_ports,
+		       GFP_KERNEL);
 	if (!priv) {
 		rc = -ENOMEM;
 		goto deinit;
 	}
 
+	memset(priv, 0, sizeof(struct serial_private) +
+			sizeof(unsigned int) * nr_ports);
+
+	priv->quirk = quirk;
+	pci_set_drvdata(dev, priv);
+
 	base_baud = board->base_baud;
-	if (!base_baud)
+	if (!base_baud) {
+		moan_device("Board entry does not specify baud rate.", dev);
 		base_baud = BASE_BAUD;
-	memset(&serial_req, 0, sizeof(serial_req));
+	}
 	for (i = 0; i < nr_ports; i++) {
+		memset(&serial_req, 0, sizeof(serial_req));
+		serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE |
+				   UPF_RESOURCES | UPF_SHARE_IRQ;
+		serial_req.baud_base = base_baud;
 		serial_req.irq = get_pci_irq(dev, board, i);
-		if (get_pci_port(dev, board, &serial_req, i))
+		if (quirk->setup(dev, board, &serial_req, i))
 			break;
 #ifdef SERIAL_DEBUG_PCI
 		printk("Setup PCI port: port %x, irq %d, type %d\n",
 		       serial_req.port, serial_req.irq, serial_req.io_type);
 #endif
-		serial_req.flags = ASYNC_SKIP_TEST | ASYNC_AUTOPROBE;
-		serial_req.baud_base = base_baud;
 		
 		priv->line[i] = register_serial(&serial_req);
 		if (priv->line[i] < 0)
 			break;
 	}
 
-	priv->board = board;
 	priv->nr = i;
 
-	pci_set_drvdata(dev, priv);
-
 	return 0;
 
  deinit:
-	if (board->init_fn)
-		board->init_fn(dev, 0);
+	if (quirk->exit)
+		quirk->exit(dev);
  disable:
 	pci_disable_device(dev);
 	return rc;
 }
 
-static void __devexit pci_remove_one(struct pci_dev *dev)
+static void __devexit pciserial_remove_one(struct pci_dev *dev)
 {
 	struct serial_private *priv = pci_get_drvdata(dev);
-	int i;
 
 	pci_set_drvdata(dev, NULL);
 
 	if (priv) {
+		struct pci_serial_quirk *quirk;
+		int i;
+
 		for (i = 0; i < priv->nr; i++)
 			unregister_serial(priv->line[i]);
 
-		if (priv->board->init_fn)
-			priv->board->init_fn(dev, 0);
+		for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
+			if (priv->remapped_bar[i])
+				iounmap(priv->remapped_bar[i]);
+			priv->remapped_bar[i] = NULL;
+		}
+
+		/*
+		 * Find the exit quirks.
+		 */
+		quirk = find_quirk(dev);
+		if (quirk->exit)
+			quirk->exit(dev);
 
 		pci_disable_device(dev);
 
@@ -825,6 +1592,53 @@
 	}
 }
 
+static int pciserial_save_state_one(struct pci_dev *dev, u32 state)
+{
+	struct serial_private *priv = pci_get_drvdata(dev);
+
+	if (priv) {
+		int i;
+
+		for (i = 0; i < priv->nr; i++)
+			serial8250_suspend_port(priv->line[i], SUSPEND_SAVE_STATE);
+	}
+	return 0;
+}
+
+static int pciserial_suspend_one(struct pci_dev *dev, u32 state)
+{
+	struct serial_private *priv = pci_get_drvdata(dev);
+
+	if (priv) {
+		int i;
+
+		for (i = 0; i < priv->nr; i++)
+			serial8250_suspend_port(priv->line[i], SUSPEND_POWER_DOWN);
+	}
+	return 0;
+}
+
+static int pciserial_resume_one(struct pci_dev *dev)
+{
+	struct serial_private *priv = pci_get_drvdata(dev);
+
+	if (priv) {
+		int i;
+
+		/*
+		 * Ensure that the board is correctly configured.
+		 */
+		if (priv->quirk->init)
+			priv->quirk->init(dev);
+
+		for (i = 0; i < priv->nr; i++) {
+			serial8250_resume_port(priv->line[i], RESUME_POWER_ON);
+			serial8250_resume_port(priv->line[i], RESUME_RESTORE_STATE);
+		}
+	}
+	return 0;
+}
+
 static struct pci_device_id serial_pci_tbl[] __devinitdata = {
 	{	PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
 		PCI_SUBVENDOR_ID_CONNECT_TECH,
@@ -908,7 +1722,9 @@
 	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b2_bt_2_921600 },
-	/* VScom SPCOM800, from sl@s.pl */
+	/*
+	 * VScom SPCOM800, from sl@s.pl
+	 */
 	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800, 
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b2_8_921600 },
@@ -949,8 +1765,10 @@
 		PCI_SUBVENDOR_ID_CHASE_PCIRAS,
 		PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0, 
 		pbn_b2_8_460800 },
-	/* Megawolf Romulus PCI Serial Card, from Mike Hudson */
-	/* (Exoray@isys.ca) */
+	/*
+	 * Megawolf Romulus PCI Serial Card, from Mike Hudson
+	 * (Exoray@isys.ca)
+	 */
 	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
 		0x10b5, 0x106a, 0, 0,
 		pbn_plx_romulus },
@@ -976,16 +1794,24 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b0_2_115200 },
 
-	/* Digitan DS560-558, from jimd@esoft.com */
+	/*
+	 * Digitan DS560-558, from jimd@esoft.com
+	 */
 	{	PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b1_1_115200 },
 
-	/* 3Com US Robotics 56k Voice Internal PCI model 5610 */
+	/*
+	 * 3Com US Robotics 56k Voice Internal PCI model 5610
+	 */
 	{	PCI_VENDOR_ID_USR, 0x1008,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_1_115200 },
 
-	/* Titan Electronic cards */
+	/*
+	 * Titan Electronic cards
+	 *  The 400L and 800L have a custom setup quirk.
+	 */
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b0_1_921600 },
@@ -999,120 +1825,76 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b0_4_921600 },
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
-		PCI_ANY_ID, PCI_ANY_ID,
-		SPCI_FL_BASE1, 1, 921600 },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b1_1_921600 },
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
-		PCI_ANY_ID, PCI_ANY_ID,
-		SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 2, 921600 },
-	/* The 400L and 800L have a custom hack in get_pci_port */
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b1_bt_2_921600 },
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
-		PCI_ANY_ID, PCI_ANY_ID,
-		SPCI_FL_BASE_TABLE, 4, 921600 },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_bt_4_921600 },
 	{	PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
-		PCI_ANY_ID, PCI_ANY_ID,
-		SPCI_FL_BASE_TABLE, 8, 921600 },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_bt_8_921600 },
 
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_0 },
+		pbn_b2_1_460800 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_0 },
+		pbn_b2_1_460800 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_1 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_650,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_1 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_850,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_1 },
+		pbn_b2_1_460800 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_2 },
+		pbn_b2_bt_2_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_2 },
+		pbn_b2_bt_2_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_2 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_550,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_2 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_650,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_2 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_850,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_2 },
+		pbn_b2_bt_2_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_4 },
+		pbn_b2_bt_4_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_4 },
+		pbn_b2_bt_4_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig10x_4 },
+		pbn_b2_bt_4_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
+		pbn_b0_1_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
+		pbn_b0_1_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_550,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_650,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_850,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_550,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_650,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_850,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_0 },
+		pbn_b0_1_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_2 },
+		pbn_b0_bt_2_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_2 },
+		pbn_b0_bt_2_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_2 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_550,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_2 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_650,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_2 },
-	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_2 },
+		pbn_b0_bt_2_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_4 },
+		pbn_b0_bt_4_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_4 },
+		pbn_b0_bt_4_921600 },
 	{	PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_siig20x_4 },
+		pbn_b0_bt_4_921600 },
 
-	/* Computone devices submitted by Doug McNash dmcnash@computone.com */
+	/*
+	 * Computone devices submitted by Doug McNash dmcnash@computone.com
+	 */
 	{	PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
 		PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
 		0, 0, pbn_computone_4 },
@@ -1124,18 +1906,22 @@
 		0, 0, pbn_computone_6 },
 
 	{	PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_oxsemi },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_oxsemi },
 	{	PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
-		PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0, pbn_timedia },
+		PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
+		pbn_b0_bt_1_921600 },
 
-	{	PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
-		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_b0_bt_2_115200 },
-	/* AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org> */
+	/*
+	 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
+	 */
 	{	PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b0_bt_8_115200 },
 
+	{	PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_bt_2_115200 },
 	{	PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b0_bt_2_115200 },
@@ -1158,26 +1944,40 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b0_bt_1_460800 },
 
-	/* RAStel 2 port modem, gerg@moreton.com.au */
+	/*
+	 * RAStel 2 port modem, gerg@moreton.com.au
+	 */
 	{	PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b2_bt_2_115200 },
 
-	/* EKF addition for i960 Boards form EKF with serial port */
-	{	PCI_VENDOR_ID_INTEL, 0x1960,
+	/*
+	 * EKF addition for i960 Boards form EKF with serial port
+	 */
+	{	PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
 		0xE4BF, PCI_ANY_ID, 0, 0,
 		pbn_intel_i960 },
 
-	/* Xircom Cardbus/Ethernet combos */
+	/*
+	 * Xircom Cardbus/Ethernet combos
+	 */
 	{	PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_xircom_combo },
+		pbn_b0_1_115200 },
+	/*
+	 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
+	 */
+	{	PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_1_115200 },
 
 	/*
 	 * Untested PCI modems, sent in from various folks...
 	 */
 
-	/* Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de> */
+	/*
+	 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
+	 */
 	{	PCI_VENDOR_ID_ROCKWELL, 0x1004,
 		0x1048, 0x1500, 0, 0,
 		pbn_b1_1_115200 },
@@ -1186,10 +1986,12 @@
 		0xFF00, 0, 0, 0,
 		pbn_sgi_ioc3 },
 
-	/* HP Diva card */
+	/*
+	 * HP Diva card
+	 */
 	{	PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_hp_diva },
+		pbn_b0_5_115200 },
 	{	PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b2_1_115200 },
@@ -1203,15 +2005,14 @@
 
 	{	PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_dci_pccom4 },
+		pbn_b3_4_115200 },
 	{	PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
-		pbn_dci_pccom8 },
+		pbn_b3_8_115200 },
 
 	/*
-	 * These entries match devices with class
-	 * COMMUNICATION_SERIAL, COMMUNICATION_MODEM
-	 * or COMMUNICATION_MULTISERIAL
+	 * These entries match devices with class COMMUNICATION_SERIAL,
+	 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
 	 */
 	{	PCI_ANY_ID, PCI_ANY_ID,
 		PCI_ANY_ID, PCI_ANY_ID,
@@ -1230,9 +2031,15 @@
 
 static struct pci_driver serial_pci_driver = {
 	.name		= "serial",
-	.probe		= pci_init_one,
-	.remove		= __devexit_p(pci_remove_one),
+	.probe		= pciserial_init_one,
+	.remove		= __devexit_p(pciserial_remove_one),
+	.save_state	= pciserial_save_state_one,
+	.suspend	= pciserial_suspend_one,
+	.resume		= pciserial_resume_one,
 	.id_table	= serial_pci_tbl,
+	.driver = {
+		.devclass = &tty_devclass,
+	},
 };
 
 static int __init serial8250_pci_init(void)
diff -urN linux-2.5.64-bk10/drivers/serial/core.c linux-2.5.64-bk11/drivers/serial/core.c
--- linux-2.5.64-bk10/drivers/serial/core.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/drivers/serial/core.c	Mon Mar 31 12:34:56 2003
@@ -21,9 +21,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *  $Id: core.c,v 1.100 2002/07/28 10:03:28 rmk Exp $
- *
  */
 #include <linux/config.h>
 #include <linux/module.h>
@@ -31,9 +28,9 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/console.h>
-#include <linux/pm.h>
 #include <linux/serial_core.h>
 #include <linux/smp_lock.h>
+#include <linux/device.h>
 #include <linux/serial.h> /* for serial_state and serial_icounter_struct */
 
 #include <asm/irq.h>
@@ -46,11 +43,6 @@
 #define DPRINTK(x...)	do { } while (0)
 #endif
 
-#ifndef CONFIG_PM
-#define pm_access(pm)		do { } while (0)
-#define pm_unregister(pm)	do { } while (0)
-#endif
-
 /*
  * This is used to lock changes in serial line configuration.
  */
@@ -58,8 +50,17 @@
 
 #define HIGH_BITS_OFFSET	((sizeof(long)-sizeof(int))*8)
 
-static void uart_change_speed(struct uart_info *info, struct termios *old_termios);
+#define uart_users(state)	((state)->count + ((state)->info ? (state)->info->blocked_open : 0))
+
+#ifdef CONFIG_SERIAL_CORE_CONSOLE
+#define uart_console(port)	((port)->cons && (port)->cons->index == (port)->line)
+#else
+#define uart_console(port)	(0)
+#endif
+
+static void uart_change_speed(struct uart_state *state, struct termios *old_termios);
 static void uart_wait_until_sent(struct tty_struct *tty, int timeout);
+static void uart_change_pm(struct uart_state *state, int pm_state);
 
 /*
  * This routine is used by the interrupt handler to schedule processing in
@@ -73,8 +74,8 @@
 
 static void uart_stop(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 	unsigned long flags;
 
 	spin_lock_irqsave(&port->lock, flags);
@@ -84,32 +85,31 @@
 
 static void __uart_start(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 
-	if (!uart_circ_empty(&info->xmit) && info->xmit.buf &&
+	if (!uart_circ_empty(&state->info->xmit) && state->info->xmit.buf &&
 	    !tty->stopped && !tty->hw_stopped)
 		port->ops->start_tx(port, 1);
 }
 
 static void uart_start(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 	unsigned long flags;
 
-	pm_access(info->state->pm);
-
-	spin_lock_irqsave(&info->port->lock, flags);
+	spin_lock_irqsave(&port->lock, flags);
 	__uart_start(tty);
-	spin_unlock_irqrestore(&info->port->lock, flags);
+	spin_unlock_irqrestore(&port->lock, flags);
 }
 
 static void uart_tasklet_action(unsigned long data)
 {
-	struct uart_info *info = (struct uart_info *)data;
+	struct uart_state *state = (struct uart_state *)data;
 	struct tty_struct *tty;
 
-	tty = info->tty;
+	tty = state->info->tty;
 	if (tty) {
 		if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
 		    tty->ldisc.write_wakeup)
@@ -137,11 +137,12 @@
 
 /*
  * Startup the port.  This will be called once per open.  All calls
- * will be serialised by the global port semaphore.
+ * will be serialised by the per-port semaphore.
  */
-static int uart_startup(struct uart_info *info, int init_hw)
+static int uart_startup(struct uart_state *state, int init_hw)
 {
-	struct uart_port *port = info->port;
+	struct uart_info *info = state->info;
+	struct uart_port *port = state->port;
 	unsigned long page;
 	int retval = 0;
 
@@ -182,7 +183,7 @@
 			/*
 			 * Initialise the hardware port settings.
 			 */
-			uart_change_speed(info, NULL);
+			uart_change_speed(state, NULL);
 
 			/*
 			 * Setup the RTS and DTR signals once the
@@ -194,8 +195,7 @@
 
 		info->flags |= UIF_INITIALIZED;
 
-		if (info->tty)
-			clear_bit(TTY_IO_ERROR, &info->tty->flags);
+		clear_bit(TTY_IO_ERROR, &info->tty->flags);
 	}
 
 	if (retval && capable(CAP_SYS_ADMIN))
@@ -207,11 +207,12 @@
 /*
  * This routine will shutdown a serial port; interrupts are disabled, and
  * DTR is dropped if the hangup on close termio flag is on.  Calls to
- * uart_shutdown are serialised by port_sem.
+ * uart_shutdown are serialised by the per-port semaphore.
  */
-static void uart_shutdown(struct uart_info *info)
+static void uart_shutdown(struct uart_state *state)
 {
-	struct uart_port *port = info->port;
+	struct uart_info *info = state->info;
+	struct uart_port *port = state->port;
 
 	if (!(info->flags & UIF_INITIALIZED))
 		return;
@@ -220,7 +221,7 @@
 	 * Turn off DTR and RTS early.
 	 */
 	if (!info->tty || (info->tty->termios->c_cflag & HUPCL))
-		uart_clear_mctrl(info->port, TIOCM_DTR | TIOCM_RTS);
+		uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
 
 	/*
 	 * clear delta_msr_wait queue to avoid mem leaks: we may free
@@ -412,10 +413,10 @@
 EXPORT_SYMBOL(uart_get_divisor);
 
 static void
-uart_change_speed(struct uart_info *info, struct termios *old_termios)
+uart_change_speed(struct uart_state *state, struct termios *old_termios)
 {
-	struct tty_struct *tty = info->tty;
-	struct uart_port *port = info->port;
+	struct tty_struct *tty = state->info->tty;
+	struct uart_port *port = state->port;
 	struct termios *termios;
 
 	/*
@@ -431,14 +432,14 @@
 	 * Set flags based on termios cflag
 	 */
 	if (termios->c_cflag & CRTSCTS)
-		info->flags |= UIF_CTS_FLOW;
+		state->info->flags |= UIF_CTS_FLOW;
 	else
-		info->flags &= ~UIF_CTS_FLOW;
+		state->info->flags &= ~UIF_CTS_FLOW;
 
 	if (termios->c_cflag & CLOCAL)
-		info->flags &= ~UIF_CHECK_CD;
+		state->info->flags &= ~UIF_CHECK_CD;
 	else
-		info->flags |= UIF_CHECK_CD;
+		state->info->flags |= UIF_CHECK_CD;
 
 	port->ops->set_termios(port, termios, old_termios);
 }
@@ -526,10 +527,10 @@
 
 static void uart_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
 
 	if (tty)
-		__uart_put_char(info->port, &info->xmit, ch);
+		__uart_put_char(state->port, &state->info->xmit, ch);
 }
 
 static void uart_flush_chars(struct tty_struct *tty)
@@ -541,16 +542,16 @@
 uart_write(struct tty_struct *tty, int from_user, const unsigned char * buf,
 	   int count)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
 	int ret;
 
-	if (!tty || !info->xmit.buf)
+	if (!tty || !state->info->xmit.buf)
 		return 0;
 
 	if (from_user)
-		ret = __uart_user_write(info->port, &info->xmit, buf, count);
+		ret = __uart_user_write(state->port, &state->info->xmit, buf, count);
 	else
-		ret = __uart_kern_write(info->port, &info->xmit, buf, count);
+		ret = __uart_kern_write(state->port, &state->info->xmit, buf, count);
 
 	uart_start(tty);
 	return ret;
@@ -558,29 +559,30 @@
 
 static int uart_write_room(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
 
-	return uart_circ_chars_free(&info->xmit);
+	return uart_circ_chars_free(&state->info->xmit);
 }
 
 static int uart_chars_in_buffer(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
 
-	return uart_circ_chars_pending(&info->xmit);
+	return uart_circ_chars_pending(&state->info->xmit);
 }
 
 static void uart_flush_buffer(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 	unsigned long flags;
 
 	DPRINTK("uart_flush_buffer(%d) called\n",
 	        minor(tty->device) - tty->driver.minor_start);
 
-	spin_lock_irqsave(&info->port->lock, flags);
-	uart_circ_clear(&info->xmit);
-	spin_unlock_irqrestore(&info->port->lock, flags);
+	spin_lock_irqsave(&port->lock, flags);
+	uart_circ_clear(&state->info->xmit);
+	spin_unlock_irqrestore(&port->lock, flags);
 	wake_up_interruptible(&tty->write_wait);
 	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
 	    tty->ldisc.write_wakeup)
@@ -593,8 +595,8 @@
  */
 static void uart_send_xchar(struct tty_struct *tty, char ch)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 	unsigned long flags;
 
 	if (port->ops->send_xchar)
@@ -611,19 +613,19 @@
 
 static void uart_throttle(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
 
 	if (I_IXOFF(tty))
 		uart_send_xchar(tty, STOP_CHAR(tty));
 
 	if (tty->termios->c_cflag & CRTSCTS)
-		uart_clear_mctrl(info->port, TIOCM_RTS);
+		uart_clear_mctrl(state->port, TIOCM_RTS);
 }
 
 static void uart_unthrottle(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 
 	if (I_IXOFF(tty)) {
 		if (port->x_char)
@@ -636,10 +638,9 @@
 		uart_set_mctrl(port, TIOCM_RTS);
 }
 
-static int uart_get_info(struct uart_info *info, struct serial_struct *retinfo)
+static int uart_get_info(struct uart_state *state, struct serial_struct *retinfo)
 {
-	struct uart_state *state = info->state;
-	struct uart_port *port = info->port;
+	struct uart_port *port = state->port;
 	struct serial_struct tmp;
 
 	memset(&tmp, 0, sizeof(tmp));
@@ -649,7 +650,7 @@
 	if (HIGH_BITS_OFFSET)
 		tmp.port_high = (long) port->iobase >> HIGH_BITS_OFFSET;
 	tmp.irq		    = port->irq;
-	tmp.flags	    = port->flags | info->flags;
+	tmp.flags	    = port->flags;
 	tmp.xmit_fifo_size  = port->fifosize;
 	tmp.baud_base	    = port->uartclk / 16;
 	tmp.close_delay	    = state->close_delay;
@@ -666,11 +667,10 @@
 }
 
 static int
-uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
+uart_set_info(struct uart_state *state, struct serial_struct *newinfo)
 {
 	struct serial_struct new_serial;
-	struct uart_state *state = info->state;
-	struct uart_port *port = info->port;
+	struct uart_port *port = state->port;
 	unsigned long new_port;
 	unsigned int change_irq, change_port, old_flags;
 	unsigned int old_custom_divisor;
@@ -692,7 +692,7 @@
 	 * module insertion/removal doesn't change anything
 	 * under us.
 	 */
-	down(&port_sem);
+	down(&state->sem);
 
 	change_irq  = new_serial.irq != port->irq;
 
@@ -745,14 +745,14 @@
 		/*
 		 * Make sure that we are the sole user of this port.
 		 */
-		if (state->count > 1 || info->blocked_open != 0)
+		if (uart_users(state) > 1)
 			goto exit;
 
 		/*
 		 * We need to shutdown the serial port at the old
 		 * port/type/irq combination.
 		 */
-		uart_shutdown(info);
+		uart_shutdown(state);
 	}
 
 	if (change_port) {
@@ -813,18 +813,21 @@
 
 	port->irq              = new_serial.irq;
 	port->uartclk          = new_serial.baud_base * 16;
-	port->flags            = new_serial.flags & UPF_CHANGE_MASK;
+	port->flags            = (port->flags & ~UPF_CHANGE_MASK) |
+				 (new_serial.flags & UPF_CHANGE_MASK);
 	port->custom_divisor   = new_serial.custom_divisor;
 	state->close_delay     = new_serial.close_delay * HZ / 100;
 	state->closing_wait    = new_serial.closing_wait * HZ / 100;
 	port->fifosize         = new_serial.xmit_fifo_size;
-	info->tty->low_latency = (port->flags & UPF_LOW_LATENCY) ? 1 : 0;
+	if (state->info->tty)
+		state->info->tty->low_latency =
+			(port->flags & UPF_LOW_LATENCY) ? 1 : 0;
 
  check_and_exit:
 	retval = 0;
 	if (port->type == PORT_UNKNOWN)
 		goto exit;
-	if (info->flags & UIF_INITIALIZED) {
+	if (state->info->flags & UIF_INITIALIZED) {
 		if (((old_flags ^ port->flags) & UPF_SPD_MASK) ||
 		    old_custom_divisor != port->custom_divisor) {
 			/* If they're setting up a custom divisor or speed,
@@ -832,25 +835,26 @@
 			 * need to rate-limit; it's CAP_SYS_ADMIN only. */
 			if (port->flags & UPF_SPD_MASK) {
 				printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n",
-				       current->comm, info->tty->driver.name, 
-				       info->port->line);
+				       current->comm, state->info->tty->driver.name, 
+				       state->port->line);
 			}
-			uart_change_speed(info, NULL);
+			uart_change_speed(state, NULL);
 		}
 	} else
-		retval = uart_startup(info, 1);
+		retval = uart_startup(state, 1);
  exit:
-	up(&port_sem);
+	up(&state->sem);
 	return retval;
 }
 
 
 /*
- * uart_get_lsr_info - get line status register info
+ * uart_get_lsr_info - get line status register info.
+ * Note: uart_ioctl protects us against hangups.
  */
-static int uart_get_lsr_info(struct uart_info *info, unsigned int *value)
+static int uart_get_lsr_info(struct uart_state *state, unsigned int *value)
 {
-	struct uart_port *port = info->port;
+	struct uart_port *port = state->port;
 	unsigned int result;
 
 	result = port->ops->tx_empty(port);
@@ -861,9 +865,9 @@
 	 * avoid a race condition (depending on when the transmit
 	 * interrupt happens).
 	 */
-	if (info->port->x_char ||
-	    ((uart_circ_chars_pending(&info->xmit) > 0) &&
-	     !info->tty->stopped && !info->tty->hw_stopped))
+	if (port->x_char ||
+	    ((uart_circ_chars_pending(&state->info->xmit) > 0) &&
+	     !state->info->tty->stopped && !state->info->tty->hw_stopped))
 		result &= ~TIOCSER_TEMT;
 	
 	return put_user(result, value);
@@ -888,6 +892,8 @@
 	if (get_user(arg, value))
 		return -EFAULT;
 
+	arg &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2;
+
 	set = clear = 0;
 	switch (cmd) {
 	case TIOCMBIS:
@@ -911,8 +917,8 @@
 
 static void uart_break_ctl(struct tty_struct *tty, int break_state)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 
 	BUG_ON(!kernel_locked());
 
@@ -920,25 +926,25 @@
 		port->ops->break_ctl(port, break_state);
 }
 
-static int uart_do_autoconfig(struct uart_info *info)
+static int uart_do_autoconfig(struct uart_state *state)
 {
-	struct uart_port *port = info->port;
+	struct uart_port *port = state->port;
 	int flags, ret;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
 	/*
-	 * Take the 'count' lock.  This prevents count
-	 * from incrementing, and hence any extra opens
-	 * of the port while we're auto-configging.
+	 * Take the per-port semaphore.  This prevents count from
+	 * changing, and hence any extra opens of the port while
+	 * we're auto-configuring.
 	 */
-	if (down_interruptible(&port_sem))
+	if (down_interruptible(&state->sem))
 		return -ERESTARTSYS;
 
 	ret = -EBUSY;
-	if (info->state->count == 1 && info->blocked_open == 0) {
-		uart_shutdown(info);
+	if (uart_users(state) == 1) {
+		uart_shutdown(state);
 
 		/*
 		 * If we already have a port type configured,
@@ -957,16 +963,22 @@
 		 */
 		port->ops->config_port(port, flags);
 
-		ret = uart_startup(info, 1);
+		ret = uart_startup(state, 1);
 	}
-	up(&port_sem);
+	up(&state->sem);
 	return ret;
 }
 
+/*
+ * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
+ * - mask passed in arg for lines of interest
+ *   (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
+ * Caller should use TIOCGICOUNT to see which one it was
+ */
 static int
-uart_wait_modem_status(struct uart_info *info, unsigned long arg)
+uart_wait_modem_status(struct uart_state *state, unsigned long arg)
 {
-	struct uart_port *port = info->port;
+	struct uart_port *port = state->port;
 	DECLARE_WAITQUEUE(wait, current);
 	struct uart_icount cprev, cnow;
 	int ret;
@@ -983,7 +995,7 @@
 	port->ops->enable_ms(port);
 	spin_unlock_irq(&port->lock);
 
-	add_wait_queue(&info->delta_msr_wait, &wait);
+	add_wait_queue(&state->info->delta_msr_wait, &wait);
 	for (;;) {
 		spin_lock_irq(&port->lock);
 		memcpy(&cnow, &port->icount, sizeof(struct uart_icount));
@@ -1011,117 +1023,144 @@
 	}
 
 	current->state = TASK_RUNNING;
-	remove_wait_queue(&info->delta_msr_wait, &wait);
+	remove_wait_queue(&state->info->delta_msr_wait, &wait);
 
 	return ret;
 }
 
 /*
- * Called via sys_ioctl under the BKL.  We can use spin_lock_irq() here.
+ * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
+ * Return: write counters to the user passed counter struct
+ * NB: both 1->0 and 0->1 transitions are counted except for
+ *     RI where only 0->1 is counted.
  */
 static int
-uart_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd,
-	   unsigned long arg)
+uart_get_count(struct uart_state *state, struct serial_icounter_struct *icnt)
 {
-	struct uart_info *info = tty->driver_data;
 	struct serial_icounter_struct icount;
 	struct uart_icount cnow;
+	struct uart_port *port = state->port;
+
+	spin_lock_irq(&port->lock);
+	memcpy(&cnow, &port->icount, sizeof(struct uart_icount));
+	spin_unlock_irq(&port->lock);
+
+	icount.cts         = cnow.cts;
+	icount.dsr         = cnow.dsr;
+	icount.rng         = cnow.rng;
+	icount.dcd         = cnow.dcd;
+	icount.rx          = cnow.rx;
+	icount.tx          = cnow.tx;
+	icount.frame       = cnow.frame;
+	icount.overrun     = cnow.overrun;
+	icount.parity      = cnow.parity;
+	icount.brk         = cnow.brk;
+	icount.buf_overrun = cnow.buf_overrun;
+
+	return copy_to_user(icnt, &icount, sizeof(icount)) ? -EFAULT : 0;
+}
+
+/*
+ * Called via sys_ioctl under the BKL.  We can use spin_lock_irq() here.
+ */
+static int
+uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
+	   unsigned long arg)
+{
+	struct uart_state *state = tty->driver_data;
 	int ret = -ENOIOCTLCMD;
 
 	BUG_ON(!kernel_locked());
 
-	if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
-	    (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
-	    (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
-		if (tty->flags & (1 << TTY_IO_ERROR))
-			return -EIO;
+	/*
+	 * These ioctls don't rely on the hardware to be present.
+	 */
+	switch (cmd) {
+	case TIOCGSERIAL:
+		ret = uart_get_info(state, (struct serial_struct *)arg);
+		break;
+
+	case TIOCSSERIAL:
+		ret = uart_set_info(state, (struct serial_struct *)arg);
+		break;
+
+	case TIOCSERCONFIG:
+		ret = uart_do_autoconfig(state);
+		break;
+
+	case TIOCSERGWILD: /* obsolete */
+	case TIOCSERSWILD: /* obsolete */
+		ret = 0;
+		break;
 	}
 
-	switch (cmd) {
-		case TIOCMGET:
-			ret = uart_get_modem_info(info->port,
-						  (unsigned int *)arg);
-			break;
+	if (ret != -ENOIOCTLCMD)
+		goto out;
 
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			ret = uart_set_modem_info(info->port, cmd,
-						  (unsigned int *)arg);
-			break;
+	if (tty->flags & (1 << TTY_IO_ERROR)) {
+		ret = -EIO;
+		goto out;
+	}
 
-		case TIOCGSERIAL:
-			ret = uart_get_info(info, (struct serial_struct *)arg);
-			break;
+	/*
+	 * The following should only be used when hardware is present.
+	 */
+	switch (cmd) {
+	case TIOCMIWAIT:
+		ret = uart_wait_modem_status(state, arg);
+		break;
 
-		case TIOCSSERIAL:
-			ret = uart_set_info(info, (struct serial_struct *)arg);
-			break;
+	case TIOCGICOUNT:
+		ret = uart_get_count(state, (struct serial_icounter_struct *)arg);
+		break;
+	}
 
-		case TIOCSERCONFIG:
-			ret = uart_do_autoconfig(info);
-			break;
+	if (ret != -ENOIOCTLCMD)
+		goto out;
 
-		case TIOCSERGETLSR: /* Get line status register */
-			ret = uart_get_lsr_info(info, (unsigned int *)arg);
-			break;
+	down(&state->sem);
 
-		/*
-		 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
-		 * - mask passed in arg for lines of interest
-		 *   (use |'ed TIOCM_RNG/DSR/CD/CTS for masking)
-		 * Caller should use TIOCGICOUNT to see which one it was
-		 */
-		case TIOCMIWAIT:
-			ret = uart_wait_modem_status(info, arg);
-			break;
+	if (tty_hung_up_p(filp)) {
+		ret = -EIO;
+		goto out_up;
+	}
 
-		/*
-		 * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
-		 * Return: write counters to the user passed counter struct
-		 * NB: both 1->0 and 0->1 transitions are counted except for
-		 *     RI where only 0->1 is counted.
-		 */
-		case TIOCGICOUNT:
-			spin_lock_irq(&info->port->lock);
-			memcpy(&cnow, &info->port->icount,
-			       sizeof(struct uart_icount));
-			spin_unlock_irq(&info->port->lock);
-
-			icount.cts         = cnow.cts;
-			icount.dsr         = cnow.dsr;
-			icount.rng         = cnow.rng;
-			icount.dcd         = cnow.dcd;
-			icount.rx          = cnow.rx;
-			icount.tx          = cnow.tx;
-			icount.frame       = cnow.frame;
-			icount.overrun     = cnow.overrun;
-			icount.parity      = cnow.parity;
-			icount.brk         = cnow.brk;
-			icount.buf_overrun = cnow.buf_overrun;
+	/*
+	 * All these rely on hardware being present and need to be
+	 * protected against the tty being hung up.
+	 */
+	switch (cmd) {
+	case TIOCMGET:
+		ret = uart_get_modem_info(state->port, (unsigned int *)arg);
+		break;
 
-			ret = copy_to_user((void *)arg, &icount, sizeof(icount))
-					? -EFAULT : 0;
-			break;
+	case TIOCMBIS:
+	case TIOCMBIC:
+	case TIOCMSET:
+		ret = uart_set_modem_info(state->port, cmd,
+					  (unsigned int *)arg);
+		break;
 
-		case TIOCSERGWILD: /* obsolete */
-		case TIOCSERSWILD: /* obsolete */
-			ret = 0;
-			break;
+	case TIOCSERGETLSR: /* Get line status register */
+		ret = uart_get_lsr_info(state, (unsigned int *)arg);
+		break;
 
-		default: {
-			struct uart_port *port = info->port;
-			if (port->ops->ioctl)
-				ret = port->ops->ioctl(port, cmd, arg);
-			break;
-		}
+	default: {
+		struct uart_port *port = state->port;
+		if (port->ops->ioctl)
+			ret = port->ops->ioctl(port, cmd, arg);
+		break;
 	}
+	}
+ out_up:
+	up(&state->sem);
+ out:
 	return ret;
 }
 
 static void uart_set_termios(struct tty_struct *tty, struct termios *old_termios)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_state *state = tty->driver_data;
 	unsigned long flags;
 	unsigned int cflag = tty->termios->c_cflag;
 
@@ -1137,11 +1176,11 @@
 	    RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0)
 		return;
 
-	uart_change_speed(info, old_termios);
+	uart_change_speed(state, old_termios);
 
 	/* Handle transition to B0 status */
 	if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD))
-		uart_clear_mctrl(info->port, TIOCM_RTS | TIOCM_DTR);
+		uart_clear_mctrl(state->port, TIOCM_RTS | TIOCM_DTR);
 
 	/* Handle transition away from B0 status */
 	if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) {
@@ -1149,15 +1188,15 @@
 		if (!(cflag & CRTSCTS) ||
 		    !test_bit(TTY_THROTTLED, &tty->flags))
 			mask |= TIOCM_RTS;
-		uart_set_mctrl(info->port, mask);
+		uart_set_mctrl(state->port, mask);
 	}
 
 	/* Handle turning off CRTSCTS */
 	if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) {
-		spin_lock_irqsave(&info->port->lock, flags);
+		spin_lock_irqsave(&state->port->lock, flags);
 		tty->hw_stopped = 0;
 		__uart_start(tty);
-		spin_unlock_irqrestore(&info->port->lock, flags);
+		spin_unlock_irqrestore(&state->port->lock, flags);
 	}
 
 #if 0
@@ -1169,7 +1208,7 @@
 	 */
 	if (!(old_termios->c_cflag & CLOCAL) &&
 	    (tty->termios->c_cflag & CLOCAL))
-		wake_up_interruptible(&info->open_wait);
+		wake_up_interruptible(&state->info->open_wait);
 #endif
 }
 
@@ -1180,29 +1219,17 @@
  */
 static void uart_close(struct tty_struct *tty, struct file *filp)
 {
-	struct uart_driver *drv = (struct uart_driver *)tty->driver.driver_state;
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
-	struct uart_state *state;
-	unsigned long flags;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 
 	BUG_ON(!kernel_locked());
+	DPRINTK("uart_close(%d) called\n", port->line);
 
-	if (!info)
-		return;
-
-	state = info->state;
-
-	DPRINTK("uart_close() called\n");
+	down(&state->sem);
 
-	/*
-	 * This is safe, as long as the BKL exists in
-	 * do_tty_hangup(), and we're protected by the BKL.
-	 */
 	if (tty_hung_up_p(filp))
 		goto done;
 
-	spin_lock_irqsave(&info->port->lock, flags);
 	if ((tty->count == 1) && (state->count != 1)) {
 		/*
 		 * Uh, oh.  tty->count is 1, which means that the tty
@@ -1217,34 +1244,28 @@
 	}
 	if (--state->count < 0) {
 		printk("rs_close: bad serial port count for %s%d: %d\n",
-		       tty->driver.name, info->port->line, state->count);
+		       tty->driver.name, port->line, state->count);
 		state->count = 0;
 	}
-	if (state->count) {
-		spin_unlock_irqrestore(&info->port->lock, flags);
+	if (state->count)
 		goto done;
-	}
-
-	/*
-	 * The UIF_CLOSING flag protects us against further opens
-	 * of this port.
-	 */
-	info->flags |= UIF_CLOSING;
-	spin_unlock_irqrestore(&info->port->lock, flags);
 
 	/*
 	 * Now we wait for the transmit buffer to clear; and we notify
-	 * the line discipline to only process XON/XOFF characters.
+	 * the line discipline to only process XON/XOFF characters by
+	 * setting tty->closing.
 	 */
 	tty->closing = 1;
-	if (info->state->closing_wait != USF_CLOSING_WAIT_NONE)
-		tty_wait_until_sent(tty, info->state->closing_wait);
+
+	if (state->closing_wait != USF_CLOSING_WAIT_NONE)
+		tty_wait_until_sent(tty, state->closing_wait);
 
 	/*
 	 * At this point, we stop accepting input.  To do this, we
 	 * disable the receive line status interrupts.
 	 */
-	if (info->flags & UIF_INITIALIZED) {
+	if (state->info->flags & UIF_INITIALIZED) {
+		unsigned long flags;
 		spin_lock_irqsave(&port->lock, flags);
 		port->ops->stop_rx(port);
 		spin_unlock_irqrestore(&port->lock, flags);
@@ -1255,46 +1276,38 @@
 		 */
 		uart_wait_until_sent(tty, port->timeout);
 	}
-	down(&port_sem);
-	uart_shutdown(info);
-	up(&port_sem);
+
+	uart_shutdown(state);
 	uart_flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
-	info->tty = NULL;
-	if (info->blocked_open) {
-		if (info->state->close_delay) {
+	state->info->tty = NULL;
+
+	if (state->info->blocked_open) {
+		if (state->close_delay) {
 			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(info->state->close_delay);
+			schedule_timeout(state->close_delay);
 			set_current_state(TASK_RUNNING);
 		}
-	} else {
-#ifdef CONFIG_PM
-		/*
-		 * Put device into D3 state.
-		 */
-		pm_send(info->state->pm, PM_SUSPEND, (void *)3);
-#else
-		if (port->ops->pm)
-			port->ops->pm(port, 3, 0);
-#endif
+	} else if (!uart_console(port)) {
+		uart_change_pm(state, 3);
 	}
 
 	/*
 	 * Wake up anyone trying to open this port.
 	 */
-	info->flags &= ~(UIF_NORMAL_ACTIVE|UIF_CLOSING);
-	wake_up_interruptible(&info->open_wait);
+	state->info->flags &= ~UIF_NORMAL_ACTIVE;
+	wake_up_interruptible(&state->info->open_wait);
 
  done:
-	module_put(drv->owner);
+	up(&state->sem);
 }
 
 static void uart_wait_until_sent(struct tty_struct *tty, int timeout)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_port *port = info->port;
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
 	unsigned long char_time, expire;
 
 	BUG_ON(!kernel_locked());
@@ -1358,23 +1371,22 @@
  */
 static void uart_hangup(struct tty_struct *tty)
 {
-	struct uart_info *info = tty->driver_data;
-	struct uart_state *state = info->state;
+	struct uart_state *state = tty->driver_data;
 
 	BUG_ON(!kernel_locked());
+	DPRINTK("uart_hangup(%d)\n", state->port->line);
 
-	uart_flush_buffer(tty);
-	down(&port_sem);
-	if (info->flags & UIF_CLOSING) {
-		up(&port_sem);
-		return;
+	down(&state->sem);
+	if (state->info && state->info->flags & UIF_NORMAL_ACTIVE) {
+		uart_flush_buffer(tty);
+		uart_shutdown(state);
+		state->count = 0;
+		state->info->flags &= ~UIF_NORMAL_ACTIVE;
+		state->info->tty = NULL;
+		wake_up_interruptible(&state->info->open_wait);
+		wake_up_interruptible(&state->info->delta_msr_wait);
 	}
-	uart_shutdown(info);
-	state->count = 0;
-	info->flags &= ~UIF_NORMAL_ACTIVE;
-	info->tty = NULL;
-	up(&port_sem);
-	wake_up_interruptible(&info->open_wait);
+	up(&state->sem);
 }
 
 /*
@@ -1383,18 +1395,15 @@
  * kernel settings, and the settings init adopts when it opens the port
  * for the first time.
  */
-static void uart_update_termios(struct uart_info *info)
+static void uart_update_termios(struct uart_state *state)
 {
-	struct tty_struct *tty = info->tty;
-
-#ifdef CONFIG_SERIAL_CORE_CONSOLE
-	struct console *c = info->port->cons;
+	struct tty_struct *tty = state->info->tty;
+	struct uart_port *port = state->port;
 
-	if (c && c->cflag && c->index == info->port->line) {
-		tty->termios->c_cflag = c->cflag;
-		c->cflag = 0;
+	if (uart_console(port) && port->cons->cflag) {
+		tty->termios->c_cflag = port->cons->cflag;
+		port->cons->cflag = 0;
 	}
-#endif
 
 	/*
 	 * If the device failed to grab its irq resources,
@@ -1405,22 +1414,26 @@
 		/*
 		 * Make termios settings take effect.
 		 */
-		uart_change_speed(info, NULL);
+		uart_change_speed(state, NULL);
 
 		/*
 		 * And finally enable the RTS and DTR signals.
 		 */
 		if (tty->termios->c_cflag & CBAUD)
-			uart_set_mctrl(info->port, TIOCM_DTR | TIOCM_RTS);
+			uart_set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
 	}
 }
 
+/*
+ * Block the open until the port is ready.  We must be called with
+ * the per-port semaphore held.
+ */
 static int
-uart_block_til_ready(struct file *filp, struct uart_info *info)
+uart_block_til_ready(struct file *filp, struct uart_state *state)
 {
 	DECLARE_WAITQUEUE(wait, current);
-	struct uart_state *state = info->state;
-	struct uart_port *port = info->port;
+	struct uart_info *info = state->info;
+	struct uart_port *port = state->port;
 
 	info->blocked_open++;
 	state->count--;
@@ -1432,18 +1445,10 @@
 		/*
 		 * If we have been hung up, tell userspace/restart open.
 		 */
-		if (tty_hung_up_p(filp))
+		if (tty_hung_up_p(filp) || info->tty == NULL)
 			break;
 
 		/*
-		 * If the device is in the middle of being closed, block
-		 * until it's done.  We will need to re-initialise the
-		 * port.  Hmm, is it legal to block a non-blocking open?
-		 */
-		if (info->flags & UIF_CLOSING)
-			goto wait;
-
-		/*
 		 * If the port has been closed, tell userspace/restart open.
 		 */
 		if (!(info->flags & UIF_INITIALIZED))
@@ -1470,7 +1475,7 @@
 		 * the data from the modem.
 		 */
 		if (info->tty->termios->c_cflag & CBAUD)
-			uart_set_mctrl(info->port, TIOCM_DTR);
+			uart_set_mctrl(port, TIOCM_DTR);
 
 		/*
 		 * and wait for the carrier to indicate that the
@@ -1479,8 +1484,9 @@
 		if (port->ops->get_mctrl(port) & TIOCM_CAR)
 			break;
 
-	 wait:
+		up(&state->sem);
 		schedule();
+		down(&state->sem);
 
 		if (signal_pending(current))
 			break;
@@ -1494,52 +1500,56 @@
 	if (signal_pending(current))
 		return -ERESTARTSYS;
 
-	if (info->tty->flags & (1 << TTY_IO_ERROR))
-		return 0;
-
-	if (tty_hung_up_p(filp) || !(info->flags & UIF_INITIALIZED))
+	if (!info->tty || tty_hung_up_p(filp))
 		return (port->flags & UPF_HUP_NOTIFY) ?
 			-EAGAIN : -ERESTARTSYS;
 
 	return 0;
 }
 
-static struct uart_info *uart_get(struct uart_driver *drv, int line)
+static struct uart_state *uart_get(struct uart_driver *drv, int line)
 {
-	struct uart_state *state = drv->state + line;
-	struct uart_info *info = NULL;
+	struct uart_state *state;
 
 	down(&port_sem);
-	if (!state->port)
+	state = drv->state + line;
+	if (down_interruptible(&state->sem)) {
+		state = ERR_PTR(-ERESTARTSYS);
 		goto out;
+	}
 
 	state->count++;
-	info = state->info;
+	if (!state->port) {
+		state->count--;
+		up(&state->sem);
+		state = ERR_PTR(-ENXIO);
+		goto out;
+	}
 
-	if (!info) {
-		info = kmalloc(sizeof(struct uart_info), GFP_KERNEL);
-		if (info) {
-			memset(info, 0, sizeof(struct uart_info));
-			init_waitqueue_head(&info->open_wait);
-			init_waitqueue_head(&info->delta_msr_wait);
+	if (!state->info) {
+		state->info = kmalloc(sizeof(struct uart_info), GFP_KERNEL);
+		if (state->info) {
+			memset(state->info, 0, sizeof(struct uart_info));
+			init_waitqueue_head(&state->info->open_wait);
+			init_waitqueue_head(&state->info->delta_msr_wait);
 
 			/*
 			 * Link the info into the other structures.
 			 */
-			info->port  = state->port;
-			info->state = state;
-			state->port->info = info;
-
-			tasklet_init(&info->tlet, uart_tasklet_action,
-				     (unsigned long)info);
-			state->info = info;
-		} else
+			state->port->info = state->info;
+
+			tasklet_init(&state->info->tlet, uart_tasklet_action,
+				     (unsigned long)state);
+		} else {
 			state->count--;
+			up(&state->sem);
+			state = ERR_PTR(-ENOMEM);
+		}
 	}
 
  out:
 	up(&port_sem);
-	return info;
+	return state;
 }
 
 /*
@@ -1555,11 +1565,10 @@
 static int uart_open(struct tty_struct *tty, struct file *filp)
 {
 	struct uart_driver *drv = (struct uart_driver *)tty->driver.driver_state;
-	struct uart_info *info;
+	struct uart_state *state;
 	int retval, line = minor(tty->device) - tty->driver.minor_start;
 
 	BUG_ON(!kernel_locked());
-
 	DPRINTK("uart_open(%d) called\n", line);
 
 	/*
@@ -1572,92 +1581,66 @@
 		goto fail;
 
 	/*
-	 * If we fail to increment the module use count, we can't have
-	 * any other users of this tty (since this implies that the module
-	 * is about to be unloaded).  Therefore, it is safe to set
-	 * tty->driver_data to be NULL, so uart_close() doesn't bite us.
-	 */
-	if (!try_module_get(drv->owner)) {
-		tty->driver_data = NULL;
+	 * We take the semaphore inside uart_get to guarantee that we won't
+	 * be re-entered while allocating the info structure, or while we
+	 * request any IRQs that the driver may need.  This also has the nice
+	 * side-effect that it delays the action of uart_hangup, so we can
+	 * guarantee that info->tty will always contain something reasonable.
+	 */
+	state = uart_get(drv, line);
+	if (IS_ERR(state)) {
+		retval = PTR_ERR(state);
 		goto fail;
 	}
 
 	/*
-	 * FIXME: This one isn't fun.  We can't guarantee that the tty isn't
-	 * already in open, nor can we guarantee the state of tty->driver_data
-	 */
-	info = uart_get(drv, line);
-	retval = -ENOMEM;
-	if (!info) {
-		if (tty->driver_data)
-			goto fail;
-		else
-			goto out;
-	}
-
-	/*
 	 * Once we set tty->driver_data here, we are guaranteed that
 	 * uart_close() will decrement the driver module use count.
 	 * Any failures from here onwards should not touch the count.
 	 */
-	tty->driver_data = info;
-	tty->low_latency = (info->port->flags & UPF_LOW_LATENCY) ? 1 : 0;
+	tty->driver_data = state;
+	tty->low_latency = (state->port->flags & UPF_LOW_LATENCY) ? 1 : 0;
 	tty->alt_speed = 0;
-	info->tty = tty;
+	state->info->tty = tty;
 
 	/*
 	 * If the port is in the middle of closing, bail out now.
 	 */
-	if (tty_hung_up_p(filp) || (info->flags & UIF_CLOSING)) {
-	    	wait_event_interruptible(info->open_wait,
-					 !(info->flags & UIF_CLOSING));
-		retval = (info->port->flags & UPF_HUP_NOTIFY) ?
+	if (tty_hung_up_p(filp)) {
+		retval = (state->port->flags & UPF_HUP_NOTIFY) ?
 			-EAGAIN : -ERESTARTSYS;
+		state->count--;
+		up(&state->sem);
 		goto fail;
 	}
 
 	/*
 	 * Make sure the device is in D0 state.
 	 */
-	if (info->state->count == 1) {
-#ifdef CONFIG_PM
-		pm_send(info->state->pm, PM_RESUME, (void *)0);
-#else
-		struct uart_port *port = info->port;
-		if (port->ops->pm)
-			port->ops->pm(port, 0, 3);
-#endif
-	}
+	if (state->count == 1)
+		uart_change_pm(state, 0);
 
 	/*
-	 * Start up the serial port.  We have this semaphore here to
-	 * prevent uart_startup or uart_shutdown being re-entered if
-	 * we sleep while requesting an IRQ.
+	 * Start up the serial port.
 	 */
-	down(&port_sem);
-	retval = uart_startup(info, 0);
-	up(&port_sem);
-	if (retval)
-		goto fail;
+	retval = uart_startup(state, 0);
 
 	/*
-	 * Wait until the port is ready.
+	 * If we succeeded, wait until the port is ready.
 	 */
-	retval = uart_block_til_ready(filp, info);
+	if (retval == 0)
+		retval = uart_block_til_ready(filp, state);
+	up(&state->sem);
 
 	/*
 	 * If this is the first open to succeed, adjust things to suit.
 	 */
-	if (retval == 0 && !(info->flags & UIF_NORMAL_ACTIVE)) {
-		info->flags |= UIF_NORMAL_ACTIVE;
+	if (retval == 0 && !(state->info->flags & UIF_NORMAL_ACTIVE)) {
+		state->info->flags |= UIF_NORMAL_ACTIVE;
 
-		uart_update_termios(info);
+		uart_update_termios(state);
 	}
 
-	return retval;
-
- out:
-	module_put(drv->owner);
  fail:
 	return retval;
 }
@@ -1892,115 +1875,98 @@
 }
 #endif /* CONFIG_SERIAL_CORE_CONSOLE */
 
-#ifdef CONFIG_PM
-/*
- *  Serial port power management.
- *
- * This is pretty coarse at the moment - either all on or all off.  We
- * should probably some day do finer power management here some day.
- *
- * We don't actually save any state; the serial driver already has the
- * state held internally to re-setup the port when we come out of D3.
- */
-static int uart_pm_set_state(struct uart_state *state, int pm_state, int oldstate)
+static void uart_change_pm(struct uart_state *state, int pm_state)
 {
-	struct uart_port *port;
-	struct uart_ops *ops;
-	int running = state->info &&
-		      state->info->flags & UIF_INITIALIZED;
+	struct uart_port *port = state->port;
+	if (port->ops->pm)
+		port->ops->pm(port, pm_state, state->pm_state);
+	state->pm_state = pm_state;
+}
 
-	down(&port_sem);
+int uart_suspend_port(struct uart_driver *drv, struct uart_port *port, u32 level)
+{
+	struct uart_state *state = drv->state + port->line;
 
-	if (!state->port || state->port->type == PORT_UNKNOWN) {
-		up(&port_sem);
-		return 0;
-	}
+	down(&state->sem);
 
-	port = state->port;
-	ops = port->ops;
+	switch (level) {
+	case SUSPEND_SAVE_STATE:
+		if (state->info && state->info->flags & UIF_INITIALIZED) {
+			struct uart_ops *ops = port->ops;
 
-	DPRINTK("pm: %08x: %d -> %d, %srunning\n",
-		port->iobase, dev->state, pm_state, running ? "" : "not ");
+			spin_lock_irq(&port->lock);
+			ops->stop_tx(port, 0);
+			ops->set_mctrl(port, 0);
+			ops->stop_rx(port);
+			spin_unlock_irq(&port->lock);
 
-	if (pm_state == 0) {
-		if (ops->pm)
-			ops->pm(port, pm_state, oldstate);
-		if (running) {
 			/*
-			 * The port lock isn't taken here -
-			 * the port isn't initialised.
+			 * Wait for the transmitter to empty.
 			 */
-			ops->set_mctrl(port, 0);
-			ops->startup(port);
-			uart_change_speed(state->info, NULL);
-			spin_lock_irq(&port->lock);
-			ops->set_mctrl(port, port->mctrl);
-			ops->start_tx(port, 0);
-			spin_unlock_irq(&port->lock);
+			while (!ops->tx_empty(port)) {
+				set_current_state(TASK_UNINTERRUPTIBLE);
+				schedule_timeout(10*HZ/1000);
+			}
+			set_current_state(TASK_RUNNING);
+
+			ops->shutdown(port);
 		}
+		break;
 
-		/*
-		 * Re-enable the console device after suspending.
-		 */
-		if (port->cons && port->cons->index == port->line)
-			port->cons->flags |= CON_ENABLED;
-	} else if (pm_state == 1) {
-		if (ops->pm)
-			ops->pm(port, pm_state, oldstate);
-	} else {
+	case SUSPEND_POWER_DOWN:
 		/*
 		 * Disable the console device before suspending.
 		 */
-		if (port->cons && port->cons->index == port->line)
+		if (uart_console(port))
 			port->cons->flags &= ~CON_ENABLED;
 
-		if (running) {
-			spin_lock_irq(&port->lock);
-			ops->stop_tx(port, 0);
-			ops->set_mctrl(port, 0);
-			ops->stop_rx(port);
-			spin_unlock_irq(&port->lock);
-			ops->shutdown(port);
-		}
-		if (ops->pm)
-			ops->pm(port, pm_state, oldstate);
+		uart_change_pm(state, 3);
+		break;
 	}
-	up(&port_sem);
+
+	up(&state->sem);
 
 	return 0;
 }
 
-/*
- *  Wakeup support.
- */
-static int uart_pm_set_wakeup(struct uart_state *state, int data)
+int uart_resume_port(struct uart_driver *drv, struct uart_port *port, u32 level)
 {
-	int err = 0;
-
-	if (state->port->ops->set_wake)
-		err = state->port->ops->set_wake(state->port, data);
+	struct uart_state *state = drv->state + port->line;
 
-	return err;
-}
+	down(&state->sem);
 
-static int uart_pm(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
-	struct uart_state *state = dev->data;
-	int err = 0;
+	switch (level) {
+	case RESUME_POWER_ON:
+		uart_change_pm(state, 0);
 
-	switch (rqst) {
-	case PM_SUSPEND:
-	case PM_RESUME:
-		err = uart_pm_set_state(state, (int)(long)data, dev->state);
+		/*
+		 * Re-enable the console device after suspending.
+		 */
+		if (uart_console(port)) {
+			uart_change_speed(state, NULL);
+			port->cons->flags |= CON_ENABLED;
+		}
 		break;
 
-	case PM_SET_WAKEUP:
-		err = uart_pm_set_wakeup(state, (int)(long)data);
+	case RESUME_RESTORE_STATE:
+		if (state->info && state->info->flags & UIF_INITIALIZED) {
+			struct uart_ops *ops = port->ops;
+
+			ops->set_mctrl(port, 0);
+			ops->startup(port);
+			uart_change_speed(state, NULL);
+			spin_lock_irq(&port->lock);
+			ops->set_mctrl(port, port->mctrl);
+			ops->start_tx(port, 0);
+			spin_unlock_irq(&port->lock);
+		}
 		break;
 	}
-	return err;
+
+	up(&state->sem);
+
+	return 0;
 }
-#endif
 
 static inline void
 uart_report_port(struct uart_driver *drv, struct uart_port *port)
@@ -2022,17 +1988,11 @@
 }
 
 static void
-__uart_register_port(struct uart_driver *drv, struct uart_state *state,
-		     struct uart_port *port)
+uart_configure_port(struct uart_driver *drv, struct uart_state *state,
+		    struct uart_port *port)
 {
 	unsigned int flags;
 
-	state->port = port;
-
-	spin_lock_init(&port->lock);
-	port->cons = drv->cons;
-	port->info = state->info;
-
 	/*
 	 * If there isn't a port here, don't do anything further.
 	 */
@@ -2051,12 +2011,6 @@
 		port->ops->config_port(port, flags);
 	}
 
-	/*
-	 * Register the port whether it's detected or not.  This allows
-	 * setserial to be used to alter this ports parameters.
-	 */
-	tty_register_device(drv->tty_driver, drv->minor + port->line);
-
 	if (port->type != PORT_UNKNOWN) {
 		unsigned long flags;
 
@@ -2070,51 +2024,33 @@
 		port->ops->set_mctrl(port, 0);
 		spin_unlock_irqrestore(&port->lock, flags);
 
-#ifdef CONFIG_PM
 		/*
 		 * Power down all ports by default, except the
-		 * console if we have one.  We need to drop the
-		 * port semaphore here.
+		 * console if we have one.
 		 */
-		if (state->pm && (!drv->cons || port->line != drv->cons->index)) {
-			up(&port_sem);
-			pm_send(state->pm, PM_SUSPEND, (void *)3);
-			down(&port_sem);
-		}
-#endif
+		if (!uart_console(port))
+			uart_change_pm(state, 3);
 	}
 }
 
 /*
- *	Hangup the port.  This must be done outside the port_sem
- *	since uart_hangup() grabs this same semaphore.  Grr.
+ * This reverses the affects of uart_configure_port, hanging up the
+ * port before removal.
  */
 static void
-__uart_hangup_port(struct uart_driver *drv, struct uart_state *state)
+uart_unconfigure_port(struct uart_driver *drv, struct uart_state *state)
 {
+	struct uart_port *port = state->port;
 	struct uart_info *info = state->info;
 
 	if (info && info->tty)
 		tty_vhangup(info->tty);
-}
 
-/*
- * This reverses the affects of __uart_register_port.
- */
-static void
-__uart_unregister_port(struct uart_driver *drv, struct uart_state *state)
-{
-	struct uart_port *port = state->port;
-	struct uart_info *info = state->info;
+	down(&state->sem);
 
 	state->info = NULL;
 
 	/*
-	 * Remove the devices from devfs
-	 */
-	tty_unregister_device(drv->tty_driver, drv->minor + port->line);
-
-	/*
 	 * Free the port IO and memory resources, if any.
 	 */
 	if (port->type != PORT_UNKNOWN)
@@ -2132,6 +2068,8 @@
 		tasklet_kill(&info->tlet);
 		kfree(info);
 	}
+
+	up(&state->sem);
 }
 
 /**
@@ -2186,6 +2124,7 @@
 	drv->tty_driver = normal;
 
 	normal->magic		= TTY_DRIVER_MAGIC;
+	normal->owner		= drv->owner;
 	normal->driver_name	= drv->driver_name;
 	normal->name		= drv->dev_name;
 	normal->major		= drv->major;
@@ -2232,20 +2171,13 @@
 
 		state->close_delay     = 5 * HZ / 10;
 		state->closing_wait    = 30 * HZ;
-#ifdef CONFIG_PM
-		state->pm = pm_register(PM_SYS_DEV, PM_SYS_COM, uart_pm);
-		if (state->pm)
-			state->pm->data = state;
-#endif
+
+		init_MUTEX(&state->sem);
 	}
 
 	retval = tty_register_driver(normal);
  out:
 	if (retval < 0) {
-#ifdef CONFIG_PM
-		for (i = 0; i < drv->nr; i++)
-			pm_unregister(drv->state[i].pm);
-#endif
 		kfree(normal);
 		kfree(drv->state);
 		kfree(termios);
@@ -2264,11 +2196,6 @@
  */
 void uart_unregister_driver(struct uart_driver *drv)
 {
-	int i;
-
-	for (i = 0; i < drv->nr; i++)
-		pm_unregister(drv->state[i].pm);
-
 	tty_unregister_driver(drv->tty_driver);
 
 	kfree(drv->state);
@@ -2289,6 +2216,7 @@
 int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
 {
 	struct uart_state *state;
+	int ret = 0;
 
 	BUG_ON(in_interrupt());
 
@@ -2298,10 +2226,29 @@
 	state = drv->state + port->line;
 
 	down(&port_sem);
-	__uart_register_port(drv, state, port);
+	if (state->port) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	state->port = port;
+
+	spin_lock_init(&port->lock);
+	port->cons = drv->cons;
+	port->info = state->info;
+
+	uart_configure_port(drv, state, port);
+
+	/*
+	 * Register the port whether it's detected or not.  This allows
+	 * setserial to be used to alter this ports parameters.
+	 */
+	tty_register_device(drv->tty_driver, drv->minor + port->line);
+
+ out:
 	up(&port_sem);
 
-	return 0;
+	return ret;
 }
 
 /**
@@ -2323,10 +2270,14 @@
 		printk(KERN_ALERT "Removing wrong port: %p != %p\n",
 			state->port, port);
 
-	__uart_hangup_port(drv, state);
-
 	down(&port_sem);
-	__uart_unregister_port(drv, state);
+
+	/*
+	 * Remove the devices from devfs
+	 */
+	tty_unregister_device(drv->tty_driver, drv->minor + port->line);
+
+	uart_unconfigure_port(drv, state);
 	state->port = NULL;
 	up(&port_sem);
 
@@ -2426,8 +2377,7 @@
 		 * alter it underneath itself - the port may be open and
 		 * trying to do useful work.
 		 */
-		if (state->count != 0 ||
-		    (state->info && state->info->blocked_open != 0)) {
+		if (uart_users(state) != 0) {
 			ret = -EBUSY;
 			goto out;
 		}
@@ -2447,7 +2397,7 @@
 			state->port->line     = state - drv->state;
 			state->port->mapbase  = port->mapbase;
 
-			__uart_register_port(drv, state, state->port);
+			uart_configure_port(drv, state, state->port);
 		}
 
 		ret = state->port->line;
@@ -2479,16 +2429,16 @@
 
 	state = drv->state + line;
 
-	__uart_hangup_port(drv, state);
-
 	down(&port_sem);
-	__uart_unregister_port(drv, state);
+	uart_unconfigure_port(drv, state);
 	up(&port_sem);
 }
 
 EXPORT_SYMBOL(uart_write_wakeup);
 EXPORT_SYMBOL(uart_register_driver);
 EXPORT_SYMBOL(uart_unregister_driver);
+EXPORT_SYMBOL(uart_suspend_port);
+EXPORT_SYMBOL(uart_resume_port);
 EXPORT_SYMBOL(uart_register_port);
 EXPORT_SYMBOL(uart_unregister_port);
 EXPORT_SYMBOL(uart_add_one_port);
diff -urN linux-2.5.64-bk10/drivers/serial/sa1100.c linux-2.5.64-bk11/drivers/serial/sa1100.c
--- linux-2.5.64-bk10/drivers/serial/sa1100.c	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/drivers/serial/sa1100.c	Mon Mar 31 12:34:56 2003
@@ -32,6 +32,7 @@
 #include <linux/serial.h>
 #include <linux/console.h>
 #include <linux/sysrq.h>
+#include <linux/device.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -857,12 +858,54 @@
 	.cons			= SA1100_CONSOLE,
 };
 
+static int sa1100_serial_suspend(struct device *dev, u32 state, u32 level)
+{
+	int i;
+
+	for (i = 0; i < NR_PORTS; i++)
+		uart_suspend_port(&sa1100_reg, &sa1100_ports[i].port, level);
+
+	return 0;
+}
+
+static int sa1100_serial_resume(struct device *dev, u32 level)
+{
+	int i;
+
+	for (i = 0; i < NR_PORTS; i++)
+		uart_resume_port(&sa1100_reg, &sa1100_ports[i].port, level);
+
+	return 0;
+}
+
+static struct device_driver sa11x0_serial_driver = {
+	.name		= "sa11x0_serial",
+	.bus		= &system_bus_type,
+	.devclass	= &tty_devclass,
+	.suspend	= sa1100_serial_suspend,
+	.resume		= sa1100_serial_resume,
+};
+
+/*
+ * This "device" covers _all_ ISA 8250-compatible serial devices.
+ */
+static struct sys_device sa11x0_serial_devs = {
+	.name		= "sa11x0_serial",
+	.id		= 0,
+	.dev = {
+		.driver	= &sa11x0_serial_driver,
+	},
+};
+
 static int __init sa1100_serial_init(void)
 {
 	int ret;
 
 	printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.50 $\n");
 
+	driver_register(&sa11x0_serial_driver);
+	sys_device_register(&sa11x0_serial_devs);
+
 	sa1100_init_ports();
 	ret = uart_register_driver(&sa1100_reg);
 	if (ret == 0) {
diff -urN linux-2.5.64-bk10/fs/Kconfig linux-2.5.64-bk11/fs/Kconfig
--- linux-2.5.64-bk10/fs/Kconfig	Tue Mar  4 19:29:22 2003
+++ linux-2.5.64-bk11/fs/Kconfig	Mon Mar 31 12:34:56 2003
@@ -4,89 +4,180 @@
 
 menu "File systems"
 
-config QUOTA
-	bool "Quota support"
+config EXT2_FS
+	tristate "Second extended fs support"
 	help
-	  If you say Y here, you will be able to set per user limits for disk
-	  usage (also called disk quotas). Currently, it works for the
-	  ext2, ext3, and reiserfs file system. You need additional software
-	  in order to use quota support (you can download sources from
-	  <http://www.sf.net/projects/linuxquota/>). For further details, read
-	  the Quota mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>. Probably the quota
-	  support is only useful for multi user systems. If unsure, say N.
+	  This is the de facto standard Linux file system (method to organize
+	  files on a storage device) for hard disks.
 
-config QFMT_V1
-	tristate "Old quota format support"
-	depends on QUOTA
+	  You want to say Y here, unless you intend to use Linux exclusively
+	  from inside a DOS partition using the UMSDOS file system. The
+	  advantage of the latter is that you can get away without
+	  repartitioning your hard drive (which often implies backing
+	  everything up and restoring afterwards); the disadvantage is that
+	  Linux becomes susceptible to DOS viruses and that UMSDOS is somewhat
+	  slower than ext2fs. Even if you want to run Linux in this fashion,
+	  it might be a good idea to have ext2fs around: it enables you to
+	  read more floppy disks and facilitates the transition to a *real*
+	  Linux partition later. Another (rare) case which doesn't require
+	  ext2fs is a diskless Linux box which mounts all files over the
+	  network using NFS (in this case it's sufficient to say Y to "NFS
+	  file system support" below). Saying Y here will enlarge your kernel
+	  by about 44 KB.
+
+	  The Ext2fs-Undeletion mini-HOWTO, available from
+	  <http://www.linuxdoc.org/docs.html#howto>, gives information about
+	  how to retrieve deleted files on ext2fs file systems.
+
+	  To change the behavior of ext2 file systems, you can use the tune2fs
+	  utility ("man tune2fs"). To modify attributes of files and
+	  directories on ext2 file systems, use chattr ("man chattr").
+
+	  Ext2fs partitions can be read from within DOS using the ext2tool
+	  command line tool package (available from
+	  <ftp://ibiblio.org/pub/Linux/system/filesystems/ext2/>) and from
+	  within Windows NT using the ext2nt command line tool package from
+	  <ftp://ibiblio.org/pub/Linux/utils/dos/>.  Explore2fs is a
+	  graphical explorer for ext2fs partitions which runs on Windows 95
+	  and Windows NT and includes experimental write support; it is
+	  available from
+	  <http://jnewbigin-pc.it.swin.edu.au/Linux/Explore2fs.htm>.
+
+	  If you want to compile this file system as a module ( = code which
+	  can be inserted in and removed from the running kernel whenever you
+	  want), say M here and read <file:Documentation/modules.txt>.  The
+	  module will be called ext2.  Be aware however that the file system
+	  of your root partition (the one containing the directory /) cannot
+	  be compiled as a module, and so this could be dangerous.  Most
+	  everyone wants to say Y here.
+
+config EXT2_FS_XATTR
+	bool "Ext2 extended attributes"
+	depends on EXT2_FS
 	help
-	  This quota format was (is) used by kernels earlier than 2.4.??. If
-	  you have quota working and you don't want to convert to new quota
-	  format say Y here.
+	  Extended attributes are name:value pairs associated with inodes by
+	  the kernel or by users (see the attr(5) manual page, or visit
+	  <http://acl.bestbits.at/> for details).
 
-config QFMT_V2
-	tristate "Quota format v2 support"
-	depends on QUOTA
+	  If unsure, say N.
+
+config EXT2_FS_POSIX_ACL
+	bool "Ext2 POSIX Access Control Lists"
+	depends on EXT2_FS_XATTR
 	help
-	  This quota format allows using quotas with 32-bit UIDs/GIDs. If you
-	  need this functionality say Y here. Note that you will need latest
-	  quota utilities for new quota format with this kernel.
+	  Posix Access Control Lists (ACLs) support permissions for users and
+	  groups beyond the owner/group/world scheme.
 
-config QUOTACTL
-	bool
-	depends on XFS_QUOTA || QUOTA
+	  To learn more about Access Control Lists, visit the Posix ACLs for
+	  Linux website <http://acl.bestbits.at/>.
+
+	  If you don't know what Access Control Lists are, say N
+
+config EXT3_FS
+	tristate "Ext3 journalling file system support"
+	help
+	  This is the journaling version of the Second extended file system
+	  (often called ext3), the de facto standard Linux file system
+	  (method to organize files on a storage device) for hard disks.
+
+	  The journaling code included in this driver means you do not have
+	  to run e2fsck (file system checker) on your file systems after a
+	  crash.  The journal keeps track of any changes that were being made
+	  at the time the system crashed, and can ensure that your file system
+	  is consistent without the need for a lengthy check.
+
+	  Other than adding the journal to the file system, the on-disk format
+	  of ext3 is identical to ext2.  It is possible to freely switch
+	  between using the ext3 driver and the ext2 driver, as long as the
+	  file system has been cleanly unmounted, or e2fsck is run on the file
+	  system.
+
+	  To add a journal on an existing ext2 file system or change the
+	  behavior of ext3 file systems, you can use the tune2fs utility ("man
+	  tune2fs").  To modify attributes of files and directories on ext3
+	  file systems, use chattr ("man chattr").  You need to be using
+	  e2fsprogs version 1.20 or later in order to create ext3 journals
+	  (available at <http://sourceforge.net/projects/e2fsprogs/>).
+
+	  If you want to compile this file system as a module ( = code which
+	  can be inserted in and removed from the running kernel whenever you
+	  want), say M here and read <file:Documentation/modules.txt>.  The
+	  module will be called ext3.  Be aware however that the file system
+	  of your root partition (the one containing the directory /) cannot
+	  be compiled as a module, and so this may be dangerous.
+
+config EXT3_FS_XATTR
+	bool "Ext3 extended attributes"
+	depends on EXT3_FS
 	default y
+	help
+	  Extended attributes are name:value pairs associated with inodes by
+	  the kernel or by users (see the attr(5) manual page, or visit
+	  <http://acl.bestbits.at/> for details).
 
-config AUTOFS_FS
-	tristate "Kernel automounter support"
-	---help---
-	  The automounter is a tool to automatically mount remote file systems
-	  on demand. This implementation is partially kernel-based to reduce
-	  overhead in the already-mounted case; this is unlike the BSD
-	  automounter (amd), which is a pure user space daemon.
+	  If unsure, say N.
 
-	  To use the automounter you need the user-space tools from the autofs
-	  package; you can find the location in <file:Documentation/Changes>.
-	  You also want to answer Y to "NFS file system support", below.
+	  You need this for POSIX ACL support on ext3.
 
-	  If you want to use the newer version of the automounter with more
-	  features, say N here and say Y to "Kernel automounter v4 support",
-	  below.
+config EXT3_FS_POSIX_ACL
+	bool "Ext3 POSIX Access Control Lists"
+	depends on EXT3_FS_XATTR
+	help
+	  Posix Access Control Lists (ACLs) support permissions for users and
+	  groups beyond the owner/group/world scheme.
 
-	  If you want to compile this as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called autofs.
+	  To learn more about Access Control Lists, visit the Posix ACLs for
+	  Linux website <http://acl.bestbits.at/>.
 
-	  If you are not a part of a fairly large, distributed network, you
-	  probably do not need an automounter, and can say N here.
+	  If you don't know what Access Control Lists are, say N
 
-config AUTOFS4_FS
-	tristate "Kernel automounter version 4 support (also supports v3)"
-	---help---
-	  The automounter is a tool to automatically mount remote file systems
-	  on demand. This implementation is partially kernel-based to reduce
-	  overhead in the already-mounted case; this is unlike the BSD
-	  automounter (amd), which is a pure user space daemon.
+config JBD
+# CONFIG_JBD could be its own option (even modular), but until there are
+# other users than ext3, we will simply make it be the same as CONFIG_EXT3_FS
+# dep_tristate '  Journal Block Device support (JBD for ext3)' CONFIG_JBD $CONFIG_EXT3_FS
+	bool
+	default EXT3_FS
+	help
+	  This is a generic journaling layer for block devices.  It is
+	  currently used by the ext3 file system, but it could also be used to
+	  add journal support to other file systems or block devices such as
+	  RAID or LVM.
 
-	  To use the automounter you need the user-space tools from
-	  <ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4/>; you also
-	  want to answer Y to "NFS file system support", below.
+	  If you are using the ext3 file system, you need to say Y here. If
+	  you are not using ext3 then you will probably want to say N.
 
-	  If you want to compile this as a module ( = code which can be
+	  If you want to compile this device as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
 	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called autofs4.  You will need to add "alias autofs
-	  autofs4" to your modules configuration file.
+	  will be called jbd.  If you are compiling ext3 into the kernel,
+	  you cannot compile this code as a module.
 
-	  If you are not a part of a fairly large, distributed network or
-	  don't have a laptop which needs to dynamically reconfigure to the
-	  local network, you probably do not need an automounter, and can say
-	  N here.
+config JBD_DEBUG
+	bool "JBD (ext3) debugging support"
+	depends on JBD
+	help
+	  If you are using the ext3 journaled file system (or potentially any
+	  other file system/device using JBD), this option allows you to
+	  enable debugging output while the system is running, in order to
+	  help track down any problems you are having.  By default the
+	  debugging output will be turned off.
+
+	  If you select Y here, then you will be able to turn on debugging
+	  with "echo N > /proc/sys/fs/jbd-debug", where N is a number between
+	  1 and 5, the higher the number, the more debugging output is
+	  generated.  To turn debugging off again, do
+	  "echo 0 > /proc/sys/fs/jbd-debug".
+
+config FS_MBCACHE
+# Meta block cache for Extended Attributes (ext2/ext3)
+	tristate
+	depends on EXT2_FS_XATTR || EXT3_FS_XATTR
+	default y if EXT2_FS=y || EXT3_FS=y
+	default m if EXT2_FS=m || EXT3_FS=m
 
 config REISERFS_FS
 	tristate "Reiserfs support"
-	---help---
+	help
 	  Stores not just filenames but the files themselves in a balanced
 	  tree.  Uses journaling.
 
@@ -135,40 +226,653 @@
 	  Almost everyone but ReiserFS developers and people fine-tuning
 	  reiserfs or tracing problems should say N.
 
-config ADFS_FS
-	tristate "ADFS file system support (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
-	---help---
-	  The Acorn Disc Filing System is the standard file system of the
-	  RiscOS operating system which runs on Acorn's ARM-based Risc PC
-	  systems and the Acorn Archimedes range of machines. If you say Y
-	  here, Linux will be able to read from ADFS partitions on hard drives
-	  and from ADFS-formatted floppy discs. If you also want to be able to
-	  write to those devices, say Y to "ADFS write support" below.
+config JFS_FS
+	tristate "JFS filesystem support"
+	help
+	  This is a port of IBM's Journaled Filesystem .  More information is
+	  available in the file Documentation/filesystems/jfs.txt.
 
-	  The ADFS partition should be the first partition (i.e.,
-	  /dev/[hs]d?1) on each of your drives. Please read the file
-	  <file:Documentation/filesystems/adfs.txt> for further details.
+	  If you do not intend to use the JFS filesystem, say N.
 
-	  This code is also available as a module called adfs ( = code which
-	  can be inserted in and removed from the running kernel whenever you
-	  want). If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.
+config JFS_POSIX_ACL
+	bool "JFS POSIX Access Control Lists"
+	depends on JFS_FS
+	help
+	  Posix Access Control Lists (ACLs) support permissions for users and
+	  groups beyond the owner/group/world scheme.
 
-	  If unsure, say N.
+	  To learn more about Access Control Lists, visit the Posix ACLs for
+	  Linux website <http://acl.bestbits.at/>.
 
-config ADFS_FS_RW
-	bool "ADFS write support (DANGEROUS)"
-	depends on ADFS_FS
-	help
-	  If you say Y here, you will be able to write to ADFS partitions on
-	  hard drives and ADFS-formatted floppy disks. This is experimental
-	  codes, so if you're unsure, say N.
+	  If you don't know what Access Control Lists are, say N
 
-config AFFS_FS
+config JFS_DEBUG
+	bool "JFS debugging"
+	depends on JFS_FS
+	help
+	  If you are experiencing any problems with the JFS filesystem, say
+	  Y here.  This will result in additional debugging messages to be
+	  written to the system log.  Under normal circumstances, this
+	  results in very little overhead.
+
+config JFS_STATISTICS
+	bool "JFS statistics"
+	depends on JFS_FS
+	help
+	  Enabling this option will cause statistics from the JFS file system
+	  to be made available to the user in the /proc/fs/jfs/ directory.
+
+config FS_POSIX_ACL
+# Posix ACL utility routines (for now, only ext2/ext3/jfs)
+#
+# NOTE: you can implement Posix ACLs without these helpers (XFS does).
+# 	Never use this symbol for ifdefs.
+#
+	bool
+	depends on EXT2_FS_POSIX_ACL || EXT3_FS_POSIX_ACL || JFS_POSIX_ACL
+	default y
+
+config XFS_FS
+	tristate "XFS filesystem support"
+	help
+	  XFS is a high performance journaling filesystem which originated
+	  on the SGI IRIX platform.  It is completely multi-threaded, can
+	  support large files and large filesystems, extended attributes,
+	  variable block sizes, is extent based, and makes extensive use of
+	  Btrees (directories, extents, free space) to aid both performance
+	  and scalability.
+
+	  Refer to the documentation at <http://oss.sgi.com/projects/xfs/>
+	  for complete details.  This implementation is on-disk compatible
+	  with the IRIX version of XFS.
+
+	  If you want to compile this file system as a module ( = code which
+	  can be inserted in and removed from the running kernel whenever you
+	  want), say M here and read <file:Documentation/modules.txt>. The
+	  module will be called xfs.  Be aware, however, that if the file
+	  system of your root partition is compiled as a module, you'll need
+	  to use an initial ramdisk (initrd) to boot.
+
+config XFS_RT
+	bool "Realtime support (EXPERIMENTAL)"
+	depends on XFS_FS && EXPERIMENTAL
+	help
+	  If you say Y here you will be able to mount and use XFS filesystems
+	  which contain a realtime subvolume. The realtime subvolume is a
+	  separate area of disk space where only file data is stored. The
+	  realtime subvolume is designed to provide very deterministic
+	  data rates suitable for media streaming applications.
+
+	  See the xfs man page in section 5 for a bit more information.
+
+	  This feature is unsupported at this time, is not yet fully
+	  functional, and may cause serious problems.
+
+	  If unsure, say N.
+
+config XFS_QUOTA
+	bool "Quota support"
+	depends on XFS_FS
+	help
+	  If you say Y here, you will be able to set limits for disk usage on
+	  a per user and/or a per group basis under XFS.  XFS considers quota
+	  information as filesystem metadata and uses journaling to provide a
+	  higher level guarantee of consistency.  The on-disk data format for
+	  quota is also compatible with the IRIX version of XFS, allowing a
+	  filesystem to be migrated between Linux and IRIX without any need
+	  for conversion.
+
+	  If unsure, say N.  More comprehensive documentation can be found in
+	  README.quota in the xfsprogs package.  XFS quota can be used either
+	  with or without the generic quota support enabled (CONFIG_QUOTA) -
+	  they are completely independent subsystems.
+
+config XFS_POSIX_ACL
+	bool "ACL support"
+	depends on XFS_FS
+	help
+	  Posix Access Control Lists (ACLs) support permissions for users and
+	  groups beyond the owner/group/world scheme.
+
+	  To learn more about Access Control Lists, visit the Posix ACLs for
+	  Linux website <http://acl.bestbits.at/>.
+
+	  If you don't know what Access Control Lists are, say N
+
+config MINIX_FS
+	tristate "Minix fs support"
+	help
+	  Minix is a simple operating system used in many classes about OS's.
+	  The minix file system (method to organize files on a hard disk
+	  partition or a floppy disk) was the original file system for Linux,
+	  but has been superseded by the second extended file system ext2fs.
+	  You don't want to use the minix file system on your hard disk
+	  because of certain built-in restrictions, but it is sometimes found
+	  on older Linux floppy disks.  This option will enlarge your kernel
+	  by about 28 KB. If unsure, say N.
+
+	  If you want to compile this as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>. The module
+	  will be called minix.  Note that the file system of your root
+	  partition (the one containing the directory /) cannot be compiled as
+	  a module.
+
+config ROMFS_FS
+	tristate "ROM file system support"
+	---help---
+	  This is a very small read-only file system mainly intended for
+	  initial ram disks of installation disks, but it could be used for
+	  other read-only media as well.  Read
+	  <file:Documentation/filesystems/romfs.txt> for details.
+
+	  This file system support is also available as a module ( = code
+	  which can be inserted in and removed from the running kernel
+	  whenever you want). The module is called romfs.  If you want to
+	  compile it as a module, say M here and read
+	  <file:Documentation/modules.txt>.  Note that the file system of your
+	  root partition (the one containing the directory /) cannot be a
+	  module.
+
+	  If you don't know whether you need it, then you don't need it:
+	  answer N.
+
+config HUGETLBFS
+	bool "HugeTLB file system support"
+	depends on HUGETLB_PAGE
+
+config QUOTA
+	bool "Quota support"
+	help
+	  If you say Y here, you will be able to set per user limits for disk
+	  usage (also called disk quotas). Currently, it works for the
+	  ext2, ext3, and reiserfs file system. You need additional software
+	  in order to use quota support (you can download sources from
+	  <http://www.sf.net/projects/linuxquota/>). For further details, read
+	  the Quota mini-HOWTO, available from
+	  <http://www.linuxdoc.org/docs.html#howto>. Probably the quota
+	  support is only useful for multi user systems. If unsure, say N.
+
+config QFMT_V1
+	tristate "Old quota format support"
+	depends on QUOTA
+	help
+	  This quota format was (is) used by kernels earlier than 2.4.??. If
+	  you have quota working and you don't want to convert to new quota
+	  format say Y here.
+
+config QFMT_V2
+	tristate "Quota format v2 support"
+	depends on QUOTA
+	help
+	  This quota format allows using quotas with 32-bit UIDs/GIDs. If you
+	  need this functionality say Y here. Note that you will need latest
+	  quota utilities for new quota format with this kernel.
+
+config QUOTACTL
+	bool
+	depends on XFS_QUOTA || QUOTA
+	default y
+
+config AUTOFS_FS
+	tristate "Kernel automounter support"
+	help
+	  The automounter is a tool to automatically mount remote file systems
+	  on demand. This implementation is partially kernel-based to reduce
+	  overhead in the already-mounted case; this is unlike the BSD
+	  automounter (amd), which is a pure user space daemon.
+
+	  To use the automounter you need the user-space tools from the autofs
+	  package; you can find the location in <file:Documentation/Changes>.
+	  You also want to answer Y to "NFS file system support", below.
+
+	  If you want to use the newer version of the automounter with more
+	  features, say N here and say Y to "Kernel automounter v4 support",
+	  below.
+
+	  If you want to compile this as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>.  The module
+	  will be called autofs.
+
+	  If you are not a part of a fairly large, distributed network, you
+	  probably do not need an automounter, and can say N here.
+
+config AUTOFS4_FS
+	tristate "Kernel automounter version 4 support (also supports v3)"
+	help
+	  The automounter is a tool to automatically mount remote file systems
+	  on demand. This implementation is partially kernel-based to reduce
+	  overhead in the already-mounted case; this is unlike the BSD
+	  automounter (amd), which is a pure user space daemon.
+
+	  To use the automounter you need the user-space tools from
+	  <ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4/>; you also
+	  want to answer Y to "NFS file system support", below.
+
+	  If you want to compile this as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>.  The module
+	  will be called autofs4.  You will need to add "alias autofs
+	  autofs4" to your modules configuration file.
+
+	  If you are not a part of a fairly large, distributed network or
+	  don't have a laptop which needs to dynamically reconfigure to the
+	  local network, you probably do not need an automounter, and can say
+	  N here.
+
+menu "CD-ROM/DVD Filesystems"
+
+config ISO9660_FS
+	tristate "ISO 9660 CDROM file system support"
+	help
+	  This is the standard file system used on CD-ROMs.  It was previously
+	  known as "High Sierra File System" and is called "hsfs" on other
+	  Unix systems.  The so-called Rock-Ridge extensions which allow for
+	  long Unix filenames and symbolic links are also supported by this
+	  driver.  If you have a CD-ROM drive and want to do more with it than
+	  just listen to audio CDs and watch its LEDs, say Y (and read
+	  <file:Documentation/filesystems/isofs.txt> and the CD-ROM-HOWTO,
+	  available from <http://www.linuxdoc.org/docs.html#howto>), thereby
+	  enlarging your kernel by about 27 KB; otherwise say N.
+
+	  If you want to compile this as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>.  The module
+	  will be called isofs.
+
+config JOLIET
+	bool "Microsoft Joliet CDROM extensions"
+	depends on ISO9660_FS
+	help
+	  Joliet is a Microsoft extension for the ISO 9660 CD-ROM file system
+	  which allows for long filenames in unicode format (unicode is the
+	  new 16 bit character code, successor to ASCII, which encodes the
+	  characters of almost all languages of the world; see
+	  <http://www.unicode.org/> for more information).  Say Y here if you
+	  want to be able to read Joliet CD-ROMs under Linux.
+
+config ZISOFS
+	bool "Transparent decompression extension"
+	depends on ISO9660_FS
+	help
+	  This is a Linux-specific extension to RockRidge which lets you store
+	  data in compressed form on a CD-ROM and have it transparently
+	  decompressed when the CD-ROM is accessed.  See
+	  <http://www.kernel.org/pub/linux/utils/fs/zisofs/> for the tools
+	  necessary to create such a filesystem.  Say Y here if you want to be
+	  able to read such compressed CD-ROMs.
+
+config ZISOFS_FS
+# for fs/nls/Config.in
+	tristate
+	depends on ZISOFS
+	default ISO9660_FS
+
+config UDF_FS
+	tristate "UDF file system support"
+	help
+	  This is the new file system used on some CD-ROMs and DVDs. Say Y if
+	  you intend to mount DVD discs or CDRW's written in packet mode, or
+	  if written to by other UDF utilities, such as DirectCD.
+	  Please read <file:Documentation/filesystems/udf.txt>.
+
+	  This file system support is also available as a module ( = code
+	  which can be inserted in and removed from the running kernel
+	  whenever you want). The module is called udf. If you want to
+	  compile it as a module, say M here and read
+	  <file:Documentation/modules.txt>.
+
+	  If unsure, say N.
+
+endmenu
+
+menu "DOS/FAT/NT Filesystems"
+
+config FAT_FS
+	tristate "DOS FAT fs support"
+	help
+	  If you want to use one of the FAT-based file systems (the MS-DOS,
+	  VFAT (Windows 95) and UMSDOS (used to run Linux on top of an
+	  ordinary DOS partition) file systems), then you must say Y or M here
+	  to include FAT support. You will then be able to mount partitions or
+	  diskettes with FAT-based file systems and transparently access the
+	  files on them, i.e. MSDOS files will look and behave just like all
+	  other Unix files.
+
+	  This FAT support is not a file system in itself, it only provides
+	  the foundation for the other file systems. You will have to say Y or
+	  M to at least one of "MSDOS fs support" or "VFAT fs support" in
+	  order to make use of it.
+
+	  Another way to read and write MSDOS floppies and hard drive
+	  partitions from within Linux (but not transparently) is with the
+	  mtools ("man mtools") program suite. You don't need to say Y here in
+	  order to do that.
+
+	  If you need to move large files on floppies between a DOS and a
+	  Linux box, say Y here, mount the floppy under Linux with an MSDOS
+	  file system and use GNU tar's M option. GNU tar is a program
+	  available for Unix and DOS ("man tar" or "info tar").
+
+	  It is now also becoming possible to read and write compressed FAT
+	  file systems; read <file:Documentation/filesystems/fat_cvf.txt> for
+	  details.
+
+	  The FAT support will enlarge your kernel by about 37 KB. If unsure,
+	  say Y.
+
+	  If you want to compile this as a module however ( = code which can
+	  be inserted in and removed from the running kernel whenever you
+	  want), say M here and read <file:Documentation/modules.txt>.  The
+	  module will be called fat.  Note that if you compile the FAT
+	  support as a module, you cannot compile any of the FAT-based file
+	  systems into the kernel -- they will have to be modules as well.
+	  The file system of your root partition (the one containing the
+	  directory /) cannot be a module, so don't say M here if you intend
+	  to use UMSDOS as your root file system.
+
+config MSDOS_FS
+	tristate "MSDOS fs support"
+	depends on FAT_FS
+	help
+	  This allows you to mount MSDOS partitions of your hard drive (unless
+	  they are compressed; to access compressed MSDOS partitions under
+	  Linux, you can either use the DOS emulator DOSEMU, described in the
+	  DOSEMU-HOWTO, available from
+	  <http://www.linuxdoc.org/docs.html#howto>, or try dmsdosfs in
+	  <ftp://ibiblio.org/pub/Linux/system/filesystems/dosfs/>. If you
+	  intend to use dosemu with a non-compressed MSDOS partition, say Y
+	  here) and MSDOS floppies. This means that file access becomes
+	  transparent, i.e. the MSDOS files look and behave just like all
+	  other Unix files.
+
+	  If you want to use UMSDOS, the Unix-like file system on top of a
+	  DOS file system, which allows you to run Linux from within a DOS
+	  partition without repartitioning, you'll have to say Y or M here.
+
+	  If you have Windows 95 or Windows NT installed on your MSDOS
+	  partitions, you should use the VFAT file system (say Y to "VFAT fs
+	  support" below), or you will not be able to see the long filenames
+	  generated by Windows 95 / Windows NT.
+
+	  This option will enlarge your kernel by about 7 KB. If unsure,
+	  answer Y. This will only work if you said Y to "DOS FAT fs support"
+	  as well. If you want to compile this as a module however ( = code
+	  which can be inserted in and removed from the running kernel
+	  whenever you want), say M here and read
+	  <file:Documentation/modules.txt>.
+	  The module will be called msdos.
+
+config VFAT_FS
+	tristate "VFAT (Windows-95) fs support"
+	depends on FAT_FS
+	help
+	  This option provides support for normal Windows file systems with
+	  long filenames.  That includes non-compressed FAT-based file systems
+	  used by Windows 95, Windows 98, Windows NT 4.0, and the Unix
+	  programs from the mtools package.
+
+	  You cannot use the VFAT file system for your Linux root partition
+	  (the one containing the directory /); use UMSDOS instead if you
+	  want to run Linux from within a DOS partition (i.e. say Y to
+	  "Unix like fs on top of std MSDOS fs", below).
+
+	  The VFAT support enlarges your kernel by about 10 KB and it only
+	  works if you said Y to the "DOS FAT fs support" above.  Please read
+	  the file <file:Documentation/filesystems/vfat.txt> for details.  If
+	  unsure, say Y.
+
+	  If you want to compile this as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>.  The module
+	  will be called vfat.
+
+config UMSDOS_FS
+#dep_tristate '    UMSDOS: Unix-like file system on top of standard MSDOS fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
+# UMSDOS is temprory broken
+	bool
+	help
+	  Say Y here if you want to run Linux from within an existing DOS
+	  partition of your hard drive. The advantage of this is that you can
+	  get away without repartitioning your hard drive (which often implies
+	  backing everything up and restoring afterwards) and hence you're
+	  able to quickly try out Linux or show it to your friends; the
+	  disadvantage is that Linux becomes susceptible to DOS viruses and
+	  that UMSDOS is somewhat slower than ext2fs.  Another use of UMSDOS
+	  is to write files with long unix filenames to MSDOS floppies; it
+	  also allows Unix-style soft-links and owner/permissions of files on
+	  MSDOS floppies.  You will need a program called umssync in order to
+	  make use of UMSDOS; read
+	  <file:Documentation/filesystems/umsdos.txt>.
+
+	  To get utilities for initializing/checking UMSDOS file system, or
+	  latest patches and/or information, visit the UMSDOS home page at
+	  <http://www.voyager.hr/~mnalis/umsdos/>.
+
+	  This option enlarges your kernel by about 28 KB and it only works if
+	  you said Y to both "DOS FAT fs support" and "MSDOS fs support"
+	  above.  If you want to compile this as a module ( = code which can
+	  be inserted in and removed from the running kernel whenever you
+	  want), say M here and read <file:Documentation/modules.txt>.  The
+	  module will be called umsdos.  Note that the file system of your
+	  root partition (the one containing the directory /) cannot be a
+	  module, so saying M could be dangerous.  If unsure, say N.
+
+config NTFS_FS
+	tristate "NTFS file system support (read only)"
+	help
+	  NTFS is the file system of Microsoft Windows NT/2000/XP. For more
+	  information see <file:Documentation/filesystems/ntfs.txt>. Saying Y
+	  here would allow you to read from NTFS partitions.
+
+	  This file system is also available as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want).
+	  The module will be called ntfs. If you want to compile it as a
+	  module, say M here and read <file:Documentation/modules.txt>.
+
+	  If you are not using Windows NT/2000/XP in addition to Linux on your
+	  computer it is safe to say N.
+
+config NTFS_DEBUG
+	bool "NTFS debugging support"
+	depends on NTFS_FS
+	help
+	  If you are experiencing any problems with the NTFS file system, say
+	  Y here. This will result in additional consistency checks to be
+	  performed by the driver as well as additional debugging messages to
+	  be written to the system log. Note that debugging messages are
+	  disabled by default. To enable them, supply the option debug_msgs=1
+	  at the kernel command line when booting the kernel or as an option
+	  to insmod when loading the ntfs module. Once the driver is active,
+	  you can enable debugging messages by doing (as root):
+	  echo 1 > /proc/sys/fs/ntfs-debug
+	  Replacing the "1" with "0" would disable debug messages.
+
+	  If you leave debugging messages disabled, this results in little
+	  overhead, but enabling debug messages results in very significant
+	  slowdown of the system.
+
+	  When reporting bugs, please try to have available a full dump of
+	  debugging messages while the misbehaviour was occurring.
+
+config NTFS_RW
+	bool "NTFS write support (DANGEROUS)"
+	depends on NTFS_FS && EXPERIMENTAL
+	help
+	  This enables the experimental write support in the NTFS driver.
+
+	  WARNING: Do not use this option unless you are actively developing
+	  NTFS as it is currently guaranteed to be broken and you
+	  may lose all your data!
+
+	  It is strongly recommended and perfectly safe to say N here.
+
+endmenu
+
+menu "Pseudo filesystems"
+
+config PROC_FS
+	bool "/proc file system support"
+	help
+	  This is a virtual file system providing information about the status
+	  of the system. "Virtual" means that it doesn't take up any space on
+	  your hard disk: the files are created on the fly by the kernel when
+	  you try to access them. Also, you cannot read the files with older
+	  version of the program less: you need to use more or cat.
+
+	  It's totally cool; for example, "cat /proc/interrupts" gives
+	  information about what the different IRQs are used for at the moment
+	  (there is a small number of Interrupt ReQuest lines in your computer
+	  that are used by the attached devices to gain the CPU's attention --
+	  often a source of trouble if two devices are mistakenly configured
+	  to use the same IRQ). The program procinfo to display some
+	  information about your system gathered from the /proc file system.
+
+	  Before you can use the /proc file system, it has to be mounted,
+	  meaning it has to be given a location in the directory hierarchy.
+	  That location should be /proc. A command such as "mount -t proc proc
+	  /proc" or the equivalent line in /etc/fstab does the job.
+
+	  The /proc file system is explained in the file
+	  <file:Documentation/filesystems/proc.txt> and on the proc(5) manpage
+	  ("man 5 proc").
+
+	  This option will enlarge your kernel by about 67 KB. Several
+	  programs depend on this, so everyone should say Y here.
+
+config DEVFS_FS
+	bool "/dev file system support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	help
+	  This is support for devfs, a virtual file system (like /proc) which
+	  provides the file system interface to device drivers, normally found
+	  in /dev. Devfs does not depend on major and minor number
+	  allocations. Device drivers register entries in /dev which then
+	  appear automatically, which means that the system administrator does
+	  not have to create character and block special device files in the
+	  /dev directory using the mknod command (or MAKEDEV script) anymore.
+
+	  This is work in progress. If you want to use this, you *must* read
+	  the material in <file:Documentation/filesystems/devfs/>, especially
+	  the file README there.
+
+	  If unsure, say N.
+
+config DEVFS_MOUNT
+	bool "Automatically mount at boot"
+	depends on DEVFS_FS
+	help
+	  This option appears if you have CONFIG_DEVFS_FS enabled. Setting
+	  this to 'Y' will make the kernel automatically mount devfs onto /dev
+	  when the system is booted, before the init thread is started.
+	  You can override this with the "devfs=nomount" boot option.
+
+	  If unsure, say N.
+
+config DEVFS_DEBUG
+	bool "Debug devfs"
+	depends on DEVFS_FS
+	help
+	  If you say Y here, then the /dev file system code will generate
+	  debugging messages. See the file
+	  <file:Documentation/filesystems/devfs/boot-options> for more
+	  details.
+
+	  If unsure, say N.
+
+config DEVPTS_FS
+# It compiles as a module for testing only.  It should not be used
+# as a module in general.  If we make this "tristate", a bunch of people
+# who don't know what they are doing turn it on and complain when it
+# breaks.
+	bool "/dev/pts file system for Unix98 PTYs"
+	depends on UNIX98_PTYS
+	---help---
+	  You should say Y here if you said Y to "Unix98 PTY support" above.
+	  You'll then get a virtual file system which can be mounted on
+	  /dev/pts with "mount -t devpts". This, together with the pseudo
+	  terminal master multiplexer /dev/ptmx, is used for pseudo terminal
+	  support as described in The Open Group's Unix98 standard: in order
+	  to acquire a pseudo terminal, a process opens /dev/ptmx; the number
+	  of the pseudo terminal is then made available to the process and the
+	  pseudo terminal slave can be accessed as /dev/pts/<number>. What was
+	  traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
+
+	  The GNU C library glibc 2.1 contains the requisite support for this
+	  mode of operation; you also need client programs that use the Unix98
+	  API. Please read <file:Documentation/Changes> for more information
+	  about the Unix98 pty devices.
+
+	  Note that the experimental "/dev file system support"
+	  (CONFIG_DEVFS_FS)  is a more general facility.
+
+config TMPFS
+	bool "Virtual memory file system support (former shm fs)"
+	help
+	  Tmpfs is a file system which keeps all files in virtual memory.
+
+	  Everything in tmpfs is temporary in the sense that no files will be
+	  created on your hard drive. The files live in memory and swap
+	  space. If you unmount a tmpfs instance, everything stored therein is
+	  lost.
+
+	  See <file:Documentation/filesystems/tmpfs.txt> for details.
+
+config RAMFS
+	bool
+	default y
+	---help---
+	  Ramfs is a file system which keeps all files in RAM. It allows
+	  read and write access.
+
+	  It is more of an programming example than a useable file system.  If
+	  you need a file system which lives in RAM with limit checking use
+	  tmpfs.
+
+	  If you want to compile this as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want),
+	  say M here and read <file:Documentation/modules.txt>.  The module
+	  will be called ramfs.
+
+endmenu
+
+menu "Miscellaneous filesystems"
+
+config ADFS_FS
+	tristate "ADFS file system support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	help
+	  The Acorn Disc Filing System is the standard file system of the
+	  RiscOS operating system which runs on Acorn's ARM-based Risc PC
+	  systems and the Acorn Archimedes range of machines. If you say Y
+	  here, Linux will be able to read from ADFS partitions on hard drives
+	  and from ADFS-formatted floppy discs. If you also want to be able to
+	  write to those devices, say Y to "ADFS write support" below.
+
+	  The ADFS partition should be the first partition (i.e.,
+	  /dev/[hs]d?1) on each of your drives. Please read the file
+	  <file:Documentation/filesystems/adfs.txt> for further details.
+
+	  This code is also available as a module called adfs ( = code which
+	  can be inserted in and removed from the running kernel whenever you
+	  want). If you want to compile it as a module, say M here and read
+	  <file:Documentation/modules.txt>.
+
+	  If unsure, say N.
+
+config ADFS_FS_RW
+	bool "ADFS write support (DANGEROUS)"
+	depends on ADFS_FS
+	help
+	  If you say Y here, you will be able to write to ADFS partitions on
+	  hard drives and ADFS-formatted floppy disks. This is experimental
+	  codes, so if you're unsure, say N.
+
+config AFFS_FS
 	tristate "Amiga FFS file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
-	---help---
+	help
 	  The Fast File System (FFS) is the common file system used on hard
 	  disks by Amiga(tm) systems since AmigaOS Version 1.3 (34.20).  Say Y
 	  if you want to be able to read and write files from and to an Amiga
@@ -193,7 +897,7 @@
 config HFS_FS
 	tristate "Apple Macintosh file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
-	---help---
+	help
 	  If you say Y here, you will be able to mount Macintosh-formatted
 	  floppy disks and hard drive partitions with full read-write access.
 	  Please read <file:fs/hfs/HFS.txt> to learn about the available mount
@@ -208,7 +912,7 @@
 config BEFS_FS
 	tristate "BeOS file systemv(BeFS) support (read only) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
-	---help---
+	help
 	  The BeOS File System (BeFS) is the native file system of Be, Inc's
 	  BeOS. Notable features include support for arbitrary attributes
 	  on files and directories, and database-like indices on selected
@@ -236,7 +940,7 @@
 config BFS_FS
 	tristate "BFS file system support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
-	---help---
+	help
 	  Boot File System (BFS) is a file system used under SCO UnixWare to
 	  allow the bootloader access to the kernel image and other important
 	  files during the boot process.  It is usually mounted under /stand
@@ -256,236 +960,12 @@
 	  partition (the one containing the directory /) cannot be compiled as
 	  a module.
 
-config EXT3_FS
-	tristate "Ext3 journalling file system support"
-	---help---
-	  This is the journaling version of the Second extended file system
-	  (often called ext3), the de facto standard Linux file system
-	  (method to organize files on a storage device) for hard disks.
-
-	  The journaling code included in this driver means you do not have
-	  to run e2fsck (file system checker) on your file systems after a
-	  crash.  The journal keeps track of any changes that were being made
-	  at the time the system crashed, and can ensure that your file system
-	  is consistent without the need for a lengthy check.
-
-	  Other than adding the journal to the file system, the on-disk format
-	  of ext3 is identical to ext2.  It is possible to freely switch
-	  between using the ext3 driver and the ext2 driver, as long as the
-	  file system has been cleanly unmounted, or e2fsck is run on the file
-	  system.
-
-	  To add a journal on an existing ext2 file system or change the
-	  behavior of ext3 file systems, you can use the tune2fs utility ("man
-	  tune2fs").  To modify attributes of files and directories on ext3
-	  file systems, use chattr ("man chattr").  You need to be using
-	  e2fsprogs version 1.20 or later in order to create ext3 journals
-	  (available at <http://sourceforge.net/projects/e2fsprogs/>).
-
-	  If you want to compile this file system as a module ( = code which
-	  can be inserted in and removed from the running kernel whenever you
-	  want), say M here and read <file:Documentation/modules.txt>.  The
-	  module will be called ext3.  Be aware however that the file system
-	  of your root partition (the one containing the directory /) cannot
-	  be compiled as a module, and so this may be dangerous.
-
-config EXT3_FS_XATTR
-	bool "Ext3 extended attributes"
-	depends on EXT3_FS
-	default y
-	---help---
-	  Extended attributes are name:value pairs associated with inodes by
-	  the kernel or by users (see the attr(5) manual page, or visit
-	  <http://acl.bestbits.at/> for details).
-
-	  If unsure, say N.
-
-	  You need this for POSIX ACL support on ext3.
-
-config EXT3_FS_POSIX_ACL
-	bool "Ext3 POSIX Access Control Lists"
-	depends on EXT3_FS_XATTR
-	---help---
-	  Posix Access Control Lists (ACLs) support permissions for users and
-	  groups beyond the owner/group/world scheme.
-
-	  To learn more about Access Control Lists, visit the Posix ACLs for
-	  Linux website <http://acl.bestbits.at/>.
-
-	  If you don't know what Access Control Lists are, say N
-
-# CONFIG_JBD could be its own option (even modular), but until there are
-# other users than ext3, we will simply make it be the same as CONFIG_EXT3_FS
-# dep_tristate '  Journal Block Device support (JBD for ext3)' CONFIG_JBD $CONFIG_EXT3_FS
-config JBD
-	bool
-	default EXT3_FS
-	---help---
-	  This is a generic journaling layer for block devices.  It is
-	  currently used by the ext3 file system, but it could also be used to
-	  add journal support to other file systems or block devices such as
-	  RAID or LVM.
-
-	  If you are using the ext3 file system, you need to say Y here. If
-	  you are not using ext3 then you will probably want to say N.
-
-	  If you want to compile this device as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called jbd.  If you are compiling ext3 into the kernel,
-	  you cannot compile this code as a module.
-
-config JBD_DEBUG
-	bool "JBD (ext3) debugging support"
-	depends on JBD
-	---help---
-	  If you are using the ext3 journaled file system (or potentially any
-	  other file system/device using JBD), this option allows you to
-	  enable debugging output while the system is running, in order to
-	  help track down any problems you are having.  By default the
-	  debugging output will be turned off.
-
-	  If you select Y here, then you will be able to turn on debugging
-	  with "echo N > /proc/sys/fs/jbd-debug", where N is a number between
-	  1 and 5, the higher the number, the more debugging output is
-	  generated.  To turn debugging off again, do
-	  "echo 0 > /proc/sys/fs/jbd-debug".
-
-# msdos file systems
-config FAT_FS
-	tristate "DOS FAT fs support"
-	---help---
-	  If you want to use one of the FAT-based file systems (the MS-DOS,
-	  VFAT (Windows 95) and UMSDOS (used to run Linux on top of an
-	  ordinary DOS partition) file systems), then you must say Y or M here
-	  to include FAT support. You will then be able to mount partitions or
-	  diskettes with FAT-based file systems and transparently access the
-	  files on them, i.e. MSDOS files will look and behave just like all
-	  other Unix files.
-
-	  This FAT support is not a file system in itself, it only provides
-	  the foundation for the other file systems. You will have to say Y or
-	  M to at least one of "MSDOS fs support" or "VFAT fs support" in
-	  order to make use of it.
-
-	  Another way to read and write MSDOS floppies and hard drive
-	  partitions from within Linux (but not transparently) is with the
-	  mtools ("man mtools") program suite. You don't need to say Y here in
-	  order to do that.
-
-	  If you need to move large files on floppies between a DOS and a
-	  Linux box, say Y here, mount the floppy under Linux with an MSDOS
-	  file system and use GNU tar's M option. GNU tar is a program
-	  available for Unix and DOS ("man tar" or "info tar").
-
-	  It is now also becoming possible to read and write compressed FAT
-	  file systems; read <file:Documentation/filesystems/fat_cvf.txt> for
-	  details.
-
-	  The FAT support will enlarge your kernel by about 37 KB. If unsure,
-	  say Y.
-
-	  If you want to compile this as a module however ( = code which can
-	  be inserted in and removed from the running kernel whenever you
-	  want), say M here and read <file:Documentation/modules.txt>.  The
-	  module will be called fat.  Note that if you compile the FAT
-	  support as a module, you cannot compile any of the FAT-based file
-	  systems into the kernel -- they will have to be modules as well.
-	  The file system of your root partition (the one containing the
-	  directory /) cannot be a module, so don't say M here if you intend
-	  to use UMSDOS as your root file system.
-
-config MSDOS_FS
-	tristate "MSDOS fs support"
-	depends on FAT_FS
-	---help---
-	  This allows you to mount MSDOS partitions of your hard drive (unless
-	  they are compressed; to access compressed MSDOS partitions under
-	  Linux, you can either use the DOS emulator DOSEMU, described in the
-	  DOSEMU-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, or try dmsdosfs in
-	  <ftp://ibiblio.org/pub/Linux/system/filesystems/dosfs/>. If you
-	  intend to use dosemu with a non-compressed MSDOS partition, say Y
-	  here) and MSDOS floppies. This means that file access becomes
-	  transparent, i.e. the MSDOS files look and behave just like all
-	  other Unix files.
-
-	  If you want to use UMSDOS, the Unix-like file system on top of a
-	  DOS file system, which allows you to run Linux from within a DOS
-	  partition without repartitioning, you'll have to say Y or M here.
-
-	  If you have Windows 95 or Windows NT installed on your MSDOS
-	  partitions, you should use the VFAT file system (say Y to "VFAT fs
-	  support" below), or you will not be able to see the long filenames
-	  generated by Windows 95 / Windows NT.
-
-	  This option will enlarge your kernel by about 7 KB. If unsure,
-	  answer Y. This will only work if you said Y to "DOS FAT fs support"
-	  as well. If you want to compile this as a module however ( = code
-	  which can be inserted in and removed from the running kernel
-	  whenever you want), say M here and read
-	  <file:Documentation/modules.txt>.
-	  The module will be called msdos.
-
-#dep_tristate '    UMSDOS: Unix-like file system on top of standard MSDOS fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
-# UMSDOS is temprory broken
-config UMSDOS_FS
-	bool
-	---help---
-	  Say Y here if you want to run Linux from within an existing DOS
-	  partition of your hard drive. The advantage of this is that you can
-	  get away without repartitioning your hard drive (which often implies
-	  backing everything up and restoring afterwards) and hence you're
-	  able to quickly try out Linux or show it to your friends; the
-	  disadvantage is that Linux becomes susceptible to DOS viruses and
-	  that UMSDOS is somewhat slower than ext2fs.  Another use of UMSDOS
-	  is to write files with long unix filenames to MSDOS floppies; it
-	  also allows Unix-style soft-links and owner/permissions of files on
-	  MSDOS floppies.  You will need a program called umssync in order to
-	  make use of UMSDOS; read
-	  <file:Documentation/filesystems/umsdos.txt>.
-
-	  To get utilities for initializing/checking UMSDOS file system, or
-	  latest patches and/or information, visit the UMSDOS home page at
-	  <http://www.voyager.hr/~mnalis/umsdos/>.
-
-	  This option enlarges your kernel by about 28 KB and it only works if
-	  you said Y to both "DOS FAT fs support" and "MSDOS fs support"
-	  above.  If you want to compile this as a module ( = code which can
-	  be inserted in and removed from the running kernel whenever you
-	  want), say M here and read <file:Documentation/modules.txt>.  The
-	  module will be called umsdos.  Note that the file system of your
-	  root partition (the one containing the directory /) cannot be a
-	  module, so saying M could be dangerous.  If unsure, say N.
-
-config VFAT_FS
-	tristate "VFAT (Windows-95) fs support"
-	depends on FAT_FS
-	---help---
-	  This option provides support for normal Windows file systems with
-	  long filenames.  That includes non-compressed FAT-based file systems
-	  used by Windows 95, Windows 98, Windows NT 4.0, and the Unix
-	  programs from the mtools package.
-
-	  You cannot use the VFAT file system for your Linux root partition
-	  (the one containing the directory /); use UMSDOS instead if you
-	  want to run Linux from within a DOS partition (i.e. say Y to
-	  "Unix like fs on top of std MSDOS fs", below).
-
-	  The VFAT support enlarges your kernel by about 10 KB and it only
-	  works if you said Y to the "DOS FAT fs support" above.  Please read
-	  the file <file:Documentation/filesystems/vfat.txt> for details.  If
-	  unsure, say Y.
 
-	  If you want to compile this as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called vfat.
 
 config EFS_FS
 	tristate "EFS file system support (read only) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
-	---help---
+	help
 	  EFS is an older file system used for non-ISO9660 CD-ROMs and hard
 	  disk partitions by SGI's IRIX operating system (IRIX 6.0 and newer
 	  uses the XFS file system for hard disk partitions however).
@@ -538,7 +1018,7 @@
 	int "JFFS2 debugging verbosity (0 = quiet, 2 = noisy)"
 	depends on JFFS2_FS
 	default "0"
-	---help---
+	help
 	  This controls the amount of debugging messages produced by the JFFS2
 	  code. Set it to zero for use in production systems. For evaluation,
 	  testing and debugging, it's advisable to set it to one. This will
@@ -555,7 +1035,7 @@
 	bool "JFFS2 support for NAND flash (EXPERIMENTAL)"
 	depends on JFFS2_FS && EXPERIMENTAL
 	default n
-	---help---
+	help
 	  This enables the experimental support for NAND flash in JFFS2. NAND
 	  is a newer type of flash chip design than the traditional NOR flash,
 	  with higher density but a handful of characteristics which make it
@@ -570,7 +1050,7 @@
 
 config CRAMFS
 	tristate "Compressed ROM file system support"
-	---help---
+	help
 	  Saying Y here includes support for CramFs (Compressed ROM File
 	  System).  CramFs is designed to be a simple, small, and compressed
 	  file system for ROM based embedded systems.  CramFs is read-only,
@@ -588,136 +1068,9 @@
 
 	  If unsure, say N.
 
-config TMPFS
-	bool "Virtual memory file system support (former shm fs)"
-	help
-	  Tmpfs is a file system which keeps all files in virtual memory.
-
-	  Everything in tmpfs is temporary in the sense that no files will be
-	  created on your hard drive. The files live in memory and swap
-	  space. If you unmount a tmpfs instance, everything stored therein is
-	  lost.
-
-	  See <file:Documentation/filesystems/tmpfs.txt> for details.
-
-config RAMFS
-	bool
-	default y
-	---help---
-	  Ramfs is a file system which keeps all files in RAM. It allows
-	  read and write access.
-
-	  It is more of an programming example than a useable file system.  If
-	  you need a file system which lives in RAM with limit checking use
-	  tmpfs.
-
-	  If you want to compile this as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called ramfs.
-
-config HUGETLBFS
-	bool "HugeTLB file system support"
-	depends on HUGETLB_PAGE
-
-config ISO9660_FS
-	tristate "ISO 9660 CDROM file system support"
-	---help---
-	  This is the standard file system used on CD-ROMs.  It was previously
-	  known as "High Sierra File System" and is called "hsfs" on other
-	  Unix systems.  The so-called Rock-Ridge extensions which allow for
-	  long Unix filenames and symbolic links are also supported by this
-	  driver.  If you have a CD-ROM drive and want to do more with it than
-	  just listen to audio CDs and watch its LEDs, say Y (and read
-	  <file:Documentation/filesystems/isofs.txt> and the CD-ROM-HOWTO,
-	  available from <http://www.linuxdoc.org/docs.html#howto>), thereby
-	  enlarging your kernel by about 27 KB; otherwise say N.
-
-	  If you want to compile this as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called isofs.
-
-config JOLIET
-	bool "Microsoft Joliet CDROM extensions"
-	depends on ISO9660_FS
-	help
-	  Joliet is a Microsoft extension for the ISO 9660 CD-ROM file system
-	  which allows for long filenames in unicode format (unicode is the
-	  new 16 bit character code, successor to ASCII, which encodes the
-	  characters of almost all languages of the world; see
-	  <http://www.unicode.org/> for more information).  Say Y here if you
-	  want to be able to read Joliet CD-ROMs under Linux.
-
-config ZISOFS
-	bool "Transparent decompression extension"
-	depends on ISO9660_FS
-	help
-	  This is a Linux-specific extension to RockRidge which lets you store
-	  data in compressed form on a CD-ROM and have it transparently
-	  decompressed when the CD-ROM is accessed.  See
-	  <http://www.kernel.org/pub/linux/utils/fs/zisofs/> for the tools
-	  necessary to create such a filesystem.  Say Y here if you want to be
-	  able to read such compressed CD-ROMs.
-
-config JFS_FS
-	tristate "JFS filesystem support"
-	help
-	  This is a port of IBM's Journaled Filesystem .  More information is
-	  available in the file Documentation/filesystems/jfs.txt.
-
-	  If you do not intend to use the JFS filesystem, say N.
-
-config JFS_POSIX_ACL
-	bool "JFS POSIX Access Control Lists"
-	depends on JFS_FS
-	---help---
-	  Posix Access Control Lists (ACLs) support permissions for users and
-	  groups beyond the owner/group/world scheme.
-
-	  To learn more about Access Control Lists, visit the Posix ACLs for
-	  Linux website <http://acl.bestbits.at/>.
-
-	  If you don't know what Access Control Lists are, say N
-
-config JFS_DEBUG
-	bool "JFS debugging"
-	depends on JFS_FS
-	help
-	  If you are experiencing any problems with the JFS filesystem, say
-	  Y here.  This will result in additional debugging messages to be
-	  written to the system log.  Under normal circumstances, this
-	  results in very little overhead.
-
-config JFS_STATISTICS
-	bool "JFS statistics"
-	depends on JFS_FS
-	help
-	  Enabling this option will cause statistics from the JFS file system
-	  to be made available to the user in the /proc/fs/jfs/ directory.
-
-config MINIX_FS
-	tristate "Minix fs support"
-	---help---
-	  Minix is a simple operating system used in many classes about OS's.
-	  The minix file system (method to organize files on a hard disk
-	  partition or a floppy disk) was the original file system for Linux,
-	  but has been superseded by the second extended file system ext2fs.
-	  You don't want to use the minix file system on your hard disk
-	  because of certain built-in restrictions, but it is sometimes found
-	  on older Linux floppy disks.  This option will enlarge your kernel
-	  by about 28 KB. If unsure, say N.
-
-	  If you want to compile this as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>. The module
-	  will be called minix.  Note that the file system of your root
-	  partition (the one containing the directory /) cannot be compiled as
-	  a module.
-
 config VXFS_FS
 	tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
-	---help---
+	help
 	  FreeVxFS is a file system driver that support the VERITAS VxFS(TM)
 	  file system format.  VERITAS VxFS(TM) is the standard file system
 	  of SCO UnixWare (and possibly others) and optionally available
@@ -731,173 +1084,32 @@
 	  This file system is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
 	  The module is called freevxfs.  If you want to compile it as a
-	  module, say M here and read <file:Documentation/modules.txt>.  If
-	  unsure, say N.
-
-config NTFS_FS
-	tristate "NTFS file system support (read only)"
-	---help---
-	  NTFS is the file system of Microsoft Windows NT/2000/XP. For more
-	  information see <file:Documentation/filesystems/ntfs.txt>. Saying Y
-	  here would allow you to read from NTFS partitions.
-
-	  This file system is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called ntfs. If you want to compile it as a
-	  module, say M here and read <file:Documentation/modules.txt>.
-
-	  If you are not using Windows NT/2000/XP in addition to Linux on your
-	  computer it is safe to say N.
-
-config NTFS_DEBUG
-	bool "NTFS debugging support"
-	depends on NTFS_FS
-	---help---
-	  If you are experiencing any problems with the NTFS file system, say
-	  Y here. This will result in additional consistency checks to be
-	  performed by the driver as well as additional debugging messages to
-	  be written to the system log. Note that debugging messages are
-	  disabled by default. To enable them, supply the option debug_msgs=1
-	  at the kernel command line when booting the kernel or as an option
-	  to insmod when loading the ntfs module. Once the driver is active,
-	  you can enable debugging messages by doing (as root):
-	  echo 1 > /proc/sys/fs/ntfs-debug
-	  Replacing the "1" with "0" would disable debug messages.
-
-	  If you leave debugging messages disabled, this results in little
-	  overhead, but enabling debug messages results in very significant
-	  slowdown of the system.
-
-	  When reporting bugs, please try to have available a full dump of
-	  debugging messages while the misbehaviour was occurring.
-
-config NTFS_RW
-	bool "NTFS write support (DANGEROUS)"
-	depends on NTFS_FS && EXPERIMENTAL
-	help
-	  This enables the experimental write support in the NTFS driver.
-
-	  WARNING: Do not use this option unless you are actively developing
-	  NTFS as it is currently guaranteed to be broken and you
-	  may lose all your data!
-
-	  It is strongly recommended and perfectly safe to say N here.
-
-config HPFS_FS
-	tristate "OS/2 HPFS file system support"
-	---help---
-	  OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
-	  is the file system used for organizing files on OS/2 hard disk
-	  partitions. Say Y if you want to be able to read files from and
-	  write files to an OS/2 HPFS partition on your hard drive. OS/2
-	  floppies however are in regular MSDOS format, so you don't need this
-	  option in order to be able to read them. Read
-	  <file:Documentation/filesystems/hpfs.txt>.
-
-	  This file system is also available as a module ( = code which can be
-	  inserted in and removed from the running kernel whenever you want).
-	  The module is called hpfs.  If you want to compile it as a module,
-	  say M here and read <file:Documentation/modules.txt>.  If unsure,
-	  say N.
-
-config PROC_FS
-	bool "/proc file system support"
-	---help---
-	  This is a virtual file system providing information about the status
-	  of the system. "Virtual" means that it doesn't take up any space on
-	  your hard disk: the files are created on the fly by the kernel when
-	  you try to access them. Also, you cannot read the files with older
-	  version of the program less: you need to use more or cat.
-
-	  It's totally cool; for example, "cat /proc/interrupts" gives
-	  information about what the different IRQs are used for at the moment
-	  (there is a small number of Interrupt ReQuest lines in your computer
-	  that are used by the attached devices to gain the CPU's attention --
-	  often a source of trouble if two devices are mistakenly configured
-	  to use the same IRQ). The program procinfo to display some
-	  information about your system gathered from the /proc file system.
-
-	  Before you can use the /proc file system, it has to be mounted,
-	  meaning it has to be given a location in the directory hierarchy.
-	  That location should be /proc. A command such as "mount -t proc proc
-	  /proc" or the equivalent line in /etc/fstab does the job.
-
-	  The /proc file system is explained in the file
-	  <file:Documentation/filesystems/proc.txt> and on the proc(5) manpage
-	  ("man 5 proc").
-
-	  This option will enlarge your kernel by about 67 KB. Several
-	  programs depend on this, so everyone should say Y here.
-
-config DEVFS_FS
-	bool "/dev file system support (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
-	---help---
-	  This is support for devfs, a virtual file system (like /proc) which
-	  provides the file system interface to device drivers, normally found
-	  in /dev. Devfs does not depend on major and minor number
-	  allocations. Device drivers register entries in /dev which then
-	  appear automatically, which means that the system administrator does
-	  not have to create character and block special device files in the
-	  /dev directory using the mknod command (or MAKEDEV script) anymore.
-
-	  This is work in progress. If you want to use this, you *must* read
-	  the material in <file:Documentation/filesystems/devfs/>, especially
-	  the file README there.
-
-	  If unsure, say N.
-
-config DEVFS_MOUNT
-	bool "Automatically mount at boot"
-	depends on DEVFS_FS
-	help
-	  This option appears if you have CONFIG_DEVFS_FS enabled. Setting
-	  this to 'Y' will make the kernel automatically mount devfs onto /dev
-	  when the system is booted, before the init thread is started.
-	  You can override this with the "devfs=nomount" boot option.
+	  module, say M here and read <file:Documentation/modules.txt>.  If
+	  unsure, say N.
 
-	  If unsure, say N.
 
-config DEVFS_DEBUG
-	bool "Debug devfs"
-	depends on DEVFS_FS
+config HPFS_FS
+	tristate "OS/2 HPFS file system support"
 	help
-	  If you say Y here, then the /dev file system code will generate
-	  debugging messages. See the file
-	  <file:Documentation/filesystems/devfs/boot-options> for more
-	  details.
-
-	  If unsure, say N.
+	  OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
+	  is the file system used for organizing files on OS/2 hard disk
+	  partitions. Say Y if you want to be able to read files from and
+	  write files to an OS/2 HPFS partition on your hard drive. OS/2
+	  floppies however are in regular MSDOS format, so you don't need this
+	  option in order to be able to read them. Read
+	  <file:Documentation/filesystems/hpfs.txt>.
 
-# It compiles as a module for testing only.  It should not be used
-# as a module in general.  If we make this "tristate", a bunch of people
-# who don't know what they are doing turn it on and complain when it
-# breaks.
-config DEVPTS_FS
-	bool "/dev/pts file system for Unix98 PTYs"
-	depends on UNIX98_PTYS
-	---help---
-	  You should say Y here if you said Y to "Unix98 PTY support" above.
-	  You'll then get a virtual file system which can be mounted on
-	  /dev/pts with "mount -t devpts". This, together with the pseudo
-	  terminal master multiplexer /dev/ptmx, is used for pseudo terminal
-	  support as described in The Open Group's Unix98 standard: in order
-	  to acquire a pseudo terminal, a process opens /dev/ptmx; the number
-	  of the pseudo terminal is then made available to the process and the
-	  pseudo terminal slave can be accessed as /dev/pts/<number>. What was
-	  traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
+	  This file system is also available as a module ( = code which can be
+	  inserted in and removed from the running kernel whenever you want).
+	  The module is called hpfs.  If you want to compile it as a module,
+	  say M here and read <file:Documentation/modules.txt>.  If unsure,
+	  say N.
 
-	  The GNU C library glibc 2.1 contains the requisite support for this
-	  mode of operation; you also need client programs that use the Unix98
-	  API. Please read <file:Documentation/Changes> for more information
-	  about the Unix98 pty devices.
 
-	  Note that the experimental "/dev file system support"
-	  (CONFIG_DEVFS_FS)  is a more general facility.
 
 config QNX4FS_FS
 	tristate "QNX4 file system support (read only)"
-	---help---
+	help
 	  This is the file system used by the real-time operating systems
 	  QNX 4 and QNX 6 (the latter is also called QNX RTP).
 	  Further information is available at <http://www.qnx.com/>.
@@ -923,97 +1135,11 @@
 	  It's currently broken, so for now:
 	  answer N.
 
-config ROMFS_FS
-	tristate "ROM file system support"
-	---help---
-	  This is a very small read-only file system mainly intended for
-	  initial ram disks of installation disks, but it could be used for
-	  other read-only media as well.  Read
-	  <file:Documentation/filesystems/romfs.txt> for details.
-
-	  This file system support is also available as a module ( = code
-	  which can be inserted in and removed from the running kernel
-	  whenever you want). The module is called romfs.  If you want to
-	  compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  Note that the file system of your
-	  root partition (the one containing the directory /) cannot be a
-	  module.
-
-	  If you don't know whether you need it, then you don't need it:
-	  answer N.
-
-config EXT2_FS
-	tristate "Second extended fs support"
-	---help---
-	  This is the de facto standard Linux file system (method to organize
-	  files on a storage device) for hard disks.
-
-	  You want to say Y here, unless you intend to use Linux exclusively
-	  from inside a DOS partition using the UMSDOS file system. The
-	  advantage of the latter is that you can get away without
-	  repartitioning your hard drive (which often implies backing
-	  everything up and restoring afterwards); the disadvantage is that
-	  Linux becomes susceptible to DOS viruses and that UMSDOS is somewhat
-	  slower than ext2fs. Even if you want to run Linux in this fashion,
-	  it might be a good idea to have ext2fs around: it enables you to
-	  read more floppy disks and facilitates the transition to a *real*
-	  Linux partition later. Another (rare) case which doesn't require
-	  ext2fs is a diskless Linux box which mounts all files over the
-	  network using NFS (in this case it's sufficient to say Y to "NFS
-	  file system support" below). Saying Y here will enlarge your kernel
-	  by about 44 KB.
-
-	  The Ext2fs-Undeletion mini-HOWTO, available from
-	  <http://www.linuxdoc.org/docs.html#howto>, gives information about
-	  how to retrieve deleted files on ext2fs file systems.
-
-	  To change the behavior of ext2 file systems, you can use the tune2fs
-	  utility ("man tune2fs"). To modify attributes of files and
-	  directories on ext2 file systems, use chattr ("man chattr").
-
-	  Ext2fs partitions can be read from within DOS using the ext2tool
-	  command line tool package (available from
-	  <ftp://ibiblio.org/pub/Linux/system/filesystems/ext2/>) and from
-	  within Windows NT using the ext2nt command line tool package from
-	  <ftp://ibiblio.org/pub/Linux/utils/dos/>.  Explore2fs is a
-	  graphical explorer for ext2fs partitions which runs on Windows 95
-	  and Windows NT and includes experimental write support; it is
-	  available from
-	  <http://jnewbigin-pc.it.swin.edu.au/Linux/Explore2fs.htm>.
-
-	  If you want to compile this file system as a module ( = code which
-	  can be inserted in and removed from the running kernel whenever you
-	  want), say M here and read <file:Documentation/modules.txt>.  The
-	  module will be called ext2.  Be aware however that the file system
-	  of your root partition (the one containing the directory /) cannot
-	  be compiled as a module, and so this could be dangerous.  Most
-	  everyone wants to say Y here.
-
-config EXT2_FS_XATTR
-	bool "Ext2 extended attributes"
-	depends on EXT2_FS
-	---help---
-	  Extended attributes are name:value pairs associated with inodes by
-	  the kernel or by users (see the attr(5) manual page, or visit
-	  <http://acl.bestbits.at/> for details).
-
-	  If unsure, say N.
-
-config EXT2_FS_POSIX_ACL
-	bool "Ext2 POSIX Access Control Lists"
-	depends on EXT2_FS_XATTR
-	---help---
-	  Posix Access Control Lists (ACLs) support permissions for users and
-	  groups beyond the owner/group/world scheme.
-
-	  To learn more about Access Control Lists, visit the Posix ACLs for
-	  Linux website <http://acl.bestbits.at/>.
 
-	  If you don't know what Access Control Lists are, say N
 
 config SYSV_FS
 	tristate "System V/Xenix/V7/Coherent file system support"
-	---help---
+	help
 	  SCO, Xenix and Coherent are commercial Unix systems for Intel
 	  machines, and Version 7 was used on the DEC PDP-11. Saying Y
 	  here would allow you to read from their floppies and hard disk
@@ -1049,172 +1175,55 @@
 
 	  If you haven't heard about all of this before, it's safe to say N.
 
-config UDF_FS
-	tristate "UDF file system support"
-	---help---
-	  This is the new file system used on some CD-ROMs and DVDs. Say Y if
-	  you intend to mount DVD discs or CDRW's written in packet mode, or
-	  if written to by other UDF utilities, such as DirectCD.
-	  Please read <file:Documentation/filesystems/udf.txt>.
-
-	  This file system support is also available as a module ( = code
-	  which can be inserted in and removed from the running kernel
-	  whenever you want). The module is called udf. If you want to
-	  compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.
 
-	  If unsure, say N.
 
 config UFS_FS
 	tristate "UFS file system support (read only)"
-	---help---
-	  BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
-	  OpenBSD and NeXTstep) use a file system called UFS. Some System V
-	  Unixes can create and mount hard disk partitions and diskettes using
-	  this file system as well. Saying Y here will allow you to read from
-	  these partitions; if you also want to write to them, say Y to the
-	  experimental "UFS file system write support", below. Please read the
-	  file <file:Documentation/filesystems/ufs.txt> for more information.
-
-	  If you only intend to mount files from some other Unix over the
-	  network using NFS, you don't need the UFS file system support (but
-	  you need NFS file system support obviously).
-
-	  Note that this option is generally not needed for floppies, since a
-	  good portable way to transport files and directories between unixes
-	  (and even other operating systems) is given by the tar program ("man
-	  tar" or preferably "info tar").
-
-	  When accessing NeXTstep files, you may need to convert them from the
-	  NeXT character set to the Latin1 character set; use the program
-	  recode ("info recode") for this purpose.
-
-	  If you want to compile the UFS file system support as a module ( =
-	  code which can be inserted in and removed from the running kernel
-	  whenever you want), say M here and read
-	  <file:Documentation/modules.txt>. The module will be called ufs.
-
-	  If you haven't heard about all of this before, it's safe to say N.
-
-config UFS_FS_WRITE
-	bool "UFS file system write support (DANGEROUS)"
-	depends on UFS_FS && EXPERIMENTAL
 	help
-	  Say Y here if you want to try writing to UFS partitions. This is
-	  experimental, so you should back up your UFS partitions beforehand.
-
-config XFS_FS
-	tristate "XFS filesystem support"
-	---help---
-	  XFS is a high performance journaling filesystem which originated
-	  on the SGI IRIX platform.  It is completely multi-threaded, can
-	  support large files and large filesystems, extended attributes,
-	  variable block sizes, is extent based, and makes extensive use of
-	  Btrees (directories, extents, free space) to aid both performance
-	  and scalability.
-
-	  Refer to the documentation at <http://oss.sgi.com/projects/xfs/>
-	  for complete details.  This implementation is on-disk compatible
-	  with the IRIX version of XFS.
-
-	  If you want to compile this file system as a module ( = code which
-	  can be inserted in and removed from the running kernel whenever you
-	  want), say M here and read <file:Documentation/modules.txt>. The
-	  module will be called xfs.  Be aware, however, that if the file
-	  system of your root partition is compiled as a module, you'll need
-	  to use an initial ramdisk (initrd) to boot.
-
-config XFS_RT
-	bool "Realtime support (EXPERIMENTAL)"
-	depends on XFS_FS && EXPERIMENTAL
-	---help---
-	  If you say Y here you will be able to mount and use XFS filesystems
-	  which contain a realtime subvolume. The realtime subvolume is a
-	  separate area of disk space where only file data is stored. The
-	  realtime subvolume is designed to provide very deterministic
-	  data rates suitable for media streaming applications.
-
-	  See the xfs man page in section 5 for a bit more information.
-
-	  This feature is unsupported at this time, is not yet fully
-	  functional, and may cause serious problems.
-
-	  If unsure, say N.
-
-config XFS_QUOTA
-	bool "Quota support"
-	depends on XFS_FS
-	---help---
-	  If you say Y here, you will be able to set limits for disk usage on
-	  a per user and/or a per group basis under XFS.  XFS considers quota
-	  information as filesystem metadata and uses journaling to provide a
-	  higher level guarantee of consistency.  The on-disk data format for
-	  quota is also compatible with the IRIX version of XFS, allowing a
-	  filesystem to be migrated between Linux and IRIX without any need
-	  for conversion.
-
-	  If unsure, say N.  More comprehensive documentation can be found in
-	  README.quota in the xfsprogs package.  XFS quota can be used either
-	  with or without the generic quota support enabled (CONFIG_QUOTA) -
-	  they are completely independent subsystems.
-
-config XFS_POSIX_ACL
-	bool "ACL support"
-	depends on XFS_FS
-	---help---
-	  Posix Access Control Lists (ACLs) support permissions for users and
-	  groups beyond the owner/group/world scheme.
-
-	  To learn more about Access Control Lists, visit the Posix ACLs for
-	  Linux website <http://acl.bestbits.at/>.
-
-	  If you don't know what Access Control Lists are, say N
-
+	  BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
+	  OpenBSD and NeXTstep) use a file system called UFS. Some System V
+	  Unixes can create and mount hard disk partitions and diskettes using
+	  this file system as well. Saying Y here will allow you to read from
+	  these partitions; if you also want to write to them, say Y to the
+	  experimental "UFS file system write support", below. Please read the
+	  file <file:Documentation/filesystems/ufs.txt> for more information.
 
-menu "Network File Systems"
-	depends on NET
+	  If you only intend to mount files from some other Unix over the
+	  network using NFS, you don't need the UFS file system support (but
+	  you need NFS file system support obviously).
 
-config CODA_FS
-	tristate "Coda file system support (advanced network fs)"
-	depends on INET
-	---help---
-	  Coda is an advanced network file system, similar to NFS in that it
-	  enables you to mount file systems of a remote server and access them
-	  with regular Unix commands as if they were sitting on your hard
-	  disk.  Coda has several advantages over NFS: support for
-	  disconnected operation (e.g. for laptops), read/write server
-	  replication, security model for authentication and encryption,
-	  persistent client caches and write back caching.
+	  Note that this option is generally not needed for floppies, since a
+	  good portable way to transport files and directories between unixes
+	  (and even other operating systems) is given by the tar program ("man
+	  tar" or preferably "info tar").
 
-	  If you say Y here, your Linux box will be able to act as a Coda
-	  *client*.  You will need user level code as well, both for the
-	  client and server.  Servers are currently user level, i.e. they need
-	  no kernel support.  Please read
-	  <file:Documentation/filesystems/coda.txt> and check out the Coda
-	  home page <http://www.coda.cs.cmu.edu/>.
+	  When accessing NeXTstep files, you may need to convert them from the
+	  NeXT character set to the Latin1 character set; use the program
+	  recode ("info recode") for this purpose.
 
-	  If you want to compile the coda client support as a module ( = code
-	  which can be inserted in and removed from the running kernel
+	  If you want to compile the UFS file system support as a module ( =
+	  code which can be inserted in and removed from the running kernel
 	  whenever you want), say M here and read
-	  <file:Documentation/modules.txt>.  The module will be called coda.
+	  <file:Documentation/modules.txt>. The module will be called ufs.
 
-config INTERMEZZO_FS
-	tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
-	depends on INET && EXPERIMENTAL
+	  If you haven't heard about all of this before, it's safe to say N.
+
+config UFS_FS_WRITE
+	bool "UFS file system write support (DANGEROUS)"
+	depends on UFS_FS && EXPERIMENTAL
 	help
-	  InterMezzo is a networked file system with disconnected operation
-	  and kernel level write back caching.  It is most often used for
-	  replicating potentially large trees or keeping laptop/desktop copies
-	  in sync.
+	  Say Y here if you want to try writing to UFS partitions. This is
+	  experimental, so you should back up your UFS partitions beforehand.
 
-	  If you say Y or M your kernel or module will provide InterMezzo
-	  support.  You will also need a file server daemon, which you can get
-	  from <http://www.inter-mezzo.org/>.
+endmenu
+
+menu "Network File Systems"
+	depends on NET
 
 config NFS_FS
 	tristate "NFS file system support"
 	depends on INET
-	---help---
+	help
 	  If you are connected to some other (usually local) Unix computer
 	  (using SLIP, PLIP, PPP or Ethernet) and want to mount files residing
 	  on that computer (the NFS server) using the Network File Sharing
@@ -1268,24 +1277,10 @@
 
 	  If unsure, say N.
 
-config ROOT_NFS
-	bool "Root file system on NFS"
-	depends on NFS_FS=y && IP_PNP
-	help
-	  If you want your Linux box to mount its whole root file system (the
-	  one containing the directory /) from some other computer over the
-	  net via NFS (presumably because your box doesn't have a hard disk),
-	  say Y. Read <file:Documentation/nfsroot.txt> for details. It is
-	  likely that in this case, you also want to say Y to "Kernel level IP
-	  autoconfiguration" so that your box can discover its network address
-	  at boot time.
-
-	  Most people say N here.
-
 config NFSD
 	tristate "NFS server support"
 	depends on INET
-	---help---
+	help
 	  If you want your Linux box to act as an NFS *server*, so that other
 	  computers on your local network which support NFS can access certain
 	  directories on your box transparently, you have two options: you can
@@ -1334,34 +1329,19 @@
 	  Enable NFS service over TCP connections.  This the officially
 	  still experimental, but seems to work well.
 
-config SUNRPC
-	tristate
-	default m if NFS_FS!=y && NFSD!=y && (NFS_FS=m || NFSD=m)
-	default y if NFS_FS=y || NFSD=y
-
-config SUNRPC_GSS
-	tristate "Provide RPCSEC_GSS authentication (EXPERIMENTAL)"
-	depends on SUNRPC && EXPERIMENTAL
-	default SUNRPC if NFS_V4=y
-	help
-	  Provides cryptographic authentication for NFS rpc requests.  To
-	  make this useful, you must also select at least one rpcsec_gss
-	  mechanism.
-	  Note: You should always select this option if you wish to use
-	  NFSv4.
-
-config RPCSEC_GSS_KRB5
-	tristate "Kerberos V mechanism for RPCSEC_GSS (EXPERIMENTAL)"
-	depends on SUNRPC_GSS && CRYPTO_DES && CRYPTO_MD5
-	default SUNRPC_GSS if NFS_V4=y
+config ROOT_NFS
+	bool "Root file system on NFS"
+	depends on NFS_FS=y && IP_PNP
 	help
-	  Provides a gss-api mechanism based on Kerberos V5 (this is
-	  mandatory for RFC3010-compliant NFSv4 implementations).
-	  Requires a userspace daemon;
-		see http://www.citi.umich.edu/projects/nfsv4/.
+	  If you want your Linux box to mount its whole root file system (the
+	  one containing the directory /) from some other computer over the
+	  net via NFS (presumably because your box doesn't have a hard disk),
+	  say Y. Read <file:Documentation/nfsroot.txt> for details. It is
+	  likely that in this case, you also want to say Y to "Kernel level IP
+	  autoconfiguration" so that your box can discover its network address
+	  at boot time.
 
-	  Note: If you select this option, please ensure that you also
-	  enable the MD5 and DES crypto ciphers.
+	  Most people say N here.
 
 config LOCKD
 	tristate
@@ -1377,32 +1357,10 @@
 	tristate
 	default NFSD
 
-config CIFS
-	tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)(EXPERIMENTAL)"
-	depends on INET
-	---help---
-	  This is the client VFS module for the Common Internet File System
-	  (CIFS) protocol which is the successor to the Server Message Block 
-	  (SMB) protocol, the native file sharing mechanism for most early
-	  PC operating systems.  CIFS is fully supported by current network
-	  file servers such as Windows 2000 (including Windows NT version 4 
-	  and Windows XP) as well by Samba (which provides excellent CIFS
-	  server support for Linux and many other operating systems).  For
-	  production systems the smbfs module may be used instead of this
-	  cifs module since smbfs is currently more stable and provides
-	  support for older servers.  The intent of this module is to provide the
-	  most advanced network file system function for CIFS compliant servers, 
-	  including support for dfs (heirarchical name space), secure per-user
-	  session establishment, safe distributed caching (oplock), optional
-	  packet signing, Unicode and other internationalization improvements, and
-	  optional Winbind (nsswitch) integration.  This module is in an early
-	  development stage, so unless you are specifically interested in this
-	  filesystem, just say N.
-
 config SMB_FS
 	tristate "SMB file system support (to mount Windows shares etc.)"
 	depends on INET
-	---help---
+	help
 	  SMB (Server Message Block) is the protocol Windows for Workgroups
 	  (WfW), Windows 95/98, Windows NT and OS/2 Lan Manager use to share
 	  files and printers over local networks.  Saying Y here allows you to
@@ -1456,10 +1414,32 @@
 
 	  smbmount from samba 2.2.0 or later supports this.
 
+config CIFS
+	tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)(EXPERIMENTAL)"
+	depends on INET
+	help
+	  This is the client VFS module for the Common Internet File System
+	  (CIFS) protocol which is the successor to the Server Message Block 
+	  (SMB) protocol, the native file sharing mechanism for most early
+	  PC operating systems.  CIFS is fully supported by current network
+	  file servers such as Windows 2000 (including Windows NT version 4 
+	  and Windows XP) as well by Samba (which provides excellent CIFS
+	  server support for Linux and many other operating systems).  For
+	  production systems the smbfs module may be used instead of this
+	  cifs module since smbfs is currently more stable and provides
+	  support for older servers.  The intent of this module is to provide the
+	  most advanced network file system function for CIFS compliant servers, 
+	  including support for dfs (heirarchical name space), secure per-user
+	  session establishment, safe distributed caching (oplock), optional
+	  packet signing, Unicode and other internationalization improvements, and
+	  optional Winbind (nsswitch) integration.  This module is in an early
+	  development stage, so unless you are specifically interested in this
+	  filesystem, just say N.
+
 config NCP_FS
 	tristate "NCP file system support (to mount NetWare volumes)"
 	depends on IPX!=n || INET
-	---help---
+	help
 	  NCP (NetWare Core Protocol) is a protocol that runs over IPX and is
 	  used by Novell NetWare clients to talk to file servers.  It is to
 	  IPX what NFS is to TCP/IP, if that helps.  Saying Y here allows you
@@ -1480,10 +1460,76 @@
 	  will be called ncpfs.  Say N unless you are connected to a Novell
 	  network.
 
+config CODA_FS
+	tristate "Coda file system support (advanced network fs)"
+	depends on INET
+	help
+	  Coda is an advanced network file system, similar to NFS in that it
+	  enables you to mount file systems of a remote server and access them
+	  with regular Unix commands as if they were sitting on your hard
+	  disk.  Coda has several advantages over NFS: support for
+	  disconnected operation (e.g. for laptops), read/write server
+	  replication, security model for authentication and encryption,
+	  persistent client caches and write back caching.
+
+	  If you say Y here, your Linux box will be able to act as a Coda
+	  *client*.  You will need user level code as well, both for the
+	  client and server.  Servers are currently user level, i.e. they need
+	  no kernel support.  Please read
+	  <file:Documentation/filesystems/coda.txt> and check out the Coda
+	  home page <http://www.coda.cs.cmu.edu/>.
+
+	  If you want to compile the coda client support as a module ( = code
+	  which can be inserted in and removed from the running kernel
+	  whenever you want), say M here and read
+	  <file:Documentation/modules.txt>.  The module will be called coda.
+
+config INTERMEZZO_FS
+	tristate "InterMezzo file system support (replicating fs) (EXPERIMENTAL)"
+	depends on INET && EXPERIMENTAL
+	help
+	  InterMezzo is a networked file system with disconnected operation
+	  and kernel level write back caching.  It is most often used for
+	  replicating potentially large trees or keeping laptop/desktop copies
+	  in sync.
+
+	  If you say Y or M your kernel or module will provide InterMezzo
+	  support.  You will also need a file server daemon, which you can get
+	  from <http://www.inter-mezzo.org/>.
+
+config SUNRPC
+	tristate
+	default m if NFS_FS!=y && NFSD!=y && (NFS_FS=m || NFSD=m)
+	default y if NFS_FS=y || NFSD=y
+
+config SUNRPC_GSS
+	tristate "Provide RPCSEC_GSS authentication (EXPERIMENTAL)"
+	depends on SUNRPC && EXPERIMENTAL
+	default SUNRPC if NFS_V4=y
+	help
+	  Provides cryptographic authentication for NFS rpc requests.  To
+	  make this useful, you must also select at least one rpcsec_gss
+	  mechanism.
+	  Note: You should always select this option if you wish to use
+	  NFSv4.
+
+config RPCSEC_GSS_KRB5
+	tristate "Kerberos V mechanism for RPCSEC_GSS (EXPERIMENTAL)"
+	depends on SUNRPC_GSS && CRYPTO_DES && CRYPTO_MD5
+	default SUNRPC_GSS if NFS_V4=y
+	help
+	  Provides a gss-api mechanism based on Kerberos V5 (this is
+	  mandatory for RFC3010-compliant NFSv4 implementations).
+	  Requires a userspace daemon;
+		see http://www.citi.umich.edu/projects/nfsv4/.
+
+	  Note: If you select this option, please ensure that you also
+	  enable the MD5 and DES crypto ciphers.
+
 source "fs/ncpfs/Kconfig"
 
-# for fs/nls/Config.in
 config AFS_FS
+# for fs/nls/Config.in
 	tristate "Andrew File System support (AFS) (Experimental)"
 	depends on INET && EXPERIMENTAL
 	help
@@ -1501,29 +1547,6 @@
 
 endmenu
 
-# for fs/nls/Config.in
-config ZISOFS_FS
-	tristate
-	depends on ZISOFS
-	default ISO9660_FS
-
-# Meta block cache for Extended Attributes (ext2/ext3)
-config FS_MBCACHE
-	tristate
-	depends on EXT2_FS_XATTR || EXT3_FS_XATTR
-	default y if EXT2_FS=y || EXT3_FS=y
-	default m if EXT2_FS=m || EXT3_FS=m
-
-# Posix ACL utility routines (for now, only ext2/ext3/jfs)
-#
-# NOTE: you can implement Posix ACLs without these helpers (XFS does).
-# 	Never use this symbol for ifdefs.
-#
-config FS_POSIX_ACL
-	bool
-	depends on EXT2_FS_POSIX_ACL || EXT3_FS_POSIX_ACL || JFS_POSIX_ACL
-	default y
-
 menu "Partition Types"
 
 source "fs/partitions/Kconfig"
diff -urN linux-2.5.64-bk10/fs/seq_file.c linux-2.5.64-bk11/fs/seq_file.c
--- linux-2.5.64-bk10/fs/seq_file.c	Tue Mar  4 19:29:31 2003
+++ linux-2.5.64-bk11/fs/seq_file.c	Mon Mar 31 12:34:56 2003
@@ -1,7 +1,7 @@
 /*
  * linux/fs/seq_file.c
  *
- * helper functions for making syntetic files from sequences of records.
+ * helper functions for making synthetic files from sequences of records.
  * initial implementation -- AV, Oct 2001.
  */
 
@@ -215,7 +215,7 @@
 				while ((retval=traverse(m, offset)) == -EAGAIN)
 					;
 				if (retval) {
-					/* with extreme perjudice... */
+					/* with extreme prejudice... */
 					file->f_pos = 0;
 					m->index = 0;
 					m->count = 0;
diff -urN linux-2.5.64-bk10/include/asm-ppc/processor.h linux-2.5.64-bk11/include/asm-ppc/processor.h
--- linux-2.5.64-bk10/include/asm-ppc/processor.h	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/include/asm-ppc/processor.h	Mon Mar 31 12:34:56 2003
@@ -469,8 +469,8 @@
 #define	ICMP	SPRN_ICMP	/* Instruction TLB Compare Register */
 #define	IMISS	SPRN_IMISS	/* Instruction TLB Miss Register */
 #define	IMMR	SPRN_IMMR      	/* PPC 860/821 Internal Memory Map Register */
-#define	L2CR	SPRN_L2CR    	/* PPC 750 L2 control register */
-#define	L3CR	SPRN_L3CR    	/* PPC 7450 L3 Cache control register */
+#define	L2CR	SPRN_L2CR    	/* Classic PPC L2 cache control register */
+#define	L3CR	SPRN_L3CR	/* PPC 745x L3 cache control register */
 #define	LR	SPRN_LR
 #define	PVR	SPRN_PVR	/* Processor Version */
 #define	RPA	SPRN_RPA	/* Required Physical Address Register */
@@ -609,7 +609,7 @@
 void release_thread(struct task_struct *);
 
 /* Prepare to copy thread state - unlazy all lazy status */
-#define prepare_to_copy(tsk)	do { } while (0)
+extern void prepare_to_copy(struct task_struct *tsk);
 
 /*
  * Create a new kernel thread.
diff -urN linux-2.5.64-bk10/include/asm-ppc64/compat.h linux-2.5.64-bk11/include/asm-ppc64/compat.h
--- linux-2.5.64-bk10/include/asm-ppc64/compat.h	Tue Mar  4 19:29:03 2003
+++ linux-2.5.64-bk11/include/asm-ppc64/compat.h	Mon Mar 31 12:34:56 2003
@@ -61,7 +61,18 @@
 	compat_off_t	l_start;
 	compat_off_t	l_len;
 	compat_pid_t	l_pid;
-	short		__unused;
+};
+
+#define F_GETLK64	12	/*  using 'struct flock64' */
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+struct compat_flock64 {
+	short		l_type;
+	short		l_whence;
+	compat_loff_t	l_start;
+	compat_loff_t	l_len;
+	compat_pid_t	l_pid;
 };
 
 struct compat_statfs {
@@ -84,4 +95,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_PPC64_COMPAT_H */
diff -urN linux-2.5.64-bk10/include/asm-ppc64/fcntl.h linux-2.5.64-bk11/include/asm-ppc64/fcntl.h
--- linux-2.5.64-bk10/include/asm-ppc64/fcntl.h	Tue Mar  4 19:28:55 2003
+++ linux-2.5.64-bk11/include/asm-ppc64/fcntl.h	Mon Mar 31 12:34:56 2003
@@ -42,10 +42,6 @@
 #define F_SETSIG	10	/*  for sockets. */
 #define F_GETSIG	11	/*  for sockets. */
 
-#define F_GETLK64	12	/*  using 'struct flock64' */
-#define F_SETLK64	13
-#define F_SETLKW64	14
-
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
@@ -87,13 +83,6 @@
 	pid_t l_pid;
 };
 
-struct flock64 {
-	short  l_type;
-	short  l_whence;
-	loff_t l_start;
-	loff_t l_len;
-	pid_t  l_pid;
-};
-
 #define F_LINUX_SPECIFIC_BASE	1024
+
 #endif /* _PPC64_FCNTL_H */
diff -urN linux-2.5.64-bk10/include/asm-ppc64/pci-bridge.h linux-2.5.64-bk11/include/asm-ppc64/pci-bridge.h
--- linux-2.5.64-bk10/include/asm-ppc64/pci-bridge.h	Tue Mar  4 19:28:58 2003
+++ linux-2.5.64-bk11/include/asm-ppc64/pci-bridge.h	Mon Mar 31 12:34:56 2003
@@ -20,7 +20,8 @@
 	phb_type_unknown    = 0x0,
 	phb_type_hypervisor = 0x1,
 	phb_type_python     = 0x10,
-	phb_type_speedwagon = 0x11
+	phb_type_speedwagon = 0x11,
+	phb_type_winnipeg   = 0x12
 };
 
 /*
diff -urN linux-2.5.64-bk10/include/asm-ppc64/topology.h linux-2.5.64-bk11/include/asm-ppc64/topology.h
--- linux-2.5.64-bk10/include/asm-ppc64/topology.h	Tue Mar  4 19:29:53 2003
+++ linux-2.5.64-bk11/include/asm-ppc64/topology.h	Mon Mar 31 12:34:56 2003
@@ -1,6 +1,7 @@
 #ifndef _ASM_PPC64_TOPOLOGY_H
 #define _ASM_PPC64_TOPOLOGY_H
 
+#include <linux/config.h>
 #include <asm/mmzone.h>
 
 #ifdef CONFIG_NUMA
diff -urN linux-2.5.64-bk10/include/linux/list.h linux-2.5.64-bk11/include/linux/list.h
--- linux-2.5.64-bk10/include/linux/list.h	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/include/linux/list.h	Mon Mar 31 12:34:56 2003
@@ -5,7 +5,6 @@
 
 #include <linux/stddef.h>
 #include <linux/prefetch.h>
-#include <linux/stddef.h>
 #include <asm/system.h>
 
 /*
diff -urN linux-2.5.64-bk10/include/linux/pci_ids.h linux-2.5.64-bk11/include/linux/pci_ids.h
--- linux-2.5.64-bk10/include/linux/pci_ids.h	Mon Mar 31 12:34:52 2003
+++ linux-2.5.64-bk11/include/linux/pci_ids.h	Mon Mar 31 12:34:56 2003
@@ -1235,6 +1235,7 @@
 
 #define PCI_VENDOR_ID_XIRCOM		0x115d
 #define PCI_DEVICE_ID_XIRCOM_X3201_ETH	0x0003
+#define PCI_DEVICE_ID_XIRCOM_RBM56G	0x0101
 #define PCI_DEVICE_ID_XIRCOM_X3201_MDM	0x0103
 
 #define PCI_VENDOR_ID_RENDITION		0x1163
diff -urN linux-2.5.64-bk10/include/linux/serial_core.h linux-2.5.64-bk11/include/linux/serial_core.h
--- linux-2.5.64-bk10/include/linux/serial_core.h	Tue Mar  4 19:28:59 2003
+++ linux-2.5.64-bk11/include/linux/serial_core.h	Mon Mar 31 12:34:56 2003
@@ -208,12 +208,11 @@
 #define USF_CLOSING_WAIT_NONE	(65535)
 
 	int			count;
+	int			pm_state;
 	struct uart_info	*info;
 	struct uart_port	*port;
 
-#ifdef CONFIG_PM
-	struct pm_dev		*pm;
-#endif
+	struct semaphore	sem;
 };
 
 #define UART_XMIT_SIZE 1024
@@ -224,8 +223,6 @@
  * stuff here.
  */
 struct uart_info {
-	struct uart_port	*port;
-	struct uart_state	*state;
 	struct tty_struct	*tty;
 	struct circ_buf		xmit;
 	unsigned int		flags;
@@ -237,7 +234,6 @@
  */
 #define UIF_CHECK_CD		(1 << 25)
 #define UIF_CTS_FLOW		(1 << 26)
-#define UIF_CLOSING		(1 << 27)
 #define UIF_NORMAL_ACTIVE	(1 << 29)
 #define UIF_INITIALIZED		(1 << 31)
 
@@ -307,6 +303,12 @@
 int uart_add_one_port(struct uart_driver *reg, struct uart_port *port);
 int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
 
+/*
+ * Power Management
+ */
+int uart_suspend_port(struct uart_driver *reg, struct uart_port *port, u32 level);
+int uart_resume_port(struct uart_driver *reg, struct uart_port *port, u32 level);
+
 #define uart_circ_empty(circ)		((circ)->head == (circ)->tail)
 #define uart_circ_clear(circ)		((circ)->head = (circ)->tail = 0)
 
diff -urN linux-2.5.64-bk10/scripts/kconfig/Makefile linux-2.5.64-bk11/scripts/kconfig/Makefile
--- linux-2.5.64-bk10/scripts/kconfig/Makefile	Tue Mar  4 19:29:54 2003
+++ linux-2.5.64-bk11/scripts/kconfig/Makefile	Mon Mar 31 12:34:56 2003
@@ -6,20 +6,29 @@
 #         Utilizes the lxdialog package
 # qconf:  Used for the xconfig target
 #         Based on QT which needs to be installed to compile it
+# gconf:  Used for the gconfig target
+#         Based on GTK which needs to be installed to compile it
 #
+#################
 
 # object files used by all lkc flavours
 libkconfig-objs := zconf.tab.o
 
-host-progs	:= conf mconf qconf
+host-progs	:= conf mconf qconf gconf
 conf-objs	:= conf.o  libkconfig.so
 mconf-objs	:= mconf.o libkconfig.so
 
-qconf-objs	:= kconfig_load.o
+ifeq ($(MAKECMDGOALS),$(obj)/qconf)
 qconf-cxxobjs	:= qconf.o
+qconf-objs	:= kconfig_load.o
+endif
+
+ifeq ($(MAKECMDGOALS),$(obj)/gconf)
+gconf-objs	:= gconf.o kconfig_load.o
+endif
 
 clean-files	:= libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \
-		   zconf.tab.c zconf.tab.h lex.zconf.c
+		   .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c
 
 # generated files seem to need this to find local include files
 HOSTCFLAGS_lex.zconf.o	:= -I$(src)
@@ -28,7 +37,10 @@
 HOSTLOADLIBES_qconf	= -L$(QTDIR)/lib -Wl,-rpath,$(QTDIR)/lib -l$(QTLIB) -ldl
 HOSTCXXFLAGS_qconf.o	= -I$(QTDIR)/include 
 
-$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o: $(obj)/zconf.tab.h
+HOSTLOADLIBES_gconf	= `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
+HOSTCFLAGS_gconf.o	= `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags`
+
+$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
 
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
@@ -38,7 +50,7 @@
 
 # QT needs some extra effort...
 $(obj)/.tmp_qtcheck:
-	@set -e; for d in $$QTDIR /usr/share/qt /usr/lib/qt*3*; do \
+	@set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
 	  if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \
 	done; \
 	if [ -z "$$DIR" ]; then \
@@ -60,12 +72,40 @@
 	fi
 endif
 
+$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
+
+ifeq ($(MAKECMDGOALS),$(obj)/gconf)
+-include $(obj)/.tmp_gtkcheck
+
+# GTK needs some extra effort, too...
+$(obj)/.tmp_gtkcheck:
+	@if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then		\
+		if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then			\
+			touch $@;								\
+		else									\
+			echo "*"; 							\
+			echo "* GTK+ is present but version >= 2.0.0 is required.";	\
+			echo "*";							\
+			false;								\
+		fi									\
+	else										\
+		echo "*"; 								\
+		echo "* Unable to find the GTK+ installation. Please make sure that"; 	\
+		echo "* the GTK+ 2.0 development package is correctly installed..."; 	\
+		echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; 		\
+		echo "*"; 								\
+		false;									\
+	fi
+endif
+
 $(obj)/zconf.tab.o: $(obj)/lex.zconf.c
 
 $(obj)/kconfig_load.o: $(obj)/lkc_defs.h
 
 $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
 
+$(obj)/gconf.o: $(obj)/lkc_defs.h
+
 $(obj)/%.moc: $(src)/%.h
 	$(MOC) -i $< -o $@
 
diff -urN linux-2.5.64-bk10/scripts/kconfig/expr.h linux-2.5.64-bk11/scripts/kconfig/expr.h
--- linux-2.5.64-bk10/scripts/kconfig/expr.h	Tue Mar  4 19:29:24 2003
+++ linux-2.5.64-bk11/scripts/kconfig/expr.h	Mon Mar 31 12:34:56 2003
@@ -155,9 +155,11 @@
 #define for_all_properties(sym, st, tok) \
 	for (st = sym->prop; st; st = st->next) \
 		if (st->type == (tok))
-#define for_all_prompts(sym, st) for_all_properties(sym, st, P_PROMPT)
 #define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT)
 #define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE)
+#define for_all_prompts(sym, st) \
+	for (st = sym->prop; st; st = st->next) \
+		if (st->text)
 
 struct menu {
 	struct menu *next;
diff -urN linux-2.5.64-bk10/scripts/kconfig/gconf.c linux-2.5.64-bk11/scripts/kconfig/gconf.c
--- linux-2.5.64-bk10/scripts/kconfig/gconf.c	Wed Dec 31 16:00:00 1969
+++ linux-2.5.64-bk11/scripts/kconfig/gconf.c	Mon Mar 31 12:34:56 2003
@@ -0,0 +1,1580 @@
+/* Hey EMACS -*- linux-c -*- */
+/*
+ *
+ * Copyright (C) 2002-2003 Romain Lievin <roms@lpg.ticalc.org>
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include "lkc.h"
+#include "images.c"
+
+#include <glade/glade.h>
+#include <gtk/gtk.h>
+#include <glib.h>
+#include <gdk/gdkkeysyms.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <stdlib.h>
+
+//#define DEBUG
+
+enum {
+	SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW
+};
+
+static gint view_mode = SPLIT_VIEW;
+static gboolean show_name = TRUE;
+static gboolean show_range = TRUE;
+static gboolean show_value = TRUE;
+static gboolean show_all = FALSE;
+static gboolean show_debug = FALSE;
+static gboolean resizeable = FALSE;
+
+static gboolean config_changed = FALSE;
+
+static char nohelp_text[] =
+    "Sorry, no help available for this option yet.\n";
+
+GtkWidget *main_wnd = NULL;
+GtkWidget *tree1_w = NULL;	// left  frame
+GtkWidget *tree2_w = NULL;	// right frame
+GtkWidget *text_w = NULL;
+GtkWidget *hpaned = NULL;
+GtkWidget *vpaned = NULL;
+GtkWidget *back_btn = NULL;
+
+GtkTextTag *tag1, *tag2;
+GdkColor color;
+
+GtkTreeStore *tree1, *tree2, *tree;
+GtkTreeModel *model1, *model2;
+static GtkTreeIter *parents[256] = { 0 };
+static gint indent;
+
+static struct menu *current;
+
+enum {
+	COL_OPTION, COL_NAME, COL_NO, COL_MOD, COL_YES, COL_VALUE,
+	COL_MENU, COL_COLOR, COL_EDIT, COL_PIXBUF,
+	COL_PIXVIS, COL_BTNVIS, COL_BTNACT, COL_BTNINC,
+	COL_NUMBER
+};
+
+static void display_list(void);
+static void display_tree(struct menu *menu);
+static void display_tree_part(void);
+static void update_tree(struct menu *src, GtkTreeIter * dst);
+static void set_node2(GtkTreeIter * node, struct menu *menu, gchar ** row);
+static gchar **fill_row(struct menu *menu);
+
+
+/* Helping/Debugging Functions */
+
+
+const char *dbg_print_stype(int val)
+{
+	static char buf[256];
+
+	bzero(buf, 256);
+
+	if (val == S_UNKNOWN)
+		strcpy(buf, "unknown");
+	if (val == S_BOOLEAN)
+		strcpy(buf, "boolean");
+	if (val == S_TRISTATE)
+		strcpy(buf, "tristate");
+	if (val == S_INT)
+		strcpy(buf, "int");
+	if (val == S_HEX)
+		strcpy(buf, "hex");
+	if (val == S_STRING)
+		strcpy(buf, "string");
+	if (val == S_OTHER)
+		strcpy(buf, "other");
+
+#ifdef DEBUG
+	printf("%s", buf);
+#endif
+
+	return buf;
+}
+
+const char *dbg_print_flags(int val)
+{
+	static char buf[256] = { 0 };
+
+	bzero(buf, 256);
+
+	if (val & SYMBOL_YES)
+		strcat(buf, "yes/");
+	if (val & SYMBOL_MOD)
+		strcat(buf, "mod/");
+	if (val & SYMBOL_NO)
+		strcat(buf, "no/");
+	if (val & SYMBOL_CONST)
+		strcat(buf, "const/");
+	if (val & SYMBOL_CHECK)
+		strcat(buf, "check/");
+	if (val & SYMBOL_CHOICE)
+		strcat(buf, "choice/");
+	if (val & SYMBOL_CHOICEVAL)
+		strcat(buf, "choiceval/");
+	if (val & SYMBOL_PRINTED)
+		strcat(buf, "printed/");
+	if (val & SYMBOL_VALID)
+		strcat(buf, "valid/");
+	if (val & SYMBOL_OPTIONAL)
+		strcat(buf, "optional/");
+	if (val & SYMBOL_WRITE)
+		strcat(buf, "write/");
+	if (val & SYMBOL_CHANGED)
+		strcat(buf, "changed/");
+	if (val & SYMBOL_NEW)
+		strcat(buf, "new/");
+	if (val & SYMBOL_AUTO)
+		strcat(buf, "auto/");
+
+	buf[strlen(buf) - 1] = '\0';
+#ifdef DEBUG
+	printf("%s", buf);
+#endif
+
+	return buf;
+}
+
+const char *dbg_print_ptype(int val)
+{
+	static char buf[256];
+
+	bzero(buf, 256);
+
+	if (val == P_UNKNOWN)
+		strcpy(buf, "unknown");
+	if (val == P_PROMPT)
+		strcpy(buf, "prompt");
+	if (val == P_COMMENT)
+		strcpy(buf, "comment");
+	if (val == P_MENU)
+		strcpy(buf, "menu");
+	if (val == P_ROOTMENU)
+		strcpy(buf, "rootmenu");
+	if (val == P_DEFAULT)
+		strcpy(buf, "default");
+	if (val == P_CHOICE)
+		strcpy(buf, "choice");
+
+#ifdef DEBUG
+	printf("%s", buf);
+#endif
+
+	return buf;
+}
+
+
+/* Main Window Initialization */
+
+
+void init_main_window(const gchar * glade_file)
+{
+	GladeXML *xml;
+	GtkWidget *widget;
+	GtkTextBuffer *txtbuf;
+	char title[256];
+	GdkPixmap *pixmap;
+	GdkBitmap *mask;
+	GtkStyle *style;
+
+	xml = glade_xml_new(glade_file, "window1", NULL);
+	if (!xml)
+		g_error("GUI loading failed !\n");
+	glade_xml_signal_autoconnect(xml);
+
+	main_wnd = glade_xml_get_widget(xml, "window1");
+	hpaned = glade_xml_get_widget(xml, "hpaned1");
+	vpaned = glade_xml_get_widget(xml, "vpaned1");
+	tree1_w = glade_xml_get_widget(xml, "treeview1");
+	tree2_w = glade_xml_get_widget(xml, "treeview2");
+	text_w = glade_xml_get_widget(xml, "textview3");
+
+	back_btn = glade_xml_get_widget(xml, "button1");
+	gtk_widget_set_sensitive(back_btn, FALSE);
+
+	widget = glade_xml_get_widget(xml, "show_name1");
+	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
+				       show_name);
+
+	widget = glade_xml_get_widget(xml, "show_range1");
+	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
+				       show_range);
+
+	widget = glade_xml_get_widget(xml, "show_data1");
+	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
+				       show_value);
+
+	style = gtk_widget_get_style(main_wnd);
+	widget = glade_xml_get_widget(xml, "toolbar1");
+
+	pixmap = gdk_pixmap_create_from_xpm_d(main_wnd->window, &mask,
+					      &style->bg[GTK_STATE_NORMAL],
+					      (gchar **) xpm_single_view);
+	gtk_image_set_from_pixmap(GTK_IMAGE
+				  (((GtkToolbarChild
+				     *) (g_list_nth(GTK_TOOLBAR(widget)->
+						    children,
+						    5)->data))->icon),
+				  pixmap, mask);
+	pixmap =
+	    gdk_pixmap_create_from_xpm_d(main_wnd->window, &mask,
+					 &style->bg[GTK_STATE_NORMAL],
+					 (gchar **) xpm_split_view);
+	gtk_image_set_from_pixmap(GTK_IMAGE
+				  (((GtkToolbarChild
+				     *) (g_list_nth(GTK_TOOLBAR(widget)->
+						    children,
+						    6)->data))->icon),
+				  pixmap, mask);
+	pixmap =
+	    gdk_pixmap_create_from_xpm_d(main_wnd->window, &mask,
+					 &style->bg[GTK_STATE_NORMAL],
+					 (gchar **) xpm_tree_view);
+	gtk_image_set_from_pixmap(GTK_IMAGE
+				  (((GtkToolbarChild
+				     *) (g_list_nth(GTK_TOOLBAR(widget)->
+						    children,
+						    7)->data))->icon),
+				  pixmap, mask);
+
+	switch (view_mode) {
+	case SINGLE_VIEW:
+		widget = glade_xml_get_widget(xml, "button4");
+		gtk_button_clicked(GTK_BUTTON(widget));
+		break;
+	case SPLIT_VIEW:
+		widget = glade_xml_get_widget(xml, "button5");
+		gtk_button_clicked(GTK_BUTTON(widget));
+		break;
+	case FULL_VIEW:
+		widget = glade_xml_get_widget(xml, "button6");
+		gtk_button_clicked(GTK_BUTTON(widget));
+		break;
+	}
+
+	txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
+	tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
+					  "foreground", "red",
+					  "weight", PANGO_WEIGHT_BOLD,
+					  NULL);
+	tag2 = gtk_text_buffer_create_tag(txtbuf, "mytag2",
+					  /*"style", PANGO_STYLE_OBLIQUE, */
+					  NULL);
+
+	sprintf(title, "Linux Kernel v%s.%s.%s%s Configuration",
+		getenv("VERSION"), getenv("PATCHLEVEL"),
+		getenv("SUBLEVEL"), getenv("EXTRAVERSION"));
+	gtk_window_set_title(GTK_WINDOW(main_wnd), title);
+
+	gtk_widget_show(main_wnd);
+}
+
+void init_tree_model(void)
+{
+	gint i;
+
+	tree = tree2 = gtk_tree_store_new(COL_NUMBER,
+					  G_TYPE_STRING, G_TYPE_STRING,
+					  G_TYPE_STRING, G_TYPE_STRING,
+					  G_TYPE_STRING, G_TYPE_STRING,
+					  G_TYPE_POINTER, GDK_TYPE_COLOR,
+					  G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
+					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+	model2 = GTK_TREE_MODEL(tree2);
+
+	for (parents[0] = NULL, i = 1; i < 256; i++)
+		parents[i] = (GtkTreeIter *) g_malloc(sizeof(GtkTreeIter));
+
+	tree1 = gtk_tree_store_new(COL_NUMBER,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_POINTER, GDK_TYPE_COLOR,
+				   G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
+				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
+	model1 = GTK_TREE_MODEL(tree1);
+}
+
+void init_left_tree(void)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
+	GtkCellRenderer *renderer;
+	GtkTreeSelection *sel;
+
+	gtk_tree_view_set_model(view, model1);
+	gtk_tree_view_set_headers_visible(view, TRUE);
+	gtk_tree_view_set_rules_hint(view, FALSE);
+
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Options", renderer,
+						    "text", COL_OPTION,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+
+	sel = gtk_tree_view_get_selection(view);
+	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
+	gtk_widget_realize(tree1_w);
+}
+
+static void renderer_edited(GtkCellRendererText * cell,
+			    const gchar * path_string,
+			    const gchar * new_text, gpointer user_data);
+static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle,
+			     gchar * arg1, gpointer user_data);
+
+void init_right_tree(void)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(tree2_w);
+	GtkCellRenderer *renderer;
+	GtkTreeSelection *sel;
+	GtkTreeViewColumn *column;
+	gint i;
+
+	gtk_tree_view_set_model(view, model2);
+	gtk_tree_view_set_headers_visible(view, TRUE);
+	gtk_tree_view_set_rules_hint(view, FALSE);
+
+	column = gtk_tree_view_column_new();
+	gtk_tree_view_append_column(view, column);
+	gtk_tree_view_column_set_title(column, "Options");
+
+	renderer = gtk_cell_renderer_pixbuf_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "pixbuf", COL_PIXBUF,
+					    "visible", COL_PIXVIS, NULL);
+	renderer = gtk_cell_renderer_toggle_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "active", COL_BTNACT,
+					    "inconsistent", COL_BTNINC,
+					    "visible", COL_BTNVIS, NULL);
+	g_signal_connect(G_OBJECT(renderer), "toggled",
+			 G_CALLBACK(renderer_toggled), NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "text", COL_OPTION,
+					    "foreground-gdk",
+					    COL_COLOR, NULL);
+
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Name", renderer,
+						    "text", COL_NAME,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "N", renderer,
+						    "text", COL_NO,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "M", renderer,
+						    "text", COL_MOD,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Y", renderer,
+						    "text", COL_YES,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Value", renderer,
+						    "text", COL_VALUE,
+						    "editable",
+						    COL_EDIT,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	g_signal_connect(G_OBJECT(renderer), "edited",
+			 G_CALLBACK(renderer_edited), NULL);
+
+	column = gtk_tree_view_get_column(view, COL_NAME);
+	gtk_tree_view_column_set_visible(column, show_name);
+	column = gtk_tree_view_get_column(view, COL_NO);
+	gtk_tree_view_column_set_visible(column, show_range);
+	column = gtk_tree_view_get_column(view, COL_MOD);
+	gtk_tree_view_column_set_visible(column, show_range);
+	column = gtk_tree_view_get_column(view, COL_YES);
+	gtk_tree_view_column_set_visible(column, show_range);
+	column = gtk_tree_view_get_column(view, COL_VALUE);
+	gtk_tree_view_column_set_visible(column, show_value);
+
+	if (resizeable) {
+		for (i = 0; i < COL_VALUE; i++) {
+			column = gtk_tree_view_get_column(view, i);
+			gtk_tree_view_column_set_resizable(column, TRUE);
+		}
+	}
+
+	sel = gtk_tree_view_get_selection(view);
+	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
+}
+
+
+/* Utility Functions */
+
+
+static void text_insert_help(struct menu *menu)
+{
+	GtkTextBuffer *buffer;
+	GtkTextIter start, end;
+	const char *prompt = menu_get_prompt(menu);
+	gchar *name;
+	const char *help = nohelp_text;
+
+	if (!menu->sym)
+		help = "";
+	else if (menu->sym->help)
+		help = menu->sym->help;
+
+	if (menu->sym && menu->sym->name)
+		name = g_strdup_printf(menu->sym->name);
+	else
+		name = g_strdup("");
+
+	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
+	gtk_text_buffer_get_bounds(buffer, &start, &end);
+	gtk_text_buffer_delete(buffer, &start, &end);
+	gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text_w), 15);
+
+	gtk_text_buffer_get_end_iter(buffer, &end);
+	gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1,
+					 NULL);
+	gtk_text_buffer_insert_at_cursor(buffer, " ", 1);
+	gtk_text_buffer_get_end_iter(buffer, &end);
+	gtk_text_buffer_insert_with_tags(buffer, &end, name, -1, tag1,
+					 NULL);
+	gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2);
+	gtk_text_buffer_get_end_iter(buffer, &end);
+	gtk_text_buffer_insert_with_tags(buffer, &end, help, -1, tag2,
+					 NULL);
+}
+
+
+static void text_insert_msg(const char *title, const char *message)
+{
+	GtkTextBuffer *buffer;
+	GtkTextIter start, end;
+	const char *msg = message;
+
+	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
+	gtk_text_buffer_get_bounds(buffer, &start, &end);
+	gtk_text_buffer_delete(buffer, &start, &end);
+	gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text_w), 15);
+
+	gtk_text_buffer_get_end_iter(buffer, &end);
+	gtk_text_buffer_insert_with_tags(buffer, &end, title, -1, tag1,
+					 NULL);
+	gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2);
+	gtk_text_buffer_get_end_iter(buffer, &end);
+	gtk_text_buffer_insert_with_tags(buffer, &end, msg, -1, tag2,
+					 NULL);
+}
+
+
+/* Main Windows Callbacks */
+
+void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data);
+gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
+				 gpointer user_data)
+{
+	GtkWidget *dialog, *label;
+	gint result;
+
+	if (config_changed == FALSE)
+		return FALSE;
+
+	dialog = gtk_dialog_new_with_buttons("Warning !",
+					     GTK_WINDOW(main_wnd),
+					     (GtkDialogFlags)
+					     (GTK_DIALOG_MODAL |
+					      GTK_DIALOG_DESTROY_WITH_PARENT),
+					     GTK_STOCK_OK,
+					     GTK_RESPONSE_YES,
+					     GTK_STOCK_NO,
+					     GTK_RESPONSE_NO,
+					     GTK_STOCK_CANCEL,
+					     GTK_RESPONSE_CANCEL, NULL);
+	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
+					GTK_RESPONSE_CANCEL);
+
+	label = gtk_label_new("\nSave configuration ?\n");
+	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
+	gtk_widget_show(label);
+
+	result = gtk_dialog_run(GTK_DIALOG(dialog));
+	switch (result) {
+	case GTK_RESPONSE_YES:
+		on_save1_activate(NULL, NULL);
+		return FALSE;
+	case GTK_RESPONSE_NO:
+		return FALSE;
+	case GTK_RESPONSE_CANCEL:
+	case GTK_RESPONSE_DELETE_EVENT:
+	default:
+		gtk_widget_destroy(dialog);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+
+void on_window1_destroy(GtkObject * object, gpointer user_data)
+{
+	gtk_main_quit();
+}
+
+
+void
+on_window1_size_request(GtkWidget * widget,
+			GtkRequisition * requisition, gpointer user_data)
+{
+	static gint old_h = 0;
+	gint w, h;
+
+	if (widget->window == NULL)
+		gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
+	else
+		gdk_window_get_size(widget->window, &w, &h);
+
+	if (h == old_h)
+		return;
+	old_h = h;
+
+	gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
+}
+
+
+/* Menu & Toolbar Callbacks */
+
+
+static void
+load_filename(GtkFileSelection * file_selector, gpointer user_data)
+{
+	const gchar *fn;
+
+	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
+					     (user_data));
+
+	if (conf_read(fn))
+		text_insert_msg("Error", "Unable to load configuration !");
+	else
+		display_tree(&rootmenu);
+}
+
+void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkWidget *fs;
+
+	fs = gtk_file_selection_new("Load file...");
+	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
+			 "clicked",
+			 G_CALLBACK(load_filename), (gpointer) fs);
+	g_signal_connect_swapped(GTK_OBJECT
+				 (GTK_FILE_SELECTION(fs)->ok_button),
+				 "clicked", G_CALLBACK(gtk_widget_destroy),
+				 (gpointer) fs);
+	g_signal_connect_swapped(GTK_OBJECT
+				 (GTK_FILE_SELECTION(fs)->cancel_button),
+				 "clicked", G_CALLBACK(gtk_widget_destroy),
+				 (gpointer) fs);
+	gtk_widget_show(fs);
+}
+
+
+void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	if (conf_write(NULL))
+		text_insert_msg("Error", "Unable to save configuration !");
+
+	config_changed = FALSE;
+}
+
+
+static void
+store_filename(GtkFileSelection * file_selector, gpointer user_data)
+{
+	const gchar *fn;
+
+	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
+					     (user_data));
+
+	if (conf_write(fn))
+		text_insert_msg("Error", "Unable to save configuration !");
+
+	gtk_widget_destroy(GTK_WIDGET(user_data));
+}
+
+void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkWidget *fs;
+
+	fs = gtk_file_selection_new("Save file as...");
+	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
+			 "clicked",
+			 G_CALLBACK(store_filename), (gpointer) fs);
+	g_signal_connect_swapped(GTK_OBJECT
+				 (GTK_FILE_SELECTION(fs)->ok_button),
+				 "clicked", G_CALLBACK(gtk_widget_destroy),
+				 (gpointer) fs);
+	g_signal_connect_swapped(GTK_OBJECT
+				 (GTK_FILE_SELECTION(fs)->cancel_button),
+				 "clicked", G_CALLBACK(gtk_widget_destroy),
+				 (gpointer) fs);
+	gtk_widget_show(fs);
+}
+
+
+void on_quit1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	if (!on_window1_delete_event(NULL, NULL, NULL))
+		gtk_widget_destroy(GTK_WIDGET(main_wnd));
+}
+
+
+void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkTreeViewColumn *col;
+
+	show_name = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NAME);
+	if (col)
+		gtk_tree_view_column_set_visible(col, show_name);
+}
+
+
+void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkTreeViewColumn *col;
+
+	show_range = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NO);
+	if (col)
+		gtk_tree_view_column_set_visible(col, show_range);
+	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_MOD);
+	if (col)
+		gtk_tree_view_column_set_visible(col, show_range);
+	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_YES);
+	if (col)
+		gtk_tree_view_column_set_visible(col, show_range);
+
+}
+
+
+void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkTreeViewColumn *col;
+
+	show_value = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_VALUE);
+	if (col)
+		gtk_tree_view_column_set_visible(col, show_value);
+}
+
+
+void
+on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	show_all = GTK_CHECK_MENU_ITEM(menuitem)->active;
+
+	gtk_tree_store_clear(tree2);
+	display_tree(&rootmenu);	// instead of update_tree for speed reasons
+}
+
+
+void
+on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	show_debug = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	update_tree(&rootmenu, NULL);
+}
+
+
+void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkWidget *dialog;
+	const gchar *intro_text =
+	    "Welcome to gkc, the GTK+ graphical kernel configuration tool\n"
+	    "for Linux.\n"
+	    "For each option, a blank box indicates the feature is disabled, a\n"
+	    "check indicates it is enabled, and a dot indicates that it is to\n"
+	    "be compiled as a module.  Clicking on the box will cycle through the three states.\n"
+	    "\n"
+	    "If you do not see an option (e.g., a device driver) that you\n"
+	    "believe should be present, try turning on Show All Options\n"
+	    "under the Options menu.\n"
+	    "Although there is no cross reference yet to help you figure out\n"
+	    "what other options must be enabled to support the option you\n"
+	    "are interested in, you can still view the help of a grayed-out\n"
+	    "option.\n"
+	    "\n"
+	    "Toggling Show Debug Info under the Options menu will show \n"
+	    "the dependencies, which you can then match by examining other options.";
+
+	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
+					GTK_DIALOG_DESTROY_WITH_PARENT,
+					GTK_MESSAGE_INFO,
+					GTK_BUTTONS_CLOSE, intro_text);
+	g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
+				 G_CALLBACK(gtk_widget_destroy),
+				 GTK_OBJECT(dialog));
+	gtk_widget_show_all(dialog);
+}
+
+
+void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkWidget *dialog;
+	const gchar *about_text =
+	    "gkc is copyright (c) 2002 Romain Lievin <roms@lpg.ticalc.org>.\n"
+	    "Based on the source code from Roman Zippel.\n";
+
+	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
+					GTK_DIALOG_DESTROY_WITH_PARENT,
+					GTK_MESSAGE_INFO,
+					GTK_BUTTONS_CLOSE, about_text);
+	g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
+				 G_CALLBACK(gtk_widget_destroy),
+				 GTK_OBJECT(dialog));
+	gtk_widget_show_all(dialog);
+}
+
+
+void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data)
+{
+	GtkWidget *dialog;
+	const gchar *license_text =
+	    "gkc is released under the terms of the GNU GPL v2.\n"
+	    "For more information, please see the source code or\n"
+	    "visit http://www.fsf.org/licenses/licenses.html\n";
+
+	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
+					GTK_DIALOG_DESTROY_WITH_PARENT,
+					GTK_MESSAGE_INFO,
+					GTK_BUTTONS_CLOSE, license_text);
+	g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
+				 G_CALLBACK(gtk_widget_destroy),
+				 GTK_OBJECT(dialog));
+	gtk_widget_show_all(dialog);
+}
+
+
+void on_back_pressed(GtkButton * button, gpointer user_data)
+{
+	enum prop_type type;
+
+	current = current->parent;
+	type = current->prompt ? current->prompt->type : P_UNKNOWN;
+	if ((type != P_ROOTMENU) && (type != P_MENU))
+		current = current->parent;
+	display_tree_part();
+
+	if (current == &rootmenu)
+		gtk_widget_set_sensitive(back_btn, FALSE);
+}
+
+
+void on_load_pressed(GtkButton * button, gpointer user_data)
+{
+	on_load1_activate(NULL, user_data);
+}
+
+
+void on_save_pressed(GtkButton * button, gpointer user_data)
+{
+	on_save1_activate(NULL, user_data);
+}
+
+
+void on_single_clicked(GtkButton * button, gpointer user_data)
+{
+	view_mode = SINGLE_VIEW;
+	gtk_paned_set_position(GTK_PANED(hpaned), 0);
+	gtk_widget_hide(tree1_w);
+	if (tree2)
+		gtk_tree_store_clear(tree2);
+	current = &rootmenu;
+	display_tree_part();
+}
+
+
+void on_split_clicked(GtkButton * button, gpointer user_data)
+{
+	gint w, h;
+	view_mode = SPLIT_VIEW;
+	gtk_widget_show(tree1_w);
+	gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
+	gtk_paned_set_position(GTK_PANED(hpaned), w / 2);
+	if (tree2)
+		gtk_tree_store_clear(tree2);
+	display_list();
+}
+
+
+void on_full_clicked(GtkButton * button, gpointer user_data)
+{
+	view_mode = FULL_VIEW;
+	gtk_paned_set_position(GTK_PANED(hpaned), 0);
+	gtk_widget_hide(tree1_w);
+	if (tree2)
+		gtk_tree_store_clear(tree2);
+	display_tree(&rootmenu);
+	gtk_widget_set_sensitive(back_btn, FALSE);
+}
+
+
+void on_collapse_pressed(GtkButton * button, gpointer user_data)
+{
+	gtk_tree_view_collapse_all(GTK_TREE_VIEW(tree2_w));
+}
+
+
+void on_expand_pressed(GtkButton * button, gpointer user_data)
+{
+	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
+}
+
+
+/* CTree Callbacks */
+
+/* Change hex/int/string value in the cell */
+static void renderer_edited(GtkCellRendererText * cell,
+			    const gchar * path_string,
+			    const gchar * new_text, gpointer user_data)
+{
+	GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
+	GtkTreeIter iter;
+	const char *old_def, *new_def;
+	struct menu *menu;
+	struct symbol *sym;
+
+	if (!gtk_tree_model_get_iter(model2, &iter, path))
+		return;
+
+	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+	sym = menu->sym;
+
+	gtk_tree_model_get(model2, &iter, COL_VALUE, &old_def, -1);
+	new_def = new_text;
+
+	sym_set_string_value(sym, new_def);
+
+	config_changed = TRUE;
+	update_tree(&rootmenu, NULL);
+
+	gtk_tree_path_free(path);
+}
+
+/* Change the value of a symbol and update the tree */
+static void change_sym_value(struct menu *menu, gint col)
+{
+	struct symbol *sym = menu->sym;
+	int stype;
+	tristate oldval, newval;
+
+	newval = no;
+	switch (col) {
+	case COL_OPTION:
+		return;
+	case COL_NAME:
+		return;
+	case COL_NO:
+		newval = no;
+		break;
+	case COL_MOD:
+		newval = mod;
+		break;
+	case COL_YES:
+		newval = yes;
+		break;
+	default:
+		break;
+	}
+
+	if (!sym)
+		return;
+
+	stype = sym_get_type(sym);
+	switch (stype) {
+	case S_BOOLEAN:
+	case S_TRISTATE:
+		if (col == COL_VALUE)
+			return;
+		else {
+			oldval = sym_get_tristate_value(sym);
+			if (!sym_tristate_within_range(sym, newval))
+				newval = yes;
+			sym_set_tristate_value(sym, newval);
+			config_changed = TRUE;
+			if (view_mode == FULL_VIEW)
+				update_tree(&rootmenu, NULL);
+			else
+				//display_tree_part();  //fixme: keep exp/coll
+				update_tree(current, NULL);
+		}
+		break;
+	case S_INT:
+	case S_HEX:
+	case S_STRING:
+		break;
+	}
+}
+
+static void renderer_toggled(GtkCellRendererToggle * cellrenderertoggle,
+			     gchar * path_string, gpointer user_data)
+{
+	GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
+	GtkTreeIter iter;
+	gint col;
+	struct menu *menu;
+	const int next_col[3] = { COL_NO, COL_MOD, COL_YES };
+
+	if (!gtk_tree_model_get_iter(model2, &iter, path))
+		return;
+
+	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+	gtk_tree_model_get(model2, &iter, COL_BTNINC, &col, -1);
+	if (col)
+		col = COL_MOD;
+	else {
+		gtk_tree_model_get(model2, &iter, COL_BTNACT, &col, -1);
+		col = col ? COL_YES : COL_NO;
+	}
+
+	change_sym_value(menu, next_col[((col - COL_NO) + 1) % 3]);
+
+	gtk_tree_path_free(path);
+}
+
+static gint column2index(GtkTreeViewColumn * column)
+{
+	gint i;
+
+	for (i = 0; i < COL_NUMBER; i++) {
+		GtkTreeViewColumn *col;
+
+		col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), i);
+		if (col == column)
+			return i;
+	}
+
+	return -1;
+}
+
+
+//#define GTK_BUG_FIXED // GTK+ 2.1.4 mini
+
+/* User click: update choice (full) or goes down (single) */
+gboolean
+on_treeview2_button_press_event(GtkWidget * widget,
+				GdkEventButton * event, gpointer user_data)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(widget);
+	GtkTreePath *path;
+	GtkTreeViewColumn *column;
+	GtkTreeIter iter;
+	struct menu *menu;
+	gint col;
+
+#ifdef GTK_BUG_FIXED
+	gint tx = (gint) event->x;
+	gint ty = (gint) event->y;
+	gint cx, cy;
+
+	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
+				      &cy);
+#else
+	gtk_tree_view_get_cursor(view, &path, &column);
+#endif
+	if (path == NULL)
+		return FALSE;
+
+	gtk_tree_model_get_iter(model2, &iter, path);
+	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+
+	col = column2index(column);
+	if ((col == COL_OPTION) && (event->type == GDK_2BUTTON_PRESS) &&
+	    (view_mode != FULL_VIEW) && menu->list) {
+		enum prop_type type;
+		type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
+		if ((type != P_MENU) && (type != P_ROOTMENU))
+			return FALSE;
+		current = menu;
+		display_tree_part();
+		gtk_widget_set_sensitive(back_btn, TRUE);
+	} else
+		change_sym_value(menu, col);
+
+	return FALSE;
+}
+
+/* Key pressed: update choice */
+gboolean
+on_treeview2_key_press_event(GtkWidget * widget,
+			     GdkEventKey * event, gpointer user_data)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(widget);
+	GtkTreePath *path;
+	GtkTreeViewColumn *column;
+	GtkTreeIter iter;
+	struct menu *menu;
+	gint col;
+
+	gtk_tree_view_get_cursor(view, &path, &column);
+	if (path == NULL) {
+		//g_warning("key_press_event: path is NULL !\n");
+		return FALSE;
+	}
+
+	if (event->keyval == GDK_space) {
+		if (gtk_tree_view_row_expanded(view, path))
+			gtk_tree_view_collapse_row(view, path);
+		else
+			gtk_tree_view_expand_row(view, path, FALSE);
+		return FALSE;
+	}
+	if (widget == tree1_w)
+		return FALSE;
+
+	gtk_tree_model_get_iter(model2, &iter, path);
+	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+
+	if (!strcasecmp(event->string, "n"))
+		col = COL_NO;
+	else if (!strcasecmp(event->string, "m"))
+		col = COL_MOD;
+	else if (!strcasecmp(event->string, "y"))
+		col = COL_YES;
+	else if (!strcasecmp(event->string, "e"))
+		col = COL_VALUE;
+	else
+		col = 0;
+
+	change_sym_value(menu, col);
+
+	return FALSE;
+}
+
+
+/* Row selection changed: update help */
+void
+on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data)
+{
+	GtkTreeSelection *selection;
+	GtkTreeIter iter;
+	struct menu *menu;
+
+	selection = gtk_tree_view_get_selection(treeview);
+	if (gtk_tree_selection_get_selected(selection, &model2, &iter)) {
+		gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+		text_insert_help(menu);
+	}
+}
+
+
+/* User click: display sub-tree in the right frame. */
+gboolean
+on_treeview1_button_press_event(GtkWidget * widget,
+				GdkEventButton * event, gpointer user_data)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(widget);
+	GtkTreePath *path;
+	GtkTreeViewColumn *column;
+	GtkTreeIter iter;
+	struct menu *menu;
+
+	gint tx = (gint) event->x;
+	gint ty = (gint) event->y;
+	gint cx, cy;
+
+	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
+				      &cy);
+	if (path == NULL)
+		return FALSE;
+
+	gtk_tree_model_get_iter(model1, &iter, path);
+	gtk_tree_model_get(model1, &iter, COL_MENU, &menu, -1);
+
+	current = menu;
+	display_tree_part();
+
+	return FALSE;
+}
+
+
+/* Conf management */
+
+
+/* Fill a row of strings */
+static gchar **fill_row(struct menu *menu)
+{
+	static gchar **row;
+	struct symbol *sym = menu->sym;
+	const char *def;
+	int stype;
+	tristate val;
+	enum prop_type type;
+
+	//g_strfreev(row); //to fix...
+	row = (gchar **) g_malloc0(COL_NUMBER * sizeof(gchar *));
+	row[COL_OPTION] =
+	    g_strdup_printf("%s %s", menu_get_prompt(menu),
+			    sym ? (sym->
+				   flags & SYMBOL_NEW ? "(NEW)" : "") :
+			    "");
+
+	if (show_all && !menu_is_visible(menu))
+		row[COL_COLOR] = g_strdup("DarkGray");
+	else
+		row[COL_COLOR] = g_strdup("Black");
+
+	type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
+	switch (type) {
+	case P_MENU:
+	case P_ROOTMENU:
+		row[COL_PIXBUF] =
+		    (gchar *) (view_mode !=
+			       FULL_VIEW ? xpm_menu : xpm_void);
+		row[COL_PIXVIS] = GINT_TO_POINTER(TRUE);
+		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
+		break;
+	case P_COMMENT:
+		row[COL_PIXBUF] = (gchar *) xpm_void;
+		row[COL_PIXVIS] = GINT_TO_POINTER(FALSE);
+		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
+		break;
+	default:
+		row[COL_PIXBUF] = (gchar *) xpm_void;
+		row[COL_PIXVIS] = GINT_TO_POINTER(FALSE);
+		row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);
+		break;
+	}
+
+	if (!sym)
+		return row;
+	row[COL_NAME] = g_strdup(sym->name);
+
+	sym_calc_value(sym);
+	sym->flags &= ~SYMBOL_CHANGED;
+
+	if (sym_is_choice(sym)) {	// parse childs for getting final value
+		struct menu *child;
+		struct symbol *def_sym = sym_get_choice_value(sym);
+		struct menu *def_menu = NULL;
+
+		for (child = menu->list; child; child = child->next) {
+			if (menu_is_visible(child)
+			    && child->sym == def_sym)
+				def_menu = child;
+		}
+
+		if (def_menu)
+			row[COL_VALUE] =
+			    g_strdup(menu_get_prompt(def_menu));
+	}
+
+	stype = sym_get_type(sym);
+	switch (stype) {
+	case S_BOOLEAN:
+		if (sym_is_choice(sym))
+			break;
+	case S_TRISTATE:
+		val = sym_get_tristate_value(sym);
+		switch (val) {
+		case no:
+			row[COL_NO] = g_strdup("N");
+			row[COL_VALUE] = g_strdup("N");
+			row[COL_BTNACT] = GINT_TO_POINTER(FALSE);
+			row[COL_BTNINC] = GINT_TO_POINTER(FALSE);
+			break;
+		case mod:
+			row[COL_MOD] = g_strdup("M");
+			row[COL_VALUE] = g_strdup("M");
+			row[COL_BTNINC] = GINT_TO_POINTER(TRUE);
+			break;
+		case yes:
+			row[COL_YES] = g_strdup("Y");
+			row[COL_VALUE] = g_strdup("Y");
+			row[COL_BTNACT] = GINT_TO_POINTER(TRUE);
+			row[COL_BTNINC] = GINT_TO_POINTER(FALSE);
+			break;
+		}
+
+		if (val != no && sym_tristate_within_range(sym, no))
+			row[COL_NO] = g_strdup("_");
+		if (val != mod && sym_tristate_within_range(sym, mod))
+			row[COL_MOD] = g_strdup("_");
+		if (val != yes && sym_tristate_within_range(sym, yes))
+			row[COL_YES] = g_strdup("_");
+		break;
+	case S_INT:
+	case S_HEX:
+	case S_STRING:
+		def = sym_get_string_value(sym);
+		row[COL_VALUE] = g_strdup(def);
+		row[COL_EDIT] = GINT_TO_POINTER(TRUE);
+		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
+		break;
+	}
+
+	return row;
+}
+
+
+/* Set the node content with a row of strings */
+static void set_node2(GtkTreeIter * node, struct menu *menu, gchar ** row)
+{
+	GdkColor color;
+	gboolean success;
+	GdkPixbuf *pix;
+
+	pix = gdk_pixbuf_new_from_xpm_data((const char **)
+					   row[COL_PIXBUF]);
+
+	gdk_color_parse(row[COL_COLOR], &color);
+	gdk_colormap_alloc_colors(gdk_colormap_get_system(), &color, 1,
+				  FALSE, FALSE, &success);
+
+	gtk_tree_store_set(tree, node,
+			   COL_OPTION, row[COL_OPTION],
+			   COL_NAME, row[COL_NAME],
+			   COL_NO, row[COL_NO],
+			   COL_MOD, row[COL_MOD],
+			   COL_YES, row[COL_YES],
+			   COL_VALUE, row[COL_VALUE],
+			   COL_MENU, (gpointer) menu,
+			   COL_COLOR, &color,
+			   COL_EDIT, GPOINTER_TO_INT(row[COL_EDIT]),
+			   COL_PIXBUF, pix,
+			   COL_PIXVIS, GPOINTER_TO_INT(row[COL_PIXVIS]),
+			   COL_BTNVIS, GPOINTER_TO_INT(row[COL_BTNVIS]),
+			   COL_BTNACT, GPOINTER_TO_INT(row[COL_BTNACT]),
+			   COL_BTNINC, GPOINTER_TO_INT(row[COL_BTNINC]),
+			   -1);
+
+	g_object_unref(pix);
+	g_strfreev(row);
+}
+
+
+/* Add a node to the tree */
+static void place_node2(struct menu *menu, char **row)
+{
+	GtkTreeIter *parent = parents[indent - 1];
+	GtkTreeIter *node = parents[indent];
+
+	gtk_tree_store_append(tree, node, parent);
+	set_node2(node, menu, row);
+}
+
+
+/* Find a node in the GTK+ tree */
+static GtkTreeIter found;
+
+/*
+ * Find a menu in the GtkTree starting at parent.
+ */
+GtkTreeIter *gtktree_iter_find_node(GtkTreeIter * parent,
+				    struct menu *tofind)
+{
+	GtkTreeIter iter;
+	GtkTreeIter *child = &iter;
+	gboolean valid;
+	GtkTreeIter *ret;
+
+	valid = gtk_tree_model_iter_children(model2, child, parent);
+	while (valid) {
+		struct menu *menu;
+
+		gtk_tree_model_get(model2, child, 6, &menu, -1);
+
+		if (menu == tofind) {
+			memcpy(&found, child, sizeof(GtkTreeIter));
+			return &found;
+		}
+
+		ret = gtktree_iter_find_node(child, tofind);
+		if (ret)
+			return ret;
+
+		valid = gtk_tree_model_iter_next(model2, child);
+	}
+
+	return NULL;
+}
+
+
+/*
+ * Update the tree by adding/removing entries
+ * Does not change other nodes
+ */
+static void update_tree(struct menu *src, GtkTreeIter * dst)
+{
+	struct menu *child1;
+	GtkTreeIter iter, tmp;
+	GtkTreeIter *child2 = &iter;
+	gboolean valid;
+	GtkTreeIter *sibling;
+	struct symbol *sym;
+	struct property *prop;
+	struct menu *menu1, *menu2;
+
+	if (src == &rootmenu)
+		indent = 1;
+
+	valid = gtk_tree_model_iter_children(model2, child2, dst);
+	for (child1 = src->list; child1; child1 = child1->next) {
+
+		prop = child1->prompt;
+		sym = child1->sym;
+
+	      reparse:
+		menu1 = child1;
+		if (valid)
+			gtk_tree_model_get(model2, child2, COL_MENU,
+					   &menu2, -1);
+		else
+			menu2 = NULL;	// force adding of a first child
+
+#ifdef DEBUG
+		printf("%*c%s | %s\n", indent, ' ',
+		       menu1 ? menu_get_prompt(menu1) : "nil",
+		       menu2 ? menu_get_prompt(menu2) : "nil");
+#endif
+
+		if (!menu_is_visible(child1) && !show_all) {	// remove node
+			if (gtktree_iter_find_node(dst, menu1) != NULL) {
+				memcpy(&tmp, child2, sizeof(GtkTreeIter));
+				valid = gtk_tree_model_iter_next(model2,
+								 child2);
+				gtk_tree_store_remove(tree2, &tmp);
+				if (!valid)
+					return;	// next parent 
+				else
+					goto reparse;	// next child
+			} else
+				continue;
+		}
+
+		if (menu1 != menu2) {
+			if (gtktree_iter_find_node(dst, menu1) == NULL) {	// add node
+				if (!valid && !menu2)
+					sibling = NULL;
+				else
+					sibling = child2;
+				gtk_tree_store_insert_before(tree2,
+							     child2,
+							     dst, sibling);
+				set_node2(child2, menu1, fill_row(menu1));
+				if (menu2 == NULL)
+					valid = TRUE;
+			} else {	// remove node
+				memcpy(&tmp, child2, sizeof(GtkTreeIter));
+				valid = gtk_tree_model_iter_next(model2,
+								 child2);
+				gtk_tree_store_remove(tree2, &tmp);
+				if (!valid)
+					return;	// next parent 
+				else
+					goto reparse;	// next child
+			}
+		} else if (sym && (sym->flags & SYMBOL_CHANGED)) {
+			set_node2(child2, menu1, fill_row(menu1));
+		}
+
+		indent++;
+		update_tree(child1, child2);
+		indent--;
+
+		valid = gtk_tree_model_iter_next(model2, child2);
+	}
+}
+
+
+/* Display the whole tree (single/split/full view) */
+static void display_tree(struct menu *menu)
+{
+	struct symbol *sym;
+	struct property *prop;
+	struct menu *child;
+	enum prop_type ptype;
+
+	if (menu == &rootmenu) {
+		indent = 1;
+		current = &rootmenu;
+	}
+
+	for (child = menu->list; child; child = child->next) {
+		prop = child->prompt;
+		sym = child->sym;
+		ptype = prop ? prop->type : P_UNKNOWN;
+
+		if (sym)
+			sym->flags &= ~SYMBOL_CHANGED;
+
+		if ((view_mode == SPLIT_VIEW) && (ptype != P_ROOTMENU) &&
+		    (tree == tree1))
+			continue;
+
+		if ((view_mode == SPLIT_VIEW) && (ptype == P_ROOTMENU) &&
+		    (tree == tree2))
+			continue;
+
+		if (menu_is_visible(child) || show_all)
+			place_node2(child, fill_row(child));
+#ifdef DEBUG
+		printf("%*c%s: ", indent, ' ', menu_get_prompt(child));
+		dbg_print_ptype(ptype);
+		printf(" | ");
+		if (sym) {
+			dbg_print_stype(sym->type);
+			printf(" | ");
+			dbg_print_flags(sym->flags);
+			printf("\n");
+		} else
+			printf("\n");
+#endif
+		if ((view_mode != FULL_VIEW) && (ptype == P_MENU)
+		    && (tree == tree2))
+			continue;
+
+		if (((menu != &rootmenu) && (ptype != P_ROOTMENU)) ||
+		    (view_mode == FULL_VIEW)
+		    || (view_mode == SPLIT_VIEW)) {
+			indent++;
+			display_tree(child);
+			indent--;
+		}
+	}
+}
+
+/* Display a part of the tree starting at current node (single/split view) */
+static void display_tree_part(void)
+{
+	if (tree2)
+		gtk_tree_store_clear(tree2);
+	display_tree(current);
+	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
+}
+
+/* Display the list in the left frame (split view) */
+static void display_list(void)
+{
+	tree = tree1;
+	display_tree(&rootmenu);
+	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w));
+	tree = tree2;
+}
+
+static void fixup_rootmenu(struct menu *menu)
+{
+	struct menu *child;
+
+	if (!menu->prompt || menu->prompt->type != P_MENU)
+		return;
+	menu->prompt->type = P_ROOTMENU;
+	for (child = menu->list; child; child = child->next)
+		fixup_rootmenu(child);
+}
+
+
+/* Main */
+
+
+int main(int ac, char *av[])
+{
+	const char *name;
+	gchar *cur_dir, *exe_path;
+	gchar *glade_file;
+
+#ifndef LKC_DIRECT_LINK
+	kconfig_load();
+#endif
+
+	/* GTK stuffs */
+	gtk_set_locale();
+	gtk_init(&ac, &av);
+	glade_init();
+
+	//add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
+	//add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
+
+	/* Determine GUI path */
+	cur_dir = g_get_current_dir();
+	exe_path = g_strdup(av[0]);
+	exe_path[0] = '/';
+	glade_file = g_strconcat(cur_dir, exe_path, ".glade", NULL);
+	g_free(cur_dir);
+	g_free(exe_path);
+
+	/* Load the interface and connect signals */
+	init_main_window(glade_file);
+	init_tree_model();
+	init_left_tree();
+	init_right_tree();
+
+	/* Conf stuffs */
+	if (ac > 1 && av[1][0] == '-') {
+		switch (av[1][1]) {
+		case 'a':
+			//showAll = 1;
+			break;
+		case 'h':
+		case '?':
+			printf("%s <config>\n", av[0]);
+			exit(0);
+		}
+		name = av[2];
+	} else
+		name = av[1];
+
+	conf_parse(name);
+	fixup_rootmenu(&rootmenu);
+	conf_read(NULL);
+
+	switch (view_mode) {
+	case SINGLE_VIEW:
+		display_tree_part();
+		break;
+	case SPLIT_VIEW:
+		display_list();
+		break;
+	case FULL_VIEW:
+		display_tree(&rootmenu);
+		break;
+	}
+
+	gtk_main();
+
+	return 0;
+}
diff -urN linux-2.5.64-bk10/scripts/kconfig/gconf.glade linux-2.5.64-bk11/scripts/kconfig/gconf.glade
--- linux-2.5.64-bk10/scripts/kconfig/gconf.glade	Wed Dec 31 16:00:00 1969
+++ linux-2.5.64-bk11/scripts/kconfig/gconf.glade	Mon Mar 31 12:34:56 2003
@@ -0,0 +1,543 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="window1">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Gtk Kernel Configurator</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="default_width">640</property>
+  <property name="default_height">480</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <signal name="destroy" handler="on_window1_destroy" object="window1"/>
+  <signal name="size_request" handler="on_window1_size_request" object="vpaned1" last_modification_time="Fri, 11 Jan 2002 16:17:11 GMT"/>
+  <signal name="delete_event" handler="on_window1_delete_event" object="window1" last_modification_time="Sun, 09 Mar 2003 19:42:46 GMT"/>
+
+  <child>
+    <widget class="GtkVBox" id="vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+	<widget class="GtkMenuBar" id="menubar1">
+	  <property name="visible">True</property>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="file1">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_File</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="file1_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="load1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Load a config file</property>
+		      <property name="label" translatable="yes">_Load</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_load1_activate"/>
+		      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image27">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-open</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="save1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Save the config in .config</property>
+		      <property name="label" translatable="yes">_Save</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_save1_activate"/>
+		      <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image28">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-save</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="save_as1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Save the config in a file</property>
+		      <property name="label" translatable="yes">Save _as</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_save_as1_activate"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image29">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-save-as</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="separator1">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="quit1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_Quit</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_quit1_activate"/>
+		      <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image30">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-quit</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="options1">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Options</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="options1_menu">
+
+		  <child>
+		    <widget class="GtkCheckMenuItem" id="show_name1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Show name</property>
+		      <property name="label" translatable="yes">Show _name</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">False</property>
+		      <signal name="activate" handler="on_show_name1_activate"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckMenuItem" id="show_range1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Show range (Y/M/N)</property>
+		      <property name="label" translatable="yes">Show _range</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">False</property>
+		      <signal name="activate" handler="on_show_range1_activate"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckMenuItem" id="show_data1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Show value of the option</property>
+		      <property name="label" translatable="yes">Show _data</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">False</property>
+		      <signal name="activate" handler="on_show_data1_activate"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="separator2">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckMenuItem" id="show_all_options1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Show all options</property>
+		      <property name="label" translatable="yes">Show all _options</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">False</property>
+		      <signal name="activate" handler="on_show_all_options1_activate"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckMenuItem" id="show_debug_info1">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">Show masked options</property>
+		      <property name="label" translatable="yes">Show _debug info</property>
+		      <property name="use_underline">True</property>
+		      <property name="active">False</property>
+		      <signal name="activate" handler="on_show_debug_info1_activate"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkMenuItem" id="help1">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Help</property>
+	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="help1_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="introduction1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_Introduction</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_introduction1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
+		      <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image31">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-dialog-question</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="about1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_About</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
+		      <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image32">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-properties</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="license1">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_License</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_license1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
+
+		      <child internal-child="image">
+			<widget class="GtkImage" id="image33">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-justify-fill</property>
+			  <property name="icon_size">1</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHandleBox" id="handlebox1">
+	  <property name="visible">True</property>
+	  <property name="shadow_type">GTK_SHADOW_OUT</property>
+	  <property name="handle_position">GTK_POS_LEFT</property>
+	  <property name="snap_edge">GTK_POS_TOP</property>
+
+	  <child>
+	    <widget class="GtkToolbar" id="toolbar1">
+	      <property name="visible">True</property>
+	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+	      <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
+	      <property name="tooltips">True</property>
+
+	      <child>
+		<widget class="button" id="button1">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Goes up of one level (single view)</property>
+		  <property name="label" translatable="yes">Back</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_pixmap">gtk-undo</property>
+		  <signal name="pressed" handler="on_back_pressed"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkVSeparator" id="vseparator1">
+		  <property name="visible">True</property>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button2">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Load a config file</property>
+		  <property name="label" translatable="yes">Load</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_pixmap">gtk-open</property>
+		  <signal name="pressed" handler="on_load_pressed"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button3">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Save a config file</property>
+		  <property name="label" translatable="yes">Save</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_pixmap">gtk-save</property>
+		  <signal name="pressed" handler="on_save_pressed"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkVSeparator" id="vseparator2">
+		  <property name="visible">True</property>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button4">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Single view</property>
+		  <property name="label" translatable="yes">Single</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_pixmap">gtk-missing-image</property>
+		  <signal name="clicked" handler="on_single_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:39 GMT"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button5">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Split view</property>
+		  <property name="label" translatable="yes">Split</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_pixmap">gtk-missing-image</property>
+		  <signal name="clicked" handler="on_split_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:45 GMT"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button6">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Full view</property>
+		  <property name="label" translatable="yes">Full</property>
+		  <property name="use_underline">True</property>
+		  <property name="stock_pixmap">gtk-missing-image</property>
+		  <signal name="clicked" handler="on_full_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:50 GMT"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="GtkVSeparator" id="vseparator3">
+		  <property name="visible">True</property>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button7">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Collapse the whole tree in the right frame</property>
+		  <property name="label" translatable="yes">Collapse</property>
+		  <property name="use_underline">True</property>
+		  <signal name="pressed" handler="on_collapse_pressed"/>
+		</widget>
+	      </child>
+
+	      <child>
+		<widget class="button" id="button8">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Expand the whole tree in the right frame</property>
+		  <property name="label" translatable="yes">Expand</property>
+		  <property name="use_underline">True</property>
+		  <signal name="pressed" handler="on_expand_pressed"/>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHPaned" id="hpaned1">
+	  <property name="width_request">1</property>
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="position">0</property>
+
+	  <child>
+	    <widget class="GtkScrolledWindow" id="scrolledwindow1">
+	      <property name="visible">True</property>
+	      <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+	      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+	      <property name="shadow_type">GTK_SHADOW_IN</property>
+	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview1">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">True</property>
+		  <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:58:22 GMT"/>
+		  <signal name="button_press_event" handler="on_treeview1_button_press_event" last_modification_time="Sun, 12 Jan 2003 16:03:52 GMT"/>
+		  <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 16:11:44 GMT"/>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="shrink">True</property>
+	      <property name="resize">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVPaned" id="vpaned1">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="position">0</property>
+
+	      <child>
+		<widget class="GtkScrolledWindow" id="scrolledwindow2">
+		  <property name="visible">True</property>
+		  <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+		  <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+		  <property name="shadow_type">GTK_SHADOW_IN</property>
+		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+		  <child>
+		    <widget class="GtkTreeView" id="treeview2">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="has_focus">True</property>
+		      <property name="headers_visible">True</property>
+		      <property name="rules_hint">False</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:57:55 GMT"/>
+		      <signal name="button_press_event" handler="on_treeview2_button_press_event" last_modification_time="Sun, 12 Jan 2003 15:57:58 GMT"/>
+		      <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 15:58:01 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="shrink">True</property>
+		  <property name="resize">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkScrolledWindow" id="scrolledwindow3">
+		  <property name="visible">True</property>
+		  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+		  <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+		  <property name="shadow_type">GTK_SHADOW_IN</property>
+		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+		  <child>
+		    <widget class="GtkTextView" id="textview3">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">False</property>
+		      <property name="justification">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap_mode">GTK_WRAP_WORD</property>
+		      <property name="cursor_visible">True</property>
+		      <property name="pixels_above_lines">0</property>
+		      <property name="pixels_below_lines">0</property>
+		      <property name="pixels_inside_wrap">0</property>
+		      <property name="left_margin">0</property>
+		      <property name="right_margin">0</property>
+		      <property name="indent">0</property>
+		      <property name="text" translatable="yes">Sorry, no help available for this option yet.</property>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="shrink">True</property>
+		  <property name="resize">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="shrink">True</property>
+	      <property name="resize">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>
diff -urN linux-2.5.64-bk10/scripts/kconfig/images.c linux-2.5.64-bk11/scripts/kconfig/images.c
--- linux-2.5.64-bk10/scripts/kconfig/images.c	Tue Mar  4 19:28:55 2003
+++ linux-2.5.64-bk11/scripts/kconfig/images.c	Mon Mar 31 12:34:56 2003
@@ -290,3 +290,37 @@
 " .......... ",
 " .......... ",
 "            "};
+
+static const char *xpm_menuback[] = {
+"12 12 2 1",
+"  c white",
+". c black",
+"            ",
+" .......... ",
+" .        . ",
+" .     .. . ",
+" .   .... . ",
+" . ...... . ",
+" . ...... . ",
+" .   .... . ",
+" .     .. . ",
+" .        . ",
+" .......... ",
+"            "};
+
+static const char *xpm_void[] = {
+"12 12 2 1",
+"  c white",
+". c black",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            ",
+"            "};
diff -urN linux-2.5.64-bk10/scripts/kconfig/lex.zconf.c_shipped linux-2.5.64-bk11/scripts/kconfig/lex.zconf.c_shipped
--- linux-2.5.64-bk10/scripts/kconfig/lex.zconf.c_shipped	Tue Mar  4 19:29:36 2003
+++ linux-2.5.64-bk11/scripts/kconfig/lex.zconf.c_shipped	Mon Mar 31 12:34:56 2003
@@ -357,18 +357,18 @@
     },
 
     {
-       11,   38,   38,   39,   40,   41,   38,   42,   41,   43,
-       44,   45,   46,   46,   47,   48,   46,   46,   46,   46,
-       46,   46,   46,   46,   49,   46,   46,   46,   50,   46,
-       46,   46,   46,   46,   46,   46,   51
+       11,   38,   38,   39,   40,   41,   42,   43,   41,   44,
+       45,   46,   47,   47,   48,   49,   47,   47,   47,   47,
+       47,   47,   47,   47,   50,   47,   47,   47,   51,   47,
+       47,   47,   47,   47,   47,   47,   52
 
     },
 
     {
-       11,   38,   38,   39,   40,   41,   38,   42,   41,   43,
-       44,   45,   46,   46,   47,   48,   46,   46,   46,   46,
-       46,   46,   46,   46,   49,   46,   46,   46,   50,   46,
-       46,   46,   46,   46,   46,   46,   51
+       11,   38,   38,   39,   40,   41,   42,   43,   41,   44,
+       45,   46,   47,   47,   48,   49,   47,   47,   47,   47,
+       47,   47,   47,   47,   50,   47,   47,   47,   51,   47,
+       47,   47,   47,   47,   47,   47,   52
     },
 
     {
@@ -387,7 +387,7 @@
     },
 
     {
-       11,  -13,   52,   53,  -13,  -13,   54,  -13,  -13,  -13,
+       11,  -13,   53,   54,  -13,  -13,   55,  -13,  -13,  -13,
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
       -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13,
       -13,  -13,  -13,  -13,  -13,  -13,  -13
@@ -402,10 +402,10 @@
     },
 
     {
-       11,   55,   55,   56,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55
+       11,   56,   56,   57,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56
     },
 
     {
@@ -425,109 +425,109 @@
 
     {
        11,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
-      -18,  -18,  -18,   57,  -18,  -18,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -18
+      -18,  -18,  -18,   58,  -18,  -18,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -18
     },
 
     {
        11,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,  -19,
-      -19,  -19,  -19,   57,  -19,  -19,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   58,   57,
-       57,   57,   57,   57,   57,   57,  -19
+      -19,  -19,  -19,   58,  -19,  -19,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   59,   58,
+       58,   58,   58,   58,   58,   58,  -19
 
     },
 
     {
        11,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20,
-      -20,  -20,  -20,   57,  -20,  -20,   57,   57,   57,   57,
-       57,   57,   57,   59,   57,   57,   57,   57,   60,   57,
-       57,   57,   57,   57,   57,   57,  -20
+      -20,  -20,  -20,   58,  -20,  -20,   58,   58,   58,   58,
+       58,   58,   58,   60,   58,   58,   58,   58,   61,   58,
+       58,   58,   58,   58,   58,   58,  -20
     },
 
     {
        11,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,  -21,
-      -21,  -21,  -21,   57,  -21,  -21,   57,   57,   57,   57,
-       61,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -21
+      -21,  -21,  -21,   58,  -21,  -21,   58,   58,   58,   58,
+       62,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -21
     },
 
     {
        11,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,  -22,
-      -22,  -22,  -22,   57,  -22,  -22,   57,   57,   57,   57,
+      -22,  -22,  -22,   58,  -22,  -22,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   62,   57,   57,
-       57,   57,   57,   57,   57,   57,  -22
+       58,   58,   58,   58,   58,   58,   58,   63,   58,   58,
+       58,   58,   58,   58,   58,   58,  -22
     },
 
     {
        11,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,   57,  -23,  -23,   57,   57,   57,   57,
-       63,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -23
+      -23,  -23,  -23,   58,  -23,  -23,   58,   58,   58,   58,
+       64,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -23
     },
 
     {
        11,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
-      -24,  -24,  -24,   57,  -24,  -24,   57,   57,   57,   57,
-       57,   64,   57,   57,   57,   57,   57,   65,   57,   57,
-       57,   57,   57,   57,   57,   57,  -24
+      -24,  -24,  -24,   58,  -24,  -24,   58,   58,   58,   58,
+       58,   65,   58,   58,   58,   58,   58,   66,   58,   58,
+       58,   58,   58,   58,   58,   58,  -24
 
     },
 
     {
        11,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
-      -25,  -25,  -25,   57,  -25,  -25,   66,   57,   57,   57,
-       67,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -25
+      -25,  -25,  -25,   58,  -25,  -25,   67,   58,   58,   58,
+       68,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -25
     },
 
     {
        11,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
-      -26,  -26,  -26,   57,  -26,  -26,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   68,
-       57,   57,   57,   57,   57,   57,  -26
+      -26,  -26,  -26,   58,  -26,  -26,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   69,
+       58,   58,   58,   58,   58,   58,  -26
     },
 
     {
        11,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27,
-      -27,  -27,  -27,   57,  -27,  -27,   57,   57,   57,   57,
+      -27,  -27,  -27,   58,  -27,  -27,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   69,   57,   57,   57,   57,  -27
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   70,   58,   58,   58,   58,  -27
     },
 
     {
        11,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
-      -28,  -28,  -28,   57,  -28,  -28,   57,   57,   57,   57,
-       70,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -28
+      -28,  -28,  -28,   58,  -28,  -28,   58,   58,   58,   58,
+       71,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -28
     },
 
     {
        11,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,   57,  -29,  -29,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   71,   57,
-       57,   57,   57,   72,   57,   57,  -29
+      -29,  -29,  -29,   58,  -29,  -29,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   72,   58,
+       58,   58,   58,   73,   58,   58,  -29
 
     },
 
     {
        11,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,
-      -30,  -30,  -30,   57,  -30,  -30,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   73,   57,   57,   57,   57,  -30
+      -30,  -30,  -30,   58,  -30,  -30,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   74,   58,   58,   58,   58,  -30
     },
 
     {
-       11,   74,   74,  -31,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   74,   74,   74,   74
+       11,   75,   75,  -31,   75,   75,   75,   75,   75,   75,
+       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
+       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
+       75,   75,   75,   75,   75,   75,   75
     },
 
     {
-       11,  -32,   75,   76,  -32,  -32,  -32,  -32,  -32,  -32,
+       11,  -32,   76,   77,  -32,  -32,  -32,  -32,  -32,  -32,
       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
 
       -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32,
@@ -535,17 +535,17 @@
     },
 
     {
-       11,   77,  -33,  -33,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,   77
+       11,   78,  -33,  -33,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78
     },
 
     {
-       11,   78,   78,   79,   78,  -34,   78,   78,  -34,   78,
-       78,   78,   78,   78,   78,  -34,   78,   78,   78,   78,
-       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
-       78,   78,   78,   78,   78,   78,   78
+       11,   79,   79,   80,   79,  -34,   79,   79,  -34,   79,
+       79,   79,   79,   79,   79,  -34,   79,   79,   79,   79,
+       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
+       79,   79,   79,   79,   79,   79,   79
 
     },
 
@@ -564,11 +564,11 @@
     },
 
     {
-       11,   80,   80,   81,   80,   80,   80,   80,   80,   80,
-       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
+       11,   81,   81,   82,   81,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
 
-       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
-       80,   80,   80,   80,   80,   80,   80
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81
     },
 
     {
@@ -588,7 +588,7 @@
 
     {
        11,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
-      -40,  -40,  -40,  -40,   82,  -40,  -40,  -40,  -40,  -40,
+      -40,  -40,  -40,  -40,   83,  -40,  -40,  -40,  -40,  -40,
       -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
       -40,  -40,  -40,  -40,  -40,  -40,  -40
     },
@@ -601,15 +601,15 @@
     },
 
     {
-       11,  -42,  -42,  -42,  -42,  -42,  -42,   83,  -42,  -42,
-      -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,
+       11,   84,   84,  -42,   84,   84,   84,   84,   84,   84,
+       84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
 
-      -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,
-      -42,  -42,  -42,  -42,  -42,  -42,  -42
+       84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
+       84,   84,   84,   84,   84,   84,   84
     },
 
     {
-       11,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
+       11,  -43,  -43,  -43,  -43,  -43,  -43,   85,  -43,  -43,
       -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
       -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
       -43,  -43,  -43,  -43,  -43,  -43,  -43
@@ -625,272 +625,272 @@
 
     {
        11,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
-      -45,   84,   85,   85,  -45,  -45,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -45
+      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
+      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
+      -45,  -45,  -45,  -45,  -45,  -45,  -45
     },
 
     {
        11,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,
-      -46,   85,   85,   85,  -46,  -46,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -46
+      -46,   86,   87,   87,  -46,  -46,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -46
     },
 
     {
        11,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,
-      -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,
+      -47,   87,   87,   87,  -47,  -47,   87,   87,   87,   87,
 
-      -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,
-      -47,  -47,  -47,  -47,  -47,  -47,  -47
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -47
     },
 
     {
-       11,  -48,  -48,   86,  -48,  -48,  -48,  -48,  -48,  -48,
+       11,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
       -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
       -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
       -48,  -48,  -48,  -48,  -48,  -48,  -48
     },
 
     {
-       11,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,
-      -49,   85,   85,   85,  -49,  -49,   85,   85,   85,   85,
-       85,   87,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -49
+       11,  -49,  -49,   88,  -49,  -49,  -49,  -49,  -49,  -49,
+      -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,
+      -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,
+      -49,  -49,  -49,  -49,  -49,  -49,  -49
 
     },
 
     {
        11,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
-      -50,   85,   85,   85,  -50,  -50,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   88,   85,   85,
-       85,   85,   85,   85,   85,   85,  -50
+      -50,   87,   87,   87,  -50,  -50,   87,   87,   87,   87,
+       87,   89,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -50
     },
 
     {
        11,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,
-      -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,
-      -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,
-      -51,  -51,  -51,  -51,  -51,  -51,   89
+      -51,   87,   87,   87,  -51,  -51,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,   87,   90,   87,   87,
+       87,   87,   87,   87,   87,   87,  -51
     },
 
     {
-       11,  -52,   52,   53,  -52,  -52,   54,  -52,  -52,  -52,
+       11,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
       -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
 
       -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
-      -52,  -52,  -52,  -52,  -52,  -52,  -52
+      -52,  -52,  -52,  -52,  -52,  -52,   91
     },
 
     {
-       11,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
+       11,  -53,   53,   54,  -53,  -53,   55,  -53,  -53,  -53,
       -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
       -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,
       -53,  -53,  -53,  -53,  -53,  -53,  -53
     },
 
     {
-       11,   55,   55,   56,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55
+       11,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
+      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
+      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
+      -54,  -54,  -54,  -54,  -54,  -54,  -54
 
     },
 
     {
-       11,   55,   55,   56,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
-       55,   55,   55,   55,   55,   55,   55
+       11,   56,   56,   57,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56
     },
 
     {
-       11,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
-      -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
-      -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
-      -56,  -56,  -56,  -56,  -56,  -56,  -56
+       11,   56,   56,   57,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
+       56,   56,   56,   56,   56,   56,   56
     },
 
     {
        11,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
-      -57,  -57,  -57,   57,  -57,  -57,   57,   57,   57,   57,
+      -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -57
+      -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,  -57,
+      -57,  -57,  -57,  -57,  -57,  -57,  -57
     },
 
     {
        11,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
-      -58,  -58,  -58,   57,  -58,  -58,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   90,   57,
-       57,   57,   57,   57,   57,   57,  -58
+      -58,  -58,  -58,   58,  -58,  -58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -58
     },
 
     {
        11,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
-      -59,  -59,  -59,   57,  -59,  -59,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   91,   57,
-       57,   57,   57,   57,   57,   57,  -59
+      -59,  -59,  -59,   58,  -59,  -59,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   92,   58,
+       58,   58,   58,   58,   58,   58,  -59
 
     },
 
     {
        11,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
-      -60,  -60,  -60,   57,  -60,  -60,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   92,   93,   57,   57,
-       57,   57,   57,   57,   57,   57,  -60
+      -60,  -60,  -60,   58,  -60,  -60,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   93,   58,
+       58,   58,   58,   58,   58,   58,  -60
     },
 
     {
        11,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,
-      -61,  -61,  -61,   57,  -61,  -61,   57,   57,   57,   57,
-       57,   94,   57,   57,   57,   57,   57,   57,   57,   95,
-       57,   57,   57,   57,   57,   57,  -61
+      -61,  -61,  -61,   58,  -61,  -61,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   94,   95,   58,   58,
+       58,   58,   58,   58,   58,   58,  -61
     },
 
     {
        11,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,
-      -62,  -62,  -62,   57,  -62,  -62,   57,   57,   57,   96,
+      -62,  -62,  -62,   58,  -62,  -62,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -62
+       58,   96,   58,   58,   58,   58,   58,   58,   58,   97,
+       58,   58,   58,   58,   58,   58,  -62
     },
 
     {
        11,  -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63,
-      -63,  -63,  -63,   57,  -63,  -63,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   97,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   98,  -63
+      -63,  -63,  -63,   58,  -63,  -63,   58,   58,   58,   98,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -63
     },
 
     {
        11,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,
-      -64,  -64,  -64,   57,  -64,  -64,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -64
+      -64,  -64,  -64,   58,  -64,  -64,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   99,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  100,  -64
 
     },
 
     {
        11,  -65,  -65,  -65,  -65,  -65,  -65,  -65,  -65,  -65,
-      -65,  -65,  -65,   57,  -65,  -65,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   99,   57,   57,  -65
+      -65,  -65,  -65,   58,  -65,  -65,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -65
     },
 
     {
        11,  -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,
-      -66,  -66,  -66,   57,  -66,  -66,   57,   57,   57,   57,
-       57,   57,   57,   57,  100,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -66
+      -66,  -66,  -66,   58,  -66,  -66,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  101,   58,   58,  -66
     },
 
     {
        11,  -67,  -67,  -67,  -67,  -67,  -67,  -67,  -67,  -67,
-      -67,  -67,  -67,   57,  -67,  -67,   57,   57,   57,   57,
+      -67,  -67,  -67,   58,  -67,  -67,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,  101,   57,   57,
-       57,   57,   57,   57,   57,   57,  -67
+       58,   58,   58,   58,  102,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -67
     },
 
     {
        11,  -68,  -68,  -68,  -68,  -68,  -68,  -68,  -68,  -68,
-      -68,  -68,  -68,   57,  -68,  -68,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,  102,   57,   57,  -68
+      -68,  -68,  -68,   58,  -68,  -68,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  103,   58,   58,
+       58,   58,   58,   58,   58,   58,  -68
     },
 
     {
        11,  -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,
-      -69,  -69,  -69,   57,  -69,  -69,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,  103,   57,
-       57,   57,   57,   57,   57,   57,  -69
+      -69,  -69,  -69,   58,  -69,  -69,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  104,   58,   58,  -69
 
     },
 
     {
        11,  -70,  -70,  -70,  -70,  -70,  -70,  -70,  -70,  -70,
-      -70,  -70,  -70,   57,  -70,  -70,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-      104,   57,   57,   57,   57,   57,  -70
+      -70,  -70,  -70,   58,  -70,  -70,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  105,   58,
+       58,   58,   58,   58,   58,   58,  -70
     },
 
     {
        11,  -71,  -71,  -71,  -71,  -71,  -71,  -71,  -71,  -71,
-      -71,  -71,  -71,   57,  -71,  -71,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  105,   57,  -71
+      -71,  -71,  -71,   58,  -71,  -71,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+      106,   58,   58,   58,   58,   58,  -71
     },
 
     {
        11,  -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,
-      -72,  -72,  -72,   57,  -72,  -72,   57,   57,   57,   57,
+      -72,  -72,  -72,   58,  -72,  -72,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,  106,   57,   57,   57,   57,  -72
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  107,   58,  -72
     },
 
     {
        11,  -73,  -73,  -73,  -73,  -73,  -73,  -73,  -73,  -73,
-      -73,  -73,  -73,   57,  -73,  -73,   57,   57,   57,   57,
-       57,   57,   57,   57,  107,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -73
+      -73,  -73,  -73,   58,  -73,  -73,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,  108,   58,   58,   58,   58,  -73
     },
 
     {
-       11,   74,   74,  -74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   74,   74,   74,   74,   74,   74,   74,
-       74,   74,   74,   74,   74,   74,   74
+       11,  -74,  -74,  -74,  -74,  -74,  -74,  -74,  -74,  -74,
+      -74,  -74,  -74,   58,  -74,  -74,   58,   58,   58,   58,
+       58,   58,   58,   58,  109,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -74
 
     },
 
     {
-       11,  -75,   75,   76,  -75,  -75,  -75,  -75,  -75,  -75,
-      -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,
-      -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,
-      -75,  -75,  -75,  -75,  -75,  -75,  -75
+       11,   75,   75,  -75,   75,   75,   75,   75,   75,   75,
+       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
+       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
+       75,   75,   75,   75,   75,   75,   75
     },
 
     {
-       11,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
+       11,  -76,   76,   77,  -76,  -76,  -76,  -76,  -76,  -76,
       -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
       -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
       -76,  -76,  -76,  -76,  -76,  -76,  -76
     },
 
     {
-       11,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,
-      -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,
+       11,   78,  -77,  -77,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
 
-      -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,
-      -77,  -77,  -77,  -77,  -77,  -77,  -77
+       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78
     },
 
     {
-       11,   78,   78,   79,   78,  -78,   78,   78,  -78,   78,
-       78,   78,   78,   78,   78,  -78,   78,   78,   78,   78,
-       78,   78,   78,   78,   78,   78,   78,   78,   78,   78,
-       78,   78,   78,   78,   78,   78,   78
+       11,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
+      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
+      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
+      -78,  -78,  -78,  -78,  -78,  -78,  -78
     },
 
     {
-       11,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,
-      -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,
-      -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,
-      -79,  -79,  -79,  -79,  -79,  -79,  -79
+       11,   79,   79,   80,   79,  -79,   79,   79,  -79,   79,
+       79,   79,   79,   79,   79,  -79,   79,   79,   79,   79,
+       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
+       79,   79,   79,   79,   79,   79,   79
 
     },
 
     {
-       11,  -80,  -80,   81,  -80,  -80,  -80,  -80,  -80,  -80,
+       11,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
       -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
       -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
       -80,  -80,  -80,  -80,  -80,  -80,  -80
     },
 
     {
-       11,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,
+       11,  -81,  -81,   82,  -81,  -81,  -81,  -81,  -81,  -81,
       -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,
       -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,
       -81,  -81,  -81,  -81,  -81,  -81,  -81
@@ -912,669 +912,728 @@
     },
 
     {
-       11,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,
-      -84,  108,   85,   85,  -84,  -84,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -84
+       11,   84,   84,  -84,   84,   84,   84,   84,   84,   84,
+       84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
+       84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
+       84,   84,   84,   84,   84,   84,   84
 
     },
 
     {
        11,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
-      -85,   85,   85,   85,  -85,  -85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -85
+      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
+      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
+      -85,  -85,  -85,  -85,  -85,  -85,  -85
     },
 
     {
        11,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,
-      -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,
-      -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,
-      -86,  -86,  -86,  -86,  -86,  -86,  -86
+      -86,  110,   87,   87,  -86,  -86,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -86
     },
 
     {
        11,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,
-      -87,   85,   85,   85,  -87,  -87,   85,   85,   85,   85,
+      -87,   87,   87,   87,  -87,  -87,   87,   87,   87,   87,
 
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -87
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -87
     },
 
     {
        11,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
-      -88,   85,   85,   85,  -88,  -88,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,  -88
+      -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
+      -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
+      -88,  -88,  -88,  -88,  -88,  -88,  -88
     },
 
     {
        11,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,
-      -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,
-      -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,
-      -89,  -89,  -89,  -89,  -89,  -89,  -89
+      -89,   87,   87,   87,  -89,  -89,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -89
 
     },
 
     {
        11,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,  -90,
-      -90,  -90,  -90,   57,  -90,  -90,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,  109,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -90
+      -90,   87,   87,   87,  -90,  -90,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,  -90
     },
 
     {
        11,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
-      -91,  -91,  -91,   57,  -91,  -91,   57,   57,   57,   57,
-       57,   57,   57,   57,  110,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -91
+      -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
+      -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
+      -91,  -91,  -91,  -91,  -91,  -91,  -91
     },
 
     {
        11,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,
-      -92,  -92,  -92,   57,  -92,  -92,   57,   57,   57,   57,
+      -92,  -92,  -92,   58,  -92,  -92,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,  111,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -92
+       58,   58,   58,   58,   58,  111,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -92
     },
 
     {
        11,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
-      -93,  -93,  -93,   57,  -93,  -93,   57,   57,   57,   57,
-       57,  112,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -93
+      -93,  -93,  -93,   58,  -93,  -93,   58,   58,   58,   58,
+       58,   58,   58,   58,  112,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -93
     },
 
     {
        11,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,
-      -94,  -94,  -94,   57,  -94,  -94,  113,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -94
+      -94,  -94,  -94,   58,  -94,  -94,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  113,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -94
 
     },
 
     {
        11,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,
-      -95,  -95,  -95,   57,  -95,  -95,   57,   57,   57,   57,
-      114,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -95
+      -95,  -95,  -95,   58,  -95,  -95,   58,   58,   58,   58,
+       58,  114,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -95
     },
 
     {
        11,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,
-      -96,  -96,  -96,   57,  -96,  -96,   57,   57,  115,   57,
-       57,   57,   57,   57,  116,   57,  117,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -96
+      -96,  -96,  -96,   58,  -96,  -96,  115,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -96
     },
 
     {
        11,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,
-      -97,  -97,  -97,   57,  -97,  -97,   57,   57,   57,   57,
+      -97,  -97,  -97,   58,  -97,  -97,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,  118,
-       57,   57,   57,   57,   57,   57,  -97
+      116,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -97
     },
 
     {
        11,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,
-      -98,  -98,  -98,   57,  -98,  -98,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -98
+      -98,  -98,  -98,   58,  -98,  -98,   58,   58,  117,   58,
+       58,   58,   58,   58,  118,   58,  119,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  -98
     },
 
     {
        11,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,
-      -99,  -99,  -99,   57,  -99,  -99,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  -99
+      -99,  -99,  -99,   58,  -99,  -99,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  120,
+       58,   58,   58,   58,   58,   58,  -99
 
     },
 
     {
        11, -100, -100, -100, -100, -100, -100, -100, -100, -100,
-     -100, -100, -100,   57, -100, -100,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  119,   57,   57,
-       57,   57,   57,   57,   57,   57, -100
+     -100, -100, -100,   58, -100, -100,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -100
     },
 
     {
        11, -101, -101, -101, -101, -101, -101, -101, -101, -101,
-     -101, -101, -101,   57, -101, -101,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  120,   57, -101
+     -101, -101, -101,   58, -101, -101,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -101
     },
 
     {
        11, -102, -102, -102, -102, -102, -102, -102, -102, -102,
-     -102, -102, -102,   57, -102, -102,   57,   57,   57,   57,
+     -102, -102, -102,   58, -102, -102,   58,   58,   58,   58,
 
-       57,   57,   57,   57,  121,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -102
+       58,   58,   58,   58,   58,   58,   58,  121,   58,   58,
+       58,   58,   58,   58,   58,   58, -102
     },
 
     {
        11, -103, -103, -103, -103, -103, -103, -103, -103, -103,
-     -103, -103, -103,   57, -103, -103,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  122,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -103
+     -103, -103, -103,   58, -103, -103,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  122,   58, -103
     },
 
     {
        11, -104, -104, -104, -104, -104, -104, -104, -104, -104,
-     -104, -104, -104,   57, -104, -104,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  123,   57, -104
+     -104, -104, -104,   58, -104, -104,   58,   58,   58,   58,
+       58,   58,   58,   58,  123,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -104
 
     },
 
     {
        11, -105, -105, -105, -105, -105, -105, -105, -105, -105,
-     -105, -105, -105,   57, -105, -105,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,  124,   57,   57,   57,   57, -105
+     -105, -105, -105,   58, -105, -105,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  124,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -105
     },
 
     {
        11, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-     -106, -106, -106,   57, -106, -106,   57,   57,   57,   57,
-       57,   57,   57,   57,  125,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -106
+     -106, -106, -106,   58, -106, -106,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  125,   58, -106
     },
 
     {
        11, -107, -107, -107, -107, -107, -107, -107, -107, -107,
-     -107, -107, -107,   57, -107, -107,   57,   57,   57,   57,
+     -107, -107, -107,   58, -107, -107,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,  126,   57,   57,   57, -107
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,  126,   58,   58,   58,   58, -107
     },
 
     {
        11, -108, -108, -108, -108, -108, -108, -108, -108, -108,
-     -108,   85,   85,   85, -108, -108,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-       85,   85,   85,   85,   85,   85, -108
+     -108, -108, -108,   58, -108, -108,   58,   58,   58,   58,
+       58,   58,   58,   58,  127,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -108
     },
 
     {
        11, -109, -109, -109, -109, -109, -109, -109, -109, -109,
-     -109, -109, -109,   57, -109, -109,   57,   57,   57,   57,
-      127,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -109
+     -109, -109, -109,   58, -109, -109,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  128,   58,   58,   58, -109
 
     },
 
     {
        11, -110, -110, -110, -110, -110, -110, -110, -110, -110,
-     -110, -110, -110,   57, -110, -110,   57,   57,  128,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -110
+     -110,   87,   87,   87, -110, -110,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,   87,   87,   87, -110
     },
 
     {
        11, -111, -111, -111, -111, -111, -111, -111, -111, -111,
-     -111, -111, -111,   57, -111, -111,   57,   57,   57,   57,
-      129,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -111
+     -111, -111, -111,   58, -111, -111,   58,   58,   58,   58,
+      129,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -111
     },
 
     {
        11, -112, -112, -112, -112, -112, -112, -112, -112, -112,
-     -112, -112, -112,   57, -112, -112,   57,   57,   57,   57,
+     -112, -112, -112,   58, -112, -112,   58,   58,  130,   58,
 
-       57,   57,   57,   57,  130,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -112
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -112
     },
 
     {
        11, -113, -113, -113, -113, -113, -113, -113, -113, -113,
-     -113, -113, -113,   57, -113, -113,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  131,   57, -113
+     -113, -113, -113,   58, -113, -113,   58,   58,   58,   58,
+      131,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -113
     },
 
     {
        11, -114, -114, -114, -114, -114, -114, -114, -114, -114,
-     -114, -114, -114,   57, -114, -114,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  132,   57,   57,
-       57,   57,   57,   57,   57,   57, -114
+     -114, -114, -114,   58, -114, -114,   58,   58,   58,   58,
+       58,   58,   58,   58,  132,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -114
 
     },
 
     {
        11, -115, -115, -115, -115, -115, -115, -115, -115, -115,
-     -115, -115, -115,   57, -115, -115,   57,   57,   57,   57,
-       57,   57,   57,  133,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -115
+     -115, -115, -115,   58, -115, -115,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  133,   58, -115
     },
 
     {
        11, -116, -116, -116, -116, -116, -116, -116, -116, -116,
-     -116, -116, -116,   57, -116, -116,   57,   57,   57,   57,
-       57,  134,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -116
+     -116, -116, -116,   58, -116, -116,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  134,   58,   58,
+       58,   58,   58,   58,   58,   58, -116
     },
 
     {
        11, -117, -117, -117, -117, -117, -117, -117, -117, -117,
-     -117, -117, -117,   57, -117, -117,   57,   57,   57,   57,
+     -117, -117, -117,   58, -117, -117,   58,   58,   58,   58,
 
-      135,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -117
+       58,   58,   58,  135,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -117
     },
 
     {
        11, -118, -118, -118, -118, -118, -118, -118, -118, -118,
-     -118, -118, -118,   57, -118, -118,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -118
+     -118, -118, -118,   58, -118, -118,   58,   58,   58,   58,
+       58,  136,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -118
     },
 
     {
        11, -119, -119, -119, -119, -119, -119, -119, -119, -119,
-     -119, -119, -119,   57, -119, -119,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,  136,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -119
+     -119, -119, -119,   58, -119, -119,   58,   58,   58,   58,
+      137,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -119
 
     },
 
     {
        11, -120, -120, -120, -120, -120, -120, -120, -120, -120,
-     -120, -120, -120,   57, -120, -120,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -120
+     -120, -120, -120,   58, -120, -120,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -120
     },
 
     {
        11, -121, -121, -121, -121, -121, -121, -121, -121, -121,
-     -121, -121, -121,   57, -121, -121,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,  137,   57,
-       57,   57,   57,   57,   57,   57, -121
+     -121, -121, -121,   58, -121, -121,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,  138,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -121
     },
 
     {
        11, -122, -122, -122, -122, -122, -122, -122, -122, -122,
-     -122, -122, -122,   57, -122, -122,   57,   57,   57,   57,
+     -122, -122, -122,   58, -122, -122,   58,   58,  139,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,  138,
-       57,   57,   57,   57,   57,   57, -122
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -122
     },
 
     {
        11, -123, -123, -123, -123, -123, -123, -123, -123, -123,
-     -123, -123, -123,   57, -123, -123,   57,   57,   57,   57,
-       57,   57,   57,   57,  139,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -123
+     -123, -123, -123,   58, -123, -123,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  140,   58,
+       58,   58,   58,   58,   58,   58, -123
     },
 
     {
        11, -124, -124, -124, -124, -124, -124, -124, -124, -124,
-     -124, -124, -124,   57, -124, -124,   57,   57,  140,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -124
+     -124, -124, -124,   58, -124, -124,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,  141,
+       58,   58,   58,   58,   58,   58, -124
 
     },
 
     {
        11, -125, -125, -125, -125, -125, -125, -125, -125, -125,
-     -125, -125, -125,   57, -125, -125,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  141,   57,   57,
-       57,   57,   57,   57,   57,   57, -125
+     -125, -125, -125,   58, -125, -125,   58,   58,   58,   58,
+       58,   58,   58,   58,  142,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -125
     },
 
     {
        11, -126, -126, -126, -126, -126, -126, -126, -126, -126,
-     -126, -126, -126,   57, -126, -126,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,  142,   57,   57, -126
+     -126, -126, -126,   58, -126, -126,   58,   58,  143,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -126
     },
 
     {
        11, -127, -127, -127, -127, -127, -127, -127, -127, -127,
-     -127, -127, -127,   57, -127, -127,  143,   57,   57,   57,
+     -127, -127, -127,   58, -127, -127,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -127
+       58,   58,   58,   58,   58,   58,   58,  144,   58,   58,
+       58,   58,   58,   58,   58,   58, -127
     },
 
     {
        11, -128, -128, -128, -128, -128, -128, -128, -128, -128,
-     -128, -128, -128,   57, -128, -128,   57,   57,   57,   57,
-      144,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -128
+     -128, -128, -128,   58, -128, -128,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  145,   58,   58, -128
     },
 
     {
        11, -129, -129, -129, -129, -129, -129, -129, -129, -129,
-     -129, -129, -129,   57, -129, -129,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  145,   57,   57,
-       57,   57,   57,   57,   57,   57, -129
+     -129, -129, -129,   58, -129, -129,  146,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -129
 
     },
 
     {
        11, -130, -130, -130, -130, -130, -130, -130, -130, -130,
-     -130, -130, -130,   57, -130, -130,   57,   57,   57,   57,
-       57,   57,  146,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -130
+     -130, -130, -130,   58, -130, -130,   58,   58,   58,   58,
+      147,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -130
     },
 
     {
        11, -131, -131, -131, -131, -131, -131, -131, -131, -131,
-     -131, -131, -131,   57, -131, -131,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,  147,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -131
+     -131, -131, -131,   58, -131, -131,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  148,   58,   58,
+       58,   58,   58,   58,   58,   58, -131
     },
 
     {
        11, -132, -132, -132, -132, -132, -132, -132, -132, -132,
-     -132, -132, -132,   57, -132, -132,   57,   57,   57,  148,
+     -132, -132, -132,   58, -132, -132,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -132
+       58,   58,  149,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -132
     },
 
     {
        11, -133, -133, -133, -133, -133, -133, -133, -133, -133,
-     -133, -133, -133,   57, -133, -133,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,  149,   57,
-       57,   57,   57,   57,   57,   57, -133
+     -133, -133, -133,   58, -133, -133,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  150,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -133
     },
 
     {
        11, -134, -134, -134, -134, -134, -134, -134, -134, -134,
-     -134, -134, -134,   57, -134, -134,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -134
+     -134, -134, -134,   58, -134, -134,   58,   58,   58,  151,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -134
 
     },
 
     {
        11, -135, -135, -135, -135, -135, -135, -135, -135, -135,
-     -135, -135, -135,   57, -135, -135,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  150,   57,   57,
-       57,   57,   57,   57,   57,   57, -135
+     -135, -135, -135,   58, -135, -135,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  152,   58,
+       58,   58,   58,   58,   58,   58, -135
     },
 
     {
        11, -136, -136, -136, -136, -136, -136, -136, -136, -136,
-     -136, -136, -136,   57, -136, -136,   57,   57,   57,   57,
-      151,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -136
+     -136, -136, -136,   58, -136, -136,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -136
     },
 
     {
        11, -137, -137, -137, -137, -137, -137, -137, -137, -137,
-     -137, -137, -137,   57, -137, -137,   57,   57,   57,   57,
+     -137, -137, -137,   58, -137, -137,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,  152,   57,   57,
-       57,   57,   57,   57,   57,   57, -137
+       58,   58,   58,   58,   58,   58,   58,  153,   58,   58,
+       58,   58,   58,   58,   58,   58, -137
     },
 
     {
        11, -138, -138, -138, -138, -138, -138, -138, -138, -138,
-     -138, -138, -138,   57, -138, -138,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,  153,   57,   57, -138
+     -138, -138, -138,   58, -138, -138,   58,   58,   58,   58,
+      154,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -138
     },
 
     {
        11, -139, -139, -139, -139, -139, -139, -139, -139, -139,
-     -139, -139, -139,   57, -139, -139,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,  154,   57,   57,   57,   57, -139
+     -139, -139, -139,   58, -139, -139,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,  155,   58,
+       58,   58,   58,   58,   58,   58, -139
 
     },
 
     {
        11, -140, -140, -140, -140, -140, -140, -140, -140, -140,
-     -140, -140, -140,   57, -140, -140,   57,   57,   57,   57,
-      155,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -140
+     -140, -140, -140,   58, -140, -140,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  156,   58,   58,
+       58,   58,   58,   58,   58,   58, -140
     },
 
     {
        11, -141, -141, -141, -141, -141, -141, -141, -141, -141,
-     -141, -141, -141,   57, -141, -141,   57,   57,   57,   57,
-       57,   57,  156,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -141
+     -141, -141, -141,   58, -141, -141,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  157,   58,   58, -141
     },
 
     {
        11, -142, -142, -142, -142, -142, -142, -142, -142, -142,
-     -142, -142, -142,   57, -142, -142,  157,   57,   57,   57,
+     -142, -142, -142,   58, -142, -142,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -142
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,  158,   58,   58,   58,   58, -142
     },
 
     {
        11, -143, -143, -143, -143, -143, -143, -143, -143, -143,
-     -143, -143, -143,   57, -143, -143,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  158,   57,   57,
-       57,   57,   57,   57,   57,   57, -143
+     -143, -143, -143,   58, -143, -143,   58,   58,   58,   58,
+      159,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -143
     },
 
     {
        11, -144, -144, -144, -144, -144, -144, -144, -144, -144,
-     -144, -144, -144,   57, -144, -144,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -144
+     -144, -144, -144,   58, -144, -144,   58,   58,   58,   58,
+       58,   58,  160,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -144
 
     },
 
     {
        11, -145, -145, -145, -145, -145, -145, -145, -145, -145,
-     -145, -145, -145,   57, -145, -145,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,  159,   57,   57, -145
+     -145, -145, -145,   58, -145, -145,  161,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -145
     },
 
     {
        11, -146, -146, -146, -146, -146, -146, -146, -146, -146,
-     -146, -146, -146,   57, -146, -146,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -146
+     -146, -146, -146,   58, -146, -146,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  162,   58,   58,
+       58,   58,   58,   58,   58,   58, -146
     },
 
     {
        11, -147, -147, -147, -147, -147, -147, -147, -147, -147,
-     -147, -147, -147,   57, -147, -147,   57,   57,   57,   57,
+     -147, -147, -147,   58, -147, -147,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,  160,   57,   57, -147
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -147
     },
 
     {
        11, -148, -148, -148, -148, -148, -148, -148, -148, -148,
-     -148, -148, -148,   57, -148, -148,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,  161,   57,   57,   57, -148
+     -148, -148, -148,   58, -148, -148,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  163,   58,   58, -148
     },
 
     {
        11, -149, -149, -149, -149, -149, -149, -149, -149, -149,
-     -149, -149, -149,   57, -149, -149,   57,   57,   57,   57,
-       57,   57,   57,   57,  162,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -149
+     -149, -149, -149,   58, -149, -149,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -149
 
     },
 
     {
        11, -150, -150, -150, -150, -150, -150, -150, -150, -150,
-     -150, -150, -150,   57, -150, -150,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  163,   57, -150
+     -150, -150, -150,   58, -150, -150,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  164,   58,   58, -150
     },
 
     {
        11, -151, -151, -151, -151, -151, -151, -151, -151, -151,
-     -151, -151, -151,   57, -151, -151,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,  164,   57,   57,
-       57,   57,   57,   57,   57,   57, -151
+     -151, -151, -151,   58, -151, -151,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  165,   58,   58,   58, -151
     },
 
     {
        11, -152, -152, -152, -152, -152, -152, -152, -152, -152,
-     -152, -152, -152,   57, -152, -152,  165,   57,   57,   57,
+     -152, -152, -152,   58, -152, -152,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -152
+       58,   58,   58,   58,  166,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -152
     },
 
     {
        11, -153, -153, -153, -153, -153, -153, -153, -153, -153,
-     -153, -153, -153,   57, -153, -153,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -153
+     -153, -153, -153,   58, -153, -153,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  167,   58, -153
     },
 
     {
        11, -154, -154, -154, -154, -154, -154, -154, -154, -154,
-     -154, -154, -154,   57, -154, -154,   57,   57,   57,   57,
-      166,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -154
+     -154, -154, -154,   58, -154, -154,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  168,   58,   58,
+       58,   58,   58,   58,   58,   58, -154
 
     },
 
     {
        11, -155, -155, -155, -155, -155, -155, -155, -155, -155,
-     -155, -155, -155,   57, -155, -155,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -155
+     -155, -155, -155,   58, -155, -155,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,  169,   58,   58,
+       58,   58,   58,   58,   58,   58, -155
     },
 
     {
        11, -156, -156, -156, -156, -156, -156, -156, -156, -156,
-     -156, -156, -156,   57, -156, -156,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -156
+     -156, -156, -156,   58, -156, -156,  170,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -156
     },
 
     {
        11, -157, -157, -157, -157, -157, -157, -157, -157, -157,
-     -157, -157, -157,   57, -157, -157,   57,   57,   57,   57,
+     -157, -157, -157,   58, -157, -157,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,  167,   57,   57, -157
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -157
     },
 
     {
        11, -158, -158, -158, -158, -158, -158, -158, -158, -158,
-     -158, -158, -158,   57, -158, -158,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -158
+     -158, -158, -158,   58, -158, -158,   58,   58,   58,   58,
+      171,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -158
     },
 
     {
        11, -159, -159, -159, -159, -159, -159, -159, -159, -159,
-     -159, -159, -159,   57, -159, -159,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -159
+     -159, -159, -159,   58, -159, -159,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -159
 
     },
 
     {
        11, -160, -160, -160, -160, -160, -160, -160, -160, -160,
-     -160, -160, -160,   57, -160, -160,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -160
+     -160, -160, -160,   58, -160, -160,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -160
     },
 
     {
        11, -161, -161, -161, -161, -161, -161, -161, -161, -161,
-     -161, -161, -161,   57, -161, -161,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -161
+     -161, -161, -161,   58, -161, -161,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,  172,   58,   58, -161
     },
 
     {
        11, -162, -162, -162, -162, -162, -162, -162, -162, -162,
-     -162, -162, -162,   57, -162, -162,   57,   57,  168,   57,
+     -162, -162, -162,   58, -162, -162,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -162
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -162
     },
 
     {
        11, -163, -163, -163, -163, -163, -163, -163, -163, -163,
-     -163, -163, -163,   57, -163, -163,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -163
+     -163, -163, -163,   58, -163, -163,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -163
     },
 
     {
        11, -164, -164, -164, -164, -164, -164, -164, -164, -164,
-     -164, -164, -164,   57, -164, -164,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  169,   57, -164
+     -164, -164, -164,   58, -164, -164,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -164
 
     },
 
     {
        11, -165, -165, -165, -165, -165, -165, -165, -165, -165,
-     -165, -165, -165,   57, -165, -165,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,  170,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -165
+     -165, -165, -165,   58, -165, -165,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -165
     },
 
     {
        11, -166, -166, -166, -166, -166, -166, -166, -166, -166,
-     -166, -166, -166,   57, -166, -166,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,  171,   57,   57,   57, -166
+     -166, -166, -166,   58, -166, -166,   58,   58,  173,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -166
     },
 
     {
        11, -167, -167, -167, -167, -167, -167, -167, -167, -167,
-     -167, -167, -167,   57, -167, -167,   57,   57,   57,   57,
+     -167, -167, -167,   58, -167, -167,   58,   58,   58,   58,
 
-      172,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -167
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -167
     },
 
     {
        11, -168, -168, -168, -168, -168, -168, -168, -168, -168,
-     -168, -168, -168,   57, -168, -168,   57,   57,   57,   57,
-      173,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -168
+     -168, -168, -168,   58, -168, -168,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,  174,   58, -168
     },
 
     {
        11, -169, -169, -169, -169, -169, -169, -169, -169, -169,
-     -169, -169, -169,   57, -169, -169,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -169
+     -169, -169, -169,   58, -169, -169,   58,   58,   58,   58,
+       58,  175,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -169
 
     },
 
     {
        11, -170, -170, -170, -170, -170, -170, -170, -170, -170,
-     -170, -170, -170,   57, -170, -170,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -170
+     -170, -170, -170,   58, -170, -170,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,  176,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -170
     },
 
     {
        11, -171, -171, -171, -171, -171, -171, -171, -171, -171,
-     -171, -171, -171,   57, -171, -171,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -171
+     -171, -171, -171,   58, -171, -171,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,  177,   58,   58,   58, -171
     },
 
     {
        11, -172, -172, -172, -172, -172, -172, -172, -172, -172,
-     -172, -172, -172,   57, -172, -172,   57,   57,   57,   57,
+     -172, -172, -172,   58, -172, -172,   58,   58,   58,   58,
 
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -172
+      178,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -172
     },
 
     {
        11, -173, -173, -173, -173, -173, -173, -173, -173, -173,
-     -173, -173, -173,   57, -173, -173,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, -173
+     -173, -173, -173,   58, -173, -173,   58,   58,   58,   58,
+      179,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -173
+    },
+
+    {
+       11, -174, -174, -174, -174, -174, -174, -174, -174, -174,
+     -174, -174, -174,   58, -174, -174,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -174
+
+    },
+
+    {
+       11, -175, -175, -175, -175, -175, -175, -175, -175, -175,
+     -175, -175, -175,   58, -175, -175,   58,   58,   58,   58,
+       58,   58,   58,   58,  180,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -175
+    },
+
+    {
+       11, -176, -176, -176, -176, -176, -176, -176, -176, -176,
+     -176, -176, -176,   58, -176, -176,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -176
+    },
+
+    {
+       11, -177, -177, -177, -177, -177, -177, -177, -177, -177,
+     -177, -177, -177,   58, -177, -177,   58,   58,   58,   58,
+
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -177
+    },
+
+    {
+       11, -178, -178, -178, -178, -178, -178, -178, -178, -178,
+     -178, -178, -178,   58, -178, -178,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -178
+    },
+
+    {
+       11, -179, -179, -179, -179, -179, -179, -179, -179, -179,
+     -179, -179, -179,   58, -179, -179,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -179
+
+    },
+
+    {
+       11, -180, -180, -180, -180, -180, -180, -180, -180, -180,
+     -180, -180, -180,   58, -180, -180,   58,   58,   58,   58,
+       58,   58,  181,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -180
+    },
+
+    {
+       11, -181, -181, -181, -181, -181, -181, -181, -181, -181,
+     -181, -181, -181,   58, -181, -181,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
+       58,   58,   58,   58,   58,   58, -181
     },
 
     } ;
@@ -1595,29 +1654,30 @@
 	*yy_cp = '\0'; \
 	yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 56
-#define YY_END_OF_BUFFER 57
-static yyconst short int yy_accept[174] =
+#define YY_NUM_RULES 58
+#define YY_END_OF_BUFFER 59
+static yyconst short int yy_accept[182] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-       57,    5,    4,    3,    2,   29,   30,   28,   28,   28,
-       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
-       55,   52,   54,   47,   51,   50,   49,   45,   41,   35,
-       40,   45,   33,   34,   43,   43,   36,   45,   43,   43,
-       45,    4,    3,    2,    2,    1,   28,   28,   28,   28,
-       28,   28,   28,   15,   28,   28,   28,   28,   28,   28,
-       28,   28,   28,   55,   52,   54,   53,   47,   46,   49,
-       48,   37,   31,   43,   43,   44,   38,   39,   32,   28,
-       28,   28,   28,   28,   28,   28,   28,   26,   25,   28,
-
-       28,   28,   28,   28,   28,   28,   28,   42,   23,   28,
-       28,   28,   28,   28,   28,   28,   28,   14,   28,    7,
-       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
-       28,   28,   28,   16,   28,   28,   28,   28,   28,   28,
-       28,   28,   28,   10,   28,   13,   28,   28,   28,   28,
-       28,   28,   21,   28,    9,   27,   28,   24,   12,   20,
-       17,   28,    8,   28,   28,   28,   28,   28,    6,   19,
-       18,   22,   11
+       59,    5,    4,    3,    2,   30,   31,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       57,   54,   56,   49,   53,   52,   51,   47,   42,   36,
+       41,   45,   47,   34,   35,   44,   44,   37,   47,   44,
+       44,   47,    4,    3,    2,    2,    1,   29,   29,   29,
+       29,   29,   29,   29,   16,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   57,   54,   56,   55,   49,   48,
+       51,   50,   38,   45,   32,   44,   44,   46,   39,   40,
+       33,   29,   29,   29,   29,   29,   29,   29,   29,   27,
+
+       26,   29,   29,   29,   29,   29,   29,   29,   29,   43,
+       24,   29,   29,   29,   29,   29,   29,   29,   29,   15,
+       29,    7,   29,   29,   29,   29,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   17,   29,   29,   29,   29,
+       29,   29,   29,   29,   29,   29,   10,   29,   13,   29,
+       29,   29,   29,   29,   29,   29,   22,   29,    9,   28,
+       29,   25,   12,   21,   18,   29,    8,   29,   29,   29,
+       29,   29,   29,    6,   29,   20,   19,   23,   11,   29,
+       14
     } ;
 
 static yyconst int yy_ec[256] =
@@ -1993,43 +2053,43 @@
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_HELP;
+BEGIN(PARAM); return T_MENUCONFIG;
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_IF;
+BEGIN(PARAM); return T_HELP;
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_ENDIF;
+BEGIN(PARAM); return T_IF;
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_DEPENDS;
+BEGIN(PARAM); return T_ENDIF;
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_REQUIRES;
+BEGIN(PARAM); return T_DEPENDS;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_OPTIONAL;
+BEGIN(PARAM); return T_REQUIRES;
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_DEFAULT;
+BEGIN(PARAM); return T_OPTIONAL;
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_PROMPT;
+BEGIN(PARAM); return T_DEFAULT;
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_TRISTATE;
+BEGIN(PARAM); return T_PROMPT;
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_BOOLEAN;
+BEGIN(PARAM); return T_TRISTATE;
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
@@ -2037,71 +2097,75 @@
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_INT;
+BEGIN(PARAM); return T_BOOLEAN;
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_HEX;
+BEGIN(PARAM); return T_INT;
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-BEGIN(PARAM); return T_STRING;
+BEGIN(PARAM); return T_HEX;
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
+BEGIN(PARAM); return T_STRING;
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
 {
 		alloc_string(yytext, yyleng);
 		zconflval.string = text;
 		return T_WORD;
 	}
 	YY_BREAK
-case 29:
+case 30:
 YY_RULE_SETUP
 
 	YY_BREAK
-case 30:
+case 31:
 YY_RULE_SETUP
 current_file->lineno++; BEGIN(INITIAL);
 	YY_BREAK
 
 
-case 31:
+case 32:
 YY_RULE_SETUP
 return T_AND;
 	YY_BREAK
-case 32:
+case 33:
 YY_RULE_SETUP
 return T_OR;
 	YY_BREAK
-case 33:
+case 34:
 YY_RULE_SETUP
 return T_OPEN_PAREN;
 	YY_BREAK
-case 34:
+case 35:
 YY_RULE_SETUP
 return T_CLOSE_PAREN;
 	YY_BREAK
-case 35:
+case 36:
 YY_RULE_SETUP
 return T_NOT;
 	YY_BREAK
-case 36:
+case 37:
 YY_RULE_SETUP
 return T_EQUAL;
 	YY_BREAK
-case 37:
+case 38:
 YY_RULE_SETUP
 return T_UNEQUAL;
 	YY_BREAK
-case 38:
+case 39:
 YY_RULE_SETUP
 return T_IF;
 	YY_BREAK
-case 39:
+case 40:
 YY_RULE_SETUP
 return T_ON;
 	YY_BREAK
-case 40:
+case 41:
 YY_RULE_SETUP
 {
 		str = yytext[0];
@@ -2109,15 +2173,15 @@
 		BEGIN(STRING);
 	}
 	YY_BREAK
-case 41:
+case 42:
 YY_RULE_SETUP
 BEGIN(INITIAL); current_file->lineno++; return T_EOL;
 	YY_BREAK
-case 42:
+case 43:
 YY_RULE_SETUP
 /* ignore */
 	YY_BREAK
-case 43:
+case 44:
 YY_RULE_SETUP
 {
 		alloc_string(yytext, yyleng);
@@ -2125,11 +2189,15 @@
 		return T_WORD;
 	}
 	YY_BREAK
-case 44:
+case 45:
+YY_RULE_SETUP
+/* comment */
+	YY_BREAK
+case 46:
 YY_RULE_SETUP
 current_file->lineno++;
 	YY_BREAK
-case 45:
+case 47:
 YY_RULE_SETUP
 
 	YY_BREAK
@@ -2140,7 +2208,7 @@
 	YY_BREAK
 
 
-case 46:
+case 48:
 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
 yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
@@ -2151,13 +2219,13 @@
 		return T_WORD_QUOTE;
 	}
 	YY_BREAK
-case 47:
+case 49:
 YY_RULE_SETUP
 {
 		append_string(yytext, yyleng);
 	}
 	YY_BREAK
-case 48:
+case 50:
 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
 yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
@@ -2168,13 +2236,13 @@
 		return T_WORD_QUOTE;
 	}
 	YY_BREAK
-case 49:
+case 51:
 YY_RULE_SETUP
 {
 		append_string(yytext + 1, yyleng - 1);
 	}
 	YY_BREAK
-case 50:
+case 52:
 YY_RULE_SETUP
 {
 		if (str == yytext[0]) {
@@ -2185,7 +2253,7 @@
 			append_string(yytext, 1);
 	}
 	YY_BREAK
-case 51:
+case 53:
 YY_RULE_SETUP
 {
 		printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
@@ -2201,7 +2269,7 @@
 	YY_BREAK
 
 
-case 52:
+case 54:
 YY_RULE_SETUP
 {
 		ts = 0;
@@ -2227,9 +2295,9 @@
 		
 	}
 	YY_BREAK
-case 53:
+case 55:
 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 1;
+yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {
@@ -2238,14 +2306,14 @@
 		return T_HELPTEXT;
 	}
 	YY_BREAK
-case 54:
+case 56:
 YY_RULE_SETUP
 {
 		current_file->lineno++;
 		append_string("\n", 1);
 	}
 	YY_BREAK
-case 55:
+case 57:
 YY_RULE_SETUP
 {
 		append_string(yytext, yyleng);
@@ -2271,7 +2339,7 @@
 	yyterminate();
 }
 	YY_BREAK
-case 56:
+case 58:
 YY_RULE_SETUP
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
diff -urN linux-2.5.64-bk10/scripts/kconfig/mconf.c linux-2.5.64-bk11/scripts/kconfig/mconf.c
--- linux-2.5.64-bk10/scripts/kconfig/mconf.c	Tue Mar  4 19:29:03 2003
+++ linux-2.5.64-bk11/scripts/kconfig/mconf.c	Mon Mar 31 12:34:56 2003
@@ -302,11 +302,8 @@
 					cprint1("%s%*c%s",
 						menu->data ? "-->" : "++>",
 						indent + 1, ' ', prompt);
-				} else {
-					if (menu->parent != &rootmenu)
-						cprint1("   %*c", indent + 1, ' ');
-					cprint1("%s  --->", prompt);
-				}
+				} else
+					cprint1("   %*c%s  --->", indent + 1, ' ', prompt);
 
 				cprint_done();
 				if (single_menu_mode && menu->data)
@@ -373,6 +370,11 @@
 		}
 		cprint_done();
 	} else {
+		if (menu == current_menu) {
+			cprint(":%p", menu);
+			cprint("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));
+			goto conf_childs;
+		}
 		child_count++;
 		val = sym_get_tristate_value(sym);
 		if (sym_is_choice_value(sym) && val == yes) {
@@ -407,6 +409,11 @@
 		}
 		cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
 			sym_has_value(sym) ? "" : " (NEW)");
+		if (menu->prompt->type == P_MENU) {
+			cprint1("  --->");
+			cprint_done();
+			return;
+		}
 		cprint_done();
 	}
 
@@ -445,9 +452,9 @@
 			cprint(":");
 			cprint("--- ");
 			cprint("L");
-			cprint("Load an Alternate Configuration File");
+			cprint("    Load an Alternate Configuration File");
 			cprint("S");
-			cprint("Save Configuration to an Alternate File");
+			cprint("    Save Configuration to an Alternate File");
 		}
 		stat = exec_conf();
 		if (stat < 0)
@@ -484,6 +491,8 @@
 			case 't':
 				if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)
 					conf_choice(submenu);
+				else if (submenu->prompt->type == P_MENU)
+					conf(submenu);
 				break;
 			case 's':
 				conf_string(submenu);
diff -urN linux-2.5.64-bk10/scripts/kconfig/menu.c linux-2.5.64-bk11/scripts/kconfig/menu.c
--- linux-2.5.64-bk10/scripts/kconfig/menu.c	Tue Mar  4 19:29:35 2003
+++ linux-2.5.64-bk11/scripts/kconfig/menu.c	Mon Mar 31 12:34:56 2003
@@ -54,9 +54,34 @@
 	current_menu = current_menu->parent;
 }
 
+struct expr *menu_check_dep(struct expr *e)
+{
+	if (!e)
+		return e;
+
+	switch (e->type) {
+	case E_NOT:
+		e->left.expr = menu_check_dep(e->left.expr);
+		break;
+	case E_OR:
+	case E_AND:
+		e->left.expr = menu_check_dep(e->left.expr);
+		e->right.expr = menu_check_dep(e->right.expr);
+		break;
+	case E_SYMBOL:
+		/* change 'm' into 'm' && MODULES */
+		if (e->left.sym == &symbol_mod)
+			return expr_alloc_and(e, expr_alloc_symbol(modules_sym));
+		break;
+	default:
+		break;
+	}
+	return e;
+}
+
 void menu_add_dep(struct expr *dep)
 {
-	current_entry->dep = expr_alloc_and(current_entry->dep, dep);
+	current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
 }
 
 void menu_set_type(int type)
@@ -96,7 +121,7 @@
 	prop->menu = current_entry;
 	prop->text = prompt;
 	prop->def = def;
-	E_EXPR(prop->visible) = dep;
+	E_EXPR(prop->visible) = menu_check_dep(dep);
 
 	if (prompt)
 		current_entry->prompt = prop;
@@ -169,8 +194,8 @@
 		}
 		for (menu = parent->list; menu; menu = menu->next)
 			menu_finalize(menu);
-	} else if (sym && parent->prompt) {
-		basedep = E_EXPR(parent->prompt->visible);
+	} else if (sym) {
+		basedep = parent->prompt ? E_EXPR(parent->prompt->visible) : NULL;
 		basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
 		basedep = expr_eliminate_dups(expr_transform(basedep));
 		last_menu = NULL;
diff -urN linux-2.5.64-bk10/scripts/kconfig/qconf.cc linux-2.5.64-bk11/scripts/kconfig/qconf.cc
--- linux-2.5.64-bk10/scripts/kconfig/qconf.cc	Tue Mar  4 19:28:56 2003
+++ linux-2.5.64-bk11/scripts/kconfig/qconf.cc	Mon Mar 31 12:34:56 2003
@@ -42,15 +42,12 @@
  * menu: entry to be updated
  */
 template <class P>
-static void updateMenuList(P* parent, struct menu* menu)
+void ConfigList::updateMenuList(P* parent, struct menu* menu)
 {
 	struct menu* child;
-	ConfigList* list = parent->listView();
 	ConfigItem* item;
 	ConfigItem* last;
 	bool visible;
-	bool showAll = list->showAll;
-	enum listMode mode = list->mode;
 	enum prop_type type;
 
 	if (!menu) {
@@ -59,7 +56,9 @@
 		return;
 	}
 
-	last = 0;
+	last = parent->firstChild();
+	if (last && !last->goParent)
+		last = 0;
 	for (child = menu->list; child; child = child->next) {
 		item = last ? last->nextSibling() : parent->firstChild();
 		type = child->prompt ? child->prompt->type : P_UNKNOWN;
@@ -81,16 +80,8 @@
 		if (showAll || visible) {
 			if (!item || item->menu != child)
 				item = new ConfigItem(parent, last, child, visible);
-			else {
-				item->visible = visible;
-				if (item->updateNeeded()) {
-					ConfigItem* i = (ConfigItem*)child->data;
-					for (; i; i = i->nextItem) {
-						i->updateMenu();
-					}
-				} else if (list->updateAll)
-					item->updateMenu();
-			}
+			else
+				item->testUpdateMenu(visible);
 
 			if (mode == fullMode || mode == menuMode ||
 			    (type != P_MENU && type != P_ROOTMENU))
@@ -100,7 +91,7 @@
 			last = item;
 			continue;
 		}
-	hide:	
+	hide:
 		if (item && item->menu == child) {
 			last = parent->firstChild();
 			if (last == item)
@@ -131,24 +122,46 @@
 {
 	ConfigList* list;
 	struct symbol* sym;
+	struct property *prop;
 	QString prompt;
 	int type;
-	enum prop_type ptype;
 	tristate expr;
 
 	list = listView();
+	if (goParent) {
+		setPixmap(promptColIdx, list->menuBackPix);
+		prompt = "..";
+		goto set_prompt;
+	}
 
 	sym = menu->sym;
-	if (!sym) {
-		setText(promptColIdx, menu_get_prompt(menu));
-		ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
-		if ((ptype == P_ROOTMENU || ptype == P_MENU) &&
-		    (list->mode == singleMode || list->mode == symbolMode))
+	prop = menu->prompt;
+	prompt = menu_get_prompt(menu);
+
+	if (prop) switch (prop->type) {
+	case P_MENU:
+	case P_ROOTMENU:
+		if (list->mode == singleMode || list->mode == symbolMode) {
+			/* a menuconfig entry is displayed differently
+			 * depending whether it's at the view root or a child.
+			 */
+			if (sym && list->rootEntry == menu)
+				break;
 			setPixmap(promptColIdx, list->menuPix);
-		else
+		} else {
+			if (sym)
+				break;
 			setPixmap(promptColIdx, 0);
-		return;
+		}
+		goto set_prompt;
+	case P_COMMENT:
+		setPixmap(promptColIdx, 0);
+		goto set_prompt;
+	default:
+		;
 	}
+	if (!sym)
+		goto set_prompt;
 
 	setText(nameColIdx, sym->name);
 
@@ -158,7 +171,6 @@
 	case S_TRISTATE:
 		char ch;
 
-		prompt = menu_get_prompt(menu);
 		if (!sym_is_changable(sym) && !list->showAll) {
 			setText(noColIdx, 0);
 			setText(modColIdx, 0);
@@ -211,26 +223,33 @@
 #endif
 		setText(dataColIdx, data);
 		if (type == S_STRING)
-			prompt.sprintf("%s: %s", menu_get_prompt(menu), data);
+			prompt.sprintf("%s: %s", prompt.latin1(), data);
 		else
-			prompt.sprintf("(%s) %s", data, menu_get_prompt(menu));
+			prompt.sprintf("(%s) %s", data, prompt.latin1());
 		break;
 	}
 	if (!sym_has_value(sym) && visible)
 		prompt += " (NEW)";
+set_prompt:
 	setText(promptColIdx, prompt);
 }
 
-bool ConfigItem::updateNeeded(void)
+void ConfigItem::testUpdateMenu(bool v)
 {
-	struct symbol* sym = menu->sym;
-	if (sym)
-		sym_calc_value(sym);
+	ConfigItem* i;
+
+	visible = v;
+	if (!menu)
+		return;
+
+	sym_calc_value(menu->sym);
 	if (menu->flags & MENU_CHANGED) {
+		/* the menu entry changed, so update all list items */
 		menu->flags &= ~MENU_CHANGED;
-		return true;
-	}
-	return false;
+		for (i = (ConfigItem*)menu->data; i; i = i->nextItem)
+			i->updateMenu();
+	} else if (listView()->updateAll)
+		updateMenu();
 }
 
 void ConfigItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align)
@@ -251,14 +270,15 @@
  */
 void ConfigItem::init(void)
 {
-	ConfigList* list = listView();
-	nextItem = (ConfigItem*)menu->data;
-	menu->data = this;
+	if (menu) {
+		ConfigList* list = listView();
+		nextItem = (ConfigItem*)menu->data;
+		menu->data = this;
 
-	if (list->mode != fullMode)
-		setOpen(TRUE);
-	if (menu->sym)
+		if (list->mode != fullMode)
+			setOpen(TRUE);
 		sym_calc_value(menu->sym);
+	}
 	updateMenu();
 }
 
@@ -267,11 +287,13 @@
  */
 ConfigItem::~ConfigItem(void)
 {
-	ConfigItem** ip = &(ConfigItem*)menu->data;
-	for (; *ip; ip = &(*ip)->nextItem) {
-		if (*ip == this) {
-			*ip = nextItem;
-			break;
+	if (menu) {
+		ConfigItem** ip = &(ConfigItem*)menu->data;
+		for (; *ip; ip = &(*ip)->nextItem) {
+			if (*ip == this) {
+				*ip = nextItem;
+				break;
+			}
 		}
 	}
 }
@@ -310,7 +332,8 @@
 	: Parent(p), cview(cv),
 	  updateAll(false),
 	  symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
-	  choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), menuPix(xpm_menu), menuInvPix(xpm_menu_inv),
+	  choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
+	  menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback),
 	  showAll(false), showName(false), showRange(false), showData(false),
 	  rootEntry(0)
 {
@@ -366,6 +389,8 @@
 	cview->setHelp(item);
 
 	menu = item->menu;
+	if (!menu)
+		return;
 	type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
 	if (mode == menuMode && (type == P_MENU || type == P_ROOTMENU))
 		emit menuSelected(menu);
@@ -373,7 +398,27 @@
 
 void ConfigList::updateList(ConfigItem* item)
 {
-	(void)item;	// unused so far
+	ConfigItem* last = 0;
+
+	if (!rootEntry)
+		goto update;
+
+	if ((mode == singleMode || mode == symbolMode) && rootEntry != &rootmenu) {
+		item = firstChild();
+		if (!item)
+			item = new ConfigItem(this, 0, true);
+		last = item;
+	}
+	if (mode == singleMode && rootEntry->sym && rootEntry->prompt) {
+		item = last ? last->nextSibling() : firstChild();
+		if (!item)
+			item = new ConfigItem(this, last, rootEntry, true);
+
+		updateMenuList(item, rootEntry);
+		triggerUpdate();
+		return;
+	}
+update:
 	updateMenuList(this, rootEntry);
 	triggerUpdate();
 }
@@ -392,7 +437,7 @@
 	int type;
 	tristate oldval;
 
-	sym = item->menu->sym;
+	sym = item->menu ? item->menu->sym : 0;
 	if (!sym)
 		return;
 
@@ -418,6 +463,8 @@
 	int type, oldexpr, newexpr;
 
 	menu = item->menu;
+	if (!menu)
+		return;
 	sym = menu->sym;
 	if (!sym) {
 		if (item->menu->list)
@@ -511,7 +558,13 @@
 	switch (ev->key()) {
 	case Key_Return:
 	case Key_Enter:
+		if (item->goParent) {
+			emit parentSelected();
+			break;
+		}
 		menu = item->menu;
+		if (!menu)
+			break;
 		type = menu->prompt ? menu->prompt->type : P_UNKNOWN;
 		if ((type == P_MENU || type == P_ROOTMENU) && mode != fullMode) {
 			emit menuSelected(menu);
@@ -564,7 +617,11 @@
 			int off = header()->sectionPos(0) + itemMargin() +
 				treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0));
 			if (x >= off && x < off + pm->width()) {
-				if (menu->sym)
+				if (item->goParent)
+					emit parentSelected();
+				else if (!menu)
+					break;
+				else if (menu->sym)
 					changeValue(item);
 				else
 					emit menuSelected(menu);
@@ -606,7 +663,13 @@
 
 	if (!item)
 		goto skip;
+	if (item->goParent) {
+		emit parentSelected();
+		goto skip;
+	}
 	menu = item->menu;
+	if (!menu)
+		goto skip;
 	ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
 	if ((ptype == P_ROOTMENU || ptype == P_MENU) &&
 	    (mode == singleMode || mode == symbolMode))
@@ -677,7 +740,6 @@
  */
 ConfigMainWindow::ConfigMainWindow(void)
 {
-	ConfigView* view;
 	QMenuBar* menu;
 	QSplitter* split1;
 	QSplitter* split2;
@@ -707,15 +769,15 @@
 	split1->setOrientation(QSplitter::Horizontal);
 	setCentralWidget(split1);
 
-	view = new ConfigView(split1, this);
-	menuList = view->list;
+	menuView = new ConfigView(split1, this);
+	menuList = menuView->list;
 
 	split2 = new QSplitter(split1);
 	split2->setOrientation(QSplitter::Vertical);
 
 	// create config tree
-	view = new ConfigView(split2, this);
-	configList = view->list;
+	configView = new ConfigView(split2, this);
+	configList = configView->list;
 
 	helpText = new QTextView(split2);
 	helpText->setTextFormat(Qt::RichText);
@@ -864,89 +926,87 @@
 void ConfigMainWindow::setHelp(QListViewItem* item)
 {
 	struct symbol* sym;
-	struct menu* menu;
+	struct menu* menu = 0;
 
 	configList->parent()->lineEdit->hide();
-	if (item) {
-		QString head, debug, help;
+	if (item)
 		menu = ((ConfigItem*)item)->menu;
-		sym = menu->sym;
-		if (sym) {
-			if (menu->prompt) {
-				head += "<big><b>";
-				head += print_filter(menu->prompt->text);
-				head += "</b></big>";
-				if (sym->name) {
-					head += " (";
-					head += print_filter(sym->name);
-					head += ")";
-				}
-			} else if (sym->name) {
-				head += "<big><b>";
+	if (!menu) {
+		helpText->setText(NULL);
+		return;
+	}
+
+	QString head, debug, help;
+	menu = ((ConfigItem*)item)->menu;
+	sym = menu->sym;
+	if (sym) {
+		if (menu->prompt) {
+			head += "<big><b>";
+			head += print_filter(menu->prompt->text);
+			head += "</b></big>";
+			if (sym->name) {
+				head += " (";
 				head += print_filter(sym->name);
-				head += "</b></big>";
+				head += ")";
 			}
-			head += "<br><br>";
+		} else if (sym->name) {
+			head += "<big><b>";
+			head += print_filter(sym->name);
+			head += "</b></big>";
+		}
+		head += "<br><br>";
 
-			if (showDebug) {
-				debug += "type: ";
-				debug += print_filter(sym_type_name(sym->type));
-				debug += "<br>";
-				for (struct property *prop = sym->prop; prop; prop = prop->next) {
-					switch (prop->type) {
-					case P_PROMPT:
-						debug += "prompt: ";
-						debug += print_filter(prop->text);
-						debug += "<br>";
-						if (prop->visible.expr) {
-							debug += "&nbsp;&nbsp;dep: ";
-							expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
-							debug += "<br>";
-						}
-						break;
-					case P_DEFAULT:
-						debug += "default: ";
-						if (sym_is_choice(sym))
-							debug += print_filter(prop->def->name);
-						else {
-							sym_calc_value(prop->def);
-							debug += print_filter(sym_get_string_value(prop->def));
-						}
+		if (showDebug) {
+			debug += "type: ";
+			debug += print_filter(sym_type_name(sym->type));
+			debug += "<br>";
+			for (struct property *prop = sym->prop; prop; prop = prop->next) {
+				switch (prop->type) {
+				case P_PROMPT:
+					debug += "prompt: ";
+					debug += print_filter(prop->text);
+					debug += "<br>";
+					if (prop->visible.expr) {
+						debug += "&nbsp;&nbsp;dep: ";
+						expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
 						debug += "<br>";
-						if (prop->visible.expr) {
-							debug += "&nbsp;&nbsp;dep: ";
-							expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
-							debug += "<br>";
-						}
-						break;
-					case P_CHOICE:
-						break;
-					default:
-						debug += "unknown property: ";
-						debug += prop_get_type_name(prop->type);
+					}
+					break;
+				case P_DEFAULT:
+					debug += "default: ";
+					debug += print_filter(prop->def->name);
+					debug += "<br>";
+					if (prop->visible.expr) {
+						debug += "&nbsp;&nbsp;dep: ";
+						expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
 						debug += "<br>";
 					}
+					break;
+				case P_CHOICE:
+					break;
+				default:
+					debug += "unknown property: ";
+					debug += prop_get_type_name(prop->type);
+					debug += "<br>";
 				}
-				debug += "<br>";
 			}
+			debug += "<br>";
+		}
 
-			help = print_filter(sym->help);
-		} else if (menu->prompt) {
-			head += "<big><b>";
-			head += print_filter(menu->prompt->text);
-			head += "</b></big><br><br>";
-			if (showDebug) {
-				if (menu->prompt->visible.expr) {
-					debug += "&nbsp;&nbsp;dep: ";
-					expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
-					debug += "<br>";
-				}
+		help = print_filter(sym->help);
+	} else if (menu->prompt) {
+		head += "<big><b>";
+		head += print_filter(menu->prompt->text);
+		head += "</b></big><br><br>";
+		if (showDebug) {
+			if (menu->prompt->visible.expr) {
+				debug += "&nbsp;&nbsp;dep: ";
+				expr_print(menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
+				debug += "<br>";
 			}
 		}
-		helpText->setText(head + debug + help);
-		return;
 	}
-	helpText->setText(NULL);
+	helpText->setText(head + debug + help);
 }
 
 void ConfigMainWindow::loadConfig(void)
@@ -1010,7 +1070,7 @@
 
 void ConfigMainWindow::showSingleView(void)
 {
-	menuList->hide();
+	menuView->hide();
 	menuList->setRootMenu(0);
 	configList->mode = singleMode;
 	if (configList->rootEntry == &rootmenu)
@@ -1032,14 +1092,14 @@
 	configApp->processEvents();
 	menuList->mode = menuMode;
 	menuList->setRootMenu(&rootmenu);
-	menuList->show();
 	menuList->setAllOpen(TRUE);
+	menuView->show();
 	menuList->setFocus();
 }
 
 void ConfigMainWindow::showFullView(void)
 {
-	menuList->hide();
+	menuView->hide();
 	menuList->setRootMenu(0);
 	configList->mode = fullMode;
 	if (configList->rootEntry == &rootmenu)
diff -urN linux-2.5.64-bk10/scripts/kconfig/qconf.h linux-2.5.64-bk11/scripts/kconfig/qconf.h
--- linux-2.5.64-bk10/scripts/kconfig/qconf.h	Tue Mar  4 19:29:17 2003
+++ linux-2.5.64-bk11/scripts/kconfig/qconf.h	Mon Mar 31 12:34:56 2003
@@ -101,10 +101,14 @@
 	void setAllOpen(bool open);
 	void setParentMenu(void);
 
+	template <class P>
+	void ConfigList::updateMenuList(P*, struct menu*);
+
 	bool updateAll;
 
 	QPixmap symbolYesPix, symbolModPix, symbolNoPix;
-	QPixmap choiceYesPix, choiceNoPix, menuPix, menuInvPix;
+	QPixmap choiceYesPix, choiceNoPix;
+	QPixmap menuPix, menuInvPix, menuBackPix;
 
 	bool showAll, showName, showRange, showData;
 	enum listMode mode;
@@ -121,12 +125,17 @@
 	typedef class QListViewItem Parent;
 public:
 	ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v)
-	: Parent(parent, after), menu(m), visible(v)
+	: Parent(parent, after), menu(m), visible(v), goParent(false)
 	{
 		init();
 	}
 	ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
-	: Parent(parent, after), menu(m), visible(v)
+	: Parent(parent, after), menu(m), visible(v), goParent(false)
+	{
+		init();
+	}
+	ConfigItem(QListView *parent, ConfigItem *after, bool v)
+	: Parent(parent, after), menu(0), visible(v), goParent(true)
 	{
 		init();
 	}
@@ -136,7 +145,7 @@
 	void okRename(int col);
 #endif
 	void updateMenu(void);
-	bool updateNeeded(void);
+	void testUpdateMenu(bool v);
 	ConfigList* listView() const
 	{
 		return (ConfigList*)Parent::listView();
@@ -170,6 +179,7 @@
 	ConfigItem* nextItem;
 	struct menu *menu;
 	bool visible;
+	bool goParent;
 };
 
 class ConfigLineEdit : public QLineEdit {
@@ -216,7 +226,9 @@
 protected:
 	void closeEvent(QCloseEvent *e);
 
+	ConfigView *menuView;
 	ConfigList *menuList;
+	ConfigView *configView;
 	ConfigList *configList;
 	QTextView *helpText;
 	QToolBar *toolBar;
diff -urN linux-2.5.64-bk10/scripts/kconfig/symbol.c linux-2.5.64-bk11/scripts/kconfig/symbol.c
--- linux-2.5.64-bk10/scripts/kconfig/symbol.c	Tue Mar  4 19:29:03 2003
+++ linux-2.5.64-bk11/scripts/kconfig/symbol.c	Mon Mar 31 12:34:56 2003
@@ -160,6 +160,9 @@
 	struct symbol *def_sym;
 	struct expr *e;
 
+	if (!sym)
+		return;
+
 	if (sym->flags & SYMBOL_VALID)
 		return;
 
diff -urN linux-2.5.64-bk10/scripts/kconfig/zconf.l linux-2.5.64-bk11/scripts/kconfig/zconf.l
--- linux-2.5.64-bk10/scripts/kconfig/zconf.l	Tue Mar  4 19:29:32 2003
+++ linux-2.5.64-bk11/scripts/kconfig/zconf.l	Mon Mar 31 12:34:56 2003
@@ -96,6 +96,7 @@
 	"endchoice"		BEGIN(PARAM); return T_ENDCHOICE;
 	"comment"		BEGIN(PARAM); return T_COMMENT;
 	"config"		BEGIN(PARAM); return T_CONFIG;
+	"menuconfig"		BEGIN(PARAM); return T_MENUCONFIG;
 	"help"			BEGIN(PARAM); return T_HELP;
 	"if"			BEGIN(PARAM); return T_IF;
 	"endif"			BEGIN(PARAM); return T_ENDIF;
@@ -141,6 +142,7 @@
 		zconflval.string = text;
 		return T_WORD;
 	}
+	#.*	/* comment */
 	\\\n	current_file->lineno++;
 	.
 	<<EOF>> {
@@ -208,7 +210,7 @@
 		}
 		
 	}
-	\n/[^ \t\n] {
+	[ \t]*\n/[^ \t\n] {
 		current_file->lineno++;
 		zconf_endhelp();
 		return T_HELPTEXT;
diff -urN linux-2.5.64-bk10/scripts/kconfig/zconf.tab.c_shipped linux-2.5.64-bk11/scripts/kconfig/zconf.tab.c_shipped
--- linux-2.5.64-bk10/scripts/kconfig/zconf.tab.c_shipped	Tue Mar  4 19:29:33 2003
+++ linux-2.5.64-bk11/scripts/kconfig/zconf.tab.c_shipped	Mon Mar 31 12:34:56 2003
@@ -1,7 +1,7 @@
-/* A Bison parser, made from zconf.y, by GNU bison 1.75.  */
+/* A Bison parser, made by GNU Bison 1.875a.  */
 
 /* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -34,10 +34,13 @@
    USER NAME SPACE" below.  */
 
 /* Identify Bison output.  */
-#define YYBISON	1
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
 
 /* Pure parsers.  */
-#define YYPURE	0
+#define YYPURE 0
 
 /* Using locations.  */
 #define YYLSP_NEEDED 0
@@ -67,32 +70,33 @@
      T_ENDCHOICE = 263,
      T_COMMENT = 264,
      T_CONFIG = 265,
-     T_HELP = 266,
-     T_HELPTEXT = 267,
-     T_IF = 268,
-     T_ENDIF = 269,
-     T_DEPENDS = 270,
-     T_REQUIRES = 271,
-     T_OPTIONAL = 272,
-     T_PROMPT = 273,
-     T_DEFAULT = 274,
-     T_TRISTATE = 275,
-     T_BOOLEAN = 276,
-     T_STRING = 277,
-     T_INT = 278,
-     T_HEX = 279,
-     T_WORD = 280,
-     T_WORD_QUOTE = 281,
-     T_UNEQUAL = 282,
-     T_EOF = 283,
-     T_EOL = 284,
-     T_CLOSE_PAREN = 285,
-     T_OPEN_PAREN = 286,
-     T_ON = 287,
-     T_OR = 288,
-     T_AND = 289,
-     T_EQUAL = 290,
-     T_NOT = 291
+     T_MENUCONFIG = 266,
+     T_HELP = 267,
+     T_HELPTEXT = 268,
+     T_IF = 269,
+     T_ENDIF = 270,
+     T_DEPENDS = 271,
+     T_REQUIRES = 272,
+     T_OPTIONAL = 273,
+     T_PROMPT = 274,
+     T_DEFAULT = 275,
+     T_TRISTATE = 276,
+     T_BOOLEAN = 277,
+     T_STRING = 278,
+     T_INT = 279,
+     T_HEX = 280,
+     T_WORD = 281,
+     T_WORD_QUOTE = 282,
+     T_UNEQUAL = 283,
+     T_EOF = 284,
+     T_EOL = 285,
+     T_CLOSE_PAREN = 286,
+     T_OPEN_PAREN = 287,
+     T_ON = 288,
+     T_OR = 289,
+     T_AND = 290,
+     T_EQUAL = 291,
+     T_NOT = 292
    };
 #endif
 #define T_MAINMENU 258
@@ -103,38 +107,40 @@
 #define T_ENDCHOICE 263
 #define T_COMMENT 264
 #define T_CONFIG 265
-#define T_HELP 266
-#define T_HELPTEXT 267
-#define T_IF 268
-#define T_ENDIF 269
-#define T_DEPENDS 270
-#define T_REQUIRES 271
-#define T_OPTIONAL 272
-#define T_PROMPT 273
-#define T_DEFAULT 274
-#define T_TRISTATE 275
-#define T_BOOLEAN 276
-#define T_STRING 277
-#define T_INT 278
-#define T_HEX 279
-#define T_WORD 280
-#define T_WORD_QUOTE 281
-#define T_UNEQUAL 282
-#define T_EOF 283
-#define T_EOL 284
-#define T_CLOSE_PAREN 285
-#define T_OPEN_PAREN 286
-#define T_ON 287
-#define T_OR 288
-#define T_AND 289
-#define T_EQUAL 290
-#define T_NOT 291
+#define T_MENUCONFIG 266
+#define T_HELP 267
+#define T_HELPTEXT 268
+#define T_IF 269
+#define T_ENDIF 270
+#define T_DEPENDS 271
+#define T_REQUIRES 272
+#define T_OPTIONAL 273
+#define T_PROMPT 274
+#define T_DEFAULT 275
+#define T_TRISTATE 276
+#define T_BOOLEAN 277
+#define T_STRING 278
+#define T_INT 279
+#define T_HEX 280
+#define T_WORD 281
+#define T_WORD_QUOTE 282
+#define T_UNEQUAL 283
+#define T_EOF 284
+#define T_EOL 285
+#define T_CLOSE_PAREN 286
+#define T_OPEN_PAREN 287
+#define T_ON 288
+#define T_OR 289
+#define T_AND 290
+#define T_EQUAL 291
+#define T_NOT 292
 
 
 
 
 /* Copy the first part of user declarations.  */
 
+
 /*
  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
  * Released under the terms of the GNU GPL v2.0.
@@ -166,7 +172,7 @@
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
-# define YYDEBUG 0
+# define YYDEBUG 1
 #endif
 
 /* Enabling verbose error messages.  */
@@ -177,41 +183,33 @@
 # define YYERROR_VERBOSE 0
 #endif
 
-#ifndef YYSTYPE
-#line 33 "zconf.y"
-typedef union {
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+
+typedef union YYSTYPE {
 	int token;
 	char *string;
 	struct symbol *symbol;
 	struct expr *expr;
 	struct menu *menu;
-} yystype;
-/* Line 193 of /usr/share/bison/yacc.c.  */
-#line 191 "zconf.tab.c"
-# define YYSTYPE yystype
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
 #endif
 
-#ifndef YYLTYPE
-typedef struct yyltype
-{
-  int first_line;
-  int first_column;
-  int last_line;
-  int last_column;
-} yyltype;
-# define YYLTYPE yyltype
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
+
 
 /* Copy the second part of user declarations.  */
 
+
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
 
-/* Line 213 of /usr/share/bison/yacc.c.  */
-#line 215 "zconf.tab.c"
+/* Line 214 of yacc.c.  */
+
 
 #if ! defined (yyoverflow) || YYERROR_VERBOSE
 
@@ -247,7 +245,7 @@
 
 #if (! defined (yyoverflow) \
      && (! defined (__cplusplus) \
-	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+	 || (YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
@@ -257,13 +255,13 @@
   };
 
 /* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
      ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
-      + YYSTACK_GAP_MAX)
+      + YYSTACK_GAP_MAXIMUM)
 
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
@@ -277,7 +275,7 @@
 	{					\
 	  register YYSIZE_T yyi;		\
 	  for (yyi = 0; yyi < (Count); yyi++)	\
-	    (To)[yyi] = (From)[yyi];	\
+	    (To)[yyi] = (From)[yyi];		\
 	}					\
       while (0)
 #  endif
@@ -294,7 +292,7 @@
 	YYSIZE_T yynewbytes;						\
 	YYCOPY (&yyptr->Stack, Stack, yysize);				\
 	Stack = &yyptr->Stack;						\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;	\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
     while (0)
@@ -309,23 +307,24 @@
 
 /* YYFINAL -- State number of the termination state. */
 #define YYFINAL  2
-#define YYLAST   154
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   160
 
 /* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS  37
+#define YYNTOKENS  38
 /* YYNNTS -- Number of nonterminals. */
-#define YYNNTS  39
+#define YYNNTS  41
 /* YYNRULES -- Number of rules. */
-#define YYNRULES  96
+#define YYNRULES  99
 /* YYNRULES -- Number of states. */
-#define YYNSTATES  146
+#define YYNSTATES  152
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   291
+#define YYMAXUTOK   292
 
-#define YYTRANSLATE(X) \
-  ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
+#define YYTRANSLATE(YYX) 						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 static const unsigned char yytranslate[] =
@@ -359,7 +358,7 @@
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36
+      35,    36,    37
 };
 
 #if YYDEBUG
@@ -368,63 +367,64 @@
 static const unsigned short yyprhs[] =
 {
        0,     0,     3,     4,     7,     9,    11,    13,    17,    19,
-      21,    23,    26,    28,    30,    32,    34,    36,    39,    43,
-      44,    48,    52,    55,    58,    61,    64,    67,    70,    73,
-      77,    81,    83,    87,    89,    94,    97,    98,   102,   106,
-     109,   112,   116,   118,   122,   123,   126,   129,   131,   137,
-     141,   142,   145,   148,   151,   154,   158,   160,   165,   168,
-     169,   172,   175,   178,   182,   185,   188,   191,   195,   198,
-     201,   202,   206,   209,   213,   216,   219,   220,   222,   226,
-     228,   230,   232,   234,   236,   238,   240,   241,   244,   246,
-     250,   254,   258,   261,   265,   269,   271
+      21,    23,    26,    28,    30,    32,    34,    36,    38,    41,
+      45,    48,    52,    53,    57,    61,    64,    67,    70,    73,
+      76,    79,    82,    86,    90,    92,    96,    98,   103,   106,
+     107,   111,   115,   118,   121,   125,   127,   131,   132,   135,
+     138,   140,   146,   150,   151,   154,   157,   160,   163,   167,
+     169,   174,   177,   178,   181,   184,   187,   191,   194,   197,
+     200,   204,   207,   210,   211,   215,   218,   222,   225,   228,
+     229,   231,   235,   237,   239,   241,   243,   245,   247,   249,
+     250,   253,   255,   259,   263,   267,   270,   274,   278,   280
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
 static const yysigned_char yyrhs[] =
 {
-      38,     0,    -1,    -1,    38,    39,    -1,    40,    -1,    48,
-      -1,    59,    -1,     3,    70,    72,    -1,     5,    -1,    14,
-      -1,     8,    -1,     1,    72,    -1,    54,    -1,    64,    -1,
-      42,    -1,    62,    -1,    72,    -1,    10,    25,    -1,    41,
-      29,    43,    -1,    -1,    43,    44,    29,    -1,    43,    68,
-      29,    -1,    43,    66,    -1,    43,    29,    -1,    20,    69,
-      -1,    21,    69,    -1,    23,    69,    -1,    24,    69,    -1,
-      22,    69,    -1,    18,    70,    73,    -1,    19,    75,    73,
-      -1,     7,    -1,    45,    29,    49,    -1,    71,    -1,    46,
-      51,    47,    29,    -1,    46,    51,    -1,    -1,    49,    50,
-      29,    -1,    49,    68,    29,    -1,    49,    66,    -1,    49,
-      29,    -1,    18,    70,    73,    -1,    17,    -1,    19,    75,
-      73,    -1,    -1,    51,    40,    -1,    13,    74,    -1,    71,
-      -1,    52,    29,    55,    53,    29,    -1,    52,    29,    55,
-      -1,    -1,    55,    40,    -1,    55,    59,    -1,    55,    48,
-      -1,     4,    70,    -1,    56,    29,    67,    -1,    71,    -1,
-      57,    60,    58,    29,    -1,    57,    60,    -1,    -1,    60,
-      40,    -1,    60,    59,    -1,    60,    48,    -1,    60,     1,
-      29,    -1,     6,    70,    -1,    61,    29,    -1,     9,    70,
-      -1,    63,    29,    67,    -1,    11,    29,    -1,    65,    12,
-      -1,    -1,    67,    68,    29,    -1,    67,    29,    -1,    15,
-      32,    74,    -1,    15,    74,    -1,    16,    74,    -1,    -1,
-      70,    -1,    70,    13,    74,    -1,    25,    -1,    26,    -1,
-       5,    -1,     8,    -1,    14,    -1,    29,    -1,    28,    -1,
-      -1,    13,    74,    -1,    75,    -1,    75,    35,    75,    -1,
-      75,    27,    75,    -1,    31,    74,    30,    -1,    36,    74,
-      -1,    74,    33,    74,    -1,    74,    34,    74,    -1,    25,
-      -1,    26,    -1
+      39,     0,    -1,    -1,    39,    40,    -1,    41,    -1,    51,
+      -1,    62,    -1,     3,    73,    75,    -1,     5,    -1,    15,
+      -1,     8,    -1,     1,    75,    -1,    57,    -1,    67,    -1,
+      43,    -1,    45,    -1,    65,    -1,    75,    -1,    10,    26,
+      -1,    42,    30,    46,    -1,    11,    26,    -1,    44,    30,
+      46,    -1,    -1,    46,    47,    30,    -1,    46,    71,    30,
+      -1,    46,    69,    -1,    46,    30,    -1,    21,    72,    -1,
+      22,    72,    -1,    24,    72,    -1,    25,    72,    -1,    23,
+      72,    -1,    19,    73,    76,    -1,    20,    78,    76,    -1,
+       7,    -1,    48,    30,    52,    -1,    74,    -1,    49,    54,
+      50,    30,    -1,    49,    54,    -1,    -1,    52,    53,    30,
+      -1,    52,    71,    30,    -1,    52,    69,    -1,    52,    30,
+      -1,    19,    73,    76,    -1,    18,    -1,    20,    78,    76,
+      -1,    -1,    54,    41,    -1,    14,    77,    -1,    74,    -1,
+      55,    30,    58,    56,    30,    -1,    55,    30,    58,    -1,
+      -1,    58,    41,    -1,    58,    62,    -1,    58,    51,    -1,
+       4,    73,    -1,    59,    30,    70,    -1,    74,    -1,    60,
+      63,    61,    30,    -1,    60,    63,    -1,    -1,    63,    41,
+      -1,    63,    62,    -1,    63,    51,    -1,    63,     1,    30,
+      -1,     6,    73,    -1,    64,    30,    -1,     9,    73,    -1,
+      66,    30,    70,    -1,    12,    30,    -1,    68,    13,    -1,
+      -1,    70,    71,    30,    -1,    70,    30,    -1,    16,    33,
+      77,    -1,    16,    77,    -1,    17,    77,    -1,    -1,    73,
+      -1,    73,    14,    77,    -1,    26,    -1,    27,    -1,     5,
+      -1,     8,    -1,    15,    -1,    30,    -1,    29,    -1,    -1,
+      14,    77,    -1,    78,    -1,    78,    36,    78,    -1,    78,
+      28,    78,    -1,    32,    77,    31,    -1,    37,    77,    -1,
+      77,    34,    77,    -1,    77,    35,    77,    -1,    26,    -1,
+      27,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const unsigned short yyrline[] =
 {
-       0,    89,    89,    90,    93,    94,    95,    96,    97,    98,
-      99,   100,   103,   105,   106,   107,   108,   114,   122,   128,
-     130,   131,   132,   133,   136,   142,   148,   154,   160,   166,
-     172,   180,   189,   195,   203,   205,   211,   213,   214,   215,
-     216,   219,   225,   231,   237,   239,   244,   253,   261,   263,
-     269,   271,   272,   273,   278,   285,   291,   299,   301,   307,
-     309,   310,   311,   312,   315,   321,   328,   335,   342,   348,
-     355,   356,   357,   360,   365,   370,   378,   380,   384,   389,
-     390,   393,   394,   395,   398,   399,   401,   402,   405,   406,
-     407,   408,   409,   410,   411,   414,   415
+       0,    90,    90,    91,    94,    95,    96,    97,    98,    99,
+     100,   101,   105,   106,   107,   108,   109,   110,   116,   124,
+     130,   138,   148,   150,   151,   152,   153,   156,   162,   168,
+     174,   180,   186,   192,   200,   209,   215,   224,   225,   231,
+     233,   234,   235,   236,   239,   245,   251,   257,   259,   264,
+     273,   282,   283,   289,   291,   292,   293,   298,   305,   311,
+     320,   321,   327,   329,   330,   331,   332,   335,   341,   348,
+     355,   362,   368,   375,   376,   377,   380,   385,   390,   398,
+     400,   404,   409,   410,   413,   414,   415,   419,   419,   421,
+     422,   425,   426,   427,   428,   429,   430,   431,   434,   435
 };
 #endif
 
@@ -435,19 +435,19 @@
 {
   "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 
   "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 
-  "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", "T_REQUIRES", 
-  "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", "T_BOOLEAN", 
-  "T_STRING", "T_INT", "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", 
-  "T_EOF", "T_EOL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_OR", 
-  "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", 
+  "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 
+  "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", 
+  "T_BOOLEAN", "T_STRING", "T_INT", "T_HEX", "T_WORD", "T_WORD_QUOTE", 
+  "T_UNEQUAL", "T_EOF", "T_EOL", "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", 
+  "T_OR", "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", 
   "common_block", "config_entry_start", "config_stmt", 
-  "config_option_list", "config_option", "choice", "choice_entry", 
-  "choice_end", "choice_stmt", "choice_option_list", "choice_option", 
-  "choice_block", "if", "if_end", "if_stmt", "if_block", "menu", 
-  "menu_entry", "menu_end", "menu_stmt", "menu_block", "source", 
-  "source_stmt", "comment", "comment_stmt", "help_start", "help", 
-  "depends_list", "depends", "prompt_stmt_opt", "prompt", "end", 
-  "nl_or_eof", "if_expr", "expr", "symbol", 0
+  "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", 
+  "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", 
+  "choice_option_list", "choice_option", "choice_block", "if", "if_end", 
+  "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", 
+  "menu_block", "source", "source_stmt", "comment", "comment_stmt", 
+  "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", 
+  "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
 };
 #endif
 
@@ -459,38 +459,38 @@
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291
+     285,   286,   287,   288,   289,   290,   291,   292
 };
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const unsigned char yyr1[] =
 {
-       0,    37,    38,    38,    39,    39,    39,    39,    39,    39,
-      39,    39,    40,    40,    40,    40,    40,    41,    42,    43,
-      43,    43,    43,    43,    44,    44,    44,    44,    44,    44,
-      44,    45,    46,    47,    48,    48,    49,    49,    49,    49,
-      49,    50,    50,    50,    51,    51,    52,    53,    54,    54,
-      55,    55,    55,    55,    56,    57,    58,    59,    59,    60,
-      60,    60,    60,    60,    61,    62,    63,    64,    65,    66,
-      67,    67,    67,    68,    68,    68,    69,    69,    69,    70,
-      70,    71,    71,    71,    72,    72,    73,    73,    74,    74,
-      74,    74,    74,    74,    74,    75,    75
+       0,    38,    39,    39,    40,    40,    40,    40,    40,    40,
+      40,    40,    41,    41,    41,    41,    41,    41,    42,    43,
+      44,    45,    46,    46,    46,    46,    46,    47,    47,    47,
+      47,    47,    47,    47,    48,    49,    50,    51,    51,    52,
+      52,    52,    52,    52,    53,    53,    53,    54,    54,    55,
+      56,    57,    57,    58,    58,    58,    58,    59,    60,    61,
+      62,    62,    63,    63,    63,    63,    63,    64,    65,    66,
+      67,    68,    69,    70,    70,    70,    71,    71,    71,    72,
+      72,    72,    73,    73,    74,    74,    74,    75,    75,    76,
+      76,    77,    77,    77,    77,    77,    77,    77,    78,    78
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 static const unsigned char yyr2[] =
 {
        0,     2,     0,     2,     1,     1,     1,     3,     1,     1,
-       1,     2,     1,     1,     1,     1,     1,     2,     3,     0,
-       3,     3,     2,     2,     2,     2,     2,     2,     2,     3,
-       3,     1,     3,     1,     4,     2,     0,     3,     3,     2,
-       2,     3,     1,     3,     0,     2,     2,     1,     5,     3,
-       0,     2,     2,     2,     2,     3,     1,     4,     2,     0,
-       2,     2,     2,     3,     2,     2,     2,     3,     2,     2,
-       0,     3,     2,     3,     2,     2,     0,     1,     3,     1,
-       1,     1,     1,     1,     1,     1,     0,     2,     1,     3,
-       3,     3,     2,     3,     3,     1,     1
+       1,     2,     1,     1,     1,     1,     1,     1,     2,     3,
+       2,     3,     0,     3,     3,     2,     2,     2,     2,     2,
+       2,     2,     3,     3,     1,     3,     1,     4,     2,     0,
+       3,     3,     2,     2,     3,     1,     3,     0,     2,     2,
+       1,     5,     3,     0,     2,     2,     2,     2,     3,     1,
+       4,     2,     0,     2,     2,     2,     3,     2,     2,     2,
+       3,     2,     2,     0,     3,     2,     3,     2,     2,     0,
+       1,     3,     1,     1,     1,     1,     1,     1,     1,     0,
+       2,     1,     3,     3,     3,     2,     3,     3,     1,     1
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -498,127 +498,134 @@
    means the default is an error.  */
 static const unsigned char yydefact[] =
 {
-       2,     0,     1,     0,     0,     0,     8,     0,    31,    10,
-       0,     0,     0,     9,    85,    84,     3,     4,     0,    14,
-       0,    44,     5,     0,    12,     0,    59,     6,     0,    15,
-       0,    13,    16,    11,    79,    80,     0,    54,    64,    66,
-      17,    95,    96,     0,     0,    46,    88,    19,    36,    35,
-      50,    70,     0,    65,    70,     7,     0,    92,     0,     0,
-       0,     0,    18,    32,    81,    82,    83,    45,     0,    33,
-      49,    55,     0,    60,    62,     0,    61,    56,    67,    91,
-      93,    94,    90,    89,     0,     0,     0,     0,     0,    76,
-      76,    76,    76,    76,    23,     0,     0,    22,     0,    42,
-       0,     0,    40,     0,    39,     0,    34,    51,    53,     0,
-      52,    47,    72,     0,    63,    57,    68,     0,    74,    75,
-      86,    86,    24,    77,    25,    28,    26,    27,    20,    69,
-      21,    86,    86,    37,    38,    48,    71,    73,     0,    29,
-      30,     0,    41,    43,    87,    78
+       2,     0,     1,     0,     0,     0,     8,     0,    34,    10,
+       0,     0,     0,     0,     9,    88,    87,     3,     4,     0,
+      14,     0,    15,     0,    47,     5,     0,    12,     0,    62,
+       6,     0,    16,     0,    13,    17,    11,    82,    83,     0,
+      57,    67,    69,    18,    20,    98,    99,     0,     0,    49,
+      91,    22,    22,    39,    38,    53,    73,     0,    68,    73,
+       7,     0,    95,     0,     0,     0,     0,    19,    21,    35,
+      84,    85,    86,    48,     0,    36,    52,    58,     0,    63,
+      65,     0,    64,    59,    70,    94,    96,    97,    93,    92,
+       0,     0,     0,     0,     0,    79,    79,    79,    79,    79,
+      26,     0,     0,    25,     0,    45,     0,     0,    43,     0,
+      42,     0,    37,    54,    56,     0,    55,    50,    75,     0,
+      66,    60,    71,     0,    77,    78,    89,    89,    27,    80,
+      28,    31,    29,    30,    23,    72,    24,    89,    89,    40,
+      41,    51,    74,    76,     0,    32,    33,     0,    44,    46,
+      90,    81
 };
 
 /* YYDEFGOTO[NTERM-NUM]. */
 static const short yydefgoto[] =
 {
-      -1,     1,    16,    17,    18,    19,    62,    95,    20,    21,
-      68,    22,    63,   103,    49,    23,   109,    24,    70,    25,
-      26,    75,    27,    52,    28,    29,    30,    31,    96,    97,
-      71,   113,   122,   123,    69,    32,   139,    45,    46
+      -1,     1,    17,    18,    19,    20,    21,    22,    67,   101,
+      23,    24,    74,    25,    69,   109,    54,    26,   115,    27,
+      76,    28,    29,    81,    30,    57,    31,    32,    33,    34,
+     102,   103,    77,   104,   128,   129,    75,    35,   145,    49,
+      50
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -120
+#define YYPACT_NINF -121
 static const short yypact[] =
 {
-    -120,    17,  -120,    32,    71,    71,  -120,    71,  -120,  -120,
-      71,    11,    99,  -120,  -120,  -120,  -120,  -120,    12,  -120,
-      22,  -120,  -120,    35,  -120,    52,  -120,  -120,    56,  -120,
-      60,  -120,  -120,  -120,  -120,  -120,    32,  -120,  -120,  -120,
-    -120,  -120,  -120,    99,    99,    83,    38,  -120,  -120,    74,
-    -120,  -120,    49,  -120,  -120,  -120,    98,  -120,    99,    99,
-     101,   101,    89,   104,  -120,  -120,  -120,  -120,    65,  -120,
-      62,    77,    72,  -120,  -120,    85,  -120,  -120,    77,  -120,
-      95,  -120,  -120,  -120,   105,     8,    99,    71,   101,    71,
-      71,    71,    71,    71,  -120,   113,   131,  -120,   115,  -120,
-      71,   101,  -120,   116,  -120,   117,  -120,  -120,  -120,   118,
-    -120,  -120,  -120,   119,  -120,  -120,  -120,    99,    83,    83,
-     136,   136,  -120,   137,  -120,  -120,  -120,  -120,  -120,  -120,
-    -120,   136,   136,  -120,  -120,  -120,  -120,    83,    99,  -120,
-    -120,    99,  -120,  -120,    83,    83
+    -121,    25,  -121,   -18,   -11,   -11,  -121,   -11,  -121,  -121,
+     -11,    21,    27,   112,  -121,  -121,  -121,  -121,  -121,    51,
+    -121,    54,  -121,    57,  -121,  -121,    58,  -121,    62,  -121,
+    -121,    80,  -121,    96,  -121,  -121,  -121,  -121,  -121,   -18,
+    -121,  -121,  -121,  -121,  -121,  -121,  -121,   112,   112,    17,
+      77,  -121,  -121,  -121,    85,  -121,  -121,    56,  -121,  -121,
+    -121,   -21,  -121,   112,   112,    42,    42,   100,   100,   115,
+    -121,  -121,  -121,  -121,    98,  -121,    68,    28,    99,  -121,
+    -121,   111,  -121,  -121,    28,  -121,   105,  -121,  -121,  -121,
+     116,   110,   112,   -11,    42,   -11,   -11,   -11,   -11,   -11,
+    -121,   118,   137,  -121,   121,  -121,   -11,    42,  -121,   122,
+    -121,   123,  -121,  -121,  -121,   124,  -121,  -121,  -121,   125,
+    -121,  -121,  -121,   112,    17,    17,   142,   142,  -121,   143,
+    -121,  -121,  -121,  -121,  -121,  -121,  -121,   142,   142,  -121,
+    -121,  -121,  -121,    17,   112,  -121,  -121,   112,  -121,  -121,
+      17,    17
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yysigned_char yypgoto[] =
 {
-    -120,  -120,  -120,   -38,  -120,  -120,  -120,  -120,  -120,  -120,
-    -120,   -42,  -120,  -120,  -120,  -120,  -120,  -120,  -120,  -120,
-    -120,  -120,   -33,  -120,  -120,  -120,  -120,  -120,  -120,    88,
-     100,    78,    46,    -1,   -23,     2,  -119,   -43,   -53
+    -121,  -121,  -121,   -35,  -121,  -121,  -121,  -121,   106,  -121,
+    -121,  -121,  -121,   -34,  -121,  -121,  -121,  -121,  -121,  -121,
+    -121,  -121,  -121,  -121,   -33,  -121,  -121,  -121,  -121,  -121,
+    -121,    90,   101,    34,    10,    -4,   -30,    -1,  -120,   -43,
+     -57
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
-   If YYTABLE_NINF, parse error.  */
-#define YYTABLE_NINF -59
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -62
 static const short yytable[] =
 {
-      56,    57,   140,    36,    37,    33,    38,    82,    83,    39,
-      74,    67,   142,   143,    73,    80,    81,     2,     3,    76,
-       4,     5,     6,     7,     8,     9,    10,    11,   108,    77,
-      12,    13,   107,    41,    42,   121,    40,   110,    55,    43,
-     117,    47,   118,   119,    44,    14,    15,   111,   132,   -58,
-      72,    48,   -58,     5,    64,     7,     8,    65,    10,    11,
-      14,    15,    12,    66,    50,    60,     5,    64,     7,     8,
-      65,    10,    11,    61,   137,    12,    66,    14,    15,    64,
-       7,    51,    65,    10,    11,    53,   120,    12,    66,    54,
-      14,    15,    85,    86,   106,   144,    34,    35,   145,   131,
-      84,   114,    14,    15,    85,    86,   112,    87,    88,    89,
-      90,    91,    92,    93,   115,    84,    58,    59,    94,    85,
-      86,    99,   100,   101,    41,    42,    41,    42,    79,    59,
-      43,    58,    59,   102,   116,    44,   124,   125,   126,   127,
-      98,   105,   128,   129,   130,   133,   134,   135,   136,   138,
-     141,   104,     0,     0,    78
+      39,    40,    36,    41,    61,    62,    42,   146,    88,    89,
+      85,    15,    16,    63,    64,    37,    38,   148,   149,    73,
+      86,    87,    79,    80,    82,     2,     3,    83,     4,     5,
+       6,     7,     8,     9,    10,    11,    12,   127,    60,    13,
+      14,   113,   114,   116,    91,    92,   117,    43,   124,   125,
+     138,    63,    64,    44,    15,    16,   -61,    78,   118,   -61,
+       5,    70,     7,     8,    71,    10,    11,    12,    45,    46,
+      13,    72,     5,    70,     7,     8,    71,    10,    11,    12,
+     143,    51,    13,    72,    52,    15,    16,    53,    55,   126,
+      70,     7,    56,    71,    10,    11,    12,    15,    16,    13,
+      72,   150,   137,   111,   151,    65,   130,   131,   132,   133,
+      58,   119,    90,    66,    15,    16,    91,    92,   119,    93,
+      94,    95,    96,    97,    98,    99,    59,    90,   112,   120,
+     100,    91,    92,   105,   106,   107,    45,    46,    45,    46,
+      64,   121,    47,   123,    47,   108,   122,    48,   134,    48,
+     135,   136,   139,   140,   141,   142,   144,   147,    68,   110,
+      84
 };
 
-static const short yycheck[] =
+static const unsigned char yycheck[] =
 {
-      43,    44,   121,     4,     5,     3,     7,    60,    61,    10,
-      52,    49,   131,   132,    52,    58,    59,     0,     1,    52,
-       3,     4,     5,     6,     7,     8,     9,    10,    70,    52,
-      13,    14,    70,    25,    26,    88,    25,    70,    36,    31,
-      32,    29,    85,    86,    36,    28,    29,    70,   101,     0,
-       1,    29,     3,     4,     5,     6,     7,     8,     9,    10,
-      28,    29,    13,    14,    29,    27,     4,     5,     6,     7,
-       8,     9,    10,    35,   117,    13,    14,    28,    29,     5,
-       6,    29,     8,     9,    10,    29,    87,    13,    14,    29,
-      28,    29,    15,    16,    29,   138,    25,    26,   141,   100,
-      11,    29,    28,    29,    15,    16,    29,    18,    19,    20,
-      21,    22,    23,    24,    29,    11,    33,    34,    29,    15,
-      16,    17,    18,    19,    25,    26,    25,    26,    30,    34,
-      31,    33,    34,    29,    29,    36,    90,    91,    92,    93,
-      62,    63,    29,    12,    29,    29,    29,    29,    29,    13,
-      13,    63,    -1,    -1,    54
+       4,     5,     3,     7,    47,    48,    10,   127,    65,    66,
+      31,    29,    30,    34,    35,    26,    27,   137,   138,    54,
+      63,    64,    57,    57,    57,     0,     1,    57,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    94,    39,    14,
+      15,    76,    76,    76,    16,    17,    76,    26,    91,    92,
+     107,    34,    35,    26,    29,    30,     0,     1,    30,     3,
+       4,     5,     6,     7,     8,     9,    10,    11,    26,    27,
+      14,    15,     4,     5,     6,     7,     8,     9,    10,    11,
+     123,    30,    14,    15,    30,    29,    30,    30,    30,    93,
+       5,     6,    30,     8,     9,    10,    11,    29,    30,    14,
+      15,   144,   106,    69,   147,    28,    96,    97,    98,    99,
+      30,    77,    12,    36,    29,    30,    16,    17,    84,    19,
+      20,    21,    22,    23,    24,    25,    30,    12,    30,    30,
+      30,    16,    17,    18,    19,    20,    26,    27,    26,    27,
+      35,    30,    32,    33,    32,    30,    30,    37,    30,    37,
+      13,    30,    30,    30,    30,    30,    14,    14,    52,    69,
+      59
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const unsigned char yystos[] =
 {
-       0,    38,     0,     1,     3,     4,     5,     6,     7,     8,
-       9,    10,    13,    14,    28,    29,    39,    40,    41,    42,
-      45,    46,    48,    52,    54,    56,    57,    59,    61,    62,
-      63,    64,    72,    72,    25,    26,    70,    70,    70,    70,
-      25,    25,    26,    31,    36,    74,    75,    29,    29,    51,
-      29,    29,    60,    29,    29,    72,    74,    74,    33,    34,
-      27,    35,    43,    49,     5,     8,    14,    40,    47,    71,
-      55,    67,     1,    40,    48,    58,    59,    71,    67,    30,
-      74,    74,    75,    75,    11,    15,    16,    18,    19,    20,
-      21,    22,    23,    24,    29,    44,    65,    66,    68,    17,
-      18,    19,    29,    50,    66,    68,    29,    40,    48,    53,
-      59,    71,    29,    68,    29,    29,    29,    32,    74,    74,
-      70,    75,    69,    70,    69,    69,    69,    69,    29,    12,
-      29,    70,    75,    29,    29,    29,    29,    74,    13,    73,
-      73,    13,    73,    73,    74,    74
+       0,    39,     0,     1,     3,     4,     5,     6,     7,     8,
+       9,    10,    11,    14,    15,    29,    30,    40,    41,    42,
+      43,    44,    45,    48,    49,    51,    55,    57,    59,    60,
+      62,    64,    65,    66,    67,    75,    75,    26,    27,    73,
+      73,    73,    73,    26,    26,    26,    27,    32,    37,    77,
+      78,    30,    30,    30,    54,    30,    30,    63,    30,    30,
+      75,    77,    77,    34,    35,    28,    36,    46,    46,    52,
+       5,     8,    15,    41,    50,    74,    58,    70,     1,    41,
+      51,    61,    62,    74,    70,    31,    77,    77,    78,    78,
+      12,    16,    17,    19,    20,    21,    22,    23,    24,    25,
+      30,    47,    68,    69,    71,    18,    19,    20,    30,    53,
+      69,    71,    30,    41,    51,    56,    62,    74,    30,    71,
+      30,    30,    30,    33,    77,    77,    73,    78,    72,    73,
+      72,    72,    72,    72,    30,    13,    30,    73,    78,    30,
+      30,    30,    30,    77,    14,    76,    76,    14,    76,    76,
+      77,    77
 };
 
 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
@@ -639,13 +646,14 @@
 
 #define yyerrok		(yyerrstatus = 0)
 #define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
+#define YYEMPTY		(-2)
 #define YYEOF		0
 
 #define YYACCEPT	goto yyacceptlab
 #define YYABORT		goto yyabortlab
 #define YYERROR		goto yyerrlab1
 
+
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
    Once GCC version 2 has supplanted version 1, this can go.  */
@@ -660,13 +668,13 @@
     {								\
       yychar = (Token);						\
       yylval = (Value);						\
-      yychar1 = YYTRANSLATE (yychar);				\
+      yytoken = YYTRANSLATE (yychar);				\
       YYPOPSTACK;						\
       goto yybackup;						\
     }								\
   else								\
     { 								\
-      yyerror ("syntax error: cannot back up");			\
+      yyerror ("syntax error: cannot back up");\
       YYERROR;							\
     }								\
 while (0)
@@ -678,7 +686,7 @@
    are run).  */
 
 #ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)           \
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
   Current.first_line   = Rhs[1].first_line;      \
   Current.first_column = Rhs[1].first_column;    \
   Current.last_line    = Rhs[N].last_line;       \
@@ -687,7 +695,11 @@
 
 /* YYLEX -- calling `yylex' with the right arguments.  */
 
-#define YYLEX	yylex ()
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
 
 /* Enable debugging if requested.  */
 #if YYDEBUG
@@ -702,19 +714,93 @@
   if (yydebug)					\
     YYFPRINTF Args;				\
 } while (0)
+
 # define YYDSYMPRINT(Args)			\
 do {						\
   if (yydebug)					\
     yysymprint Args;				\
 } while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (/* Nothing. */; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+    int yyrule;
+#endif
+{
+  int yyi;
+  unsigned int yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* Print the symbols being reduced, and their result.  */
+  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (Rule);		\
+} while (0)
+
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
 int yydebug;
 #else /* !YYDEBUG */
 # define YYDPRINTF(Args)
 # define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
 #endif /* !YYDEBUG */
 
+
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
 #ifndef	YYINITDEPTH
 # define YYINITDEPTH 200
@@ -793,95 +879,85 @@
 
 
 #if YYDEBUG
-/*-----------------------------.
-| Print this symbol on YYOUT.  |
-`-----------------------------*/
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
 
-static void
 #if defined (__STDC__) || defined (__cplusplus)
-yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
 #else
-yysymprint (yyout, yytype, yyvalue)
-    FILE* yyout;
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
     int yytype;
-    YYSTYPE yyvalue;
+    YYSTYPE *yyvaluep;
 #endif
 {
   /* Pacify ``unused variable'' warnings.  */
-  (void) yyvalue;
+  (void) yyvaluep;
 
   if (yytype < YYNTOKENS)
     {
-      YYFPRINTF (yyout, "token %s (", yytname[yytype]);
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 # ifdef YYPRINT
-      YYPRINT (yyout, yytoknum[yytype], yyvalue);
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 # endif
     }
   else
-    YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
   switch (yytype)
     {
       default:
         break;
     }
-  YYFPRINTF (yyout, ")");
+  YYFPRINTF (yyoutput, ")");
 }
-#endif /* YYDEBUG. */
-
 
+#endif /* ! YYDEBUG */
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-static void
 #if defined (__STDC__) || defined (__cplusplus)
-yydestruct (int yytype, YYSTYPE yyvalue)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
 #else
-yydestruct (yytype, yyvalue)
+static void
+yydestruct (yytype, yyvaluep)
     int yytype;
-    YYSTYPE yyvalue;
+    YYSTYPE *yyvaluep;
 #endif
 {
   /* Pacify ``unused variable'' warnings.  */
-  (void) yyvalue;
+  (void) yyvaluep;
 
   switch (yytype)
     {
+
       default:
         break;
     }
 }
-
 
 
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
+/* Prevent warnings from -Wmissing-prototypes.  */
 
 #ifdef YYPARSE_PARAM
 # if defined (__STDC__) || defined (__cplusplus)
-#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#  define YYPARSE_PARAM_DECL
+int yyparse (void *YYPARSE_PARAM);
 # else
-#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+int yyparse ();
 # endif
-#else /* !YYPARSE_PARAM */
-# define YYPARSE_PARAM_ARG
-# define YYPARSE_PARAM_DECL
-#endif /* !YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-# ifdef YYPARSE_PARAM
-int yyparse (void *);
-# else
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
 int yyparse (void);
-# endif
+#else
+int yyparse ();
 #endif
+#endif /* ! YYPARSE_PARAM */
+
 
 
 /* The lookahead symbol.  */
@@ -890,13 +966,32 @@
 /* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
-/* Number of parse errors so far.  */
+/* Number of syntax errors so far.  */
 int yynerrs;
 
 
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+  void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
 int
-yyparse (YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
+yyparse ()
+
+#endif
+#endif
 {
   
   register int yystate;
@@ -905,7 +1000,7 @@
   /* Number of tokens to shift before error messages enabled.  */
   int yyerrstatus;
   /* Lookahead token as an internal (translated) token number.  */
-  int yychar1 = 0;
+  int yytoken = 0;
 
   /* Three stacks and their tools:
      `yyss': related to states,
@@ -969,7 +1064,7 @@
  yysetstate:
   *yyssp = yystate;
 
-  if (yyssp >= yyss + yystacksize - 1)
+  if (yyss + yystacksize - 1 <= yyssp)
     {
       /* Get the current used size of the three stacks, in elements.  */
       YYSIZE_T yysize = yyssp - yyss + 1;
@@ -1001,10 +1096,10 @@
       goto yyoverflowlab;
 # else
       /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
+      if (YYMAXDEPTH <= yystacksize)
 	goto yyoverflowlab;
       yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
+      if (YYMAXDEPTH < yystacksize)
 	yystacksize = YYMAXDEPTH;
 
       {
@@ -1030,7 +1125,7 @@
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 		  (unsigned long int) yystacksize));
 
-      if (yyssp >= yyss + yystacksize - 1)
+      if (yyss + yystacksize - 1 <= yyssp)
 	YYABORT;
     }
 
@@ -1055,39 +1150,28 @@
 
   /* Not known => get a lookahead token if don't already have one.  */
 
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
       yychar = YYLEX;
     }
 
-  /* Convert token to internal form (in yychar1) for indexing tables with.  */
-
-  if (yychar <= 0)		/* This means end of input.  */
+  if (yychar <= YYEOF)
     {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more.  */
-
+      yychar = yytoken = YYEOF;
       YYDPRINTF ((stderr, "Now at end of input.\n"));
     }
   else
     {
-      yychar1 = YYTRANSLATE (yychar);
-
-      /* We have to keep this `#if YYDEBUG', since we use variables
-	 which are defined only if `YYDEBUG' is set.  */
-      YYDPRINTF ((stderr, "Next token is "));
-      YYDSYMPRINT ((stderr, yychar1, yylval));
-      YYDPRINTF ((stderr, "\n"));
+      yytoken = YYTRANSLATE (yychar);
+      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
     }
 
-  /* If the proper action on seeing token YYCHAR1 is to reduce or to
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
      detect an error, take that action.  */
-  yyn += yychar1;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
     goto yydefault;
   yyn = yytable[yyn];
   if (yyn <= 0)
@@ -1102,8 +1186,7 @@
     YYACCEPT;
 
   /* Shift the lookahead token.  */
-  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
-	      yychar, yytname[yychar1]));
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
 
   /* Discard the token being shifted unless it is eof.  */
   if (yychar != YYEOF)
@@ -1149,378 +1232,430 @@
   yyval = yyvsp[1-yylen];
 
 
-
-#if YYDEBUG
-  /* We have to keep this `#if YYDEBUG', since we use variables which
-     are defined only if `YYDEBUG' is set.  */
-  if (yydebug)
-    {
-      int yyi;
-
-      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
-		 yyn - 1, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
-	YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
-      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
+  YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
         case 8:
-    { zconfprint("unexpected 'endmenu' statement"); }
+
+    { zconfprint("unexpected 'endmenu' statement"); ;}
     break;
 
   case 9:
-    { zconfprint("unexpected 'endif' statement"); }
+
+    { zconfprint("unexpected 'endif' statement"); ;}
     break;
 
   case 10:
-    { zconfprint("unexpected 'endchoice' statement"); }
+
+    { zconfprint("unexpected 'endchoice' statement"); ;}
     break;
 
   case 11:
-    { zconfprint("syntax error"); yyerrok; }
+
+    { zconfprint("syntax error"); yyerrok; ;}
     break;
 
-  case 17:
+  case 18:
+
     {
 	struct symbol *sym = sym_lookup(yyvsp[0].string, 0);
 	sym->flags |= SYMBOL_OPTIONAL;
 	menu_add_entry(sym);
 	printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string);
-}
+;}
     break;
 
-  case 18:
+  case 19:
+
     {
 	menu_end_entry();
 	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
-}
+;}
+    break;
+
+  case 20:
+
+    {
+	struct symbol *sym = sym_lookup(yyvsp[0].string, 0);
+	sym->flags |= SYMBOL_OPTIONAL;
+	menu_add_entry(sym);
+	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string);
+;}
+    break;
+
+  case 21:
+
+    {
+	if (current_entry->prompt)
+		current_entry->prompt->type = P_MENU;
+	else
+		zconfprint("warning: menuconfig statement without prompt");
+	menu_end_entry();
+	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
+;}
     break;
 
-  case 23:
-    { }
+  case 26:
+
+    { ;}
     break;
 
-  case 24:
+  case 27:
+
     {
 	menu_set_type(S_TRISTATE);
 	printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 25:
+  case 28:
+
     {
 	menu_set_type(S_BOOLEAN);
 	printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 26:
+  case 29:
+
     {
 	menu_set_type(S_INT);
 	printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 27:
+  case 30:
+
     {
 	menu_set_type(S_HEX);
 	printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 28:
+  case 31:
+
     {
 	menu_set_type(S_STRING);
 	printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 29:
+  case 32:
+
     {
 	menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 30:
+  case 33:
+
     {
 	menu_add_prop(P_DEFAULT, NULL, yyvsp[-1].symbol, yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 31:
+  case 34:
+
     {
 	struct symbol *sym = sym_lookup(NULL, 0);
 	sym->flags |= SYMBOL_CHOICE;
 	menu_add_entry(sym);
 	menu_add_prop(P_CHOICE, NULL, NULL, NULL);
 	printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 32:
+  case 35:
+
     {
 	menu_end_entry();
 	menu_add_menu();
-}
+;}
     break;
 
-  case 33:
+  case 36:
+
     {
 	if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
 		menu_end_menu();
 		printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
 	}
-}
+;}
     break;
 
-  case 35:
+  case 38:
+
     {
 	printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
 	zconfnerrs++;
-}
+;}
     break;
 
-  case 41:
+  case 44:
+
     {
 	menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 42:
+  case 45:
+
     {
 	current_entry->sym->flags |= SYMBOL_OPTIONAL;
 	printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 43:
+  case 46:
+
     {
 	menu_add_prop(P_DEFAULT, NULL, yyvsp[-1].symbol, yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 46:
+  case 49:
+
     {
 	printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
 	menu_add_entry(NULL);
 	menu_add_dep(yyvsp[0].expr);
 	menu_end_entry();
 	menu_add_menu();
-}
+;}
     break;
 
-  case 47:
+  case 50:
+
     {
 	if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
 		menu_end_menu();
 		printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
 	}
-}
+;}
     break;
 
-  case 49:
+  case 52:
+
     {
 	printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
 	zconfnerrs++;
-}
+;}
     break;
 
-  case 54:
+  case 57:
+
     {
 	menu_add_entry(NULL);
 	menu_add_prop(P_MENU, yyvsp[0].string, NULL, NULL);
 	printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 55:
+  case 58:
+
     {
 	menu_end_entry();
 	menu_add_menu();
-}
+;}
     break;
 
-  case 56:
+  case 59:
+
     {
 	if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
 		menu_end_menu();
 		printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
 	}
-}
+;}
     break;
 
-  case 58:
+  case 61:
+
     {
 	printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
 	zconfnerrs++;
-}
+;}
     break;
 
-  case 63:
-    { zconfprint("invalid menu option"); yyerrok; }
+  case 66:
+
+    { zconfprint("invalid menu option"); yyerrok; ;}
     break;
 
-  case 64:
+  case 67:
+
     {
 	yyval.string = yyvsp[0].string;
 	printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[0].string);
-}
+;}
     break;
 
-  case 65:
+  case 68:
+
     {
 	zconf_nextfile(yyvsp[-1].string);
-}
+;}
     break;
 
-  case 66:
+  case 69:
+
     {
 	menu_add_entry(NULL);
 	menu_add_prop(P_COMMENT, yyvsp[0].string, NULL, NULL);
 	printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 67:
+  case 70:
+
     {
 	menu_end_entry();
-}
+;}
     break;
 
-  case 68:
+  case 71:
+
     {
 	printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
 	zconf_starthelp();
-}
+;}
     break;
 
-  case 69:
+  case 72:
+
     {
 	current_entry->sym->help = yyvsp[0].string;
-}
+;}
     break;
 
-  case 72:
-    { }
+  case 75:
+
+    { ;}
     break;
 
-  case 73:
+  case 76:
+
     {
 	menu_add_dep(yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 74:
+  case 77:
+
     {
 	menu_add_dep(yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 75:
+  case 78:
+
     {
 	menu_add_dep(yyvsp[0].expr);
 	printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
-}
+;}
     break;
 
-  case 77:
+  case 80:
+
     {
 	menu_add_prop(P_PROMPT, yyvsp[0].string, NULL, NULL);
-}
+;}
     break;
 
-  case 78:
+  case 81:
+
     {
 	menu_add_prop(P_PROMPT, yyvsp[-2].string, NULL, yyvsp[0].expr);
-}
+;}
     break;
 
-  case 81:
-    { yyval.token = T_ENDMENU; }
-    break;
+  case 84:
 
-  case 82:
-    { yyval.token = T_ENDCHOICE; }
+    { yyval.token = T_ENDMENU; ;}
     break;
 
-  case 83:
-    { yyval.token = T_ENDIF; }
-    break;
+  case 85:
 
-  case 86:
-    { yyval.expr = NULL; }
+    { yyval.token = T_ENDCHOICE; ;}
     break;
 
-  case 87:
-    { yyval.expr = yyvsp[0].expr; }
-    break;
+  case 86:
 
-  case 88:
-    { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); }
+    { yyval.token = T_ENDIF; ;}
     break;
 
   case 89:
-    { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); }
+
+    { yyval.expr = NULL; ;}
     break;
 
   case 90:
-    { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); }
+
+    { yyval.expr = yyvsp[0].expr; ;}
     break;
 
   case 91:
-    { yyval.expr = yyvsp[-1].expr; }
+
+    { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
     break;
 
   case 92:
-    { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); }
+
+    { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
     break;
 
   case 93:
-    { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); }
+
+    { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
     break;
 
   case 94:
-    { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); }
+
+    { yyval.expr = yyvsp[-1].expr; ;}
     break;
 
   case 95:
-    { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); }
+
+    { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
     break;
 
   case 96:
-    { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); }
+
+    { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
+    break;
+
+  case 97:
+
+    { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
+    break;
+
+  case 98:
+
+    { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
+    break;
+
+  case 99:
+
+    { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
     break;
 
 
     }
 
-/* Line 1016 of /usr/share/bison/yacc.c.  */
-#line 1509 "zconf.tab.c"
+/* Line 999 of yacc.c.  */
+
 
   yyvsp -= yylen;
   yyssp -= yylen;
 
 
-#if YYDEBUG
-  if (yydebug)
-    {
-      short *yyssp1 = yyss - 1;
-      YYFPRINTF (stderr, "state stack now");
-      while (yyssp1 != yyssp)
-	YYFPRINTF (stderr, " %d", *++yyssp1);
-      YYFPRINTF (stderr, "\n");
-    }
-#endif
+  YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
 
@@ -1565,12 +1700,12 @@
 	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
 	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
-	  yysize += yystrlen ("parse error, unexpected ") + 1;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
 	  yysize += yystrlen (yytname[yytype]);
 	  yymsg = (char *) YYSTACK_ALLOC (yysize);
 	  if (yymsg != 0)
 	    {
-	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
 	      yyp = yystpcpy (yyp, yytname[yytype]);
 
 	      if (yycount < 5)
@@ -1591,19 +1726,15 @@
 	      YYSTACK_FREE (yymsg);
 	    }
 	  else
-	    yyerror ("parse error; also virtual memory exhausted");
+	    yyerror ("syntax error; also virtual memory exhausted");
 	}
       else
 #endif /* YYERROR_VERBOSE */
-	yyerror ("parse error");
+	yyerror ("syntax error");
     }
-  goto yyerrlab1;
 
 
-/*----------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action.  |
-`----------------------------------------------------*/
-yyerrlab1:
+
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
@@ -1615,28 +1746,30 @@
 	  /* Pop the error token.  */
           YYPOPSTACK;
 	  /* Pop the rest of the stack.  */
-	  while (yyssp > yyss)
+	  while (yyss < yyssp)
 	    {
-	      YYDPRINTF ((stderr, "Error: popping "));
-	      YYDSYMPRINT ((stderr,
-			    yystos[*yyssp],
-			    *yyvsp));
-	      YYDPRINTF ((stderr, "\n"));
-	      yydestruct (yystos[*yyssp], *yyvsp);
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
 	      YYPOPSTACK;
 	    }
 	  YYABORT;
         }
 
-      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
-		  yychar, yytname[yychar1]));
-      yydestruct (yychar1, yylval);
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
       yychar = YYEMPTY;
+
     }
 
   /* Else will try to reuse lookahead token after shifting the error
      token.  */
+  goto yyerrlab1;
+
 
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
 
   for (;;)
@@ -1657,26 +1790,12 @@
       if (yyssp == yyss)
 	YYABORT;
 
-      YYDPRINTF ((stderr, "Error: popping "));
-      YYDSYMPRINT ((stderr,
-		    yystos[*yyssp], *yyvsp));
-      YYDPRINTF ((stderr, "\n"));
-
-      yydestruct (yystos[yystate], *yyvsp);
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
       yyvsp--;
       yystate = *--yyssp;
 
-
-#if YYDEBUG
-      if (yydebug)
-	{
-	  short *yyssp1 = yyss - 1;
-	  YYFPRINTF (stderr, "Error: state stack now");
-	  while (yyssp1 != yyssp)
-	    YYFPRINTF (stderr, " %d", *++yyssp1);
-	  YYFPRINTF (stderr, "\n");
-	}
-#endif
+      YY_STACK_PRINT (yyss, yyssp);
     }
 
   if (yyn == YYFINAL)
@@ -1726,12 +1845,14 @@
 
 
 
+
 void conf_parse(const char *name)
 {
 	zconf_initscan(name);
 
 	sym_init();
 	menu_init();
+	modules_sym = sym_lookup("MODULES", 0);
 	rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
 
 	//zconfdebug = 1;
@@ -1740,8 +1861,6 @@
 		exit(1);
 	menu_finalize(&rootmenu);
 
-	modules_sym = sym_lookup("MODULES", 0);
-
 	sym_change_count = 1;
 }
 
diff -urN linux-2.5.64-bk10/scripts/kconfig/zconf.y linux-2.5.64-bk11/scripts/kconfig/zconf.y
--- linux-2.5.64-bk10/scripts/kconfig/zconf.y	Tue Mar  4 19:29:36 2003
+++ linux-2.5.64-bk11/scripts/kconfig/zconf.y	Mon Mar 31 12:34:56 2003
@@ -27,7 +27,7 @@
 
 #define YYERROR_VERBOSE
 %}
-%expect 36
+%expect 40
 
 %union
 {
@@ -46,6 +46,7 @@
 %token T_ENDCHOICE
 %token T_COMMENT
 %token T_CONFIG
+%token T_MENUCONFIG
 %token T_HELP
 %token <string> T_HELPTEXT
 %token T_IF
@@ -104,12 +105,13 @@
 	  if_stmt
 	| comment_stmt
 	| config_stmt
+	| menuconfig_stmt
 	| source_stmt
 	| nl_or_eof
 ;
 
 
-/* config entry */
+/* config/menuconfig entry */
 
 config_entry_start: T_CONFIG T_WORD
 {
@@ -125,6 +127,24 @@
 	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
 };
 
+menuconfig_entry_start: T_MENUCONFIG T_WORD
+{
+	struct symbol *sym = sym_lookup($2, 0);
+	sym->flags |= SYMBOL_OPTIONAL;
+	menu_add_entry(sym);
+	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2);
+};
+
+menuconfig_stmt: menuconfig_entry_start T_EOL config_option_list
+{
+	if (current_entry->prompt)
+		current_entry->prompt->type = P_MENU;
+	else
+		zconfprint("warning: menuconfig statement without prompt");
+	menu_end_entry();
+	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
+};
+
 config_option_list:
 	  /* empty */
 	| config_option_list config_option T_EOL
@@ -423,6 +443,7 @@
 
 	sym_init();
 	menu_init();
+	modules_sym = sym_lookup("MODULES", 0);
 	rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
 
 	//zconfdebug = 1;
@@ -431,8 +452,6 @@
 		exit(1);
 	menu_finalize(&rootmenu);
 
-	modules_sym = sym_lookup("MODULES", 0);
-
 	sym_change_count = 1;
 }
 
