LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Use the ibm,pa-features property where available
From: Paul Mackerras @ 2006-05-01  4:04 UTC (permalink / raw)
  To: will_schmidt, linuxppc-dev

Forthcoming IBM machines will have a "ibm,pa-features" property on CPU
nodes, that contains bits indicating which optional architecture
features are implemented by the CPU.  This adds code to use the
property, if present, to update our CPU feature bitmaps.

This is based on a patch by Will Schmidt <will_schmidt@vnet.ibm.com>

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
At the moment we're looking at all the ibm,pa-features properties and
processing them all...  Maybe we should only look at the one for the
boot cpu.

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 1cb69e8..9a07f97 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -885,6 +885,74 @@ void __init unflatten_device_tree(void)
 	DBG(" <- unflatten_device_tree()\n");
 }
 
+/*
+ * ibm,pa-features is a per-cpu property that contains a string of
+ * attribute descriptors, each of which has a 2 byte header plus up
+ * to 254 bytes worth of processor attribute bits.  First header
+ * byte specifies the number of bytes following the header.
+ * Second header byte is an "attribute-specifier" type, of which
+ * zero is the only currently-defined value.
+ * Implementation:  Pass in the byte and bit offset for the feature
+ * that we are interested in.  The function will return -1 if the
+ * pa-features property is missing, or a 1/0 to indicate if the feature
+ * is supported/not supported.  Note that the bit numbers are
+ * big-endian to match the definition in PAPR.
+ */
+static struct ibm_pa_feature {
+	unsigned long	cpu_features;	/* CPU_FTR_xxx bit */
+	unsigned int	cpu_user_ftrs;	/* PPC_FEATURE_xxx bit */
+	unsigned char	pabyte;		/* byte number in ibm,pa-features */
+	unsigned char	pabit;		/* bit number (big-endian) */
+	unsigned char	invert;		/* if 1, pa bit set => clear feature */
+} ibm_pa_features[] __initdata = {
+	{0, PPC_FEATURE_HAS_MMU,	0, 0, 0},
+	{0, PPC_FEATURE_HAS_FPU,	0, 1, 0},
+	{CPU_FTR_SLB, 0,		0, 2, 0},
+	{CPU_FTR_CTRL, 0,		0, 3, 0},
+	{CPU_FTR_NOEXECUTE, 0,		0, 6, 0},
+	{CPU_FTR_NODSISRALIGN, 0,	1, 1, 1},
+	{CPU_FTR_CI_LARGE_PAGE, 0,	1, 2, 0},
+};
+
+static void __init check_cpu_pa_features(unsigned long node)
+{
+	unsigned char *pa_ftrs;
+	unsigned long len, tablelen, i, bit;
+
+	pa_ftrs = of_get_flat_dt_prop(node, "ibm,pa-features", &tablelen);
+	if (pa_ftrs == NULL)
+		return;
+
+	/* find descriptor with type == 0 */
+	for (;;) {
+		if (tablelen < 3)
+			return;
+		len = 2 + pa_ftrs[0];
+		if (tablelen < len)
+			return;		/* descriptor 0 not found */
+		if (pa_ftrs[1] == 0)
+			break;
+		tablelen -= len;
+		pa_ftrs += len;
+	}
+
+	/* loop over bits we know about */
+	for (i = 0; i < ARRAY_SIZE(ibm_pa_features); ++i) {
+		struct ibm_pa_feature *fp = &ibm_pa_features[i];
+
+		if (fp->pabyte >= pa_ftrs[0])
+			continue;
+		bit = (pa_ftrs[2 + fp->pabyte] >> (7 - fp->pabit)) & 1;
+		if (bit ^ fp->invert) {
+			cur_cpu_spec->cpu_features |= fp->cpu_features;
+			cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
+		} else {
+			cur_cpu_spec->cpu_features &= ~fp->cpu_features;
+			cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
+		}
+	}
+}
+
 static int __init early_init_dt_scan_cpus(unsigned long node,
 					  const char *uname, int depth,
 					  void *data)
@@ -968,6 +1036,8 @@ #ifdef CONFIG_ALTIVEC
 		cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
 	}
 #endif /* CONFIG_ALTIVEC */
+
+	check_cpu_pa_features(node);
 
 #ifdef CONFIG_PPC_PSERIES
 	if (nthreads > 1)

^ permalink raw reply related

* Re: sign extension for 32bit syscalls on ppc64
From: Stephen Rothwell @ 2006-05-01  3:44 UTC (permalink / raw)
  To: schwab; +Cc: linuxppc-dev, paulus
In-Reply-To: <20060501100518.22aedb20.sfr@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 666 bytes --]

On Mon, 1 May 2006 10:05:18 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Try mkdirat. openat has a compat wrapper that has the dfd paramater
> declared as a unsigned int and passes it to sys_openat, whose first
> paramter is decalred to be int, so the sign extension gets done.

OK, I actually tried this and it works! :-(

I traced the code path and it turns out that the place we check for the
-100 (in do_path_lookup), the compiler has used a cmpwi instruction and so
ignores the top 32 bits.  Thus we get away with the ABI abuse!

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [RFC/PATCH 4/4] powerpc: Convert DBG to pr_debug for the rest of arch/powerpc
From: Michael Ellerman @ 2006-05-01  0:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1146444821.660434.518701003988.qpush@concordia>

Convert DBG to pr_debug for the rest of arch/powerpc.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/mm/hash_native_64.c |   22 ++++++------------
 arch/powerpc/mm/init_64.c        |    8 ------
 arch/powerpc/mm/lmb.c            |   29 +++++++++---------------
 arch/powerpc/mm/slb.c            |   12 ++--------
 arch/powerpc/sysdev/dart_iommu.c |   10 ++++----
 arch/powerpc/sysdev/mpic.c       |   46 ++++++++++++++++++---------------------
 6 files changed, 50 insertions(+), 77 deletions(-)

Index: to-merge/arch/powerpc/mm/hash_native_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/hash_native_64.c
+++ to-merge/arch/powerpc/mm/hash_native_64.c
@@ -10,7 +10,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#undef DEBUG_LOW
+#undef DEBUG	/* warning: leads to _lots_ of output */
 
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
@@ -27,12 +27,6 @@
 #include <asm/cputable.h>
 #include <asm/udbg.h>
 
-#ifdef DEBUG_LOW
-#define DBG_LOW(fmt...) udbg_printf(fmt)
-#else
-#define DBG_LOW(fmt...)
-#endif
-
 #define HPTE_LOCK_BIT 3
 
 static DEFINE_SPINLOCK(native_tlbie_lock);
@@ -132,7 +126,7 @@ long native_hpte_insert(unsigned long hp
 	int i;
 
 	if (!(vflags & HPTE_V_BOLTED)) {
-		DBG_LOW("    insert(group=%lx, va=%016lx, pa=%016lx,"
+		pr_debug("    insert(group=%lx, va=%016lx, pa=%016lx,"
 			" rflags=%lx, vflags=%lx, psize=%d)\n",
 			hpte_group, va, pa, rflags, vflags, psize);
 	}
@@ -156,7 +150,7 @@ long native_hpte_insert(unsigned long hp
 	hpte_r = hpte_encode_r(pa, psize) | rflags;
 
 	if (!(vflags & HPTE_V_BOLTED)) {
-		DBG_LOW(" i=%x hpte_v=%016lx, hpte_r=%016lx\n",
+		pr_debug(" i=%x hpte_v=%016lx, hpte_r=%016lx\n",
 			i, hpte_v, hpte_r);
 	}
 
@@ -181,7 +175,7 @@ static long native_hpte_remove(unsigned 
 	int slot_offset;
 	unsigned long hpte_v;
 
-	DBG_LOW("    remove(group=%lx)\n", hpte_group);
+	pr_debug("    remove(group=%lx)\n", hpte_group);
 
 	/* pick a random entry to start at */
 	slot_offset = mftb() & 0x7;
@@ -222,7 +216,7 @@ static long native_hpte_updatepp(unsigne
 
 	want_v = hpte_encode_v(va, psize);
 
-	DBG_LOW("    update(va=%016lx, avpnv=%016lx, hash=%016lx, newpp=%x)",
+	pr_debug("    update(va=%016lx, avpnv=%016lx, hash=%016lx, newpp=%x)",
 		va, want_v & HPTE_V_AVPN, slot, newpp);
 
 	native_lock_hpte(hptep);
@@ -231,11 +225,11 @@ static long native_hpte_updatepp(unsigne
 
 	/* Even if we miss, we need to invalidate the TLB */
 	if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID)) {
-		DBG_LOW(" -> miss\n");
+		pr_debug(" -> miss\n");
 		native_unlock_hpte(hptep);
 		ret = -1;
 	} else {
-		DBG_LOW(" -> hit\n");
+		pr_debug(" -> hit\n");
 		/* Update the HPTE */
 		hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
 			(newpp & (HPTE_R_PP | HPTE_R_N));
@@ -321,7 +315,7 @@ static void native_hpte_invalidate(unsig
 
 	local_irq_save(flags);
 
-	DBG_LOW("    invalidate(va=%016lx, hash: %x)\n", va, slot);
+	pr_debug("    invalidate(va=%016lx, hash: %x)\n", va, slot);
 
 	want_v = hpte_encode_v(va, psize);
 	native_lock_hpte(hptep);
Index: to-merge/arch/powerpc/mm/init_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/init_64.c
+++ to-merge/arch/powerpc/mm/init_64.c
@@ -67,12 +67,6 @@
 
 #include "mmu_decl.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 #if PGTABLE_RANGE > USER_VSID_RANGE
 #warning Limited user VSID range means pagetable space is wasted
 #endif
@@ -172,7 +166,7 @@ void pgtable_cache_init(void)
 		int size = pgtable_cache_size[i];
 		const char *name = pgtable_cache_name[i];
 
-		DBG("Allocating page table cache %s (#%d) "
+		pr_debug("Allocating page table cache %s (#%d) "
 		    "for size: %08x...\n", name, i, size);
 		pgtable_cache[i] = kmem_cache_create(name,
 						     size, size,
Index: to-merge/arch/powerpc/mm/lmb.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/lmb.c
+++ to-merge/arch/powerpc/mm/lmb.c
@@ -10,6 +10,8 @@
  *      2 of the License, or (at your option) any later version.
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -22,15 +24,6 @@
 #include "mmu_decl.h"		/* for __max_low_memory */
 #endif
 
-#undef DEBUG
-
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 #define LMB_ALLOC_ANYWHERE	0
 
 struct lmb lmb;
@@ -40,22 +33,22 @@ void lmb_dump_all(void)
 #ifdef DEBUG
 	unsigned long i;
 
-	DBG("lmb_dump_all:\n");
-	DBG("    memory.cnt		  = 0x%lx\n", lmb.memory.cnt);
-	DBG("    memory.size		  = 0x%lx\n", lmb.memory.size);
+	pr_debug("lmb_dump_all:\n");
+	pr_debug("    memory.cnt		  = 0x%lx\n", lmb.memory.cnt);
+	pr_debug("    memory.size		  = 0x%lx\n", lmb.memory.size);
 	for (i=0; i < lmb.memory.cnt ;i++) {
-		DBG("    memory.region[0x%x].base       = 0x%lx\n",
+		pr_debug("    memory.region[0x%x].base       = 0x%lx\n",
 			    i, lmb.memory.region[i].base);
-		DBG("		      .size     = 0x%lx\n",
+		pr_debug("		      .size     = 0x%lx\n",
 			    lmb.memory.region[i].size);
 	}
 
-	DBG("\n    reserved.cnt	  = 0x%lx\n", lmb.reserved.cnt);
-	DBG("    reserved.size	  = 0x%lx\n", lmb.reserved.size);
+	pr_debug("\n    reserved.cnt	  = 0x%lx\n", lmb.reserved.cnt);
+	pr_debug("    reserved.size	  = 0x%lx\n", lmb.reserved.size);
 	for (i=0; i < lmb.reserved.cnt ;i++) {
-		DBG("    reserved.region[0x%x].base       = 0x%lx\n",
+		pr_debug("    reserved.region[0x%x].base       = 0x%lx\n",
 			    i, lmb.reserved.region[i].base);
-		DBG("		      .size     = 0x%lx\n",
+		pr_debug("		      .size     = 0x%lx\n",
 			    lmb.reserved.region[i].size);
 	}
 #endif /* DEBUG */
Index: to-merge/arch/powerpc/mm/slb.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/slb.c
+++ to-merge/arch/powerpc/mm/slb.c
@@ -24,12 +24,6 @@
 #include <asm/cputable.h>
 #include <asm/cacheflush.h>
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 extern void slb_allocate_realmode(unsigned long ea);
 extern void slb_allocate_user(unsigned long ea);
 
@@ -191,12 +185,12 @@ void slb_initialize(void)
 		patch_slb_encoding(slb_miss_user_load_normal,
 				   SLB_VSID_USER | virtual_llp);
 
-		DBG("SLB: linear  LLP = %04x\n", linear_llp);
-		DBG("SLB: virtual LLP = %04x\n", virtual_llp);
+		pr_debug("SLB: linear  LLP = %04x\n", linear_llp);
+		pr_debug("SLB: virtual LLP = %04x\n", virtual_llp);
 #ifdef CONFIG_HUGETLB_PAGE
 		patch_slb_encoding(slb_miss_user_load_huge,
 				   SLB_VSID_USER | huge_llp);
-		DBG("SLB: huge    LLP = %04x\n", huge_llp);
+		pr_debug("SLB: huge    LLP = %04x\n", huge_llp);
 #endif
 	}
 
Index: to-merge/arch/powerpc/sysdev/dart_iommu.c
===================================================================
--- to-merge.orig/arch/powerpc/sysdev/dart_iommu.c
+++ to-merge/arch/powerpc/sysdev/dart_iommu.c
@@ -27,6 +27,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -70,15 +72,13 @@ static int iommu_table_dart_inited;
 static int dart_dirty;
 static int dart_is_u4;
 
-#define DBG(...)
-
 static inline void dart_tlb_invalidate_all(void)
 {
 	unsigned long l = 0;
 	unsigned int reg, inv_bit;
 	unsigned long limit;
 
-	DBG("dart: flush\n");
+	pr_debug("dart: flush\n");
 
 	/* To invalidate the DART, set the DARTCNTL_FLUSHTLB bit in the
 	 * control register and wait for it to clear.
@@ -125,7 +125,7 @@ static void dart_build(struct iommu_tabl
 	unsigned int *dp;
 	unsigned int rpn;
 
-	DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr);
+	pr_debug("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr);
 
 	index <<= DART_PAGE_FACTOR;
 	npages <<= DART_PAGE_FACTOR;
@@ -156,7 +156,7 @@ static void dart_free(struct iommu_table
 	 * bad DMAs, but then no 32-bit architecture ever does either.
 	 */
 
-	DBG("dart: free at: %lx, %lx\n", index, npages);
+	pr_debug("dart: free at: %lx, %lx\n", index, npages);
 
 	index <<= DART_PAGE_FACTOR;
 	npages <<= DART_PAGE_FACTOR;
Index: to-merge/arch/powerpc/sysdev/mpic.c
===================================================================
--- to-merge.orig/arch/powerpc/sysdev/mpic.c
+++ to-merge/arch/powerpc/sysdev/mpic.c
@@ -37,12 +37,6 @@
 #include <asm/mpic.h>
 #include <asm/smp.h>
 
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 static struct mpic *mpics;
 static struct mpic *mpic_primary;
 static DEFINE_SPINLOCK(mpic_lock);
@@ -205,7 +199,7 @@ static void mpic_startup_ht_interrupt(st
 	if (fixup->base == NULL)
 		return;
 
-	DBG("startup_ht_interrupt(%u, %u) index: %d\n",
+	pr_debug("startup_ht_interrupt(%u, %u) index: %d\n",
 	    source, irqflags, fixup->index);
 	spin_lock_irqsave(&mpic->fixup_lock, flags);
 	/* Enable and configure */
@@ -228,7 +222,7 @@ static void mpic_shutdown_ht_interrupt(s
 	if (fixup->base == NULL)
 		return;
 
-	DBG("shutdown_ht_interrupt(%u, %u)\n", source, irqflags);
+	pr_debug("shutdown_ht_interrupt(%u, %u)\n", source, irqflags);
 
 	/* Disable */
 	spin_lock_irqsave(&mpic->fixup_lock, flags);
@@ -271,7 +265,8 @@ static void __init mpic_scan_ht_pic(stru
 		writeb(0x10 + 2 * i, base + 2);
 		tmp = readl(base + 4);
 		irq = (tmp >> 16) & 0xff;
-		DBG("HT PIC index 0x%x, irq 0x%x, tmp: %08x\n", i, irq, tmp);
+		pr_debug("HT PIC index 0x%x, irq 0x%x, tmp: %08x\n",
+				i, irq, tmp);
 		/* mask it , will be unmasked later */
 		tmp |= 0x1;
 		writel(tmp, base + 4);
@@ -318,7 +313,7 @@ static void __init mpic_scan_ht_pics(str
 		u32 l = readl(devbase + PCI_VENDOR_ID);
 		u16 s;
 
-		DBG("devfn %x, l: %x\n", devfn, l);
+		pr_debug("devfn %x, l: %x\n", devfn, l);
 
 		/* If no device, skip */
 		if (l == 0xffffffff || l == 0x00000000 ||
@@ -417,7 +412,8 @@ static void mpic_enable_irq(unsigned int
 	struct mpic *mpic = mpic_from_irq(irq);
 	unsigned int src = irq - mpic->irq_offset;
 
-	DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src);
+	pr_debug("%p: %s: enable_irq: %d (src %d)\n",
+			mpic, mpic->name, irq, src);
 
 	mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
 		       mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) &
@@ -464,7 +460,7 @@ static void mpic_disable_irq(unsigned in
 	struct mpic *mpic = mpic_from_irq(irq);
 	unsigned int src = irq - mpic->irq_offset;
 
-	DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src);
+	pr_debug("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src);
 
 	mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI,
 		       mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) |
@@ -498,7 +494,7 @@ static void mpic_end_irq(unsigned int ir
 	struct mpic *mpic = mpic_from_irq(irq);
 
 #ifdef DEBUG_IRQ
-	DBG("%s: end_irq: %d\n", mpic->name, irq);
+	pr_debug("%s: end_irq: %d\n", mpic->name, irq);
 #endif
 	/* We always EOI on end_irq() even for edge interrupts since that
 	 * should only lower the priority, the MPIC should have properly
@@ -524,7 +520,7 @@ static void mpic_enable_ipi(unsigned int
 	struct mpic *mpic = mpic_from_ipi(irq);
 	unsigned int src = irq - mpic->ipi_offset;
 
-	DBG("%s: enable_ipi: %d (ipi %d)\n", mpic->name, irq, src);
+	pr_debug("%s: enable_ipi: %d (ipi %d)\n", mpic->name, irq, src);
 	mpic_ipi_write(src, mpic_ipi_read(src) & ~MPIC_VECPRI_MASK);
 }
 
@@ -762,7 +758,7 @@ void __init mpic_init(struct mpic *mpic)
 
 #ifdef CONFIG_MPIC_BROKEN_U3
 	/* Do the HT PIC fixups on U3 broken mpic */
-	DBG("MPIC flags: %x\n", mpic->flags);
+	pr_debug("MPIC flags: %x\n", mpic->flags);
 	if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY))
 		mpic_scan_ht_pics(mpic);
 #endif /* CONFIG_MPIC_BROKEN_U3 */
@@ -802,8 +798,8 @@ void __init mpic_init(struct mpic *mpic)
 #endif
 		}
 
-		DBG("setup source %d, vecpri: %08x, level: %d\n", i, vecpri,
-		    (level != 0));
+		pr_debug("setup source %d, vecpri: %08x, level: %d\n",
+				i, vecpri, (level != 0));
 
 		/* init hw */
 		mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri);
@@ -879,7 +875,8 @@ void mpic_setup_this_cpu(void)
 
 	BUG_ON(mpic == NULL);
 
-	DBG("%s: setup_this_cpu(%d)\n", mpic->name, hard_smp_processor_id());
+	pr_debug("%s: setup_this_cpu(%d)\n",
+			mpic->name, hard_smp_processor_id());
 
 	spin_lock_irqsave(&mpic_lock, flags);
 
@@ -930,7 +927,8 @@ void mpic_teardown_this_cpu(int secondar
 
 	BUG_ON(mpic == NULL);
 
-	DBG("%s: teardown_this_cpu(%d)\n", mpic->name, hard_smp_processor_id());
+	pr_debug("%s: teardown_this_cpu(%d)\n",
+			mpic->name, hard_smp_processor_id());
 	spin_lock_irqsave(&mpic_lock, flags);
 
 	/* let the mpic know we don't want intrs.  */
@@ -952,7 +950,7 @@ void mpic_send_ipi(unsigned int ipi_no, 
 	BUG_ON(mpic == NULL);
 
 #ifdef DEBUG_IPI
-	DBG("%s: send_ipi(ipi_no: %d)\n", mpic->name, ipi_no);
+	pr_debug("%s: send_ipi(ipi_no: %d)\n", mpic->name, ipi_no);
 #endif
 
 	mpic_cpu_write(MPIC_CPU_IPI_DISPATCH_0 + ipi_no * 0x10,
@@ -965,11 +963,11 @@ int mpic_get_one_irq(struct mpic *mpic, 
 
 	irq = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK;
 #ifdef DEBUG_LOW
-	DBG("%s: get_one_irq(): %d\n", mpic->name, irq);
+	pr_debug("%s: get_one_irq(): %d\n", mpic->name, irq);
 #endif
 	if (mpic->cascade && irq == mpic->cascade_vec) {
 #ifdef DEBUG_LOW
-		DBG("%s: cascading ...\n", mpic->name);
+		pr_debug("%s: cascading ...\n", mpic->name);
 #endif
 		irq = mpic->cascade(regs, mpic->cascade_data);
 		mpic_eoi(mpic);
@@ -979,12 +977,12 @@ int mpic_get_one_irq(struct mpic *mpic, 
 		return -1;
 	if (irq < MPIC_VEC_IPI_0) {
 #ifdef DEBUG_IRQ
-		DBG("%s: irq %d\n", mpic->name, irq + mpic->irq_offset);
+		pr_debug("%s: irq %d\n", mpic->name, irq + mpic->irq_offset);
 #endif
 		return irq + mpic->irq_offset;
 	}
 #ifdef DEBUG_IPI
-       	DBG("%s: ipi %d !\n", mpic->name, irq - MPIC_VEC_IPI_0);
+	pr_debug("%s: ipi %d !\n", mpic->name, irq - MPIC_VEC_IPI_0);
 #endif
 	return irq - MPIC_VEC_IPI_0 + mpic->ipi_offset;
 }

^ permalink raw reply

* [RFC/PATCH 3/4] powerpc: Convert DBG to pr_debug in arch/powerpc/platforms
From: Michael Ellerman @ 2006-05-01  0:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1146444821.660434.518701003988.qpush@concordia>

Convert DBG to pr_debug in arch/powerpc/platforms.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/platforms/83xx/pci.c            |   14 ++-------
 arch/powerpc/platforms/85xx/pci.c            |   14 ++-------
 arch/powerpc/platforms/cell/setup.c          |   11 ++-----
 arch/powerpc/platforms/cell/smp.c            |   10 +-----
 arch/powerpc/platforms/iseries/setup.c       |   12 ++------
 arch/powerpc/platforms/maple/pci.c           |   12 ++------
 arch/powerpc/platforms/maple/setup.c         |   14 ++-------
 arch/powerpc/platforms/maple/time.c          |    6 ----
 arch/powerpc/platforms/powermac/cpufreq_64.c |   18 ++++--------
 arch/powerpc/platforms/powermac/feature.c    |   11 ++-----
 arch/powerpc/platforms/powermac/nvram.c      |   39 +++++++++++----------------
 arch/powerpc/platforms/powermac/pci.c        |   26 ++++++------------
 arch/powerpc/platforms/powermac/pfunc_base.c |   25 ++++++-----------
 arch/powerpc/platforms/powermac/pfunc_core.c |   29 ++++++++------------
 arch/powerpc/platforms/powermac/smp.c        |    6 ----
 arch/powerpc/platforms/powermac/time.c       |   11 ++-----
 arch/powerpc/platforms/pseries/firmware.c    |   10 +-----
 arch/powerpc/platforms/pseries/iommu.c       |   33 +++++++++++++---------
 arch/powerpc/platforms/pseries/lpar.c        |   26 ++++++------------
 arch/powerpc/platforms/pseries/setup.c       |   14 ++-------
 arch/powerpc/platforms/pseries/smp.c         |   11 +------
 21 files changed, 121 insertions(+), 231 deletions(-)

Index: to-merge/arch/powerpc/platforms/83xx/pci.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/83xx/pci.c
+++ to-merge/arch/powerpc/platforms/83xx/pci.c
@@ -9,6 +9,8 @@
  * option) any later version.
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
@@ -26,14 +28,6 @@
 #include <asm/prom.h>
 #include <sysdev/fsl_soc.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 int mpc83xx_pci2_busno;
 
 int mpc83xx_exclude_device(u_char bus, u_char devfn)
@@ -55,7 +49,7 @@ int __init add_bridge(struct device_node
 	int primary = 1, has_address = 0;
 	phys_addr_t immr = get_immrbase();
 
-	DBG("Adding PCI host bridge %s\n", dev->full_name);
+	pr_debug("Adding PCI host bridge %s\n", dev->full_name);
 
 	/* Fetch host bridge registers address */
 	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
@@ -95,7 +89,7 @@ int __init add_bridge(struct device_node
 	       "Firmware bus number: %d->%d\n",
 	       rsrc.start, hose->first_busno, hose->last_busno);
 
-	DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
+	pr_debug(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
 	    hose, hose->cfg_addr, hose->cfg_data);
 
 	/* Interpret the "ranges" property */
Index: to-merge/arch/powerpc/platforms/85xx/pci.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/85xx/pci.c
+++ to-merge/arch/powerpc/platforms/85xx/pci.c
@@ -9,6 +9,8 @@
  * option) any later version.
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
@@ -26,14 +28,6 @@
 #include <asm/prom.h>
 #include <sysdev/fsl_soc.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 int mpc85xx_pci2_busno = 0;
 
 #ifdef CONFIG_PCI
@@ -46,7 +40,7 @@ int __init add_bridge(struct device_node
 	int primary = 1, has_address = 0;
 	phys_addr_t immr = get_immrbase();
 
-	DBG("Adding PCI host bridge %s\n", dev->full_name);
+	pr_debug("Adding PCI host bridge %s\n", dev->full_name);
 
 	/* Fetch host bridge registers address */
 	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
@@ -83,7 +77,7 @@ int __init add_bridge(struct device_node
 	       "Firmware bus number: %d->%d\n",
 		rsrc.start, hose->first_busno, hose->last_busno);
 
-	DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
+	pr_debug(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
 		hose, hose->cfg_addr, hose->cfg_data);
 
 	/* Interpret the "ranges" property */
Index: to-merge/arch/powerpc/platforms/cell/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/cell/setup.c
+++ to-merge/arch/powerpc/platforms/cell/setup.c
@@ -12,6 +12,7 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
+
 #undef DEBUG
 
 #include <linux/config.h>
@@ -51,12 +52,6 @@
 #include "iommu.h"
 #include "pervasive.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 static void cell_show_cpuinfo(struct seq_file *m)
 {
 	struct device_node *root;
@@ -181,7 +176,7 @@ static void __init cell_setup_arch(void)
  */
 static void __init cell_init_early(void)
 {
-	DBG(" -> cell_init_early()\n");
+	pr_debug(" -> cell_init_early()\n");
 
 	hpte_init_native();
 
@@ -191,7 +186,7 @@ static void __init cell_init_early(void)
 
 	cell_spumem_init(1);
 
-	DBG(" <- cell_init_early()\n");
+	pr_debug(" <- cell_init_early()\n");
 }
 
 
Index: to-merge/arch/powerpc/platforms/cell/smp.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/cell/smp.c
+++ to-merge/arch/powerpc/platforms/cell/smp.c
@@ -46,12 +46,6 @@
 
 #include "interrupt.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /*
  * The primary thread of each non-boot processor is recorded here before
  * smp init.
@@ -200,7 +194,7 @@ void __init smp_init_cell(void)
 {
 	int i;
 
-	DBG(" -> smp_init_cell()\n");
+	pr_debug(" -> smp_init_cell()\n");
 
 	smp_ops = &bpa_iic_smp_ops;
 
@@ -226,5 +220,5 @@ void __init smp_init_cell(void)
 		smp_ops->take_timebase = cell_take_timebase;
 	}
 
-	DBG(" <- smp_init_cell()\n");
+	pr_debug(" <- smp_init_cell()\n");
 }
Index: to-merge/arch/powerpc/platforms/iseries/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/iseries/setup.c
+++ to-merge/arch/powerpc/platforms/iseries/setup.c
@@ -65,12 +65,6 @@
 #include "call_sm.h"
 #include "call_hpt.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /* Function Prototypes */
 static unsigned long build_iSeries_Memory_Map(void);
 static void iseries_shared_idle(void);
@@ -298,7 +292,7 @@ static void __init iSeries_get_cmdline(v
 
 static void __init iSeries_init_early(void)
 {
-	DBG(" -> iSeries_init_early()\n");
+	pr_debug(" -> iSeries_init_early()\n");
 
 	ppc64_interrupt_controller = IC_ISERIES;
 
@@ -354,7 +348,7 @@ static void __init iSeries_init_early(vo
 		initrd_start = initrd_end = 0;
 #endif /* CONFIG_BLK_DEV_INITRD */
 
-	DBG(" <- iSeries_init_early()\n");
+	pr_debug(" <- iSeries_init_early()\n");
 }
 
 struct mschunks_map mschunks_map = {
@@ -749,7 +743,7 @@ void dt_init(struct iseries_flat_dt *dt)
 void dt_check_blob(struct blob *b)
 {
 	if (b->next >= (unsigned long)&b->next) {
-		DBG("Ran out of space in flat device tree blob!\n");
+		pr_debug("Ran out of space in flat device tree blob!\n");
 		BUG();
 	}
 }
Index: to-merge/arch/powerpc/platforms/maple/pci.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/maple/pci.c
+++ to-merge/arch/powerpc/platforms/maple/pci.c
@@ -27,12 +27,6 @@
 
 #include "maple.h"
 
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 static struct pci_controller *u3_agp, *u3_ht;
 
 static int __init fixup_one_level_bus_range(struct device_node *node, int higher)
@@ -317,7 +311,7 @@ static int __init add_bridge(struct devi
 	int *bus_range;
 	int primary = 1;
 
-	DBG("Adding PCI host bridge %s\n", dev->full_name);
+	pr_debug("Adding PCI host bridge %s\n", dev->full_name);
 
 	bus_range = (int *) get_property(dev, "bus-range", &len);
 	if (bus_range == NULL || len < 2 * sizeof(int)) {
@@ -360,12 +354,12 @@ void __init maple_pcibios_fixup(void)
 {
 	struct pci_dev *dev = NULL;
 
-	DBG(" -> maple_pcibios_fixup\n");
+	pr_debug(" -> maple_pcibios_fixup\n");
 
 	for_each_pci_dev(dev)
 		pci_read_irq_line(dev);
 
-	DBG(" <- maple_pcibios_fixup\n");
+	pr_debug(" <- maple_pcibios_fixup\n");
 }
 
 static void __init maple_fixup_phb_resources(void)
Index: to-merge/arch/powerpc/platforms/maple/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/maple/setup.c
+++ to-merge/arch/powerpc/platforms/maple/setup.c
@@ -65,12 +65,6 @@
 
 #include "maple.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 static unsigned long maple_find_nvram_base(void)
 {
 	struct device_node *rtcs;
@@ -197,7 +191,7 @@ void __init maple_setup_arch(void)
  */
 static void __init maple_init_early(void)
 {
-	DBG(" -> maple_init_early\n");
+	pr_debug(" -> maple_init_early\n");
 
 	/* Initialize hash table, from now on, we can take hash faults
 	 * and call ioremap
@@ -209,7 +203,7 @@ static void __init maple_init_early(void
 
 	iommu_init_early_dart();
 
-	DBG(" <- maple_init_early\n");
+	pr_debug(" <- maple_init_early\n");
 }
 
 
@@ -222,7 +216,7 @@ static __init void maple_init_IRQ(void)
 	unsigned char senses[128];
 	int n;
 
-	DBG(" -> maple_init_IRQ\n");
+	pr_debug(" -> maple_init_IRQ\n");
 
 	/* XXX: Non standard, replace that with a proper openpic/mpic node
 	 * in the device-tree. Find the Open PIC if present */
@@ -247,7 +241,7 @@ static __init void maple_init_IRQ(void)
 	BUG_ON(mpic == NULL);
 	mpic_init(mpic);
 
-	DBG(" <- maple_init_IRQ\n");
+	pr_debug(" <- maple_init_IRQ\n");
 }
 
 static void __init maple_progress(char *s, unsigned short hex)
Index: to-merge/arch/powerpc/platforms/maple/time.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/maple/time.c
+++ to-merge/arch/powerpc/platforms/maple/time.c
@@ -36,12 +36,6 @@
 
 #include "maple.h"
 
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 extern void GregorianDay(struct rtc_time * tm);
 
 static int maple_rtc_addr;
Index: to-merge/arch/powerpc/platforms/powermac/cpufreq_64.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ to-merge/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -10,6 +10,8 @@
  * that is iMac G5 and latest single CPU desktop.
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -31,14 +33,6 @@
 #include <asm/smu.h>
 #include <asm/pmac_pfunc.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /* see 970FX user manual */
 
 #define SCOM_PCR 0x0aa001			/* PCR scom addr */
@@ -415,7 +409,7 @@ static int __init g5_neo2_cpufreq_init(s
 	/* Check 970FX for now */
 	valp = (u32 *)get_property(cpunode, "cpu-version", NULL);
 	if (!valp) {
-		DBG("No cpu-version property !\n");
+		pr_debug("No cpu-version property !\n");
 		goto bail_noprops;
 	}
 	pvr_hi = (*valp) >> 16;
@@ -427,7 +421,7 @@ static int __init g5_neo2_cpufreq_init(s
 	/* Look for the powertune data in the device-tree */
 	g5_pmode_data = (u32 *)get_property(cpunode, "power-mode-data",&psize);
 	if (!g5_pmode_data) {
-		DBG("No power-mode-data !\n");
+		pr_debug("No power-mode-data !\n");
 		goto bail_noprops;
 	}
 	g5_pmode_max = psize / sizeof(u32) - 1;
@@ -573,7 +567,7 @@ static int __init g5_pm72_cpufreq_init(s
 		goto bail;
 	}
 
-	DBG("cpufreq: i2c clock chip found: %s\n", hwclock->full_name);
+	pr_debug("cpufreq: i2c clock chip found: %s\n", hwclock->full_name);
 
 	/* Now get all the platform functions */
 	pfunc_cpu_getfreq =
@@ -704,7 +698,7 @@ static int __init g5_cpufreq_init(void)
 
 	cpus = of_find_node_by_path("/cpus");
 	if (cpus == NULL) {
-		DBG("No /cpus node !\n");
+		pr_debug("No /cpus node !\n");
 		return -ENODEV;
 	}
 
Index: to-merge/arch/powerpc/platforms/powermac/feature.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/feature.c
+++ to-merge/arch/powerpc/platforms/powermac/feature.c
@@ -16,6 +16,9 @@
  *   - Split split split...
  *
  */
+
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
@@ -41,14 +44,6 @@
 #include <asm/pci-bridge.h>
 #include <asm/pmac_low_i2c.h>
 
-#undef DEBUG_FEATURE
-
-#ifdef DEBUG_FEATURE
-#define DBG(fmt...) printk(KERN_DEBUG fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 #ifdef CONFIG_6xx
 extern int powersave_lowspeed;
 #endif
Index: to-merge/arch/powerpc/platforms/powermac/nvram.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/nvram.c
+++ to-merge/arch/powerpc/platforms/powermac/nvram.c
@@ -8,6 +8,9 @@
  *
  *  Todo: - add support for the OF persistent properties
  */
+
+#define DEBUG
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -30,14 +33,6 @@
 #include <asm/machdep.h>
 #include <asm/nvram.h>
 
-#define DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 #define NVRAM_SIZE		0x2000	/* 8kB of non-volatile RAM */
 
 #define CORE99_SIGNATURE	0x5a
@@ -266,15 +261,15 @@ static u32 core99_check(u8* datas)
 	struct core99_header* hdr99 = (struct core99_header*)datas;
 
 	if (hdr99->hdr.signature != CORE99_SIGNATURE) {
-		DBG("Invalid signature\n");
+		pr_debug("Invalid signature\n");
 		return 0;
 	}
 	if (hdr99->hdr.cksum != chrp_checksum(&hdr99->hdr)) {
-		DBG("Invalid checksum\n");
+		pr_debug("Invalid checksum\n");
 		return 0;
 	}
 	if (hdr99->adler != core99_calc_adler(datas)) {
-		DBG("Invalid adler\n");
+		pr_debug("Invalid adler\n");
 		return 0;
 	}
 	return hdr99->generation;
@@ -287,7 +282,7 @@ static int sm_erase_bank(int bank)
 
 	u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
 
-       	DBG("nvram: Sharp/Micron Erasing bank %d...\n", bank);
+       	pr_debug("nvram: Sharp/Micron Erasing bank %d...\n", bank);
 
 	out_8(base, SM_FLASH_CMD_ERASE_SETUP);
 	out_8(base, SM_FLASH_CMD_ERASE_CONFIRM);
@@ -319,7 +314,7 @@ static int sm_write_bank(int bank, u8* d
 
 	u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
 
-       	DBG("nvram: Sharp/Micron Writing bank %d...\n", bank);
+       	pr_debug("nvram: Sharp/Micron Writing bank %d...\n", bank);
 
 	for (i=0; i<NVRAM_SIZE; i++) {
 		out_8(base+i, SM_FLASH_CMD_WRITE_SETUP);
@@ -354,7 +349,7 @@ static int amd_erase_bank(int bank)
 
 	u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
 
-       	DBG("nvram: AMD Erasing bank %d...\n", bank);
+       	pr_debug("nvram: AMD Erasing bank %d...\n", bank);
 
 	/* Unlock 1 */
 	out_8(base+0x555, 0xaa);
@@ -401,7 +396,7 @@ static int amd_write_bank(int bank, u8* 
 
 	u8 __iomem *base = (u8 __iomem *)nvram_data + core99_bank*NVRAM_SIZE;
 
-       	DBG("nvram: AMD Writing bank %d...\n", bank);
+       	pr_debug("nvram: AMD Writing bank %d...\n", bank);
 
 	for (i=0; i<NVRAM_SIZE; i++) {
 		/* Unlock 1 */
@@ -470,9 +465,9 @@ static void __init lookup_partitions(voi
 		nvram_partitions[pmac_nvram_XPRAM] = 0x1300;
 		nvram_partitions[pmac_nvram_NR] = 0x1400;
 	}
-	DBG("nvram: OF partition at 0x%x\n", nvram_partitions[pmac_nvram_OF]);
-	DBG("nvram: XP partition at 0x%x\n", nvram_partitions[pmac_nvram_XPRAM]);
-	DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
+	pr_debug("nvram: OF partition at 0x%x\n", nvram_partitions[pmac_nvram_OF]);
+	pr_debug("nvram: XP partition at 0x%x\n", nvram_partitions[pmac_nvram_XPRAM]);
+	pr_debug("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
 }
 
 static void core99_nvram_sync(void)
@@ -488,7 +483,7 @@ static void core99_nvram_sync(void)
 		NVRAM_SIZE))
 		goto bail;
 
-	DBG("Updating nvram...\n");
+	pr_debug("Updating nvram...\n");
 
 	hdr99 = (struct core99_header*)nvram_image;
 	hdr99->generation++;
@@ -529,14 +524,14 @@ static int __init core99_nvram_setup(str
 	nvram_data = ioremap(addr, NVRAM_SIZE*2);
 	nvram_naddrs = 1; /* Make sure we get the correct case */
 
-	DBG("nvram: Checking bank 0...\n");
+	pr_debug("nvram: Checking bank 0...\n");
 
 	gen_bank0 = core99_check((u8 *)nvram_data);
 	gen_bank1 = core99_check((u8 *)nvram_data + NVRAM_SIZE);
 	core99_bank = (gen_bank0 < gen_bank1) ? 1 : 0;
 
-	DBG("nvram: gen0=%d, gen1=%d\n", gen_bank0, gen_bank1);
-	DBG("nvram: Active bank is: %d\n", core99_bank);
+	pr_debug("nvram: gen0=%d, gen1=%d\n", gen_bank0, gen_bank1);
+	pr_debug("nvram: Active bank is: %d\n", core99_bank);
 
 	for (i=0; i<NVRAM_SIZE; i++)
 		nvram_image[i] = nvram_data[i + core99_bank*NVRAM_SIZE];
Index: to-merge/arch/powerpc/platforms/powermac/pci.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/pci.c
+++ to-merge/arch/powerpc/platforms/powermac/pci.c
@@ -10,6 +10,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#undef DEBUG
+
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -29,14 +31,6 @@
 #include <asm/ppc-pci.h>
 #endif
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 static int add_bridge(struct device_node *dev);
 
 /* XXX Could be per-controller, but I don't think we risk anything by
@@ -626,7 +620,7 @@ static void __init init_p2pbridge(void)
 	    || strcmp(p2pbridge->parent->name, "pci") != 0)
 		return;
 	if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) {
-		DBG("Can't find PCI infos for PCI<->PCI bridge\n");
+		pr_debug("Can't find PCI infos for PCI<->PCI bridge\n");
 		return;
 	}
 	/* Warning: At this point, we have not yet renumbered all busses.
@@ -634,7 +628,7 @@ static void __init init_p2pbridge(void)
 	 */
 	hose = pci_find_hose_for_OF_device(p2pbridge);
 	if (!hose) {
-		DBG("Can't find hose for PCI<->PCI bridge\n");
+		pr_debug("Can't find hose for PCI<->PCI bridge\n");
 		return;
 	}
 	if (early_read_config_word(hose, bus, devfn,
@@ -803,7 +797,7 @@ static void __init setup_u3_ht(struct pc
 		other = u4_pcie;
 
 	if (other == NULL) {
-		DBG("U3/4 has no AGP/PCIE, using full resource range\n");
+		pr_debug("U3/4 has no AGP/PCIE, using full resource range\n");
 		return;
 	}
 
@@ -828,14 +822,14 @@ static void __init setup_u3_ht(struct pc
 		 * direction
 		 */
 		if (hose->mem_resources[cur].start == res->start) {
-			DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
+			pr_debug("U3/HT: shrink start of %d, %08lx -> %08lx\n",
 			    cur, hose->mem_resources[cur].start,
 			    res->end + 1);
 			hose->mem_resources[cur].start = res->end + 1;
 			continue;
 		}
 		if (hose->mem_resources[cur].end == res->end) {
-			DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
+			pr_debug("U3/HT: shrink end of %d, %08lx -> %08lx\n",
 			    cur, hose->mem_resources[cur].end,
 			    res->start - 1);
 			hose->mem_resources[cur].end = res->start - 1;
@@ -852,7 +846,7 @@ static void __init setup_u3_ht(struct pc
 			continue;
 		}
 		cur++;
-		DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
+		pr_debug("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
 		    cur-1, res->start - 1, cur, res->end + 1);
 		hose->mem_resources[cur].name = np->full_name;
 		hose->mem_resources[cur].flags = IORESOURCE_MEM;
@@ -877,7 +871,7 @@ static int __init add_bridge(struct devi
 	int *bus_range;
 	int primary = 1, has_address = 0;
 
-	DBG("Adding PCI host bridge %s\n", dev->full_name);
+	pr_debug("Adding PCI host bridge %s\n", dev->full_name);
 
 	/* Fetch host bridge registers address */
 	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
@@ -944,7 +938,7 @@ static int __init add_bridge(struct devi
 		disp_name, rsrc.start, hose->first_busno, hose->last_busno);
 #endif /* CONFIG_PPC32 */
 
-	DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
+	pr_debug(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
 		hose, hose->cfg_addr, hose->cfg_data);
 
 	/* Interpret the "ranges" property */
Index: to-merge/arch/powerpc/platforms/powermac/pfunc_base.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/pfunc_base.c
+++ to-merge/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -1,3 +1,5 @@
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
@@ -9,13 +11,6 @@
 #include <asm/pmac_feature.h>
 #include <asm/pmac_pfunc.h>
 
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...)	printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs)
 {
 	pmf_do_irq(data);
@@ -55,7 +50,7 @@ static int macio_do_gpio_write(PMF_STD_A
 	spin_lock_irqsave(&feature_lock, flags);
 	tmp = readb(addr);
 	tmp = (tmp & ~mask) | (value & mask);
-	DBG("Do write 0x%02x to GPIO %s (%p)\n",
+	pr_debug("Do write 0x%02x to GPIO %s (%p)\n",
 	    tmp, func->node->full_name, addr);
 	writeb(tmp, addr);
 	spin_unlock_irqrestore(&feature_lock, flags);
@@ -108,7 +103,7 @@ static void macio_gpio_init_one(struct m
 	if (gparent == NULL)
 		return;
 
-	DBG("Installing GPIO functions for macio %s\n",
+	pr_debug("Installing GPIO functions for macio %s\n",
 	    macio->of_node->full_name);
 
 	/*
@@ -130,7 +125,7 @@ static void macio_gpio_init_one(struct m
 		pmf_register_driver(gp, &macio_gpio_handlers, (void *)offset);
 	}
 
-	DBG("Calling initial GPIO functions for macio %s\n",
+	pr_debug("Calling initial GPIO functions for macio %s\n",
 	    macio->of_node->full_name);
 
 	/* And now we run all the init ones */
@@ -268,7 +263,7 @@ static struct pmf_handlers macio_mmio_ha
 
 static void macio_mmio_init_one(struct macio_chip *macio)
 {
-	DBG("Installing MMIO functions for macio %s\n",
+	pr_debug("Installing MMIO functions for macio %s\n",
 	    macio->of_node->full_name);
 
 	pmf_register_driver(macio->of_node, &macio_mmio_handlers, macio);
@@ -299,7 +294,7 @@ static void uninorth_install_pfunc(void)
 {
 	struct device_node *np;
 
-	DBG("Installing functions for UniN %s\n",
+	pr_debug("Installing functions for UniN %s\n",
 	    uninorth_node->full_name);
 
 	/*
@@ -318,7 +313,7 @@ static void uninorth_install_pfunc(void)
 			break;
 		}
 	if (unin_hwclock) {
-		DBG("Installing functions for UniN clock %s\n",
+		pr_debug("Installing functions for UniN clock %s\n",
 		    unin_hwclock->full_name);
 		pmf_register_driver(unin_hwclock, &unin_mmio_handlers, NULL);
 		pmf_do_functions(unin_hwclock, NULL, 0, PMF_FLAGS_ON_INIT,
@@ -339,7 +334,7 @@ int __init pmac_pfunc_base_install(void)
 	if (!machine_is(powermac))
 		return 0;
 
-	DBG("Installing base platform functions...\n");
+	pr_debug("Installing base platform functions...\n");
 
 	/*
 	 * Locate mac-io chips and install handlers
@@ -361,7 +356,7 @@ int __init pmac_pfunc_base_install(void)
 	if (uninorth_node && uninorth_base)
 		uninorth_install_pfunc();
 
-	DBG("All base functions installed\n");
+	pr_debug("All base functions installed\n");
 
 	return 0;
 }
Index: to-merge/arch/powerpc/platforms/powermac/pfunc_core.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/pfunc_core.c
+++ to-merge/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -5,6 +5,8 @@
  * FIXME: LOCKING !!!
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/delay.h>
@@ -21,13 +23,6 @@
 #define LOG_ERROR(fmt...)	printk(fmt)
 #define LOG_BLOB(t,b,c)
 
-#undef DEBUG
-#ifdef DEBUG
-#define DBG(fmt...)		printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /* Command numbers */
 #define PMF_CMD_LIST			0
 #define PMF_CMD_WRITE_GPIO		1
@@ -639,7 +634,7 @@ static int pmf_add_function_prop(struct 
 	int count = 0;
 	struct pmf_function *func = NULL;
 
-	DBG("pmf: Adding functions for platform-do-%s\n", name);
+	pr_debug("pmf: Adding functions for platform-do-%s\n", name);
 
 	while (length >= 12) {
 		/* Allocate a structure */
@@ -658,7 +653,7 @@ static int pmf_add_function_prop(struct 
 		func->data = data;
 		func->length = length;
 		func->dev = dev;
-		DBG("pmf: idx %d: flags=%08x, phandle=%08x "
+		pr_debug("pmf: idx %d: flags=%08x, phandle=%08x "
 		    " %d bytes remaining, parsing...\n",
 		    count+1, func->flags, func->phandle, length);
 		if (pmf_parse_one(func, NULL, NULL, NULL)) {
@@ -672,7 +667,7 @@ static int pmf_add_function_prop(struct 
 		count++;
 	}
  bail:
-	DBG("pmf: Added %d functions\n", count);
+	pr_debug("pmf: Added %d functions\n", count);
 
 	return count;
 }
@@ -709,20 +704,20 @@ int pmf_register_driver(struct device_no
 	if (handlers == NULL)
 		return -EINVAL;
 
-	DBG("pmf: registering driver for node %s\n", np->full_name);
+	pr_debug("pmf: registering driver for node %s\n", np->full_name);
 
 	spin_lock_irqsave(&pmf_lock, flags);
 	dev = pmf_find_device(np);
 	spin_unlock_irqrestore(&pmf_lock, flags);
 	if (dev != NULL) {
-		DBG("pmf: already there !\n");
+		pr_debug("pmf: already there !\n");
 		pmf_put_device(dev);
 		return -EBUSY;
 	}
 
 	dev = kzalloc(sizeof(struct pmf_device), GFP_KERNEL);
 	if (dev == NULL) {
-		DBG("pmf: no memory !\n");
+		pr_debug("pmf: no memory !\n");
 		return -ENOMEM;
 	}
 	kref_init(&dev->ref);
@@ -732,7 +727,7 @@ int pmf_register_driver(struct device_no
 
 	rc = pmf_add_functions(dev, driverdata);
 	if (rc == 0) {
-		DBG("pmf: no functions, disposing.. \n");
+		pr_debug("pmf: no functions, disposing.. \n");
 		of_node_put(np);
 		kfree(dev);
 		return -ENODEV;
@@ -782,12 +777,12 @@ void pmf_unregister_driver(struct device
 	struct pmf_device *dev;
 	unsigned long flags;
 
-	DBG("pmf: unregistering driver for node %s\n", np->full_name);
+	pr_debug("pmf: unregistering driver for node %s\n", np->full_name);
 
 	spin_lock_irqsave(&pmf_lock, flags);
 	dev = pmf_find_device(np);
 	if (dev == NULL) {
-		DBG("pmf: not such driver !\n");
+		pr_debug("pmf: not such driver !\n");
 		spin_unlock_irqrestore(&pmf_lock, flags);
 		return;
 	}
@@ -921,7 +916,7 @@ int pmf_call_one(struct pmf_function *fu
 	void *instdata = NULL;
 	int rc = 0;
 
-	DBG(" ** pmf_call_one(%s/%s) **\n", dev->node->full_name, func->name);
+	pr_debug(" ** pmf_call_one(%s/%s) **\n", dev->node->full_name, func->name);
 
 	if (dev->handlers->begin)
 		instdata = dev->handlers->begin(func, args);
Index: to-merge/arch/powerpc/platforms/powermac/smp.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/smp.c
+++ to-merge/arch/powerpc/platforms/powermac/smp.c
@@ -56,12 +56,6 @@
 
 #define DEBUG
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 extern void __secondary_start_pmac_0(void);
 extern int pmac_pfunc_base_install(void);
 
Index: to-merge/arch/powerpc/platforms/powermac/time.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/powermac/time.c
+++ to-merge/arch/powerpc/platforms/powermac/time.c
@@ -9,6 +9,9 @@
  * Copyright (C) 2003-2005 Benjamin Herrenschmidt.
  *
  */
+
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -35,14 +38,6 @@
 #include <asm/nvram.h>
 #include <asm/smu.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 /* Apparently the RTC stores seconds since 1 Jan 1904 */
 #define RTC_OFFSET	2082844800
 
Index: to-merge/arch/powerpc/platforms/pseries/firmware.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/firmware.c
+++ to-merge/arch/powerpc/platforms/pseries/firmware.c
@@ -26,12 +26,6 @@
 #include <asm/firmware.h>
 #include <asm/prom.h>
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 typedef struct {
     unsigned long val;
     char * name;
@@ -71,7 +65,7 @@ void __init fw_feature_init(void)
 	char *hypertas, *s;
 	int len, i;
 
-	DBG(" -> fw_feature_init()\n");
+	pr_debug(" -> fw_feature_init()\n");
 
 	dn = of_find_node_by_path("/rtas");
 	if (dn == NULL) {
@@ -99,5 +93,5 @@ void __init fw_feature_init(void)
 
 out:
 	of_node_put(dn);
-	DBG(" <- fw_feature_init()\n");
+	pr_debug(" <- fw_feature_init()\n");
 }
Index: to-merge/arch/powerpc/platforms/pseries/iommu.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/iommu.c
+++ to-merge/arch/powerpc/platforms/pseries/iommu.c
@@ -23,6 +23,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -47,8 +49,6 @@
 
 #include "plpar_wrappers.h"
 
-#define DBG(fmt...)
-
 static void tce_build_pSeries(struct iommu_table *tbl, long index, 
 			      long npages, unsigned long uaddr, 
 			      enum dma_data_direction direction)
@@ -334,7 +334,8 @@ static void iommu_bus_setup_pSeries(stru
 	struct pci_dn *pci;
 	int children;
 
-	DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self);
+	pr_debug("iommu_bus_setup_pSeries, bus %p, bus->self %p\n",
+			bus, bus->self);
 
 	dn = pci_bus_to_OF_node(bus);
 	pci = PCI_DN(dn);
@@ -365,7 +366,7 @@ static void iommu_bus_setup_pSeries(stru
 		if (get_property(tmp, "class-code", NULL))
 			children++;
 
-	DBG("Children: %d\n", children);
+	pr_debug("Children: %d\n", children);
 
 	/* Calculate amount of DMA window per slot. Each window must be
 	 * a power of two (due to pci_alloc_consistent requirements).
@@ -379,7 +380,7 @@ static void iommu_bus_setup_pSeries(stru
 
 		while (pci->phb->dma_window_size * children > 0x80000000ul)
 			pci->phb->dma_window_size >>= 1;
-		DBG("No ISA/IDE, window size is 0x%lx\n",
+		pr_debug("No ISA/IDE, window size is 0x%lx\n",
 			pci->phb->dma_window_size);
 		pci->phb->dma_window_base_cur = 0;
 
@@ -404,7 +405,7 @@ static void iommu_bus_setup_pSeries(stru
 	while (pci->phb->dma_window_size * children > 0x70000000ul)
 		pci->phb->dma_window_size >>= 1;
 
-	DBG("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size);
+	pr_debug("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size);
 
 }
 
@@ -416,7 +417,8 @@ static void iommu_bus_setup_pSeriesLP(st
 	struct pci_dn *ppci;
 	unsigned int *dma_window = NULL;
 
-	DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self);
+	pr_debug("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n",
+			bus, bus->self);
 
 	dn = pci_bus_to_OF_node(bus);
 
@@ -428,7 +430,8 @@ static void iommu_bus_setup_pSeriesLP(st
 	}
 
 	if (dma_window == NULL) {
-		DBG("iommu_bus_setup_pSeriesLP: bus %s seems to have no ibm,dma-window property\n", dn->full_name);
+		pr_debug("iommu_bus_setup_pSeriesLP: bus %s seems to have "
+				"no ibm,dma-window property\n", dn->full_name);
 		return;
 	}
 
@@ -458,7 +461,7 @@ static void iommu_dev_setup_pSeries(stru
 	struct device_node *dn, *mydn;
 	struct iommu_table *tbl;
 
-	DBG("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, pci_name(dev));
+	pr_debug("iommu_dev_setup_pSeries, dev %p (%s)\n", dev, pci_name(dev));
 
 	mydn = dn = pci_device_to_OF_node(dev);
 
@@ -467,7 +470,7 @@ static void iommu_dev_setup_pSeries(stru
 	 * the window sizes already.
 	 */
 	if (!dev->bus->self) {
-		DBG(" --> first child, no bridge. Allocating iommu table.\n");
+		pr_debug("first child, no bridge. Allocating iommu table.\n");
 		tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
 		iommu_table_setparms(PCI_DN(dn)->phb, dn, tbl);
 		PCI_DN(mydn)->iommu_table = iommu_init_table(tbl);
@@ -485,7 +488,8 @@ static void iommu_dev_setup_pSeries(stru
 	if (dn && PCI_DN(dn)) {
 		PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table;
 	} else {
-		DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, pci_name(dev));
+		pr_debug("iommu_dev_setup_pSeries, dev %p (%s) has no "
+				"iommu table\n", dev, pci_name(dev));
 	}
 }
 
@@ -519,7 +523,8 @@ static void iommu_dev_setup_pSeriesLP(st
 	int *dma_window = NULL;
 	struct pci_dn *pci;
 
-	DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev));
+	pr_debug("iommu_dev_setup_pSeriesLP, dev %p (%s)\n",
+			dev, pci_name(dev));
 
 	/* dev setup for LPAR is a little tricky, since the device tree might
 	 * contain the dma-window properties per-device and not neccesarily
@@ -541,11 +546,11 @@ static void iommu_dev_setup_pSeriesLP(st
 	 * slots on POWER4 machines.
 	 */
 	if (dma_window == NULL || pdn->parent == NULL) {
-		DBG("No dma window for device, linking to parent\n");
+		pr_debug("No dma window for device, linking to parent\n");
 		PCI_DN(dn)->iommu_table = PCI_DN(pdn)->iommu_table;
 		return;
 	} else {
-		DBG("Found DMA window, allocating table\n");
+		pr_debug("Found DMA window, allocating table\n");
 	}
 
 	pci = PCI_DN(pdn);
Index: to-merge/arch/powerpc/platforms/pseries/lpar.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/lpar.c
+++ to-merge/arch/powerpc/platforms/pseries/lpar.c
@@ -19,7 +19,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#undef DEBUG_LOW
+#undef DEBUG	/* warning: leads to _lots_ of output */
 
 #include <linux/config.h>
 #include <linux/kernel.h>
@@ -43,12 +43,6 @@
 
 #include "plpar_wrappers.h"
 
-#ifdef DEBUG_LOW
-#define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0)
-#else
-#define DBG_LOW(fmt...) do { } while(0)
-#endif
-
 /* in pSeries_hvCall.S */
 EXPORT_SYMBOL(plpar_hcall);
 EXPORT_SYMBOL(plpar_hcall_4out);
@@ -281,7 +275,7 @@ long pSeries_lpar_hpte_insert(unsigned l
 	unsigned long dummy0, dummy1;
 
 	if (!(vflags & HPTE_V_BOLTED))
-		DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
+		pr_debug("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
 			"rflags=%lx, vflags=%lx, psize=%d)\n",
 		hpte_group, va, pa, rflags, vflags, psize);
 
@@ -289,7 +283,7 @@ long pSeries_lpar_hpte_insert(unsigned l
 	hpte_r = hpte_encode_r(pa, psize) | rflags;
 
 	if (!(vflags & HPTE_V_BOLTED))
-		DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
+		pr_debug(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
 
 	/* Now fill in the actual HPTE */
 	/* Set CEC cookie to 0         */
@@ -307,7 +301,7 @@ long pSeries_lpar_hpte_insert(unsigned l
 			      hpte_r, &slot, &dummy0, &dummy1);
 	if (unlikely(lpar_rc == H_PTEG_FULL)) {
 		if (!(vflags & HPTE_V_BOLTED))
-			DBG_LOW(" full\n");
+			pr_debug(" full\n");
 		return -1;
 	}
 
@@ -318,11 +312,11 @@ long pSeries_lpar_hpte_insert(unsigned l
 	 */
 	if (unlikely(lpar_rc != H_SUCCESS)) {
 		if (!(vflags & HPTE_V_BOLTED))
-			DBG_LOW(" lpar err %d\n", lpar_rc);
+			pr_debug(" lpar err %d\n", lpar_rc);
 		return -2;
 	}
 	if (!(vflags & HPTE_V_BOLTED))
-		DBG_LOW(" -> slot: %d\n", slot & 7);
+		pr_debug(" -> slot: %d\n", slot & 7);
 
 	/* Because of iSeries, we have to pass down the secondary
 	 * bucket bit here as well
@@ -387,17 +381,17 @@ static long pSeries_lpar_hpte_updatepp(u
 
 	want_v = hpte_encode_v(va, psize);
 
-	DBG_LOW("    update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ",
+	pr_debug("    update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ",
 		want_v & HPTE_V_AVPN, slot, flags, psize);
 
 	lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
 
 	if (lpar_rc == H_NOT_FOUND) {
-		DBG_LOW("not found !\n");
+		pr_debug("not found !\n");
 		return -1;
 	}
 
-	DBG_LOW("ok\n");
+	pr_debug("ok\n");
 
 	BUG_ON(lpar_rc != H_SUCCESS);
 
@@ -479,7 +473,7 @@ static void pSeries_lpar_hpte_invalidate
 	unsigned long lpar_rc;
 	unsigned long dummy1, dummy2;
 
-	DBG_LOW("    inval : slot=%lx, va=%016lx, psize: %d, local: %d",
+	pr_debug("    inval : slot=%lx, va=%016lx, psize: %d, local: %d",
 		slot, va, psize, local);
 
 	want_v = hpte_encode_v(va, psize);
Index: to-merge/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/setup.c
+++ to-merge/arch/powerpc/platforms/pseries/setup.c
@@ -71,12 +71,6 @@
 #include "ras.h"
 #include "firmware.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 extern void find_udbg_vterm(void);
 
 int fwnmi_active;  /* TRUE if an FWNMI handler is present */
@@ -319,7 +313,7 @@ static int pseries_set_xdabr(unsigned lo
  */
 static void __init pSeries_init_early(void)
 {
-	DBG(" -> pSeries_init_early()\n");
+	pr_debug(" -> pSeries_init_early()\n");
 
 	fw_feature_init();
 	
@@ -340,7 +334,7 @@ static void __init pSeries_init_early(vo
 
 	pSeries_discover_pic();
 
-	DBG(" <- pSeries_init_early()\n");
+	pr_debug(" <- pSeries_init_early()\n");
 }
 
 
@@ -396,12 +390,12 @@ static int __init pSeries_probe(void)
  	if (strcmp(dtype, "chrp"))
 		return 0;
 
-	DBG("pSeries detected, looking for LPAR capability...\n");
+	pr_debug("pSeries detected, looking for LPAR capability...\n");
 
 	/* Now try to figure out if we are running on LPAR */
 	of_scan_flat_dt(pSeries_probe_hypertas, NULL);
 
-	DBG("Machine is%s LPAR !\n",
+	pr_debug("Machine is%s LPAR !\n",
 	    (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
 
 	return 1;
Index: to-merge/arch/powerpc/platforms/pseries/smp.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/pseries/smp.c
+++ to-merge/arch/powerpc/platforms/pseries/smp.c
@@ -50,13 +50,6 @@
 
 #include "plpar_wrappers.h"
 
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /*
  * The primary thread of each non-boot processor is recorded here before
  * smp init.
@@ -421,7 +414,7 @@ void __init smp_init_pSeries(void)
 {
 	int i;
 
-	DBG(" -> smp_init_pSeries()\n");
+	pr_debug(" -> smp_init_pSeries()\n");
 
 	switch (ppc64_interrupt_controller) {
 #ifdef CONFIG_MPIC
@@ -469,6 +462,6 @@ void __init smp_init_pSeries(void)
 		smp_ops->take_timebase = pSeries_take_timebase;
 	}
 
-	DBG(" <- smp_init_pSeries()\n");
+	pr_debug(" <- smp_init_pSeries()\n");
 }
 

^ permalink raw reply

* [RFC/PATCH 2/4] powerpc: Convert DBG to pr_debug in arch/powerpc/kernel
From: Michael Ellerman @ 2006-05-01  0:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1146444821.660434.518701003988.qpush@concordia>

Convert DBG to pr_debug in arch/powerpc/kernel.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/crash.c         |    6 ---
 arch/powerpc/kernel/crash_dump.c    |   12 +------
 arch/powerpc/kernel/iommu.c         |   22 ++++++-------
 arch/powerpc/kernel/legacy_serial.c |   58 ++++++++++++++++--------------------
 arch/powerpc/kernel/pci_32.c        |   40 ++++++++++--------------
 arch/powerpc/kernel/pci_64.c        |   43 +++++++++++---------------
 arch/powerpc/kernel/prom.c          |   53 ++++++++++++++------------------
 arch/powerpc/kernel/prom_parse.c    |   28 ++++++-----------
 arch/powerpc/kernel/setup-common.c  |   21 ++++---------
 arch/powerpc/kernel/setup_32.c      |    4 +-
 arch/powerpc/kernel/setup_64.c      |   28 ++++++-----------
 arch/powerpc/kernel/smp.c           |   15 ++-------
 arch/powerpc/kernel/vdso.c          |   20 ++++--------
 13 files changed, 140 insertions(+), 210 deletions(-)

Index: to-merge/arch/powerpc/kernel/crash.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/crash.c
+++ to-merge/arch/powerpc/kernel/crash.c
@@ -31,13 +31,7 @@
 #include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/smp.h>
-
-#ifdef DEBUG
 #include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
 
 /* This keeps a track of which one is crashing cpu. */
 int crashing_cpu = -1;
Index: to-merge/arch/powerpc/kernel/crash_dump.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/crash_dump.c
+++ to-merge/arch/powerpc/kernel/crash_dump.c
@@ -11,6 +11,7 @@
 
 #undef DEBUG
 
+#include <linux/kernel.h>
 #include <linux/crash_dump.h>
 #include <linux/bootmem.h>
 #include <asm/kdump.h>
@@ -18,13 +19,6 @@
 #include <asm/firmware.h>
 #include <asm/uaccess.h>
 
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 static void __init create_trampoline(unsigned long addr)
 {
 	/* The maximum range of a single instruction branch, is the current
@@ -43,7 +37,7 @@ void __init kdump_setup(void)
 {
 	unsigned long i;
 
-	DBG(" -> kdump_setup()\n");
+	pr_debug(" -> kdump_setup()\n");
 
 	for (i = KDUMP_TRAMPOLINE_START; i < KDUMP_TRAMPOLINE_END; i += 8) {
 		create_trampoline(i);
@@ -52,7 +46,7 @@ void __init kdump_setup(void)
 	create_trampoline(__pa(system_reset_fwnmi) - PHYSICAL_START);
 	create_trampoline(__pa(machine_check_fwnmi) - PHYSICAL_START);
 
-	DBG(" <- kdump_setup()\n");
+	pr_debug(" <- kdump_setup()\n");
 }
 
 #ifdef CONFIG_PROC_VMCORE
Index: to-merge/arch/powerpc/kernel/iommu.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/iommu.c
+++ to-merge/arch/powerpc/kernel/iommu.c
@@ -22,7 +22,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#undef DEBUG
 
+#include <linux/kernel.h>
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/types.h>
@@ -39,8 +41,6 @@
 #include <asm/pci-bridge.h>
 #include <asm/machdep.h>
 
-#define DBG(...)
-
 #ifdef CONFIG_IOMMU_VMERGE
 static int novmerge = 0;
 #else
@@ -270,7 +270,7 @@ int iommu_map_sg(struct device *dev, str
 	/* Init first segment length for backout at failure */
 	outs->dma_length = 0;
 
-	DBG("mapping %d elements:\n", nelems);
+	pr_debug("mapping %d elements:\n", nelems);
 
 	spin_lock_irqsave(&(tbl->it_lock), flags);
 
@@ -289,7 +289,7 @@ int iommu_map_sg(struct device *dev, str
 		npages >>= PAGE_SHIFT;
 		entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0);
 
-		DBG("  - vaddr: %lx, size: %lx\n", vaddr, slen);
+		pr_debug("  - vaddr: %lx, size: %lx\n", vaddr, slen);
 
 		/* Handle failure */
 		if (unlikely(entry == DMA_ERROR_CODE)) {
@@ -304,7 +304,7 @@ int iommu_map_sg(struct device *dev, str
 		dma_addr = entry << PAGE_SHIFT;
 		dma_addr |= s->offset;
 
-		DBG("  - %lx pages, entry: %lx, dma_addr: %lx\n",
+		pr_debug("  - %lx pages, entry: %lx, dma_addr: %lx\n",
 			    npages, entry, dma_addr);
 
 		/* Insert into HW table */
@@ -312,7 +312,7 @@ int iommu_map_sg(struct device *dev, str
 
 		/* If we are in an open segment, try merging */
 		if (segstart != s) {
-			DBG("  - trying merge...\n");
+			pr_debug("  - trying merge...\n");
 			/* We cannot merge if:
 			 * - allocated dma_addr isn't contiguous to previous allocation
 			 */
@@ -320,16 +320,16 @@ int iommu_map_sg(struct device *dev, str
 				/* Can't merge: create a new segment */
 				segstart = s;
 				outcount++; outs++;
-				DBG("    can't merge, new segment.\n");
+				pr_debug("    can't merge, new segment.\n");
 			} else {
 				outs->dma_length += s->length;
-				DBG("    merged, new len: %lx\n", outs->dma_length);
+				pr_debug("    merged, new len: %lx\n", outs->dma_length);
 			}
 		}
 
 		if (segstart == s) {
 			/* This is a new segment, fill entries */
-			DBG("  - filling new segment.\n");
+			pr_debug("  - filling new segment.\n");
 			outs->dma_address = dma_addr;
 			outs->dma_length = slen;
 		}
@@ -337,7 +337,7 @@ int iommu_map_sg(struct device *dev, str
 		/* Calculate next page pointer for contiguous check */
 		dma_next = dma_addr + slen;
 
-		DBG("  - dma next is: %lx\n", dma_next);
+		pr_debug("  - dma next is: %lx\n", dma_next);
 	}
 
 	/* Flush/invalidate TLB caches if necessary */
@@ -346,7 +346,7 @@ int iommu_map_sg(struct device *dev, str
 
 	spin_unlock_irqrestore(&(tbl->it_lock), flags);
 
-	DBG("mapped %d elements:\n", outcount);
+	pr_debug("mapped %d elements:\n", outcount);
 
 	/* For the sake of iommu_unmap_sg, we clear out the length in the
 	 * next entry of the sglist if we didn't fill the list completely
Index: to-merge/arch/powerpc/kernel/legacy_serial.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/legacy_serial.c
+++ to-merge/arch/powerpc/kernel/legacy_serial.c
@@ -1,3 +1,5 @@
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/serial.h>
@@ -13,14 +15,6 @@
 #include <asm/pci-bridge.h>
 #include <asm/ppc-pci.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(fmt...) do { printk(fmt); } while(0)
-#else
-#define DBG(fmt...) do { } while(0)
-#endif
-
 #define MAX_LEGACY_SERIAL_PORTS	8
 
 static struct plat_serial8250_port
@@ -249,7 +243,7 @@ static void __init setup_legacy_serial_c
 		return;
 	if (info->speed == 0)
 		info->speed = udbg_probe_uart_speed(addr, info->clock);
-	DBG("default console speed = %d\n", info->speed);
+	pr_debug("default console speed = %d\n", info->speed);
 	udbg_init_uart(addr, info->speed, info->clock);
 }
 
@@ -268,16 +262,16 @@ void __init find_legacy_serial_ports(voi
 	char *path;
 	int index;
 
-	DBG(" -> find_legacy_serial_port()\n");
+	pr_debug(" -> find_legacy_serial_port()\n");
 
 	/* Now find out if one of these is out firmware console */
 	path = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
 	if (path != NULL) {
 		stdout = of_find_node_by_path(path);
 		if (stdout)
-			DBG("stdout is %s\n", stdout->full_name);
+			pr_debug("stdout is %s\n", stdout->full_name);
 	} else {
-		DBG(" no linux,stdout-path !\n");
+		pr_debug(" no linux,stdout-path !\n");
 	}
 
 	/* First fill our array with SOC ports */
@@ -334,10 +328,10 @@ void __init find_legacy_serial_ports(voi
 	}
 #endif
 
-	DBG("legacy_serial_console = %d\n", legacy_serial_console);
+	pr_debug("legacy_serial_console = %d\n", legacy_serial_console);
 	if (legacy_serial_console >= 0)
 		setup_legacy_serial_console(legacy_serial_console);
-	DBG(" <- find_legacy_serial_port()\n");
+	pr_debug(" <- find_legacy_serial_port()\n");
 }
 
 static struct platform_device serial_device = {
@@ -352,12 +346,12 @@ static void __init fixup_port_irq(int in
 				  struct device_node *np,
 				  struct plat_serial8250_port *port)
 {
-	DBG("fixup_port_irq(%d)\n", index);
+	pr_debug("fixup_port_irq(%d)\n", index);
 
 	/* Check for interrupts in that node */
 	if (np->n_intrs > 0) {
 		port->irq = np->intrs[0].line;
-		DBG(" port %d (%s), irq=%d\n",
+		pr_debug(" port %d (%s), irq=%d\n",
 		    index, np->full_name, port->irq);
 		return;
 	}
@@ -369,7 +363,7 @@ static void __init fixup_port_irq(int in
 
 	if (np->n_intrs > 0) {
 		port->irq = np->intrs[0].line;
-		DBG(" port %d (%s), irq=%d\n",
+		pr_debug(" port %d (%s), irq=%d\n",
 		    index, np->full_name, port->irq);
 	}
 	of_node_put(np);
@@ -382,7 +376,7 @@ static void __init fixup_port_pio(int in
 #ifdef CONFIG_PCI
 	struct pci_controller *hose;
 
-	DBG("fixup_port_pio(%d)\n", index);
+	pr_debug("fixup_port_pio(%d)\n", index);
 
 	hose = pci_find_hose_for_OF_device(np);
 	if (hose) {
@@ -392,7 +386,7 @@ static void __init fixup_port_pio(int in
 #else
 			isa_io_base;
 #endif
-		DBG("port %d, IO %lx -> %lx\n",
+		pr_debug("port %d, IO %lx -> %lx\n",
 		    index, port->iobase, port->iobase + offset);
 		port->iobase += offset;
 	}
@@ -403,7 +397,7 @@ static void __init fixup_port_mmio(int i
 				   struct device_node *np,
 				   struct plat_serial8250_port *port)
 {
-	DBG("fixup_port_mmio(%d)\n", index);
+	pr_debug("fixup_port_mmio(%d)\n", index);
 
 	port->membase = ioremap(port->mapbase, 0x100);
 }
@@ -432,7 +426,7 @@ static int __init serial_dev_init(void)
 	 * Before we register the platfrom serial devices, we need
 	 * to fixup their interrutps and their IO ports.
 	 */
-	DBG("Fixing serial ports interrupts and IO ports ...\n");
+	pr_debug("Fixing serial ports interrupts and IO ports ...\n");
 
 	for (i = 0; i < legacy_serial_count; i++) {
 		struct plat_serial8250_port *port = &legacy_serial_ports[i];
@@ -446,7 +440,7 @@ static int __init serial_dev_init(void)
 			fixup_port_mmio(i, np, port);
 	}
 
-	DBG("Registering platform serial ports\n");
+	pr_debug("Registering platform serial ports\n");
 
 	return platform_device_register(&serial_device);
 }
@@ -468,40 +462,40 @@ static int __init check_legacy_serial_co
 	char *name;
 	u32 *spd;
 
-	DBG(" -> check_legacy_serial_console()\n");
+	pr_debug(" -> check_legacy_serial_console()\n");
 
 	/* The user has requested a console so this is already set up. */
 	if (strstr(saved_command_line, "console=")) {
-		DBG(" console was specified !\n");
+		pr_debug(" console was specified !\n");
 		return -EBUSY;
 	}
 
 	if (!of_chosen) {
-		DBG(" of_chosen is NULL !\n");
+		pr_debug(" of_chosen is NULL !\n");
 		return -ENODEV;
 	}
 
 	if (legacy_serial_console < 0) {
-		DBG(" legacy_serial_console not found !\n");
+		pr_debug(" legacy_serial_console not found !\n");
 		return -ENODEV;
 	}
 	/* We are getting a weird phandle from OF ... */
 	/* ... So use the full path instead */
 	name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
 	if (name == NULL) {
-		DBG(" no linux,stdout-path !\n");
+		pr_debug(" no linux,stdout-path !\n");
 		return -ENODEV;
 	}
 	prom_stdout = of_find_node_by_path(name);
 	if (!prom_stdout) {
-		DBG(" can't find stdout package %s !\n", name);
+		pr_debug(" can't find stdout package %s !\n", name);
 		return -ENODEV;
 	}
-	DBG("stdout is %s\n", prom_stdout->full_name);
+	pr_debug("stdout is %s\n", prom_stdout->full_name);
 
 	name = (char *)get_property(prom_stdout, "name", NULL);
 	if (!name) {
-		DBG(" stdout package has no name !\n");
+		pr_debug(" stdout package has no name !\n");
 		goto not_found;
 	}
 	spd = (u32 *)get_property(prom_stdout, "current-speed", NULL);
@@ -535,7 +529,7 @@ static int __init check_legacy_serial_co
 		goto not_found;
 	of_node_put(prom_stdout);
 
-	DBG("Found serial console at ttyS%d\n", offset);
+	pr_debug("Found serial console at ttyS%d\n", offset);
 
 	if (speed) {
 		static char __initdata opt[16];
@@ -545,7 +539,7 @@ static int __init check_legacy_serial_co
 		return add_preferred_console("ttyS", offset, NULL);
 
  not_found:
-	DBG("No preferred console found !\n");
+	pr_debug("No preferred console found !\n");
 	of_node_put(prom_stdout);
 	return -ENODEV;
 }
Index: to-merge/arch/powerpc/kernel/pci_32.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/pci_32.c
+++ to-merge/arch/powerpc/kernel/pci_32.c
@@ -2,6 +2,8 @@
  * Common pmac/prep/chrp pci routines. -- Cort
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -23,14 +25,6 @@
 #include <asm/uaccess.h>
 #include <asm/machdep.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 unsigned long isa_io_base     = 0;
 unsigned long isa_mem_base    = 0;
 unsigned long pci_dram_offset = 0;
@@ -99,7 +93,7 @@ pcibios_fixup_resources(struct pci_dev *
 		if (!res->flags)
 			continue;
 		if (res->end == 0xffffffff) {
-			DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
+			pr_debug("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
 			    pci_name(dev), i, res->start, res->end);
 			res->end -= res->start;
 			res->start = 0;
@@ -255,7 +249,7 @@ pcibios_allocate_bus_resources(struct li
 				}
 			}
 
-			DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n",
+			pr_debug("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n",
 			    res->start, res->end, res->flags, pr);
 			if (pr) {
 				if (request_resource(pr, res) == 0)
@@ -306,7 +300,7 @@ reparent_resources(struct resource *pare
 	*pp = NULL;
 	for (p = res->child; p != NULL; p = p->sibling) {
 		p->parent = res;
-		DBG(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n",
+		pr_debug(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n",
 		    p->name, p->start, p->end, res->name);
 	}
 	return 0;
@@ -362,7 +356,7 @@ pci_relocate_bridge_resource(struct pci_
 		try = conflict->start - 1;
 	}
 	if (request_resource(pr, res)) {
-		DBG(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n",
+		pr_debug(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n",
 		    res->start, res->end);
 		return -1;		/* "can't happen" */
 	}
@@ -469,7 +463,7 @@ update_bridge_base(struct pci_bus *bus, 
 		pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
 
 	} else {
-		DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n",
+		pr_debug(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n",
 		    pci_name(dev), i, res->flags);
 	}
 	pci_write_config_word(dev, PCI_COMMAND, cmd);
@@ -479,14 +473,14 @@ static inline void alloc_resource(struct
 {
 	struct resource *pr, *r = &dev->resource[idx];
 
-	DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n",
+	pr_debug("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n",
 	    pci_name(dev), idx, r->start, r->end, r->flags);
 	pr = pci_find_parent_resource(dev, r);
 	if (!pr || request_resource(pr, r) < 0) {
 		printk(KERN_ERR "PCI: Cannot allocate resource region %d"
 		       " of device %s\n", idx, pci_name(dev));
 		if (pr)
-			DBG("PCI:  parent is %p: %08lx-%08lx (f=%lx)\n",
+			pr_debug("PCI:  parent is %p: %08lx-%08lx (f=%lx)\n",
 			    pr, pr->start, pr->end, pr->flags);
 		/* We'll assign a new address later */
 		r->flags |= IORESOURCE_UNSET;
@@ -524,7 +518,7 @@ pcibios_allocate_resources(int pass)
 		if (r->flags & IORESOURCE_ROM_ENABLE) {
 			/* Turn the ROM off, leave the resource region, but keep it unregistered. */
 			u32 reg;
-			DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
+			pr_debug("PCI: Switching off ROM of %s\n", pci_name(dev));
 			r->flags &= ~IORESOURCE_ROM_ENABLE;
 			pci_read_config_dword(dev, dev->rom_base_reg, &reg);
 			pci_write_config_dword(dev, dev->rom_base_reg,
@@ -956,7 +950,7 @@ pci_process_bridge_OF_ranges(struct pci_
 			res = &hose->io_resource;
 			res->flags = IORESOURCE_IO;
 			res->start = ranges[2];
-			DBG("PCI: IO 0x%lx -> 0x%lx\n",
+			pr_debug("PCI: IO 0x%lx -> 0x%lx\n",
 				    res->start, res->start + size - 1);
 			break;
 		case 2:		/* memory space */
@@ -978,7 +972,7 @@ pci_process_bridge_OF_ranges(struct pci_
 				if(ranges[0] & 0x40000000)
 					res->flags |= IORESOURCE_PREFETCH;
 				res->start = ranges[na+2];
-				DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
+				pr_debug("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
 					    res->start, res->start + size - 1);
 			}
 			break;
@@ -1071,10 +1065,10 @@ do_update_p2p_io_resource(struct pci_bus
 		return;
  	res = *(bus->resource[0]);
 
-	DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
+	pr_debug("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
 	res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
 	res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
-	DBG("  IO window: %08lx-%08lx\n", res.start, res.end);
+	pr_debug("  IO window: %08lx-%08lx\n", res.start, res.end);
 
 	/* Set up the top and bottom of the PCI I/O segment for this bus. */
 	pci_read_config_dword(bridge, PCI_IO_BASE, &l);
@@ -1222,13 +1216,13 @@ do_fixup_p2p_level(struct pci_bus *bus)
 					continue;
 				if ((r->flags & IORESOURCE_IO) == 0)
 					continue;
-				DBG("Trying to allocate from %08lx, size %08lx from parent"
+				pr_debug("Trying to allocate from %08lx, size %08lx from parent"
 				    " res %d: %08lx -> %08lx\n",
 					res->start, res->end, i, r->start, r->end);
 			
 				if (allocate_resource(r, res, res->end + 1, res->start, max,
 				    res->end + 1, NULL, NULL) < 0) {
-					DBG("Failed !\n");
+					pr_debug("Failed !\n");
 					continue;
 				}
 				do_update_p2p_io_resource(b, found_vga);
@@ -1624,7 +1618,7 @@ pgprot_t pci_phys_mem_access_prot(struct
 		pci_dev_put(pdev);
 	}
 
-	DBG("non-PCI map for %lx, prot: %lx\n", offset, prot);
+	pr_debug("non-PCI map for %lx, prot: %lx\n", offset, prot);
 
 	return __pgprot(prot);
 }
Index: to-merge/arch/powerpc/kernel/pci_64.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/pci_64.c
+++ to-merge/arch/powerpc/kernel/pci_64.c
@@ -32,13 +32,6 @@
 #include <asm/machdep.h>
 #include <asm/ppc-pci.h>
 
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 unsigned long pci_probe_only = 1;
 int pci_assign_all_buses = 0;
 
@@ -320,7 +313,7 @@ static void pci_parse_of_addrs(struct de
 	addrs = (u32 *) get_property(node, "assigned-addresses", &proplen);
 	if (!addrs)
 		return;
-	DBG("    parse addresses (%d bytes) @ %p\n", proplen, addrs);
+	pr_debug("    parse addresses (%d bytes) @ %p\n", proplen, addrs);
 	for (; proplen >= 20; proplen -= 20, addrs += 5) {
 		flags = pci_parse_of_flags(addrs[0]);
 		if (!flags)
@@ -330,7 +323,7 @@ static void pci_parse_of_addrs(struct de
 		if (!size)
 			continue;
 		i = addrs[0] & 0xff;
-		DBG("  base: %llx, size: %llx, i: %x\n",
+		pr_debug("  base: %llx, size: %llx, i: %x\n",
 		    (unsigned long long)base, (unsigned long long)size, i);
 
 		if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
@@ -363,7 +356,7 @@ struct pci_dev *of_create_pci_dev(struct
 	if (type == NULL)
 		type = "";
 
-	DBG("    create device, devfn: %x, type: %s\n", devfn, type);
+	pr_debug("    create device, devfn: %x, type: %s\n", devfn, type);
 
 	memset(dev, 0, sizeof(struct pci_dev));
 	dev->bus = bus;
@@ -384,7 +377,7 @@ struct pci_dev *of_create_pci_dev(struct
 		dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
 	dev->class = get_int_prop(node, "class-code", 0);
 
-	DBG("    class: 0x%x\n", dev->class);
+	pr_debug("    class: 0x%x\n", dev->class);
 
 	dev->current_state = 4;		/* unknown power state */
 
@@ -407,7 +400,7 @@ struct pci_dev *of_create_pci_dev(struct
 
 	pci_parse_of_addrs(node, dev);
 
-	DBG("    adding to system ...\n");
+	pr_debug("    adding to system ...\n");
 
 	pci_device_add(dev, bus);
 
@@ -425,10 +418,10 @@ void __devinit of_scan_bus(struct device
 	int reglen, devfn;
 	struct pci_dev *dev;
 
-	DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
+	pr_debug("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
 
 	while ((child = of_get_next_child(node, child)) != NULL) {
-		DBG("  * %s\n", child->full_name);
+		pr_debug("  * %s\n", child->full_name);
 		reg = (u32 *) get_property(child, "reg", &reglen);
 		if (reg == NULL || reglen < 20)
 			continue;
@@ -438,7 +431,7 @@ void __devinit of_scan_bus(struct device
 		dev = of_create_pci_dev(child, bus, devfn);
 		if (!dev)
 			continue;
-		DBG("dev header type: %x\n", dev->hdr_type);
+		pr_debug("dev header type: %x\n", dev->hdr_type);
 
 		if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
 		    dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
@@ -459,7 +452,7 @@ void __devinit of_scan_pci_bridge(struct
 	unsigned int flags;
 	u64 size;
 
-	DBG("of_scan_pci_bridge(%s)\n", node->full_name);
+	pr_debug("of_scan_pci_bridge(%s)\n", node->full_name);
 
 	/* parse bus-range property */
 	busrange = (u32 *) get_property(node, "bus-range", &len);
@@ -524,12 +517,12 @@ void __devinit of_scan_pci_bridge(struct
 	}
 	sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
 		bus->number);
-	DBG("    bus name: %s\n", bus->name);
+	pr_debug("    bus name: %s\n", bus->name);
 
 	mode = PCI_PROBE_NORMAL;
 	if (ppc_md.pci_probe_mode)
 		mode = ppc_md.pci_probe_mode(bus);
-	DBG("    probe mode: %d\n", mode);
+	pr_debug("    probe mode: %d\n", mode);
 
 	if (mode == PCI_PROBE_DEVTREE)
 		of_scan_bus(node, bus);
@@ -546,7 +539,7 @@ void __devinit scan_phb(struct pci_contr
 	int i, mode;
 	struct resource *res;
 
-	DBG("Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
+	pr_debug("Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
 
 	bus = pci_create_bus(NULL, hose->first_busno, hose->ops, node);
 	if (bus == NULL) {
@@ -574,7 +567,7 @@ void __devinit scan_phb(struct pci_contr
 #ifdef CONFIG_PPC_MULTIPLATFORM
 	if (node && ppc_md.pci_probe_mode)
 		mode = ppc_md.pci_probe_mode(bus);
-	DBG("    probe mode: %d\n", mode);
+	pr_debug("    probe mode: %d\n", mode);
 	if (mode == PCI_PROBE_DEVTREE) {
 		bus->subordinate = hose->last_busno;
 		of_scan_bus(node, bus);
@@ -847,7 +840,7 @@ pgprot_t pci_phys_mem_access_prot(struct
 		pci_dev_put(pdev);
 	}
 
-	DBG("non-PCI map for %lx, prot: %lx\n", offset, prot);
+	pr_debug("non-PCI map for %lx, prot: %lx\n", offset, prot);
 
 	return __pgprot(prot);
 }
@@ -1047,7 +1040,7 @@ void __devinit pci_process_bridge_OF_ran
 			res = &hose->io_resource;
 			res->flags = IORESOURCE_IO;
 			res->start = pci_addr;
-			DBG("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number,
+			pr_debug("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number,
 				    res->start, res->start + size - 1);
 			break;
 		case 2:		/* memory space */
@@ -1061,7 +1054,7 @@ void __devinit pci_process_bridge_OF_ran
 				res = &hose->mem_resources[memno];
 				res->flags = IORESOURCE_MEM;
 				res->start = cpu_phys_addr;
-				DBG("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number,
+				pr_debug("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number,
 					    res->start, res->start + size - 1);
 			}
 			break;
@@ -1084,7 +1077,7 @@ void __init pci_setup_phb_io(struct pci_
 	struct device_node *isa_dn;
 
 	hose->io_base_virt = reserve_phb_iospace(size);
-	DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
+	pr_debug("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
 		hose->global_number, hose->io_base_phys,
 		(unsigned long) hose->io_base_virt);
 
@@ -1114,7 +1107,7 @@ void __devinit pci_setup_phb_io_dynamic(
 
 	hose->io_base_virt = __ioremap(hose->io_base_phys, size,
 					_PAGE_NO_CACHE | _PAGE_GUARDED);
-	DBG("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
+	pr_debug("phb%d io_base_phys 0x%lx io_base_virt 0x%lx\n",
 		hose->global_number, hose->io_base_phys,
 		(unsigned long) hose->io_base_virt);
 
Index: to-merge/arch/powerpc/kernel/prom.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/prom.c
+++ to-merge/arch/powerpc/kernel/prom.c
@@ -51,13 +51,6 @@
 #include <asm/pSeries_reconfig.h>
 #include <asm/pci-bridge.h>
 
-#ifdef DEBUG
-#define DBG(fmt...) printk(KERN_ERR fmt)
-#else
-#define DBG(fmt...)
-#endif
-
-
 static int __initdata dt_root_addr_cells;
 static int __initdata dt_root_size_cells;
 
@@ -470,7 +463,7 @@ void __init finish_device_tree(void)
 {
 	unsigned long start, end, size = 0;
 
-	DBG(" -> finish_device_tree\n");
+	pr_debug(" -> finish_device_tree\n");
 
 #ifdef CONFIG_PPC64
 	/* Initialize virtual IRQ map */
@@ -500,7 +493,7 @@ void __init finish_device_tree(void)
 	finish_node(allnodes, &end, 0);
 	BUG_ON(end != start + size);
 
-	DBG(" <- finish_device_tree\n");
+	pr_debug(" <- finish_device_tree\n");
 }
 
 static inline char *find_flat_dt_string(u32 offset)
@@ -716,7 +709,7 @@ static unsigned long __init unflatten_dt
 				strcpy(p, dad->full_name);
 #ifdef DEBUG
 				if ((strlen(p) + l + 1) != allocl) {
-					DBG("%s: p: %d, l: %d, a: %d\n",
+					pr_debug("%s: p: %d, l: %d, a: %d\n",
 					    pathp, (int)strlen(p), l, allocl);
 				}
 #endif
@@ -811,7 +804,7 @@ static unsigned long __init unflatten_dt
 			prev_pp = &pp->next;
 			memcpy(pp->value, ps, sz - 1);
 			((char *)pp->value)[sz - 1] = 0;
-			DBG("fixed up name for %s -> %s\n", pathp, pp->value);
+			pr_debug("fixed up name for %s -> %s\n", pathp, pp->value);
 		}
 	}
 	if (allnextpp) {
@@ -848,7 +841,7 @@ void __init unflatten_device_tree(void)
 	unsigned long start, mem, size;
 	struct device_node **allnextp = &allnodes;
 
-	DBG(" -> unflatten_device_tree()\n");
+	pr_debug(" -> unflatten_device_tree()\n");
 
 	/* First pass, scan for size */
 	start = ((unsigned long)initial_boot_params) +
@@ -856,7 +849,7 @@ void __init unflatten_device_tree(void)
 	size = unflatten_dt_node(0, &start, NULL, NULL, 0);
 	size = (size | 3) + 1;
 
-	DBG("  size is %lx, allocating...\n", size);
+	pr_debug("  size is %lx, allocating...\n", size);
 
 	/* Allocate memory for the expanded device tree */
 	mem = lmb_alloc(size + 4, __alignof__(struct device_node));
@@ -864,7 +857,7 @@ void __init unflatten_device_tree(void)
 
 	((u32 *)mem)[size / 4] = 0xdeadbeef;
 
-	DBG("  unflattening %lx...\n", mem);
+	pr_debug("  unflattening %lx...\n", mem);
 
 	/* Second pass, do actual unflattening */
 	start = ((unsigned long)initial_boot_params) +
@@ -882,7 +875,7 @@ void __init unflatten_device_tree(void)
 	if (of_chosen == NULL)
 		of_chosen = of_find_node_by_path("/chosen@0");
 
-	DBG(" <- unflatten_device_tree()\n");
+	pr_debug(" <- unflatten_device_tree()\n");
 }
 
 static int __init early_init_dt_scan_cpus(unsigned long node,
@@ -947,7 +940,7 @@ static int __init early_init_dt_scan_cpu
 	}
 
 	if (found) {
-		DBG("boot cpu: logical %d physical %d\n", logical_cpuid,
+		pr_debug("boot cpu: logical %d physical %d\n", logical_cpuid,
 			intserv[i]);
 		boot_cpuid = logical_cpuid;
 		set_hard_smp_processor_id(boot_cpuid, intserv[i]);
@@ -986,7 +979,7 @@ static int __init early_init_dt_scan_cho
 	unsigned long l;
 	char *p;
 
-	DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
+	pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
 
 	if (depth != 1 ||
 	    (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
@@ -1051,7 +1044,7 @@ static int __init early_init_dt_scan_cho
 		strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
 #endif /* CONFIG_CMDLINE */
 
-	DBG("Command line is: %s\n", cmd_line);
+	pr_debug("Command line is: %s\n", cmd_line);
 
 	if (strstr(cmd_line, "mem=")) {
 		char *p, *q;
@@ -1078,11 +1071,11 @@ static int __init early_init_dt_scan_roo
 
 	prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
 	dt_root_size_cells = (prop == NULL) ? 1 : *prop;
-	DBG("dt_root_size_cells = %x\n", dt_root_size_cells);
+	pr_debug("dt_root_size_cells = %x\n", dt_root_size_cells);
 
 	prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
 	dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
-	DBG("dt_root_addr_cells = %x\n", dt_root_addr_cells);
+	pr_debug("dt_root_addr_cells = %x\n", dt_root_addr_cells);
 	
 	/* break now */
 	return 1;
@@ -1138,7 +1131,7 @@ static int __init early_init_dt_scan_mem
 
 	endp = reg + (l / sizeof(cell_t));
 
-	DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
+	pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
 	    uname, l, reg[0], reg[1], reg[2], reg[3]);
 
 	while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
@@ -1149,7 +1142,7 @@ static int __init early_init_dt_scan_mem
 
 		if (size == 0)
 			continue;
-		DBG(" - %lx ,  %lx\n", base, size);
+		pr_debug(" - %lx ,  %lx\n", base, size);
 #ifdef CONFIG_PPC64
 		if (iommu_is_off) {
 			if (base >= 0x80000000ul)
@@ -1184,7 +1177,7 @@ static void __init early_reserve_mem(voi
 			size_32 = *(reserve_map_32++);
 			if (size_32 == 0)
 				break;
-			DBG("reserving: %x -> %x\n", base_32, size_32);
+			pr_debug("reserving: %x -> %x\n", base_32, size_32);
 			lmb_reserve(base_32, size_32);
 		}
 		return;
@@ -1195,19 +1188,19 @@ static void __init early_reserve_mem(voi
 		size = *(reserve_map++);
 		if (size == 0)
 			break;
-		DBG("reserving: %llx -> %llx\n", base, size);
+		pr_debug("reserving: %llx -> %llx\n", base, size);
 		lmb_reserve(base, size);
 	}
 
 #if 0
-	DBG("memory reserved, lmbs :\n");
+	pr_debug("memory reserved, lmbs :\n");
       	lmb_dump_all();
 #endif
 }
 
 void __init early_init_devtree(void *params)
 {
-	DBG(" -> early_init_devtree()\n");
+	pr_debug(" -> early_init_devtree()\n");
 
 	/* Setup flat device-tree pointer */
 	initial_boot_params = params;
@@ -1225,7 +1218,7 @@ void __init early_init_devtree(void *par
 	lmb_enforce_memory_limit(memory_limit);
 	lmb_analyze();
 
-	DBG("Phys. mem: %lx\n", lmb_phys_mem_size());
+	pr_debug("Phys. mem: %lx\n", lmb_phys_mem_size());
 
 	/* Reserve LMB regions used by kernel, initrd, dt, etc... */
 	lmb_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
@@ -1234,14 +1227,14 @@ void __init early_init_devtree(void *par
 #endif
 	early_reserve_mem();
 
-	DBG("Scanning CPUs ...\n");
+	pr_debug("Scanning CPUs ...\n");
 
 	/* Retreive CPU related informations from the flat tree
 	 * (altivec support, boot CPU ID, ...)
 	 */
 	of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
 
-	DBG(" <- early_init_devtree()\n");
+	pr_debug(" <- early_init_devtree()\n");
 }
 
 #undef printk
@@ -2004,7 +1997,7 @@ void kdump_move_device_tree(void)
 
 	initial_boot_params = new;
 
-	DBG("Flat device tree blob moved to %p\n", initial_boot_params);
+	pr_debug("Flat device tree blob moved to %p\n", initial_boot_params);
 
 	/* XXX should we unreserve the old DT? */
 }
Index: to-merge/arch/powerpc/kernel/prom_parse.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/prom_parse.c
+++ to-merge/arch/powerpc/kernel/prom_parse.c
@@ -8,12 +8,6 @@
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 
-#ifdef DEBUG
-#define DBG(fmt...) do { printk(fmt); } while(0)
-#else
-#define DBG(fmt...) do { } while(0)
-#endif
-
 #ifdef CONFIG_PPC64
 #define PRu64	"%lx"
 #else
@@ -81,7 +75,7 @@ static u64 of_bus_default_map(u32 *addr,
 	s  = of_read_addr(range + na + pna, ns);
 	da = of_read_addr(addr, na);
 
-	DBG("OF: default map, cp="PRu64", s="PRu64", da="PRu64"\n",
+	pr_debug("OF: default map, cp="PRu64", s="PRu64", da="PRu64"\n",
 	    cp, s, da);
 
 	if (da < cp || da >= (cp + s))
@@ -139,7 +133,7 @@ static u64 of_bus_pci_map(u32 *addr, u32
 	s  = of_read_addr(range + na + pna, ns);
 	da = of_read_addr(addr + 1, na - 1);
 
-	DBG("OF: PCI map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
+	pr_debug("OF: PCI map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
 
 	if (da < cp || da >= (cp + s))
 		return OF_BAD_ADDR;
@@ -199,7 +193,7 @@ static u64 of_bus_isa_map(u32 *addr, u32
 	s  = of_read_addr(range + na + pna, ns);
 	da = of_read_addr(addr + 1, na - 1);
 
-	DBG("OF: ISA map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
+	pr_debug("OF: ISA map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da);
 
 	if (da < cp || da >= (cp + s))
 		return OF_BAD_ADDR;
@@ -297,11 +291,11 @@ static int of_translate_one(struct devic
 	if (ranges == NULL || rlen == 0) {
 		offset = of_read_addr(addr, na);
 		memset(addr, 0, pna * 4);
-		DBG("OF: no ranges, 1:1 translation\n");
+		pr_debug("OF: no ranges, 1:1 translation\n");
 		goto finish;
 	}
 
-	DBG("OF: walking ranges...\n");
+	pr_debug("OF: walking ranges...\n");
 
 	/* Now walk through the ranges */
 	rlen /= 4;
@@ -312,14 +306,14 @@ static int of_translate_one(struct devic
 			break;
 	}
 	if (offset == OF_BAD_ADDR) {
-		DBG("OF: not found !\n");
+		pr_debug("OF: not found !\n");
 		return 1;
 	}
 	memcpy(addr, ranges + na, 4 * pna);
 
  finish:
 	of_dump_addr("OF: parent translation for:", addr, pna);
-	DBG("OF: with offset: "PRu64"\n", offset);
+	pr_debug("OF: with offset: "PRu64"\n", offset);
 
 	/* Translate it into parent bus space */
 	return pbus->translate(addr, offset, pna);
@@ -344,7 +338,7 @@ u64 of_translate_address(struct device_n
 	int na, ns, pna, pns;
 	u64 result = OF_BAD_ADDR;
 
-	DBG("OF: ** translation for device %s **\n", dev->full_name);
+	pr_debug("OF: ** translation for device %s **\n", dev->full_name);
 
 	/* Increase refcount at current level */
 	of_node_get(dev);
@@ -364,7 +358,7 @@ u64 of_translate_address(struct device_n
 	}
 	memcpy(addr, in_addr, na * 4);
 
-	DBG("OF: bus is %s (na=%d, ns=%d) on %s\n",
+	pr_debug("OF: bus is %s (na=%d, ns=%d) on %s\n",
 	    bus->name, na, ns, parent->full_name);
 	of_dump_addr("OF: translating address:", addr, na);
 
@@ -377,7 +371,7 @@ u64 of_translate_address(struct device_n
 
 		/* If root, we have finished */
 		if (parent == NULL) {
-			DBG("OF: reached root node\n");
+			pr_debug("OF: reached root node\n");
 			result = of_read_addr(addr, na);
 			break;
 		}
@@ -391,7 +385,7 @@ u64 of_translate_address(struct device_n
 			break;
 		}
 
-		DBG("OF: parent bus is %s (na=%d, ns=%d) on %s\n",
+		pr_debug("OF: parent bus is %s (na=%d, ns=%d) on %s\n",
 		    pbus->name, pna, pns, parent->full_name);
 
 		/* Apply bus translation */
Index: to-merge/arch/powerpc/kernel/setup-common.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/setup-common.c
+++ to-merge/arch/powerpc/kernel/setup-common.c
@@ -61,13 +61,6 @@
 
 #include "setup.h"
 
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /* The main machine-dep calls structure
  */
 struct machdep_calls ppc_md;
@@ -307,7 +300,7 @@ void __init check_for_initrd(void)
 #ifdef CONFIG_BLK_DEV_INITRD
 	unsigned long *prop;
 
-	DBG(" -> check_for_initrd()\n");
+	pr_debug(" -> check_for_initrd()\n");
 
 	if (of_chosen) {
 		prop = (unsigned long *)get_property(of_chosen,
@@ -336,7 +329,7 @@ void __init check_for_initrd(void)
 	if (initrd_start)
 		printk("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
 
-	DBG(" <- check_for_initrd()\n");
+	pr_debug(" <- check_for_initrd()\n");
 #endif /* CONFIG_BLK_DEV_INITRD */
 }
 
@@ -495,22 +488,22 @@ void probe_machine(void)
 	 * Iterate all ppc_md structures until we find the proper
 	 * one for the current machine type
 	 */
-	DBG("Probing machine type ...\n");
+	pr_debug("Probing machine type ...\n");
 
 	for (machine_id = &__machine_desc_start;
 	     machine_id < &__machine_desc_end;
 	     machine_id++) {
-		DBG("  %s ...", machine_id->name);
+		pr_debug("  %s ...", machine_id->name);
 		memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls));
 		if (ppc_md.probe()) {
-			DBG(" match !\n");
+			pr_debug(" match !\n");
 			break;
 		}
-		DBG("\n");
+		pr_debug("\n");
 	}
 	/* What can we do if we didn't find ? */
 	if (machine_id >= &__machine_desc_end) {
-		DBG("No suitable machine found !\n");
+		pr_debug("No suitable machine found !\n");
 		for (;;);
 	}
 
Index: to-merge/arch/powerpc/kernel/setup_32.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/setup_32.c
+++ to-merge/arch/powerpc/kernel/setup_32.c
@@ -2,6 +2,8 @@
  * Common prep/pmac/chrp boot and setup code.
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/string.h>
@@ -44,8 +46,6 @@
 
 #include "setup.h"
 
-#define DBG(fmt...)
-
 #if defined CONFIG_KGDB
 #include <asm/kgdb.h>
 #endif
Index: to-merge/arch/powerpc/kernel/setup_64.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/setup_64.c
+++ to-merge/arch/powerpc/kernel/setup_64.c
@@ -65,12 +65,6 @@
 
 #include "setup.h"
 
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 int have_of = 1;
 int boot_cpuid = 0;
 dev_t boot_dev;
@@ -179,7 +173,7 @@ void __init early_setup(unsigned long dt
 	/* Enable early debugging if any specified (see udbg.h) */
 	udbg_early_init();
 
- 	DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
+	pr_debug(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
 
 	/*
 	 * Do early initializations using the flattened device
@@ -203,7 +197,7 @@ void __init early_setup(unsigned long dt
 	kdump_setup();
 #endif
 
-	DBG("Found, Initializing memory management...\n");
+	pr_debug("Found, Initializing memory management...\n");
 
 	/*
 	 * Initialize the MMU Hash table and create the linear mapping
@@ -220,7 +214,7 @@ void __init early_setup(unsigned long dt
 	else if (!firmware_has_feature(FW_FEATURE_ISERIES))
 		stab_initialize(get_paca()->stab_real);
 
-	DBG(" <- early_setup()\n");
+	pr_debug(" <- early_setup()\n");
 }
 
 #ifdef CONFIG_SMP
@@ -252,7 +246,7 @@ void smp_release_cpus(void)
 	extern unsigned long __secondary_hold_spinloop;
 	unsigned long *ptr;
 
-	DBG(" -> smp_release_cpus()\n");
+	pr_debug(" -> smp_release_cpus()\n");
 
 	/* All secondary cpus are spinning on a common spinloop, release them
 	 * all now so they can start to spin on their individual paca
@@ -266,7 +260,7 @@ void smp_release_cpus(void)
 	*ptr = 1;
 	mb();
 
-	DBG(" <- smp_release_cpus()\n");
+	pr_debug(" <- smp_release_cpus()\n");
 }
 #endif /* CONFIG_SMP || CONFIG_KEXEC */
 
@@ -282,7 +276,7 @@ static void __init initialize_cache_info
 	struct device_node *np;
 	unsigned long num_cpus = 0;
 
-	DBG(" -> initialize_cache_info()\n");
+	pr_debug(" -> initialize_cache_info()\n");
 
 	for (np = NULL; (np = of_find_node_by_type(np, "cpu"));) {
 		num_cpus += 1;
@@ -314,7 +308,7 @@ static void __init initialize_cache_info
 			if (lsizep != NULL)
 				lsize = *lsizep;
 			if (sizep == 0 || lsizep == 0)
-				DBG("Argh, can't find dcache properties ! "
+				pr_debug("Argh, can't find dcache properties ! "
 				    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
 			ppc64_caches.dsize = size;
@@ -331,7 +325,7 @@ static void __init initialize_cache_info
 			if (lsizep != NULL)
 				lsize = *lsizep;
 			if (sizep == 0 || lsizep == 0)
-				DBG("Argh, can't find icache properties ! "
+				pr_debug("Argh, can't find icache properties ! "
 				    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
 			ppc64_caches.isize = size;
@@ -341,7 +335,7 @@ static void __init initialize_cache_info
 		}
 	}
 
-	DBG(" <- initialize_cache_info()\n");
+	pr_debug(" <- initialize_cache_info()\n");
 }
 
 
@@ -351,7 +345,7 @@ static void __init initialize_cache_info
  */
 void __init setup_system(void)
 {
-	DBG(" -> setup_system()\n");
+	pr_debug(" -> setup_system()\n");
 
 #ifdef CONFIG_KEXEC
 	kdump_move_device_tree();
@@ -453,7 +447,7 @@ void __init setup_system(void)
 #endif
 	printk("-----------------------------------------------------\n");
 
-	DBG(" <- setup_system()\n");
+	pr_debug(" <- setup_system()\n");
 }
 
 static int ppc64_panic_event(struct notifier_block *this,
Index: to-merge/arch/powerpc/kernel/smp.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/smp.c
+++ to-merge/arch/powerpc/kernel/smp.c
@@ -50,13 +50,6 @@
 #include <asm/paca.h>
 #endif
 
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 int smp_hw_index[NR_CPUS];
 struct thread_info *secondary_ti;
 
@@ -83,11 +76,11 @@ int __init smp_mpic_probe(void)
 {
 	int nr_cpus;
 
-	DBG("smp_mpic_probe()...\n");
+	pr_debug("smp_mpic_probe()...\n");
 
 	nr_cpus = cpus_weight(cpu_possible_map);
 
-	DBG("nr_cpus: %d\n", nr_cpus);
+	pr_debug("nr_cpus: %d\n", nr_cpus);
 
 	if (nr_cpus > 1)
 		mpic_request_ipis();
@@ -346,7 +339,7 @@ void __init smp_prepare_cpus(unsigned in
 {
 	unsigned int cpu;
 
-	DBG("smp_prepare_cpus\n");
+	pr_debug("smp_prepare_cpus\n");
 
 	/* 
 	 * setup_cpu may need to be called on the boot cpu. We havent
@@ -483,7 +476,7 @@ int __devinit __cpu_up(unsigned int cpu)
 	smp_mb();
 
 	/* wake up cpus */
-	DBG("smp: kicking cpu %d\n", cpu);
+	pr_debug("smp: kicking cpu %d\n", cpu);
 	smp_ops->kick_cpu(cpu);
 
 	/*
Index: to-merge/arch/powerpc/kernel/vdso.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/vdso.c
+++ to-merge/arch/powerpc/kernel/vdso.c
@@ -8,6 +8,8 @@
  *  2 of the License, or (at your option) any later version.
  */
 
+#undef DEBUG
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
@@ -37,14 +39,6 @@
 #include <asm/vdso.h>
 #include <asm/vdso_datapage.h>
 
-#undef DEBUG
-
-#ifdef DEBUG
-#define DBG(fmt...) printk(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
 /* Max supported size for symbol names */
 #define MAX_SYMNAME	64
 
@@ -187,7 +181,7 @@ static struct page * vdso_vma_nopage(str
 	void *vbase = vdso32_kbase;
 #endif
 
-	DBG("vdso_vma_nopage(current: %s, address: %016lx, off: %lx)\n",
+	pr_debug("vdso_vma_nopage(current: %s, address: %016lx, off: %lx)\n",
 	    current->comm, address, offset);
 
 	if (address < vma->vm_start || address > vma->vm_end)
@@ -202,7 +196,7 @@ static struct page * vdso_vma_nopage(str
 		pg = virt_to_page(vbase + offset);
 
 	get_page(pg);
-	DBG(" ->page count: %d\n", page_count(pg));
+	pr_debug(" ->page count: %d\n", page_count(pg));
 
 	return pg;
 }
@@ -584,7 +578,7 @@ static __init int vdso_fixup_alt_funcs(s
 		if (!match)
 			continue;
 
-		DBG("replacing %s with %s...\n", patch->gen_name,
+		pr_debug("replacing %s with %s...\n", patch->gen_name,
 		    patch->fix_name ? "NONE" : patch->fix_name);
 
 		/*
@@ -685,7 +679,7 @@ void __init vdso_init(void)
 	 * Calculate the size of the 64 bits vDSO
 	 */
 	vdso64_pages = (&vdso64_end - &vdso64_start) >> PAGE_SHIFT;
-	DBG("vdso64_kbase: %p, 0x%x pages\n", vdso64_kbase, vdso64_pages);
+	pr_debug("vdso64_kbase: %p, 0x%x pages\n", vdso64_kbase, vdso64_pages);
 #endif /* CONFIG_PPC64 */
 
 
@@ -693,7 +687,7 @@ void __init vdso_init(void)
 	 * Calculate the size of the 32 bits vDSO
 	 */
 	vdso32_pages = (&vdso32_end - &vdso32_start) >> PAGE_SHIFT;
-	DBG("vdso32_kbase: %p, 0x%x pages\n", vdso32_kbase, vdso32_pages);
+	pr_debug("vdso32_kbase: %p, 0x%x pages\n", vdso32_kbase, vdso32_pages);
 
 
 	/*

^ permalink raw reply

* [RFC/PATCH 1/4] powerpc: Register udbg_console for early debugging
From: Michael Ellerman @ 2006-05-01  0:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <1146444821.660434.518701003988.qpush@concordia>

If we have early debugging enabled, then register the udbg console, so we
can use printk rather than udbg_printf.

I'm not sure about the jiggering with console_loglevel, but without it you
need to add "loglevel=8" to the command line, which I think might annoy people.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/kernel/udbg.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Index: to-merge/arch/powerpc/kernel/udbg.c
===================================================================
--- to-merge.orig/arch/powerpc/kernel/udbg.c
+++ to-merge/arch/powerpc/kernel/udbg.c
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/console.h>
+#include <linux/kernel.h>
 #include <asm/processor.h>
 #include <asm/udbg.h>
 
@@ -30,18 +31,23 @@ void __init udbg_early_init(void)
 #if defined(CONFIG_PPC_EARLY_DEBUG_LPAR)
 	/* For LPAR machines that have an HVC console on vterm 0 */
 	udbg_init_debug_lpar();
+	register_early_udbg_console();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_G5)
 	/* For use on Apple G5 machines */
 	udbg_init_pmac_realmode();
+	register_early_udbg_console();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS)
 	/* RTAS panel debug */
 	udbg_init_rtas();
+	register_early_udbg_console();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_MAPLE)
 	/* Maple real mode debug */
 	udbg_init_maple_realmode();
+	register_early_udbg_console();
 #elif defined(CONFIG_PPC_EARLY_DEBUG_ISERIES)
 	/* For iSeries - hit Ctrl-x Ctrl-x to see the output */
 	udbg_init_iseries();
+	register_early_udbg_console();
 #endif
 }
 
@@ -141,12 +147,11 @@ static int early_console_initialized;
 
 void __init disable_early_printk(void)
 {
-#if 1
 	if (!early_console_initialized)
 		return;
 	unregister_console(&udbg_console);
+	console_loglevel = default_console_loglevel;
 	early_console_initialized = 0;
-#endif
 }
 
 /* called by setup_system */
@@ -155,6 +160,7 @@ void register_early_udbg_console(void)
 	if (early_console_initialized)
 		return;
 	early_console_initialized = 1;
+	console_loglevel = 8;
 	register_console(&udbg_console);
 }
 

^ permalink raw reply

* [RFC/PATCH 0/4] powerpc: Use pr_debug() for debugging
From: Michael Ellerman @ 2006-05-01  0:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Currently we have a macro called DBG() defined in most files in arch/powerpc,
which is used to do debugging printks.

In some files DBG evaluates to printk() and in others it becomes udbg_printf(),
but there doesn't seem to be any logic to explain why it's one or the other.
In fact in some files it'd be nice if it was both, so you could have early
debugging (udbg_printf), but then have things hit the dmesg buffer later (via
printk).

Using udbg_printf() in general is suboptimal IMHO because it bypasses the
printk buffer, so if you miss the messages on the screen you can't go back and
see them in dmesg.

So this series of patches rejiggers things so that we register the udbg
console really early, and therefore can always use printk. It then goes on to
change all the home spun DBG() macros into pr_debug() calls, from
include/linux/kernel.h

I haven't tested this extensively because I wanted to gauge people's reaction
first. It "works" on pSeries LPAR, and iSeries, but I haven't tested on 32-bit,
and I don't know that code well so I'm all ears on that.

cheers

^ permalink raw reply

* windfarm for PM72/PM73/RM31
From: Robin H. Johnson @ 2006-05-01  0:27 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

Hi,

I'm working on writing a windfarm driver for the PM72/PM73/RM31 boxes,
amongst some other windfarm work I'm doing, and I have a few quick
notes/questions:

Process so far/TODO list:
- I've got the ds1775 and max6690 chips returning all of their data on
  PowerMac11,2 and PowerMac7,3. I need to change the detection code for the
  max6690 sub-nodes (it has both internal and external temps) as they
  don't exist on PM72.
- Need to write windfarm sensor drivers for: ds1631, ad7417, lm87
- Flesh out my windfarm_pm72 more - it's based on the therm_pm72
  constants and the pm112 module for now, completely untested until I
  have the sensors and controllers hooked up.

Questions:
1. Message naming consistancy - there are a number of printk/DBG
statements that seem to flip randomly between using a prefix of
'windfarm:' or 'wf:', and then some that omit it entirely.
Any consensus on which one is preferred?

2. Could somebody please send me a tarball of /proc/device-tree/ from a
RackMac3,1 unit? I've got the data for PM72/73 already.

-- 
Robin Hugh Johnson
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 241 bytes --]

^ permalink raw reply

* Re: sign extension for 32bit syscalls on ppc64
From: Stephen Rothwell @ 2006-05-01  0:05 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linuxppc-dev, paulus
In-Reply-To: <jezmi4xzoc.fsf@sykes.suse.de>

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

Hi Andreas,

On Sat, 29 Apr 2006 15:46:11 +0200 Andreas Schwab <schwab@suse.de> wrote:
>
> Stephen Rothwell <sfr@canb.auug.org.au> writes:
> 
> > Has any testing been done on these interfaces that involves 32 bit
> > processes passing AT_FDCWD on 64 bit kernels (I realise that it will work
> > for some architectures but I suspect not ppc64).
> 
> Appears to work fine for me (tested with openat).

Try mkdirat. openat has a compat wrapper that has the dfd paramater
declared as a unsigned int and passes it to sys_openat, whose first
paramter is decalred to be int, so the sign extension gets done.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] powermac: U4 DART improvements
From: Olof Johansson @ 2006-04-30 19:14 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus

Hi,

Jimi Xenidis posted Xen drivers that do individual TLB shootdowns on U4
DART on Friday:

http://lists.xensource.com/archives/html/xen-ppc-devel/2006-04/msg00085.html

We haven't been able to do it before since we didn't know any register
layouts past what Darwin used. So now we can implement individual
teardown.

This boots happily on my quad at home, but I'd appreciate more testing
by people who have U4-based machines. Also, if someone feels like doing
some benchmarking to find the breakeven point between full invalidation
and individual shootdowns, that'd be cool.

Patch below.

---

Implement single-entry TLB invalidations in the U4 DART.

At some point it makes more sense to invalidate the whole TLB instead of
individual entries. I picked a breakpoint at 32 entries, but it might make
sense to move it if benchmarking shows it to be too high or low.


Signed-off-by: Olof Johansson <olof@lixom.net>


diff --git a/arch/powerpc/sysdev/dart.h b/arch/powerpc/sysdev/dart.h
index c2d0576..1c8817c 100644
--- a/arch/powerpc/sysdev/dart.h
+++ b/arch/powerpc/sysdev/dart.h
@@ -47,8 +47,12 @@
 /* U4 registers */
 #define DART_BASE_U4_BASE_MASK	0xffffff
 #define DART_BASE_U4_BASE_SHIFT	0
-#define DART_CNTL_U4_FLUSHTLB	0x20000000
 #define DART_CNTL_U4_ENABLE	0x80000000
+#define DART_CNTL_U4_IONE	0x40000000
+#define DART_CNTL_U4_FLUSHTLB	0x20000000
+#define DART_CNTL_U4_IDLE	0x10000000
+#define DART_CNTL_U4_PAR_EN	0x08000000
+#define DART_CNTL_U4_IONE_MASK	0x07ffffff
 #define DART_SIZE_U4_SIZE_MASK	0x1fff
 #define DART_SIZE_U4_SIZE_SHIFT	0
 
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index 38087bd..66b6e21 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -101,8 +101,8 @@ retry:
 	if (l == (1L << limit)) {
 		if (limit < 4) {
 			limit++;
-		        reg = DART_IN(DART_CNTL);
-		        reg &= ~inv_bit;
+			reg = DART_IN(DART_CNTL);
+			reg &= ~inv_bit;
 			DART_OUT(DART_CNTL, reg);
 			goto retry;
 		} else
@@ -111,6 +111,34 @@ retry:
 	}
 }
 
+static inline void dart_tlb_invalidate_one(unsigned long bus_rpn)
+{
+	unsigned int reg;
+	unsigned int l, limit;
+
+	reg = DART_CNTL_U4_ENABLE | DART_CNTL_U4_IONE |
+		(bus_rpn & DART_CNTL_U4_IONE_MASK);
+	DART_OUT(DART_CNTL, reg);
+	mb();
+
+	limit = 0;
+wait_more:
+	l = 0;
+	while ((DART_IN(DART_CNTL) & DART_CNTL_U4_IONE) && l < (1L << limit)) {
+		rmb();
+		l++;
+	}
+
+	if (l == (1L << limit)) {
+		if (limit < 4) {
+			limit++;
+			goto wait_more;
+		} else
+			panic("DART: TLB did not flush after waiting a long "
+			      "time. Buggy U4 ?");
+	}
+}
+
 static void dart_flush(struct iommu_table *tbl)
 {
 	if (dart_dirty)
@@ -124,6 +152,7 @@ static void dart_build(struct iommu_tabl
 {
 	unsigned int *dp;
 	unsigned int rpn;
+	long l;
 
 	DBG("dart: build at: %lx, %lx, addr: %x\n", index, npages, uaddr);
 
@@ -135,7 +164,8 @@ static void dart_build(struct iommu_tabl
 	/* On U3, all memory is contigous, so we can move this
 	 * out of the loop.
 	 */
-	while (npages--) {
+	l = npages;
+	while (l--) {
 		rpn = virt_to_abs(uaddr) >> DART_PAGE_SHIFT;
 
 		*(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK);
@@ -143,7 +173,18 @@ static void dart_build(struct iommu_tabl
 		uaddr += DART_PAGE_SIZE;
 	}
 
-	dart_dirty = 1;
+
+	/* Pick 32 entries as a random point at which it makes more sense to
+	 * invalidate the whole TLB. FIXME: Benchmark and pick a better number.
+	 */
+	if (dart_is_u4 && npages > 32) {
+		rpn = index;
+		mb(); /* make sure all updates have reached memory */
+		while (npages--)
+			dart_tlb_invalidate_one(rpn++);
+	} else {
+		dart_dirty = 1;
+	}
 }
 
 

^ permalink raw reply related

* Re: Linux 2.6 sources for MPC852T processor
From: Marcelo Tosatti @ 2006-04-30 16:53 UTC (permalink / raw)
  To: Dan Malek; +Cc: David Jander, linuxppc-embedded
In-Reply-To: <0606BE3C-7751-4E71-B724-FEFE2FF252C8@embeddededge.com>

On Wed, Apr 26, 2006 at 07:32:13PM -0400, Dan Malek wrote:
> 
> On Apr 26, 2006, at 7:50 AM, David Jander wrote:
> 
> > Yes, MPC852T is supported, although I might add that I have been  
> > using 2.6.14
> > and 2.6.15 sucessfully with our own MPC852T-based board, but 2.6.16  
> > did not
> > boot and as of today I don't know why, or whether this is an issue  
> > at all
> > with boards other than ours.
> 
> There is a horrible bug in the 8xx TLB miss handler that is in the  
> 2.6.16
> sources.  I don't know when it appeared.  Enable the CPU6 Errata
> workaround to see if that solves the problem and please report back
> to me.  I'm working on a solution.

Hi Dan,

Shame on me! I screwed up.

David, can you please try the following patch on top of vanilla v2.6.16?

The large TLB change introduced in v2.6.16 (which is broken as is for
configurations without CPU6 errata enabled as Dan noted) should boost
performance significantly, so you might want to rerun the lmbench
tests...

diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index ec53c7d..7a2f205 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -355,9 +355,7 @@ #endif
 
 	. = 0x1200
 DataStoreTLBMiss:
-#ifdef CONFIG_8xx_CPU6
 	stw	r3, 8(r0)
-#endif
 	DO_8xx_CPU6(0x3f80, r3)
 	mtspr	SPRN_M_TW, r10	/* Save a couple of working registers */
 	mfcr	r10
@@ -417,9 +415,7 @@ #endif
 	lwz	r11, 0(r0)
 	mtcr	r11
 	lwz	r11, 4(r0)
-#ifdef CONFIG_8xx_CPU6
 	lwz	r3, 8(r0)
-#endif
 	rfi
 
 /* This is an instruction TLB error on the MPC8xx.  This could be due

^ permalink raw reply related

* Re: PPC 405GPr support in linux 2.4.32
From: Marcelo Tosatti @ 2006-04-30 16:40 UTC (permalink / raw)
  To: Stephen Williams; +Cc: Willy Tarreau, linuxppc-embedded
In-Reply-To: <44510E4D.5040504@icarus.com>

On Thu, Apr 27, 2006 at 11:32:45AM -0700, Stephen Williams wrote:
> Eugene Surovegin wrote:
> > There are bigger problems with 4xx support in 2.4 mainline than just 
> > missing some chips support.
> > 
> > Some parts which are already in 2.4 (e.g. ethernet driver) are of 
> > non-production quality. 
> > 
> > I can imagine Marcelo agreeing to commit 405GPr/405EP support as this 
> > change shouldn't break anything, but this will not make 2.4 support 
> > really useful for real world deployments. I think we are stuck with 
> > maintaining our own 2.4 trees with backports from 2.6. This is what I 
> > do myself of all our products (and yeah, diff between stock 2.4.32 and 
> > my internal version has already grown quite big to be acceptable for 
> > 2.4 inclusion).
> > 
> 
> Of course we are going to have to keep our own per-board trees.
> but the blatantly common stuff, like the core 405gpr support and
> certain drivers, might as well go in if the gatekeeper can be
> convinced. You and I both probably have huge drivers for custom
> devices hanging off our PPCs, with various hacks to squeeze extra
> performance out. These make our transition to 2.6 difficult, and
> surely we are not alone.
> 
> So 2.4 is going to be around for a while longer for us, so we might
> as well make an effort to keep the house in some sort of order. It
> serves no one to keep these fixes a secret:-)
> 
> In any case, if the patches I sent are rejected, then that's that.
> We'll see.

Folks,

The v2.4 patch acceptance policy has been shifting gradually from
"accept new features" to "critical fixes only", and at this point in
time the goal is to have a minimal amount of modifications as possible.

There should be no need for major patch reworking with reference to new
v2.4 releases.

Willy Tarreau created a repository of useful v2.4 patches for this sort
of situations. Stephen, Eugene, I think the 405GPr patches are good candidates.

http://w.ods.org/linux/kernel/2.4/lkup/hardware.html

Of course that it would be incredibly better for everyone to be happy with
v2.6. I see a lot of embedded users complaining about v2.6.

Cyclades (my former employer) has been using v2.6 in production
environments with 48MHz MPC855T PPC's with no problems at all (actually,
it is faster in certain key situations). This boxes have 128MB, which is
can be considered large, but still, no major problems have been seen in
_several_ different v2.6 versions.

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Arnd Bergmann @ 2006-04-30 16:14 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Olof Johansson, linuxppc-dev, torvalds, Paul Mackerras
In-Reply-To: <A15F2F5A-81AC-4192-B171-CF966C955272@kernel.crashing.org>

On Sunday 30 April 2006 15:04, Segher Boessenkool wrote:
> >
> > The Cell Broadband Engine Architecture in theory is 2.03 and also  
> > mandates
> 
> The docs (for example, "CBE_Architecture_v10.pdf") say 2.02.  One  
> more reason
> to not use those arch version numbers.

Sorry, my fault. I misremembered it from that spec.

	Arnd <><

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Olof Johansson @ 2006-04-30 15:07 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, torvalds, Paul Mackerras, Arnd Bergmann
In-Reply-To: <20060430150356.GR5518@pb15.lixom.net>

On Sun, Apr 30, 2006 at 10:03:56AM -0500, Olof Johansson wrote:
> On Sun, Apr 30, 2006 at 01:42:01PM +0200, Arnd Bergmann wrote:
> 
> > The Cell Broadband Engine Architecture in theory is 2.03 and also mandates
> > some of the extensions that are optional in there.
> > The relevant sections in the specs are:
> 
> Ok. So Cell should really set PPC_FEATURE_ARCH_2_02 then, and possible
> PPC_FEATURE_CELL to signify the cell extensions?
> 
> Right now ARCH_2_02 is not set as far as I can see.

s/2_02/2_03/g


-Olof

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Olof Johansson @ 2006-04-30 15:07 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Olof Johansson, linuxppc-dev, torvalds, Paul Mackerras
In-Reply-To: <200604301357.21578.arnd@arndb.de>

On Sun, Apr 30, 2006 at 01:57:21PM +0200, Arnd Bergmann wrote:

> • Mediated interrupt
> • Multiple concurrent large pages
> • Add TL (TLB load control) bit to logical-partitioning control register
>  (LPCR) for software versus hardware load of TLB
> • Change tlbie<l> of large page to always invalidate ERAT
> • Hypervisor SPRs no longer readable when HV equals 0
> 
> Do we know which ones of these made it into 2.05?

I'm not sure that can be discussed on a public mailing list, given that
2.02 is the last non-secret architecture version at this time. :-)


-Olof

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Olof Johansson @ 2006-04-30 15:03 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Olof Johansson, linuxppc-dev, torvalds, Paul Mackerras
In-Reply-To: <200604301342.02043.arnd@arndb.de>

On Sun, Apr 30, 2006 at 01:42:01PM +0200, Arnd Bergmann wrote:

> The Cell Broadband Engine Architecture in theory is 2.03 and also mandates
> some of the extensions that are optional in there.
> The relevant sections in the specs are:

Ok. So Cell should really set PPC_FEATURE_ARCH_2_02 then, and possible
PPC_FEATURE_CELL to signify the cell extensions?

Right now ARCH_2_02 is not set as far as I can see.


-Olof

^ permalink raw reply

* Re: [PATCH] Wire up *at syscalls
From: Andreas Schwab @ 2006-04-30 13:28 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, David Woodhouse
In-Reply-To: <17489.50396.320494.589703@cargo.ozlabs.ibm.com>

Paul Mackerras <paulus@samba.org> writes:

> David Woodhouse writes:
>
>> Hm, do we really need that? How about something based on this instead...
>> note that I used CONFIG_PPC_CELL because dependencies on CONFIG_*_MODULE
>> in the static kernel are evil.
>
> Nice idea, but you didn't change the syscall entry path to multiply
> the syscall number by 24 instead of 16.  It would be nice to have a
> way to do something like that but generate two separate tables instead
> of a single table with 3 entries per syscall.

Like this?  Only compile-tested so far.

Andreas.

---
 arch/powerpc/kernel/systbl.S                |  309 ---------------------------
 arch/powerpc/platforms/cell/spu_callbacks.c |  311 +---------------------------
 include/asm-powerpc/systbl.h                |  304 +++++++++++++++++++++++++++
 3 files changed, 322 insertions(+), 602 deletions(-)

Index: linux-2.6.17-rc3-git3/arch/powerpc/kernel/systbl.S
===================================================================
--- linux-2.6.17-rc3-git3.orig/arch/powerpc/kernel/systbl.S	2006-04-30 13:47:29.000000000 +0200
+++ linux-2.6.17-rc3-git3/arch/powerpc/kernel/systbl.S	2006-04-30 13:58:29.000000000 +0200
@@ -32,6 +32,10 @@
 #define SYS32ONLY(func)		.long	sys_##func
 #define SYSX(f, f3264, f32)	.long	f32
 #endif
+#define SYSCALL_SPU(func)	SYSCALL(func)
+#define COMPAT_SYS_SPU(func)	COMPAT_SYS(func)
+#define PPC_SYS_SPU(func)	PPC_SYS(func)
+#define SYSX_SPU(f, f3264, f32)	SYSX(f, f3264, f32)
 
 #ifdef CONFIG_PPC64
 #define sys_sigpending	sys_ni_syscall
@@ -39,307 +43,4 @@
 #endif
 
 _GLOBAL(sys_call_table)
-SYSCALL(restart_syscall)
-SYSCALL(exit)
-PPC_SYS(fork)
-SYSCALL(read)
-SYSCALL(write)
-COMPAT_SYS(open)
-SYSCALL(close)
-COMPAT_SYS(waitpid)
-COMPAT_SYS(creat)
-SYSCALL(link)
-SYSCALL(unlink)
-COMPAT_SYS(execve)
-SYSCALL(chdir)
-COMPAT_SYS(time)
-SYSCALL(mknod)
-SYSCALL(chmod)
-SYSCALL(lchown)
-SYSCALL(ni_syscall)
-OLDSYS(stat)
-SYSX(sys_lseek,ppc32_lseek,sys_lseek)
-SYSCALL(getpid)
-COMPAT_SYS(mount)
-SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
-SYSCALL(setuid)
-SYSCALL(getuid)
-COMPAT_SYS(stime)
-COMPAT_SYS(ptrace)
-SYSCALL(alarm)
-OLDSYS(fstat)
-COMPAT_SYS(pause)
-COMPAT_SYS(utime)
-SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
-COMPAT_SYS(access)
-COMPAT_SYS(nice)
-SYSCALL(ni_syscall)
-SYSCALL(sync)
-COMPAT_SYS(kill)
-SYSCALL(rename)
-COMPAT_SYS(mkdir)
-SYSCALL(rmdir)
-SYSCALL(dup)
-SYSCALL(pipe)
-COMPAT_SYS(times)
-SYSCALL(ni_syscall)
-SYSCALL(brk)
-SYSCALL(setgid)
-SYSCALL(getgid)
-SYSCALL(signal)
-SYSCALL(geteuid)
-SYSCALL(getegid)
-SYSCALL(acct)
-SYSCALL(umount)
-SYSCALL(ni_syscall)
-COMPAT_SYS(ioctl)
-COMPAT_SYS(fcntl)
-SYSCALL(ni_syscall)
-COMPAT_SYS(setpgid)
-SYSCALL(ni_syscall)
-SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
-COMPAT_SYS(umask)
-SYSCALL(chroot)
-SYSCALL(ustat)
-SYSCALL(dup2)
-SYSCALL(getppid)
-SYSCALL(getpgrp)
-SYSCALL(setsid)
-SYS32ONLY(sigaction)
-SYSCALL(sgetmask)
-COMPAT_SYS(ssetmask)
-SYSCALL(setreuid)
-SYSCALL(setregid)
-SYS32ONLY(sigsuspend)
-COMPAT_SYS(sigpending)
-COMPAT_SYS(sethostname)
-COMPAT_SYS(setrlimit)
-COMPAT_SYS(old_getrlimit)
-COMPAT_SYS(getrusage)
-COMPAT_SYS(gettimeofday)
-COMPAT_SYS(settimeofday)
-COMPAT_SYS(getgroups)
-COMPAT_SYS(setgroups)
-SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
-SYSCALL(symlink)
-OLDSYS(lstat)
-COMPAT_SYS(readlink)
-SYSCALL(uselib)
-SYSCALL(swapon)
-SYSCALL(reboot)
-SYSX(sys_ni_syscall,old32_readdir,old_readdir)
-SYSCALL(mmap)
-SYSCALL(munmap)
-SYSCALL(truncate)
-SYSCALL(ftruncate)
-SYSCALL(fchmod)
-SYSCALL(fchown)
-COMPAT_SYS(getpriority)
-COMPAT_SYS(setpriority)
-SYSCALL(ni_syscall)
-COMPAT_SYS(statfs)
-COMPAT_SYS(fstatfs)
-SYSCALL(ni_syscall)
-COMPAT_SYS(socketcall)
-COMPAT_SYS(syslog)
-COMPAT_SYS(setitimer)
-COMPAT_SYS(getitimer)
-COMPAT_SYS(newstat)
-COMPAT_SYS(newlstat)
-COMPAT_SYS(newfstat)
-SYSX(sys_ni_syscall,sys_uname,sys_uname)
-SYSCALL(ni_syscall)
-SYSCALL(vhangup)
-SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
-COMPAT_SYS(wait4)
-SYSCALL(swapoff)
-COMPAT_SYS(sysinfo)
-COMPAT_SYS(ipc)
-SYSCALL(fsync)
-SYS32ONLY(sigreturn)
-PPC_SYS(clone)
-COMPAT_SYS(setdomainname)
-PPC_SYS(newuname)
-SYSCALL(ni_syscall)
-COMPAT_SYS(adjtimex)
-SYSCALL(mprotect)
-SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
-SYSCALL(ni_syscall)
-SYSCALL(init_module)
-SYSCALL(delete_module)
-SYSCALL(ni_syscall)
-SYSCALL(quotactl)
-COMPAT_SYS(getpgid)
-SYSCALL(fchdir)
-SYSCALL(bdflush)
-COMPAT_SYS(sysfs)
-SYSX(ppc64_personality,ppc64_personality,sys_personality)
-SYSCALL(ni_syscall)
-SYSCALL(setfsuid)
-SYSCALL(setfsgid)
-SYSCALL(llseek)
-COMPAT_SYS(getdents)
-SYSX(sys_select,ppc32_select,ppc_select)
-SYSCALL(flock)
-SYSCALL(msync)
-COMPAT_SYS(readv)
-COMPAT_SYS(writev)
-COMPAT_SYS(getsid)
-SYSCALL(fdatasync)
-COMPAT_SYS(sysctl)
-SYSCALL(mlock)
-SYSCALL(munlock)
-SYSCALL(mlockall)
-SYSCALL(munlockall)
-COMPAT_SYS(sched_setparam)
-COMPAT_SYS(sched_getparam)
-COMPAT_SYS(sched_setscheduler)
-COMPAT_SYS(sched_getscheduler)
-SYSCALL(sched_yield)
-COMPAT_SYS(sched_get_priority_max)
-COMPAT_SYS(sched_get_priority_min)
-COMPAT_SYS(sched_rr_get_interval)
-COMPAT_SYS(nanosleep)
-SYSCALL(mremap)
-SYSCALL(setresuid)
-SYSCALL(getresuid)
-SYSCALL(ni_syscall)
-SYSCALL(poll)
-COMPAT_SYS(nfsservctl)
-SYSCALL(setresgid)
-SYSCALL(getresgid)
-COMPAT_SYS(prctl)
-COMPAT_SYS(rt_sigreturn)
-COMPAT_SYS(rt_sigaction)
-COMPAT_SYS(rt_sigprocmask)
-COMPAT_SYS(rt_sigpending)
-COMPAT_SYS(rt_sigtimedwait)
-COMPAT_SYS(rt_sigqueueinfo)
-COMPAT_SYS(rt_sigsuspend)
-COMPAT_SYS(pread64)
-COMPAT_SYS(pwrite64)
-SYSCALL(chown)
-SYSCALL(getcwd)
-SYSCALL(capget)
-SYSCALL(capset)
-COMPAT_SYS(sigaltstack)
-SYSX(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
-SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
-PPC_SYS(vfork)
-COMPAT_SYS(getrlimit)
-COMPAT_SYS(readahead)
-SYS32ONLY(mmap2)
-SYS32ONLY(truncate64)
-SYS32ONLY(ftruncate64)
-SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
-SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
-SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
-SYSCALL(pciconfig_read)
-SYSCALL(pciconfig_write)
-SYSCALL(pciconfig_iobase)
-SYSCALL(ni_syscall)
-SYSCALL(getdents64)
-SYSCALL(pivot_root)
-SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
-SYSCALL(madvise)
-SYSCALL(mincore)
-SYSCALL(gettid)
-SYSCALL(tkill)
-SYSCALL(setxattr)
-SYSCALL(lsetxattr)
-SYSCALL(fsetxattr)
-SYSCALL(getxattr)
-SYSCALL(lgetxattr)
-SYSCALL(fgetxattr)
-SYSCALL(listxattr)
-SYSCALL(llistxattr)
-SYSCALL(flistxattr)
-SYSCALL(removexattr)
-SYSCALL(lremovexattr)
-SYSCALL(fremovexattr)
-COMPAT_SYS(futex)
-COMPAT_SYS(sched_setaffinity)
-COMPAT_SYS(sched_getaffinity)
-SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
-SYS32ONLY(sendfile64)
-COMPAT_SYS(io_setup)
-SYSCALL(io_destroy)
-COMPAT_SYS(io_getevents)
-COMPAT_SYS(io_submit)
-SYSCALL(io_cancel)
-SYSCALL(set_tid_address)
-SYSX(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
-SYSCALL(exit_group)
-SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
-SYSCALL(epoll_create)
-SYSCALL(epoll_ctl)
-SYSCALL(epoll_wait)
-SYSCALL(remap_file_pages)
-SYSX(sys_timer_create,compat_sys_timer_create,sys_timer_create)
-COMPAT_SYS(timer_settime)
-COMPAT_SYS(timer_gettime)
-SYSCALL(timer_getoverrun)
-SYSCALL(timer_delete)
-COMPAT_SYS(clock_settime)
-COMPAT_SYS(clock_gettime)
-COMPAT_SYS(clock_getres)
-COMPAT_SYS(clock_nanosleep)
-SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
-COMPAT_SYS(tgkill)
-COMPAT_SYS(utimes)
-COMPAT_SYS(statfs64)
-COMPAT_SYS(fstatfs64)
-SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
-PPC_SYS(rtas)
-OLDSYS(debug_setcontext)
-SYSCALL(ni_syscall)
-SYSCALL(ni_syscall)
-COMPAT_SYS(mbind)
-COMPAT_SYS(get_mempolicy)
-COMPAT_SYS(set_mempolicy)
-COMPAT_SYS(mq_open)
-SYSCALL(mq_unlink)
-COMPAT_SYS(mq_timedsend)
-COMPAT_SYS(mq_timedreceive)
-COMPAT_SYS(mq_notify)
-COMPAT_SYS(mq_getsetattr)
-COMPAT_SYS(kexec_load)
-COMPAT_SYS(add_key)
-COMPAT_SYS(request_key)
-COMPAT_SYS(keyctl)
-COMPAT_SYS(waitid)
-COMPAT_SYS(ioprio_set)
-COMPAT_SYS(ioprio_get)
-SYSCALL(inotify_init)
-SYSCALL(inotify_add_watch)
-SYSCALL(inotify_rm_watch)
-SYSCALL(spu_run)
-SYSCALL(spu_create)
-COMPAT_SYS(pselect6)
-COMPAT_SYS(ppoll)
-SYSCALL(unshare)
-SYSCALL(splice)
-SYSCALL(tee)
-SYSCALL(vmsplice)
-COMPAT_SYS(openat)
-SYSCALL(mkdirat)
-SYSCALL(mknodat)
-SYSCALL(fchownat)
-COMPAT_SYS(futimesat)
-SYSX(sys_newfstatat, sys_fstatat64, sys_fstatat64)
-SYSCALL(unlinkat)
-SYSCALL(renameat)
-SYSCALL(linkat)
-SYSCALL(symlinkat)
-SYSCALL(readlinkat)
-SYSCALL(fchmodat)
-SYSCALL(faccessat)
-
-/*
- * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
- * as well when appropriate.
- */
+#include <asm/systbl.h>
Index: linux-2.6.17-rc3-git3/arch/powerpc/platforms/cell/spu_callbacks.c
===================================================================
--- linux-2.6.17-rc3-git3.orig/arch/powerpc/platforms/cell/spu_callbacks.c	2006-04-30 13:47:29.000000000 +0200
+++ linux-2.6.17-rc3-git3/arch/powerpc/platforms/cell/spu_callbacks.c	2006-04-30 14:12:43.000000000 +0200
@@ -34,304 +34,19 @@
  */
 
 void *spu_syscall_table[] = {
-	[__NR_restart_syscall]		sys_ni_syscall, /* sys_restart_syscall */
-	[__NR_exit]			sys_ni_syscall, /* sys_exit */
-	[__NR_fork]			sys_ni_syscall, /* ppc_fork */
-	[__NR_read]			sys_read,
-	[__NR_write]			sys_write,
-	[__NR_open]			sys_open,
-	[__NR_close]			sys_close,
-	[__NR_waitpid]			sys_waitpid,
-	[__NR_creat]			sys_creat,
-	[__NR_link]			sys_link,
-	[__NR_unlink]			sys_unlink,
-	[__NR_execve]			sys_ni_syscall, /* sys_execve */
-	[__NR_chdir]			sys_chdir,
-	[__NR_time]			sys_time,
-	[__NR_mknod]			sys_mknod,
-	[__NR_chmod]			sys_chmod,
-	[__NR_lchown]			sys_lchown,
-	[__NR_break]			sys_ni_syscall,
-	[__NR_oldstat]			sys_ni_syscall,
-	[__NR_lseek]			sys_lseek,
-	[__NR_getpid]			sys_getpid,
-	[__NR_mount]			sys_ni_syscall, /* sys_mount */
-	[__NR_umount]			sys_ni_syscall,
-	[__NR_setuid]			sys_setuid,
-	[__NR_getuid]			sys_getuid,
-	[__NR_stime]			sys_stime,
-	[__NR_ptrace]			sys_ni_syscall, /* sys_ptrace */
-	[__NR_alarm]			sys_alarm,
-	[__NR_oldfstat]			sys_ni_syscall,
-	[__NR_pause]			sys_ni_syscall, /* sys_pause */
-	[__NR_utime]			sys_ni_syscall, /* sys_utime */
-	[__NR_stty]			sys_ni_syscall,
-	[__NR_gtty]			sys_ni_syscall,
-	[__NR_access]			sys_access,
-	[__NR_nice]			sys_nice,
-	[__NR_ftime]			sys_ni_syscall,
-	[__NR_sync]			sys_sync,
-	[__NR_kill]			sys_kill,
-	[__NR_rename]			sys_rename,
-	[__NR_mkdir]			sys_mkdir,
-	[__NR_rmdir]			sys_rmdir,
-	[__NR_dup]			sys_dup,
-	[__NR_pipe]			sys_pipe,
-	[__NR_times]			sys_times,
-	[__NR_prof]			sys_ni_syscall,
-	[__NR_brk]			sys_brk,
-	[__NR_setgid]			sys_setgid,
-	[__NR_getgid]			sys_getgid,
-	[__NR_signal]			sys_ni_syscall, /* sys_signal */
-	[__NR_geteuid]			sys_geteuid,
-	[__NR_getegid]			sys_getegid,
-	[__NR_acct]			sys_ni_syscall, /* sys_acct */
-	[__NR_umount2]			sys_ni_syscall, /* sys_umount */
-	[__NR_lock]			sys_ni_syscall,
-	[__NR_ioctl]			sys_ioctl,
-	[__NR_fcntl]			sys_fcntl,
-	[__NR_mpx]			sys_ni_syscall,
-	[__NR_setpgid]			sys_setpgid,
-	[__NR_ulimit]			sys_ni_syscall,
-	[__NR_oldolduname]		sys_ni_syscall,
-	[__NR_umask]			sys_umask,
-	[__NR_chroot]			sys_chroot,
-	[__NR_ustat]			sys_ni_syscall, /* sys_ustat */
-	[__NR_dup2]			sys_dup2,
-	[__NR_getppid]			sys_getppid,
-	[__NR_getpgrp]			sys_getpgrp,
-	[__NR_setsid]			sys_setsid,
-	[__NR_sigaction]		sys_ni_syscall,
-	[__NR_sgetmask]			sys_sgetmask,
-	[__NR_ssetmask]			sys_ssetmask,
-	[__NR_setreuid]			sys_setreuid,
-	[__NR_setregid]			sys_setregid,
-	[__NR_sigsuspend]		sys_ni_syscall,
-	[__NR_sigpending]		sys_ni_syscall,
-	[__NR_sethostname]		sys_sethostname,
-	[__NR_setrlimit]		sys_setrlimit,
-	[__NR_getrlimit]		sys_ni_syscall,
-	[__NR_getrusage]		sys_getrusage,
-	[__NR_gettimeofday]		sys_gettimeofday,
-	[__NR_settimeofday]		sys_settimeofday,
-	[__NR_getgroups]		sys_getgroups,
-	[__NR_setgroups]		sys_setgroups,
-	[__NR_select]			sys_ni_syscall,
-	[__NR_symlink]			sys_symlink,
-	[__NR_oldlstat]			sys_ni_syscall,
-	[__NR_readlink]			sys_readlink,
-	[__NR_uselib]			sys_ni_syscall, /* sys_uselib */
-	[__NR_swapon]			sys_ni_syscall, /* sys_swapon */
-	[__NR_reboot]			sys_ni_syscall, /* sys_reboot */
-	[__NR_readdir]			sys_ni_syscall,
-	[__NR_mmap]			sys_mmap,
-	[__NR_munmap]			sys_munmap,
-	[__NR_truncate]			sys_truncate,
-	[__NR_ftruncate]		sys_ftruncate,
-	[__NR_fchmod]			sys_fchmod,
-	[__NR_fchown]			sys_fchown,
-	[__NR_getpriority]		sys_getpriority,
-	[__NR_setpriority]		sys_setpriority,
-	[__NR_profil]			sys_ni_syscall,
-	[__NR_statfs]			sys_ni_syscall, /* sys_statfs */
-	[__NR_fstatfs]			sys_ni_syscall, /* sys_fstatfs */
-	[__NR_ioperm]			sys_ni_syscall,
-	[__NR_socketcall]		sys_socketcall,
-	[__NR_syslog]			sys_syslog,
-	[__NR_setitimer]		sys_setitimer,
-	[__NR_getitimer]		sys_getitimer,
-	[__NR_stat]			sys_newstat,
-	[__NR_lstat]			sys_newlstat,
-	[__NR_fstat]			sys_newfstat,
-	[__NR_olduname]			sys_ni_syscall,
-	[__NR_iopl]			sys_ni_syscall,
-	[__NR_vhangup]			sys_vhangup,
-	[__NR_idle]			sys_ni_syscall,
-	[__NR_vm86]			sys_ni_syscall,
-	[__NR_wait4]			sys_wait4,
-	[__NR_swapoff]			sys_ni_syscall, /* sys_swapoff */
-	[__NR_sysinfo]			sys_sysinfo,
-	[__NR_ipc]			sys_ni_syscall, /* sys_ipc */
-	[__NR_fsync]			sys_fsync,
-	[__NR_sigreturn]		sys_ni_syscall,
-	[__NR_clone]			sys_ni_syscall, /* ppc_clone */
-	[__NR_setdomainname]		sys_setdomainname,
-	[__NR_uname]			ppc_newuname,
-	[__NR_modify_ldt]		sys_ni_syscall,
-	[__NR_adjtimex]			sys_adjtimex,
-	[__NR_mprotect]			sys_mprotect,
-	[__NR_sigprocmask]		sys_ni_syscall,
-	[__NR_create_module]		sys_ni_syscall,
-	[__NR_init_module]		sys_ni_syscall, /* sys_init_module */
-	[__NR_delete_module]		sys_ni_syscall, /* sys_delete_module */
-	[__NR_get_kernel_syms]		sys_ni_syscall,
-	[__NR_quotactl]			sys_ni_syscall, /* sys_quotactl */
-	[__NR_getpgid]			sys_getpgid,
-	[__NR_fchdir]			sys_fchdir,
-	[__NR_bdflush]			sys_bdflush,
-	[__NR_sysfs]			sys_ni_syscall, /* sys_sysfs */
-	[__NR_personality]		ppc64_personality,
-	[__NR_afs_syscall]		sys_ni_syscall,
-	[__NR_setfsuid]			sys_setfsuid,
-	[__NR_setfsgid]			sys_setfsgid,
-	[__NR__llseek]			sys_llseek,
-	[__NR_getdents]			sys_getdents,
-	[__NR__newselect]		sys_select,
-	[__NR_flock]			sys_flock,
-	[__NR_msync]			sys_msync,
-	[__NR_readv]			sys_readv,
-	[__NR_writev]			sys_writev,
-	[__NR_getsid]			sys_getsid,
-	[__NR_fdatasync]		sys_fdatasync,
-	[__NR__sysctl]			sys_ni_syscall, /* sys_sysctl */
-	[__NR_mlock]			sys_mlock,
-	[__NR_munlock]			sys_munlock,
-	[__NR_mlockall]			sys_mlockall,
-	[__NR_munlockall]		sys_munlockall,
-	[__NR_sched_setparam]		sys_sched_setparam,
-	[__NR_sched_getparam]		sys_sched_getparam,
-	[__NR_sched_setscheduler]	sys_sched_setscheduler,
-	[__NR_sched_getscheduler]	sys_sched_getscheduler,
-	[__NR_sched_yield]		sys_sched_yield,
-	[__NR_sched_get_priority_max]	sys_sched_get_priority_max,
-	[__NR_sched_get_priority_min]	sys_sched_get_priority_min,
-	[__NR_sched_rr_get_interval]	sys_sched_rr_get_interval,
-	[__NR_nanosleep]		sys_nanosleep,
-	[__NR_mremap]			sys_mremap,
-	[__NR_setresuid]		sys_setresuid,
-	[__NR_getresuid]		sys_getresuid,
-	[__NR_query_module]		sys_ni_syscall,
-	[__NR_poll]			sys_poll,
-	[__NR_nfsservctl]		sys_ni_syscall, /* sys_nfsservctl */
-	[__NR_setresgid]		sys_setresgid,
-	[__NR_getresgid]		sys_getresgid,
-	[__NR_prctl]			sys_prctl,
-	[__NR_rt_sigreturn]		sys_ni_syscall, /* ppc64_rt_sigreturn */
-	[__NR_rt_sigaction]		sys_ni_syscall, /* sys_rt_sigaction */
-	[__NR_rt_sigprocmask]		sys_ni_syscall, /* sys_rt_sigprocmask */
-	[__NR_rt_sigpending]		sys_ni_syscall, /* sys_rt_sigpending */
-	[__NR_rt_sigtimedwait]		sys_ni_syscall, /* sys_rt_sigtimedwait */
-	[__NR_rt_sigqueueinfo]		sys_ni_syscall, /* sys_rt_sigqueueinfo */
-	[__NR_rt_sigsuspend]		sys_ni_syscall, /* sys_rt_sigsuspend */
-	[__NR_pread64]			sys_pread64,
-	[__NR_pwrite64]			sys_pwrite64,
-	[__NR_chown]			sys_chown,
-	[__NR_getcwd]			sys_getcwd,
-	[__NR_capget]			sys_capget,
-	[__NR_capset]			sys_capset,
-	[__NR_sigaltstack]		sys_ni_syscall, /* sys_sigaltstack */
-	[__NR_sendfile]			sys_sendfile64,
-	[__NR_getpmsg]			sys_ni_syscall,
-	[__NR_putpmsg]			sys_ni_syscall,
-	[__NR_vfork]			sys_ni_syscall, /* ppc_vfork */
-	[__NR_ugetrlimit]		sys_getrlimit,
-	[__NR_readahead]		sys_readahead,
-	[192]				sys_ni_syscall,
-	[193]				sys_ni_syscall,
-	[194]				sys_ni_syscall,
-	[195]				sys_ni_syscall,
-	[196]				sys_ni_syscall,
-	[197]				sys_ni_syscall,
-	[__NR_pciconfig_read]		sys_ni_syscall, /* sys_pciconfig_read */
-	[__NR_pciconfig_write]		sys_ni_syscall, /* sys_pciconfig_write */
-	[__NR_pciconfig_iobase]		sys_ni_syscall, /* sys_pciconfig_iobase */
-	[__NR_multiplexer]		sys_ni_syscall,
-	[__NR_getdents64]		sys_getdents64,
-	[__NR_pivot_root]		sys_pivot_root,
-	[204]				sys_ni_syscall,
-	[__NR_madvise]			sys_madvise,
-	[__NR_mincore]			sys_mincore,
-	[__NR_gettid]			sys_gettid,
-	[__NR_tkill]			sys_tkill,
-	[__NR_setxattr]			sys_setxattr,
-	[__NR_lsetxattr]		sys_lsetxattr,
-	[__NR_fsetxattr]		sys_fsetxattr,
-	[__NR_getxattr]			sys_getxattr,
-	[__NR_lgetxattr]		sys_lgetxattr,
-	[__NR_fgetxattr]		sys_fgetxattr,
-	[__NR_listxattr]		sys_listxattr,
-	[__NR_llistxattr]		sys_llistxattr,
-	[__NR_flistxattr]		sys_flistxattr,
-	[__NR_removexattr]		sys_removexattr,
-	[__NR_lremovexattr]		sys_lremovexattr,
-	[__NR_fremovexattr]		sys_fremovexattr,
-	[__NR_futex]			sys_futex,
-	[__NR_sched_setaffinity]	sys_sched_setaffinity,
-	[__NR_sched_getaffinity]	sys_sched_getaffinity,
-	[__NR_tuxcall]			sys_ni_syscall,
-	[226]				sys_ni_syscall,
-	[__NR_io_setup]			sys_io_setup,
-	[__NR_io_destroy]		sys_io_destroy,
-	[__NR_io_getevents]		sys_io_getevents,
-	[__NR_io_submit]		sys_io_submit,
-	[__NR_io_cancel]		sys_io_cancel,
-	[__NR_set_tid_address]		sys_ni_syscall, /* sys_set_tid_address */
-	[__NR_fadvise64]		sys_fadvise64,
-	[__NR_exit_group]		sys_ni_syscall, /* sys_exit_group */
-	[__NR_lookup_dcookie]		sys_ni_syscall, /* sys_lookup_dcookie */
-	[__NR_epoll_create]		sys_epoll_create,
-	[__NR_epoll_ctl]		sys_epoll_ctl,
-	[__NR_epoll_wait]		sys_epoll_wait,
-	[__NR_remap_file_pages]		sys_remap_file_pages,
-	[__NR_timer_create]		sys_timer_create,
-	[__NR_timer_settime]		sys_timer_settime,
-	[__NR_timer_gettime]		sys_timer_gettime,
-	[__NR_timer_getoverrun]		sys_timer_getoverrun,
-	[__NR_timer_delete]		sys_timer_delete,
-	[__NR_clock_settime]		sys_clock_settime,
-	[__NR_clock_gettime]		sys_clock_gettime,
-	[__NR_clock_getres]		sys_clock_getres,
-	[__NR_clock_nanosleep]		sys_clock_nanosleep,
-	[__NR_swapcontext]		sys_ni_syscall, /* ppc64_swapcontext */
-	[__NR_tgkill]			sys_tgkill,
-	[__NR_utimes]			sys_utimes,
-	[__NR_statfs64]			sys_statfs64,
-	[__NR_fstatfs64]		sys_fstatfs64,
-	[254]				sys_ni_syscall,
-	[__NR_rtas]			ppc_rtas,
-	[256]				sys_ni_syscall,
-	[257]				sys_ni_syscall,
-	[258]				sys_ni_syscall,
-	[__NR_mbind]			sys_ni_syscall, /* sys_mbind */
-	[__NR_get_mempolicy]		sys_ni_syscall, /* sys_get_mempolicy */
-	[__NR_set_mempolicy]		sys_ni_syscall, /* sys_set_mempolicy */
-	[__NR_mq_open]			sys_ni_syscall, /* sys_mq_open */
-	[__NR_mq_unlink]		sys_ni_syscall, /* sys_mq_unlink */
-	[__NR_mq_timedsend]		sys_ni_syscall, /* sys_mq_timedsend */
-	[__NR_mq_timedreceive]		sys_ni_syscall, /* sys_mq_timedreceive */
-	[__NR_mq_notify]		sys_ni_syscall, /* sys_mq_notify */
-	[__NR_mq_getsetattr]		sys_ni_syscall, /* sys_mq_getsetattr */
-	[__NR_kexec_load]		sys_ni_syscall, /* sys_kexec_load */
-	[__NR_add_key]			sys_ni_syscall, /* sys_add_key */
-	[__NR_request_key]		sys_ni_syscall, /* sys_request_key */
-	[__NR_keyctl]			sys_ni_syscall, /* sys_keyctl */
-	[__NR_waitid]			sys_ni_syscall, /* sys_waitid */
-	[__NR_ioprio_set]		sys_ni_syscall, /* sys_ioprio_set */
-	[__NR_ioprio_get]		sys_ni_syscall, /* sys_ioprio_get */
-	[__NR_inotify_init]		sys_ni_syscall, /* sys_inotify_init */
-	[__NR_inotify_add_watch]	sys_ni_syscall, /* sys_inotify_add_watch */
-	[__NR_inotify_rm_watch]		sys_ni_syscall, /* sys_inotify_rm_watch */
-	[__NR_spu_run]			sys_ni_syscall, /* sys_spu_run */
-	[__NR_spu_create]		sys_ni_syscall, /* sys_spu_create */
-	[__NR_pselect6]			sys_ni_syscall, /* sys_pselect */
-	[__NR_ppoll]			sys_ni_syscall, /* sys_ppoll */
-	[__NR_unshare]			sys_unshare,
-	[__NR_splice]			sys_splice,
-	[__NR_tee]			sys_tee,
-	[__NR_vmsplice]			sys_vmsplice,
-	[__NR_openat]			sys_openat,
-	[__NR_mkdirat]			sys_mkdirat,
-	[__NR_mknodat]			sys_mknodat,
-	[__NR_fchownat]			sys_fchownat,
-	[__NR_futimesat]		sys_futimesat,
-	[__NR_newfstatat]		sys_newfstatat,
-	[__NR_unlinkat]			sys_unlinkat,
-	[__NR_renameat]			sys_renameat,
-	[__NR_linkat]			sys_linkat,
-	[__NR_symlinkat]		sys_symlinkat,
-	[__NR_readlinkat]		sys_readlinkat,
-	[__NR_fchmodat]			sys_fchmodat,
-	[__NR_faccessat]		sys_faccessat,
+#define SYSCALL(func)		sys_ni_syscall,
+#define COMPAT_SYS(func)	sys_ni_syscall,
+#define PPC_SYS(func)		sys_ni_syscall,
+#define OLDSYS(func)		sys_ni_syscall,
+#define SYS32ONLY(func)		sys_ni_syscall,
+#define SYSX(f, f3264, f32)	sys_ni_syscall,
+
+#define SYSCALL_SPU(func)	sys_##func,
+#define COMPAT_SYS_SPU(func)	sys_##func,
+#define PPC_SYS_SPU(func)	ppc_##func,
+#define SYSX_SPU(f, f3264, f32)	f,
+
+#include <asm/systbl.h>
 };
 
 long spu_sys_callback(struct spu_syscall_block *s)
Index: linux-2.6.17-rc3-git3/include/asm-powerpc/systbl.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.17-rc3-git3/include/asm-powerpc/systbl.h	2006-04-30 14:17:52.000000000 +0200
@@ -0,0 +1,304 @@
+/*
+ * List of powerpc syscalls. For the meaning of the _SPU suffix see
+ * arch/powerpc/platforms/cell/spu_callbacks.c
+ */
+
+SYSCALL(restart_syscall)
+SYSCALL(exit)
+PPC_SYS(fork)
+SYSCALL_SPU(read)
+SYSCALL_SPU(write)
+COMPAT_SYS_SPU(open)
+SYSCALL_SPU(close)
+COMPAT_SYS_SPU(waitpid)
+COMPAT_SYS_SPU(creat)
+SYSCALL_SPU(link)
+SYSCALL_SPU(unlink)
+COMPAT_SYS(execve)
+SYSCALL_SPU(chdir)
+COMPAT_SYS_SPU(time)
+SYSCALL_SPU(mknod)
+SYSCALL_SPU(chmod)
+SYSCALL_SPU(lchown)
+SYSCALL(ni_syscall)
+OLDSYS(stat)
+SYSX_SPU(sys_lseek,ppc32_lseek,sys_lseek)
+SYSCALL_SPU(getpid)
+COMPAT_SYS(mount)
+SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
+SYSCALL_SPU(setuid)
+SYSCALL_SPU(getuid)
+COMPAT_SYS_SPU(stime)
+COMPAT_SYS(ptrace)
+SYSCALL_SPU(alarm)
+OLDSYS(fstat)
+COMPAT_SYS(pause)
+COMPAT_SYS(utime)
+SYSCALL(ni_syscall)
+SYSCALL(ni_syscall)
+COMPAT_SYS_SPU(access)
+COMPAT_SYS_SPU(nice)
+SYSCALL(ni_syscall)
+SYSCALL_SPU(sync)
+COMPAT_SYS_SPU(kill)
+SYSCALL_SPU(rename)
+COMPAT_SYS_SPU(mkdir)
+SYSCALL_SPU(rmdir)
+SYSCALL_SPU(dup)
+SYSCALL_SPU(pipe)
+COMPAT_SYS_SPU(times)
+SYSCALL(ni_syscall)
+SYSCALL_SPU(brk)
+SYSCALL_SPU(setgid)
+SYSCALL_SPU(getgid)
+SYSCALL(signal)
+SYSCALL_SPU(geteuid)
+SYSCALL_SPU(getegid)
+SYSCALL(acct)
+SYSCALL(umount)
+SYSCALL(ni_syscall)
+COMPAT_SYS_SPU(ioctl)
+COMPAT_SYS_SPU(fcntl)
+SYSCALL(ni_syscall)
+COMPAT_SYS_SPU(setpgid)
+SYSCALL(ni_syscall)
+SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
+COMPAT_SYS_SPU(umask)
+SYSCALL_SPU(chroot)
+SYSCALL(ustat)
+SYSCALL_SPU(dup2)
+SYSCALL_SPU(getppid)
+SYSCALL_SPU(getpgrp)
+SYSCALL_SPU(setsid)
+SYS32ONLY(sigaction)
+SYSCALL_SPU(sgetmask)
+COMPAT_SYS_SPU(ssetmask)
+SYSCALL_SPU(setreuid)
+SYSCALL_SPU(setregid)
+SYS32ONLY(sigsuspend)
+COMPAT_SYS(sigpending)
+COMPAT_SYS_SPU(sethostname)
+COMPAT_SYS_SPU(setrlimit)
+COMPAT_SYS(old_getrlimit)
+COMPAT_SYS_SPU(getrusage)
+COMPAT_SYS_SPU(gettimeofday)
+COMPAT_SYS_SPU(settimeofday)
+COMPAT_SYS_SPU(getgroups)
+COMPAT_SYS_SPU(setgroups)
+SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
+SYSCALL_SPU(symlink)
+OLDSYS(lstat)
+COMPAT_SYS_SPU(readlink)
+SYSCALL(uselib)
+SYSCALL(swapon)
+SYSCALL(reboot)
+SYSX(sys_ni_syscall,old32_readdir,old_readdir)
+SYSCALL_SPU(mmap)
+SYSCALL_SPU(munmap)
+SYSCALL_SPU(truncate)
+SYSCALL_SPU(ftruncate)
+SYSCALL_SPU(fchmod)
+SYSCALL_SPU(fchown)
+COMPAT_SYS_SPU(getpriority)
+COMPAT_SYS_SPU(setpriority)
+SYSCALL(ni_syscall)
+COMPAT_SYS(statfs)
+COMPAT_SYS(fstatfs)
+SYSCALL(ni_syscall)
+COMPAT_SYS_SPU(socketcall)
+COMPAT_SYS_SPU(syslog)
+COMPAT_SYS_SPU(setitimer)
+COMPAT_SYS_SPU(getitimer)
+COMPAT_SYS_SPU(newstat)
+COMPAT_SYS_SPU(newlstat)
+COMPAT_SYS_SPU(newfstat)
+SYSX(sys_ni_syscall,sys_uname,sys_uname)
+SYSCALL(ni_syscall)
+SYSCALL_SPU(vhangup)
+SYSCALL(ni_syscall)
+SYSCALL(ni_syscall)
+COMPAT_SYS_SPU(wait4)
+SYSCALL(swapoff)
+COMPAT_SYS_SPU(sysinfo)
+COMPAT_SYS(ipc)
+SYSCALL_SPU(fsync)
+SYS32ONLY(sigreturn)
+PPC_SYS(clone)
+COMPAT_SYS_SPU(setdomainname)
+PPC_SYS_SPU(newuname)
+SYSCALL(ni_syscall)
+COMPAT_SYS_SPU(adjtimex)
+SYSCALL_SPU(mprotect)
+SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
+SYSCALL(ni_syscall)
+SYSCALL(init_module)
+SYSCALL(delete_module)
+SYSCALL(ni_syscall)
+SYSCALL(quotactl)
+COMPAT_SYS_SPU(getpgid)
+SYSCALL_SPU(fchdir)
+SYSCALL_SPU(bdflush)
+COMPAT_SYS(sysfs)
+SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality)
+SYSCALL(ni_syscall)
+SYSCALL_SPU(setfsuid)
+SYSCALL_SPU(setfsgid)
+SYSCALL_SPU(llseek)
+COMPAT_SYS_SPU(getdents)
+SYSX_SPU(sys_select,ppc32_select,ppc_select)
+SYSCALL_SPU(flock)
+SYSCALL_SPU(msync)
+COMPAT_SYS_SPU(readv)
+COMPAT_SYS_SPU(writev)
+COMPAT_SYS_SPU(getsid)
+SYSCALL_SPU(fdatasync)
+COMPAT_SYS(sysctl)
+SYSCALL_SPU(mlock)
+SYSCALL_SPU(munlock)
+SYSCALL_SPU(mlockall)
+SYSCALL_SPU(munlockall)
+COMPAT_SYS_SPU(sched_setparam)
+COMPAT_SYS_SPU(sched_getparam)
+COMPAT_SYS_SPU(sched_setscheduler)
+COMPAT_SYS_SPU(sched_getscheduler)
+SYSCALL_SPU(sched_yield)
+COMPAT_SYS_SPU(sched_get_priority_max)
+COMPAT_SYS_SPU(sched_get_priority_min)
+COMPAT_SYS_SPU(sched_rr_get_interval)
+COMPAT_SYS_SPU(nanosleep)
+SYSCALL_SPU(mremap)
+SYSCALL_SPU(setresuid)
+SYSCALL_SPU(getresuid)
+SYSCALL(ni_syscall)
+SYSCALL_SPU(poll)
+COMPAT_SYS(nfsservctl)
+SYSCALL_SPU(setresgid)
+SYSCALL_SPU(getresgid)
+COMPAT_SYS_SPU(prctl)
+COMPAT_SYS(rt_sigreturn)
+COMPAT_SYS(rt_sigaction)
+COMPAT_SYS(rt_sigprocmask)
+COMPAT_SYS(rt_sigpending)
+COMPAT_SYS(rt_sigtimedwait)
+COMPAT_SYS(rt_sigqueueinfo)
+COMPAT_SYS(rt_sigsuspend)
+COMPAT_SYS_SPU(pread64)
+COMPAT_SYS_SPU(pwrite64)
+SYSCALL_SPU(chown)
+SYSCALL_SPU(getcwd)
+SYSCALL_SPU(capget)
+SYSCALL_SPU(capset)
+COMPAT_SYS(sigaltstack)
+SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
+SYSCALL(ni_syscall)
+SYSCALL(ni_syscall)
+PPC_SYS(vfork)
+COMPAT_SYS_SPU(getrlimit)
+COMPAT_SYS_SPU(readahead)
+SYS32ONLY(mmap2)
+SYS32ONLY(truncate64)
+SYS32ONLY(ftruncate64)
+SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
+SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
+SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
+SYSCALL(pciconfig_read)
+SYSCALL(pciconfig_write)
+SYSCALL(pciconfig_iobase)
+SYSCALL(ni_syscall)
+SYSCALL_SPU(getdents64)
+SYSCALL_SPU(pivot_root)
+SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
+SYSCALL_SPU(madvise)
+SYSCALL_SPU(mincore)
+SYSCALL_SPU(gettid)
+SYSCALL_SPU(tkill)
+SYSCALL_SPU(setxattr)
+SYSCALL_SPU(lsetxattr)
+SYSCALL_SPU(fsetxattr)
+SYSCALL_SPU(getxattr)
+SYSCALL_SPU(lgetxattr)
+SYSCALL_SPU(fgetxattr)
+SYSCALL_SPU(listxattr)
+SYSCALL_SPU(llistxattr)
+SYSCALL_SPU(flistxattr)
+SYSCALL_SPU(removexattr)
+SYSCALL_SPU(lremovexattr)
+SYSCALL_SPU(fremovexattr)
+COMPAT_SYS_SPU(futex)
+COMPAT_SYS_SPU(sched_setaffinity)
+COMPAT_SYS_SPU(sched_getaffinity)
+SYSCALL(ni_syscall)
+SYSCALL(ni_syscall)
+SYS32ONLY(sendfile64)
+COMPAT_SYS_SPU(io_setup)
+SYSCALL_SPU(io_destroy)
+COMPAT_SYS_SPU(io_getevents)
+COMPAT_SYS_SPU(io_submit)
+SYSCALL_SPU(io_cancel)
+SYSCALL(set_tid_address)
+SYSX_SPU(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
+SYSCALL(exit_group)
+SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
+SYSCALL_SPU(epoll_create)
+SYSCALL_SPU(epoll_ctl)
+SYSCALL_SPU(epoll_wait)
+SYSCALL_SPU(remap_file_pages)
+SYSX_SPU(sys_timer_create,compat_sys_timer_create,sys_timer_create)
+COMPAT_SYS_SPU(timer_settime)
+COMPAT_SYS_SPU(timer_gettime)
+SYSCALL_SPU(timer_getoverrun)
+SYSCALL_SPU(timer_delete)
+COMPAT_SYS_SPU(clock_settime)
+COMPAT_SYS_SPU(clock_gettime)
+COMPAT_SYS_SPU(clock_getres)
+COMPAT_SYS_SPU(clock_nanosleep)
+SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
+COMPAT_SYS_SPU(tgkill)
+COMPAT_SYS_SPU(utimes)
+COMPAT_SYS_SPU(statfs64)
+COMPAT_SYS_SPU(fstatfs64)
+SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
+PPC_SYS_SPU(rtas)
+OLDSYS(debug_setcontext)
+SYSCALL(ni_syscall)
+SYSCALL(ni_syscall)
+COMPAT_SYS(mbind)
+COMPAT_SYS(get_mempolicy)
+COMPAT_SYS(set_mempolicy)
+COMPAT_SYS(mq_open)
+SYSCALL(mq_unlink)
+COMPAT_SYS(mq_timedsend)
+COMPAT_SYS(mq_timedreceive)
+COMPAT_SYS(mq_notify)
+COMPAT_SYS(mq_getsetattr)
+COMPAT_SYS(kexec_load)
+COMPAT_SYS(add_key)
+COMPAT_SYS(request_key)
+COMPAT_SYS(keyctl)
+COMPAT_SYS(waitid)
+COMPAT_SYS(ioprio_set)
+COMPAT_SYS(ioprio_get)
+SYSCALL(inotify_init)
+SYSCALL(inotify_add_watch)
+SYSCALL(inotify_rm_watch)
+SYSCALL(spu_run)
+SYSCALL(spu_create)
+COMPAT_SYS(pselect6)
+COMPAT_SYS(ppoll)
+SYSCALL_SPU(unshare)
+SYSCALL_SPU(splice)
+SYSCALL_SPU(tee)
+SYSCALL_SPU(vmsplice)
+COMPAT_SYS_SPU(openat)
+SYSCALL_SPU(mkdirat)
+SYSCALL_SPU(mknodat)
+SYSCALL_SPU(fchownat)
+COMPAT_SYS_SPU(futimesat)
+SYSX_SPU(sys_newfstatat, sys_fstatat64, sys_fstatat64)
+SYSCALL_SPU(unlinkat)
+SYSCALL_SPU(renameat)
+SYSCALL_SPU(linkat)
+SYSCALL_SPU(symlinkat)
+SYSCALL_SPU(readlinkat)
+SYSCALL_SPU(fchmodat)
+SYSCALL_SPU(faccessat)

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Segher Boessenkool @ 2006-04-30 13:04 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Olof Johansson, linuxppc-dev, torvalds, Paul Mackerras
In-Reply-To: <200604301342.02043.arnd@arndb.de>

>> We already have SMT, ICACHE_SNOOP and ALTIVEC feature bits, so it  
>> probably
>> makes sense to stay in the ARCH_2_05 direction. Unfortunately it  
>> might
>> be tricky to rename the old defines now due to userland exposure.
>>
>> I guess Cell breaks all this logic though. Which PPC base version  
>> does
>> it implement?
>
> The Cell Broadband Engine Architecture in theory is 2.03 and also  
> mandates

The docs (for example, "CBE_Architecture_v10.pdf") say 2.02.  One  
more reason
to not use those arch version numbers.


Segher

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Arnd Bergmann @ 2006-04-30 11:57 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Olof Johansson, torvalds, Paul Mackerras
In-Reply-To: <200604301342.02043.arnd@arndb.de>

On Sunday 30 April 2006 13:42, Arnd Bergmann wrote:
> The Cell Broadband Engine Architecture in theory is 2.03 and also mandates
> some of the extensions that are optional in there.

Oh, and it also has some extensions that are supposed to be part of later
powerpc architecture releases (CBEA, appendix E):

• Mediated interrupt
• Multiple concurrent large pages
• Add TL (TLB load control) bit to logical-partitioning control register
 (LPCR) for software versus hardware load of TLB
• Change tlbie<l> of large page to always invalidate ERAT
• Hypervisor SPRs no longer readable when HV equals 0

Do we know which ones of these made it into 2.05?

	Arnd <><

^ permalink raw reply

* Re: please pull powerpc.git 'merge' branch
From: Arnd Bergmann @ 2006-04-30 11:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Olof Johansson, torvalds, Paul Mackerras
In-Reply-To: <20060430042059.GO5518@pb15.lixom.net>

On Sunday 30 April 2006 06:20, Olof Johansson wrote:

> We already have SMT, ICACHE_SNOOP and ALTIVEC feature bits, so it probably
> makes sense to stay in the ARCH_2_05 direction. Unfortunately it might
> be tricky to rename the old defines now due to userland exposure.
> 
> I guess Cell breaks all this logic though. Which PPC base version does
> it implement?

The Cell Broadband Engine Architecture in theory is 2.03 and also mandates
some of the extensions that are optional in there.
The relevant sections in the specs are:

| 4.1.1 Optional Features in PowerPC Architecture, Book I (Required for
|       CBEA) 
| The following facilities and instructions are considered optional in
| the PowerPC Architecture, but are required for the PPE by the CBEA
| user mode environment. 
|  • Floating reciprocal estimate single A-form (fres)
|  • Floating reciprocal square-root estimate A-form (frsqte)
|  • Vector/SIMD multimedia extension
| Note: The optional PowerPC floating-point instructions that are
| mandatory in the CBEA are needed for the application space targeted
| by the CBEA. 
|
| 4.1.3 Optional Features in PowerPC Architecture, Book II (Required
|       for CBEA) 
| The following facilities and instructions are considered optional
| in the PowerPC Architecture, but are required in the CBEA.
|  • Data cache block touch X-form (dcbt)
|    This is an optional version of dcbt that permits a program to
|    provide a hint that a sequence of data cache blocks is likely
|    to be needed soon. 
|  Book II describes these facilities and instructions.

I believe the actual implementation is missing one of the mandatory
features of 2.03 that was not in 2.02 though.

	Arnd <><

^ permalink raw reply

* Large Page Support, 2.6 kernel , PPC440
From: moris dong @ 2006-04-30  8:17 UTC (permalink / raw)
  To: linuxppc-dev

Friends,
My PPC440 (32bit) MMU supports multiple page sizes.
For the default 4K pages, my 2.6.11 kernel compiles and boots just fine.
I want to re-build it with large pages, to improve my application 
performance.
I tried modifying PAGE_SHIFT in "page.h" to 13 (8K pages) and re-build my 
kernel.
Compilation worked out fine, but my kernel does NOT boot, nor it prints 
anything to the console.

Has anyone successfully compiled & booted a 2.6 kernel for PPC440 with pages 
larger than 4K ?
What am I doing wrong ?

Thanks a lot.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

^ permalink raw reply

* Large Page Support, 2.6 kernel , PPC440
From: moris dong @ 2006-04-30  8:15 UTC (permalink / raw)
  To: linuxppc-embedded

Friends,
My PPC440 (32bit) MMU supports multiple page sizes.
For the default 4K pages, my 2.6.11 kernel compiles and boots just fine.
I want to re-build it with large pages, to improve my application 
performance.
I tried modifying PAGE_SHIFT in "page.h" to 13 (8K pages) and re-build my 
kernel.
Compilation worked out fine, but my kernel does NOT boot, nor it prints 
anything to the console.

Has anyone successfully compiled & booted a 2.6 kernel with pages larger 
than 4K ?
What am I doing wrong ?

Thanks a lot.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

^ permalink raw reply

* [PATCH] powerpc: Fix comment in ibm_architecture_vec
From: Olof Johansson @ 2006-04-30  4:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17491.1134.565353.149941@cargo.ozlabs.ibm.com>

On Sat, Apr 29, 2006 at 04:15:10PM +1000, Paul Mackerras wrote:

> Paul Mackerras:
>       powerpc/pseries: Tell firmware our capabilities on new machines

Below is definitely not 2.6.17 material, so for the 2.6.18 queue:

---

Either constant or comment is wrong, I'm guessing it's comment since the
ELF header version uses 64MB.

Signed-off-by: Olof Johansson <olof@lixom.net>


diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 078fb55..ef99f26 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -705,7 +705,7 @@ static unsigned char ibm_architecture_ve
 	W(0xffffffff),			/* virt_base */
 	W(0xffffffff),			/* virt_size */
 	W(0xffffffff),			/* load_base */
-	W(64),				/* 128MB min RMA */
+	W(64),				/* 64MB min RMA */
 	W(0xffffffff),			/* full client load */
 	0,				/* min RMA percentage of total RAM */
 	48,				/* max log_2(hash table size) */

^ permalink raw reply related

* [PATCH] powerpc: rename PPC_FEATURE_POWER.* to PPC_FEATURE_ARCH.*
From: Olof Johansson @ 2006-04-30  4:48 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev
In-Reply-To: <20060430035001.GN5518@pb15.lixom.net>

On Sat, Apr 29, 2006 at 10:50:01PM -0500, Olof Johansson wrote:

> A rename of existing names might make sense for consistency/clarity. But
> that's outside of __KERNEL__ so it would break userspace.

Less talk, more patches. 2.6.18 material.

Btw, looks like glibc duplicates the definitions instead of includes them,
but let's be nice and keep them anyway. Besides, they got the ISA
version to processor mappings wrong in their comments.


---

Rename PPC_FEATURE_POWER.* to be signify the base architecture versions
instead. Keep the old names around since they're defined outside of
__KERNEL__.

If POWER5 is 2.02 (last public version), and POWER6 is 2.05, then POWER5+
should be 2.03 or 2.04. Not sure what fills in the hole, but I took a
guess that 5+ is 2.03.


Signed-off-by: Olof Johansson <olof@lixom.net>

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 3f7182d..7017d1c 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -52,10 +52,10 @@ extern void __setup_cpu_ppc970(unsigned 
 #define COMMON_USER		(PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
 				 PPC_FEATURE_HAS_MMU)
 #define COMMON_USER_PPC64	(COMMON_USER | PPC_FEATURE_64)
-#define COMMON_USER_POWER4	(COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
-#define COMMON_USER_POWER5	(COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
+#define COMMON_USER_POWER4	(COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_00)
+#define COMMON_USER_POWER5	(COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_02 |\
 				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
-#define COMMON_USER_POWER5_PLUS	(COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
+#define COMMON_USER_POWER5_PLUS	(COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_03|\
 				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
 #define COMMON_USER_POWER6	(COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
 				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 9fcf016..deae3af 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -15,15 +15,24 @@
 #define PPC_FEATURE_HAS_EFP_SINGLE	0x00400000
 #define PPC_FEATURE_HAS_EFP_DOUBLE	0x00200000
 #define PPC_FEATURE_NO_TB		0x00100000
-#define PPC_FEATURE_POWER4		0x00080000
-#define PPC_FEATURE_POWER5		0x00040000
-#define PPC_FEATURE_POWER5_PLUS		0x00020000
+#define PPC_FEATURE_ARCH_2_00		0x00080000
+#define PPC_FEATURE_ARCH_2_02		0x00040000
+#define PPC_FEATURE_ARCH_2_03		0x00020000
 #define PPC_FEATURE_CELL		0x00010000
 #define PPC_FEATURE_BOOKE		0x00008000
 #define PPC_FEATURE_SMT			0x00004000
 #define PPC_FEATURE_ICACHE_SNOOP	0x00002000
 #define PPC_FEATURE_ARCH_2_05		0x00001000
 
+/*
+ * These are needed for userspace compat, since processor
+ * models used to be used before instead of arch versions
+ */
+
+#define PPC_FEATURE_POWER4	PPC_FEATURE_ARCH_2_00
+#define PPC_FEATURE_POWER5	PPC_FEATURE_ARCH_2_02
+#define PPC_FEATURE_POWER5_PLUS	PPC_FEATURE_ARCH_2_03
+
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 

^ permalink raw reply related

* Re: please pull powerpc.git 'merge' branch
From: Olof Johansson @ 2006-04-30  4:20 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Olof Johansson, linuxppc-dev, torvalds, Paul Mackerras
In-Reply-To: <71339D1F-CAF1-4FF0-A1A3-1A74B8984F05@kernel.crashing.org>

On Sun, Apr 30, 2006 at 05:12:57AM +0200, Segher Boessenkool wrote:
> >>Previously we've said implementation instead of specification
> >>("PPC_FEATURE_POWER5_PLUS" etc). That's better than saying base
> >>architecture version, since there are parts of the arch that might or
> >>might not be implemented (i.e. optional features, etc).
> >
> >We now have the AT_PLATFORM string, which we didn't have when we added
> >the POWER5_PLUS etc. features.  That specifies which particular
> >implementation we are on quite precisely.  We don't want to have a bit
> >for every single implementation or we'll run out of bits.
> >
> >The ARCH_2_05 bit means all the non-optional bits of the 2.05
> >architecture.  If there are optional features in the architecture, we
> >have separate bits for them.  For example, we don't have separate
> >bits for POWER4 and for 970; instead we have a HAS_ALTIVEC bit, and
> >for 970 we set both POWER4 and HAS_ALTIVEC.  So the POWER4 bit is
> >really a "2.00 architecture version" bit.
> 
> Except that the 970 at least is actually version 2.01.

Are there any userspace-visible differences between 2.00 and 2.01?

> Sounds
> like names are better than bare numbers -- you showed yourself that
> numbers like this are confusing, but you also say that a cpu name
> really means an arch version (which isn't so bad -- there generally
> is only one "main" CPU per arch version anyway, and people generally
> know what is compatible to what).

It's actually about an even tradeoff between the two. We run the risk
of running out of bits eventually no matter what, and as long as it's
blindingly clear and well stated that it does not imply any optional
features, then it doesn't matter. This puts the burden on userspace
developers to know which features are optional, not just what works on
their POWER6 lab machine, etc.

> So please rename ARCH_2_05 to the name of the first CPU that implements
> architecture 2.05?

We already have SMT, ICACHE_SNOOP and ALTIVEC feature bits, so it probably
makes sense to stay in the ARCH_2_05 direction. Unfortunately it might
be tricky to rename the old defines now due to userland exposure.

I guess Cell breaks all this logic though. Which PPC base version does
it implement?


-Olof

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox