* PPC64 cleanups 0/11
@ 2005-01-04 3:53 Stephen Rothwell
2005-01-04 4:04 ` [PATCH 1/11] PPC64: Consolidate cache sizing variables Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 3:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: ppc64-dev, LKML
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
Hi Andrew,
The following series of patches are mainly just cleanups of the ppc64 code
in order to eliminate the naca structure. In the end, the naca only
exists for legacy iseries kernels. One of the more intrusive parts of
these patches is the renaming of the fields of the lppaca structure to
eliminate another set of StudyCaps.
These patches (in total) have been built on iSeries, pSeries and pmac and
booted on iSeries and pSeries.
Please apply and send upstream.
--
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 [flat|nested] 14+ messages in thread
* [PATCH 1/11] PPC64: Consolidate cache sizing variables
2005-01-04 3:53 PPC64 cleanups 0/11 Stephen Rothwell
@ 2005-01-04 4:04 ` Stephen Rothwell
2005-01-04 4:08 ` [PATCH 2/11] PPC64: remove the page table size from the naca Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:04 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 21280 bytes --]
Hi Andrew,
This patch consolidates the variables that define the PPC64 cache sizes
into a single structure (the were in the naca and the systemcfg
structures). Those that were in the systemcfg structure are left there
just because they are exported to user mode through /proc.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk/arch/ppc64/kernel/asm-offsets.c linus-bk-naca.1/arch/ppc64/kernel/asm-offsets.c
--- linus-bk/arch/ppc64/kernel/asm-offsets.c 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/asm-offsets.c 2004-12-31 14:52:14.000000000 +1100
@@ -35,6 +35,7 @@
#include <asm/iSeries/HvLpEvent.h>
#include <asm/rtas.h>
#include <asm/cputable.h>
+#include <asm/cache.h>
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -69,12 +70,12 @@
/* naca */
DEFINE(PACA, offsetof(struct naca_struct, paca));
- DEFINE(DCACHEL1LINESIZE, offsetof(struct systemcfg, dCacheL1LineSize));
- DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct naca_struct, dCacheL1LogLineSize));
- DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct naca_struct, dCacheL1LinesPerPage));
- DEFINE(ICACHEL1LINESIZE, offsetof(struct systemcfg, iCacheL1LineSize));
- DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct naca_struct, iCacheL1LogLineSize));
- DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct naca_struct, iCacheL1LinesPerPage));
+ DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
+ DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
+ DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
+ DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
+ DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
+ DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
/* paca */
diff -ruN linus-bk/arch/ppc64/kernel/eeh.c linus-bk-naca.1/arch/ppc64/kernel/eeh.c
--- linus-bk/arch/ppc64/kernel/eeh.c 2004-10-26 16:06:41.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/eeh.c 2004-12-31 14:52:14.000000000 +1100
@@ -32,6 +32,7 @@
#include <asm/machdep.h>
#include <asm/rtas.h>
#include <asm/atomic.h>
+#include <asm/systemcfg.h>
#include "pci.h"
#undef DEBUG
diff -ruN linus-bk/arch/ppc64/kernel/iSeries_setup.c linus-bk-naca.1/arch/ppc64/kernel/iSeries_setup.c
--- linus-bk/arch/ppc64/kernel/iSeries_setup.c 2004-11-12 09:09:48.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/iSeries_setup.c 2004-12-31 14:52:14.000000000 +1100
@@ -44,6 +44,7 @@
#include "iSeries_setup.h"
#include <asm/naca.h>
#include <asm/paca.h>
+#include <asm/cache.h>
#include <asm/sections.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCallHpt.h>
@@ -560,33 +561,36 @@
unsigned int i, n;
unsigned int procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex;
- systemcfg->iCacheL1Size =
- xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
- systemcfg->iCacheL1LineSize =
+ systemcfg->icache_size =
+ ppc64_caches.isize = xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
+ systemcfg->icache_line_size =
+ ppc64_caches.iline_size =
xIoHriProcessorVpd[procIx].xInstCacheOperandSize;
- systemcfg->dCacheL1Size =
+ systemcfg->dcache_size =
+ ppc64_caches.dsize =
xIoHriProcessorVpd[procIx].xDataL1CacheSizeKB * 1024;
- systemcfg->dCacheL1LineSize =
+ systemcfg->dcache_line_size =
+ ppc64_caches.dline_size =
xIoHriProcessorVpd[procIx].xDataCacheOperandSize;
- naca->iCacheL1LinesPerPage = PAGE_SIZE / systemcfg->iCacheL1LineSize;
- naca->dCacheL1LinesPerPage = PAGE_SIZE / systemcfg->dCacheL1LineSize;
+ ppc64_caches.ilines_per_page = PAGE_SIZE / ppc64_caches.iline_size;
+ ppc64_caches.dlines_per_page = PAGE_SIZE / ppc64_caches.dline_size;
- i = systemcfg->iCacheL1LineSize;
+ i = ppc64_caches.iline_size;
n = 0;
while ((i = (i / 2)))
++n;
- naca->iCacheL1LogLineSize = n;
+ ppc64_caches.log_iline_size = n;
- i = systemcfg->dCacheL1LineSize;
+ i = ppc64_caches.dline_size;
n = 0;
while ((i = (i / 2)))
++n;
- naca->dCacheL1LogLineSize = n;
+ ppc64_caches.log_dline_size = n;
printk("D-cache line size = %d\n",
- (unsigned int)systemcfg->dCacheL1LineSize);
+ (unsigned int)ppc64_caches.dline_size);
printk("I-cache line size = %d\n",
- (unsigned int)systemcfg->iCacheL1LineSize);
+ (unsigned int)ppc64_caches.iline_size);
}
/*
diff -ruN linus-bk/arch/ppc64/kernel/idle.c linus-bk-naca.1/arch/ppc64/kernel/idle.c
--- linus-bk/arch/ppc64/kernel/idle.c 2004-10-27 07:32:57.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/idle.c 2004-12-31 14:52:14.000000000 +1100
@@ -32,6 +32,7 @@
#include <asm/iSeries/HvCall.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/plpar_wrappers.h>
+#include <asm/systemcfg.h>
extern void power4_idle(void);
diff -ruN linus-bk/arch/ppc64/kernel/misc.S linus-bk-naca.1/arch/ppc64/kernel/misc.S
--- linus-bk/arch/ppc64/kernel/misc.S 2004-11-12 09:09:48.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/misc.S 2004-12-31 14:52:14.000000000 +1100
@@ -189,6 +189,11 @@
isync
blr
+ .section ".toc","aw"
+PPC64_CACHES:
+ .tc ppc64_caches[TC],ppc64_caches
+ .section ".text"
+
/*
* Write any modified data cache blocks out to memory
* and invalidate the corresponding instruction cache blocks.
@@ -207,11 +212,8 @@
* and in some cases i-cache and d-cache line sizes differ from
* each other.
*/
- LOADADDR(r10,naca) /* Get Naca address */
- ld r10,0(r10)
- LOADADDR(r11,systemcfg) /* Get systemcfg address */
- ld r11,0(r11)
- lwz r7,DCACHEL1LINESIZE(r11)/* Get cache line size */
+ ld r10,PPC64_CACHES@toc(r2)
+ lwz r7,DCACHEL1LINESIZE(r10)/* Get cache line size */
addi r5,r7,-1
andc r6,r3,r5 /* round low to line bdy */
subf r8,r6,r4 /* compute length */
@@ -227,7 +229,7 @@
/* Now invalidate the instruction cache */
- lwz r7,ICACHEL1LINESIZE(r11) /* Get Icache line size */
+ lwz r7,ICACHEL1LINESIZE(r10) /* Get Icache line size */
addi r5,r7,-1
andc r6,r3,r5 /* round low to line bdy */
subf r8,r6,r4 /* compute length */
@@ -256,11 +258,8 @@
*
* Different systems have different cache line sizes
*/
- LOADADDR(r10,naca) /* Get Naca address */
- ld r10,0(r10)
- LOADADDR(r11,systemcfg) /* Get systemcfg address */
- ld r11,0(r11)
- lwz r7,DCACHEL1LINESIZE(r11) /* Get dcache line size */
+ ld r10,PPC64_CACHES@toc(r2)
+ lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
addi r5,r7,-1
andc r6,r3,r5 /* round low to line bdy */
subf r8,r6,r4 /* compute length */
@@ -286,11 +285,8 @@
* flush all bytes from start to stop-1 inclusive
*/
_GLOBAL(flush_dcache_phys_range)
- LOADADDR(r10,naca) /* Get Naca address */
- ld r10,0(r10)
- LOADADDR(r11,systemcfg) /* Get systemcfg address */
- ld r11,0(r11)
- lwz r7,DCACHEL1LINESIZE(r11) /* Get dcache line size */
+ ld r10,PPC64_CACHES@toc(r2)
+ lwz r7,DCACHEL1LINESIZE(r10) /* Get dcache line size */
addi r5,r7,-1
andc r6,r3,r5 /* round low to line bdy */
subf r8,r6,r4 /* compute length */
@@ -332,13 +328,10 @@
*/
/* Flush the dcache */
- LOADADDR(r7,naca)
- ld r7,0(r7)
- LOADADDR(r8,systemcfg) /* Get systemcfg address */
- ld r8,0(r8)
+ ld r7,PPC64_CACHES@toc(r2)
clrrdi r3,r3,12 /* Page align */
lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */
- lwz r5,DCACHEL1LINESIZE(r8) /* Get dcache line size */
+ lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */
mr r6,r3
mtctr r4
0: dcbst 0,r6
@@ -349,7 +342,7 @@
/* Now invalidate the icache */
lwz r4,ICACHEL1LINESPERPAGE(r7) /* Get # icache lines per page */
- lwz r5,ICACHEL1LINESIZE(r8) /* Get icache line size */
+ lwz r5,ICACHEL1LINESIZE(r7) /* Get icache line size */
mtctr r4
1: icbi 0,r3
add r3,r3,r5
diff -ruN linus-bk/arch/ppc64/kernel/nvram.c linus-bk-naca.1/arch/ppc64/kernel/nvram.c
--- linus-bk/arch/ppc64/kernel/nvram.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/nvram.c 2004-12-31 14:52:14.000000000 +1100
@@ -31,6 +31,7 @@
#include <asm/rtas.h>
#include <asm/prom.h>
#include <asm/machdep.h>
+#include <asm/systemcfg.h>
#undef DEBUG_NVRAM
diff -ruN linus-bk/arch/ppc64/kernel/pSeries_iommu.c linus-bk-naca.1/arch/ppc64/kernel/pSeries_iommu.c
--- linus-bk/arch/ppc64/kernel/pSeries_iommu.c 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/pSeries_iommu.c 2004-12-31 14:52:14.000000000 +1100
@@ -43,6 +43,7 @@
#include <asm/machdep.h>
#include <asm/abs_addr.h>
#include <asm/plpar_wrappers.h>
+#include <asm/systemcfg.h>
#include "pci.h"
diff -ruN linus-bk/arch/ppc64/kernel/pacaData.c linus-bk-naca.1/arch/ppc64/kernel/pacaData.c
--- linus-bk/arch/ppc64/kernel/pacaData.c 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/pacaData.c 2004-12-31 14:52:14.000000000 +1100
@@ -10,6 +10,8 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/threads.h>
+#include <linux/module.h>
+
#include <asm/processor.h>
#include <asm/ptrace.h>
#include <asm/page.h>
@@ -20,7 +22,9 @@
#include <asm/paca.h>
struct naca_struct *naca;
+EXPORT_SYMBOL(naca);
struct systemcfg *systemcfg;
+EXPORT_SYMBOL(systemcfg);
/* This symbol is provided by the linker - let it fill in the paca
* field correctly */
diff -ruN linus-bk/arch/ppc64/kernel/pmac_setup.c linus-bk-naca.1/arch/ppc64/kernel/pmac_setup.c
--- linus-bk/arch/ppc64/kernel/pmac_setup.c 2004-10-25 18:18:33.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/pmac_setup.c 2004-12-31 14:52:14.000000000 +1100
@@ -70,6 +70,7 @@
#include <asm/time.h>
#include <asm/of_device.h>
#include <asm/lmb.h>
+#include <asm/naca.h>
#include "pmac.h"
#include "mpic.h"
diff -ruN linus-bk/arch/ppc64/kernel/ppc_ksyms.c linus-bk-naca.1/arch/ppc64/kernel/ppc_ksyms.c
--- linus-bk/arch/ppc64/kernel/ppc_ksyms.c 2004-10-21 07:17:18.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/ppc_ksyms.c 2004-12-31 14:52:14.000000000 +1100
@@ -67,7 +67,6 @@
EXPORT_SYMBOL(__down_interruptible);
EXPORT_SYMBOL(__up);
-EXPORT_SYMBOL(naca);
EXPORT_SYMBOL(__down);
#ifdef CONFIG_PPC_ISERIES
EXPORT_SYMBOL(itLpNaca);
@@ -162,4 +161,3 @@
EXPORT_SYMBOL(tb_ticks_per_usec);
EXPORT_SYMBOL(paca);
EXPORT_SYMBOL(cur_cpu_spec);
-EXPORT_SYMBOL(systemcfg);
diff -ruN linus-bk/arch/ppc64/kernel/rtas-proc.c linus-bk-naca.1/arch/ppc64/kernel/rtas-proc.c
--- linus-bk/arch/ppc64/kernel/rtas-proc.c 2004-10-21 07:17:18.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/rtas-proc.c 2004-12-31 14:52:14.000000000 +1100
@@ -31,6 +31,7 @@
#include <asm/rtas.h>
#include <asm/machdep.h> /* for ppc_md */
#include <asm/time.h>
+#include <asm/systemcfg.h>
/* Token for Sensors */
#define KEY_SWITCH 0x0001
diff -ruN linus-bk/arch/ppc64/kernel/rtas.c linus-bk-naca.1/arch/ppc64/kernel/rtas.c
--- linus-bk/arch/ppc64/kernel/rtas.c 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/rtas.c 2004-12-31 14:52:14.000000000 +1100
@@ -29,6 +29,7 @@
#include <asm/udbg.h>
#include <asm/delay.h>
#include <asm/uaccess.h>
+#include <asm/systemcfg.h>
struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
diff -ruN linus-bk/arch/ppc64/kernel/rtasd.c linus-bk-naca.1/arch/ppc64/kernel/rtasd.c
--- linus-bk/arch/ppc64/kernel/rtasd.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/rtasd.c 2004-12-31 14:52:14.000000000 +1100
@@ -26,6 +26,7 @@
#include <asm/prom.h>
#include <asm/nvram.h>
#include <asm/atomic.h>
+#include <asm/systemcfg.h>
#if 0
#define DEBUG(A...) printk(KERN_ERR A)
diff -ruN linus-bk/arch/ppc64/kernel/setup.c linus-bk-naca.1/arch/ppc64/kernel/setup.c
--- linus-bk/arch/ppc64/kernel/setup.c 2004-12-14 04:07:06.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/setup.c 2004-12-31 16:22:00.000000000 +1100
@@ -54,6 +54,7 @@
#include <asm/rtas.h>
#include <asm/iommu.h>
#include <asm/serial.h>
+#include <asm/cache.h>
#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
@@ -111,6 +112,8 @@
int boot_cpuid_phys = 0;
dev_t boot_dev;
+struct ppc64_caches ppc64_caches;
+
/*
* These are used in binfmt_elf.c to put aux entries on the stack
* for each elf executable being started.
@@ -489,15 +492,15 @@
lsizep = (u32 *) get_property(np, dc, NULL);
if (lsizep != NULL)
lsize = *lsizep;
-
if (sizep == 0 || lsizep == 0)
DBG("Argh, can't find dcache properties ! "
"sizep: %p, lsizep: %p\n", sizep, lsizep);
- systemcfg->dCacheL1Size = size;
- systemcfg->dCacheL1LineSize = lsize;
- naca->dCacheL1LogLineSize = __ilog2(lsize);
- naca->dCacheL1LinesPerPage = PAGE_SIZE/(lsize);
+ systemcfg->dcache_size = ppc64_caches.dsize = size;
+ systemcfg->dcache_line_size =
+ ppc64_caches.dline_size = lsize;
+ ppc64_caches.log_dline_size = __ilog2(lsize);
+ ppc64_caches.dlines_per_page = PAGE_SIZE / lsize;
size = 0;
lsize = cur_cpu_spec->icache_bsize;
@@ -511,11 +514,11 @@
DBG("Argh, can't find icache properties ! "
"sizep: %p, lsizep: %p\n", sizep, lsizep);
- systemcfg->iCacheL1Size = size;
- systemcfg->iCacheL1LineSize = lsize;
- naca->iCacheL1LogLineSize = __ilog2(lsize);
- naca->iCacheL1LinesPerPage = PAGE_SIZE/(lsize);
-
+ systemcfg->icache_size = ppc64_caches.isize = size;
+ systemcfg->icache_line_size =
+ ppc64_caches.iline_size = lsize;
+ ppc64_caches.log_iline_size = __ilog2(lsize);
+ ppc64_caches.ilines_per_page = PAGE_SIZE / lsize;
}
}
@@ -664,8 +667,10 @@
printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount);
printk("systemcfg->physicalMemorySize = 0x%lx\n", systemcfg->physicalMemorySize);
- printk("systemcfg->dCacheL1LineSize = 0x%x\n", systemcfg->dCacheL1LineSize);
- printk("systemcfg->iCacheL1LineSize = 0x%x\n", systemcfg->iCacheL1LineSize);
+ printk("ppc64_caches.dcache_line_size = 0x%x\n",
+ ppc64_caches.dline_size);
+ printk("ppc64_caches.icache_line_size = 0x%x\n",
+ ppc64_caches.iline_size);
printk("htab_data.htab = 0x%p\n", htab_data.htab);
printk("htab_data.num_ptegs = 0x%lx\n", htab_data.htab_num_ptegs);
printk("-----------------------------------------------------\n");
@@ -1000,8 +1005,8 @@
* Systems with OF can look in the properties on the cpu node(s)
* for a possibly more accurate value.
*/
- dcache_bsize = systemcfg->dCacheL1LineSize;
- icache_bsize = systemcfg->iCacheL1LineSize;
+ dcache_bsize = ppc64_caches.dline_size;
+ icache_bsize = ppc64_caches.iline_size;
/* reboot on panic */
panic_timeout = 180;
diff -ruN linus-bk/arch/ppc64/kernel/sys_ppc32.c linus-bk-naca.1/arch/ppc64/kernel/sys_ppc32.c
--- linus-bk/arch/ppc64/kernel/sys_ppc32.c 2004-10-28 16:57:54.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/sys_ppc32.c 2004-12-31 14:52:14.000000000 +1100
@@ -73,6 +73,7 @@
#include <asm/ppcdebug.h>
#include <asm/time.h>
#include <asm/mmu_context.h>
+#include <asm/systemcfg.h>
#include "pci.h"
diff -ruN linus-bk/arch/ppc64/kernel/sysfs.c linus-bk-naca.1/arch/ppc64/kernel/sysfs.c
--- linus-bk/arch/ppc64/kernel/sysfs.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-naca.1/arch/ppc64/kernel/sysfs.c 2004-12-31 14:52:14.000000000 +1100
@@ -13,6 +13,7 @@
#include <asm/cputable.h>
#include <asm/hvcall.h>
#include <asm/prom.h>
+#include <asm/systemcfg.h>
/* SMT stuff */
diff -ruN linus-bk/arch/ppc64/kernel/time.c linus-bk-naca.1/arch/ppc64/kernel/time.c
--- linus-bk/arch/ppc64/kernel/time.c 2004-10-21 07:17:18.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/time.c 2004-12-31 14:52:14.000000000 +1100
@@ -66,6 +66,7 @@
#include <asm/ppcdebug.h>
#include <asm/prom.h>
#include <asm/sections.h>
+#include <asm/systemcfg.h>
void smp_local_timer_interrupt(struct pt_regs *);
diff -ruN linus-bk/arch/ppc64/kernel/traps.c linus-bk-naca.1/arch/ppc64/kernel/traps.c
--- linus-bk/arch/ppc64/kernel/traps.c 2004-09-09 09:59:49.000000000 +1000
+++ linus-bk-naca.1/arch/ppc64/kernel/traps.c 2004-12-31 14:52:14.000000000 +1100
@@ -37,6 +37,7 @@
#include <asm/processor.h>
#include <asm/ppcdebug.h>
#include <asm/rtas.h>
+#include <asm/systemcfg.h>
#ifdef CONFIG_PPC_PSERIES
/* This is true if we are using the firmware NMI handler (typically LPAR) */
diff -ruN linus-bk/include/asm-ppc64/cache.h linus-bk-naca.1/include/asm-ppc64/cache.h
--- linus-bk/include/asm-ppc64/cache.h 2002-08-28 06:04:10.000000000 +1000
+++ linus-bk-naca.1/include/asm-ppc64/cache.h 2004-12-31 14:52:14.000000000 +1100
@@ -7,6 +7,8 @@
#ifndef __ARCH_PPC64_CACHE_H
#define __ARCH_PPC64_CACHE_H
+#include <asm/types.h>
+
/* bytes per L1 cache line */
#define L1_CACHE_SHIFT 7
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
@@ -14,4 +16,21 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#define L1_CACHE_SHIFT_MAX 7 /* largest L1 which this arch supports */
+#ifndef __ASSEMBLY__
+
+struct ppc64_caches {
+ u32 dsize; /* L1 d-cache size */
+ u32 dline_size; /* L1 d-cache line size */
+ u32 log_dline_size;
+ u32 dlines_per_page;
+ u32 isize; /* L1 i-cache size */
+ u32 iline_size; /* L1 i-cache line size */
+ u32 log_iline_size;
+ u32 ilines_per_page;
+};
+
+extern struct ppc64_caches ppc64_caches;
+
+#endif
+
#endif
diff -ruN linus-bk/include/asm-ppc64/naca.h linus-bk-naca.1/include/asm-ppc64/naca.h
--- linus-bk/include/asm-ppc64/naca.h 2004-09-16 21:51:58.000000000 +1000
+++ linus-bk-naca.1/include/asm-ppc64/naca.h 2004-12-31 14:52:14.000000000 +1100
@@ -16,11 +16,7 @@
#ifndef __ASSEMBLY__
struct naca_struct {
- /*==================================================================
- * Cache line 1: 0x0000 - 0x007F
- * Kernel only data - undefined for user space
- *==================================================================
- */
+ /* Kernel only data - undefined for user space */
void *xItVpdAreas; /* VPD Data 0x00 */
void *xRamDisk; /* iSeries ramdisk 0x08 */
u64 xRamDiskSize; /* In pages 0x10 */
@@ -32,12 +28,6 @@
u64 interrupt_controller; /* Type of int controller 0x40 */
u64 unused1; /* was SLB size in entries 0x48 */
u64 pftSize; /* Log 2 of page table size 0x50 */
- void *systemcfg; /* Pointer to systemcfg data 0x58 */
- u32 dCacheL1LogLineSize; /* L1 d-cache line size Log2 0x60 */
- u32 dCacheL1LinesPerPage; /* L1 d-cache lines / page 0x64 */
- u32 iCacheL1LogLineSize; /* L1 i-cache line size Log2 0x68 */
- u32 iCacheL1LinesPerPage; /* L1 i-cache lines / page 0x6c */
- u8 resv0[15]; /* Reserved 0x71 - 0x7F */
};
extern struct naca_struct *naca;
diff -ruN linus-bk/include/asm-ppc64/page.h linus-bk-naca.1/include/asm-ppc64/page.h
--- linus-bk/include/asm-ppc64/page.h 2004-10-29 07:03:22.000000000 +1000
+++ linus-bk-naca.1/include/asm-ppc64/page.h 2004-12-31 14:52:14.000000000 +1100
@@ -93,7 +93,7 @@
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
-#include <asm/naca.h>
+#include <asm/cache.h>
#undef STRICT_MM_TYPECHECKS
@@ -106,8 +106,8 @@
{
unsigned long lines, line_size;
- line_size = systemcfg->dCacheL1LineSize;
- lines = naca->dCacheL1LinesPerPage;
+ line_size = ppc64_caches.dline_size;
+ lines = ppc64_caches.dlines_per_page;
__asm__ __volatile__(
"mtctr %1 # clear_page\n\
diff -ruN linus-bk/include/asm-ppc64/processor.h linus-bk-naca.1/include/asm-ppc64/processor.h
--- linus-bk/include/asm-ppc64/processor.h 2004-12-29 18:05:40.000000000 +1100
+++ linus-bk-naca.1/include/asm-ppc64/processor.h 2004-12-31 15:01:17.000000000 +1100
@@ -19,6 +19,7 @@
#endif
#include <asm/ptrace.h>
#include <asm/types.h>
+#include <asm/systemcfg.h>
/* Machine State Register (MSR) Fields */
#define MSR_SF_LG 63 /* Enable 64 bit mode */
diff -ruN linus-bk/include/asm-ppc64/systemcfg.h linus-bk-naca.1/include/asm-ppc64/systemcfg.h
--- linus-bk/include/asm-ppc64/systemcfg.h 2004-09-29 08:25:16.000000000 +1000
+++ linus-bk-naca.1/include/asm-ppc64/systemcfg.h 2004-12-31 14:52:14.000000000 +1100
@@ -15,14 +15,6 @@
* End Change Activity
*/
-
-#ifndef __KERNEL__
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <linux/types.h>
-#endif
-
/*
* If the major version changes we are incompatible.
* Minor version changes are a hint.
@@ -50,10 +42,11 @@
__u64 tb_update_count; /* Timebase atomicity ctr 0x50 */
__u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */
__u32 tz_dsttime; /* Type of dst correction 0x5C */
- __u32 dCacheL1Size; /* L1 d-cache size 0x60 */
- __u32 dCacheL1LineSize; /* L1 d-cache line size 0x64 */
- __u32 iCacheL1Size; /* L1 i-cache size 0x68 */
- __u32 iCacheL1LineSize; /* L1 i-cache line size 0x6C */
+ /* next four are no longer used except to be exported to /proc */
+ __u32 dcache_size; /* L1 d-cache size 0x60 */
+ __u32 dcache_line_size; /* L1 d-cache line size 0x64 */
+ __u32 icache_size; /* L1 i-cache size 0x68 */
+ __u32 icache_line_size; /* L1 i-cache line size 0x6C */
__u8 reserved0[3984]; /* Reserve rest of page 0x70 */
};
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/11] PPC64: remove the page table size from the naca
2005-01-04 4:04 ` [PATCH 1/11] PPC64: Consolidate cache sizing variables Stephen Rothwell
@ 2005-01-04 4:08 ` Stephen Rothwell
2005-01-04 4:12 ` [PATCH 3/11] PPC64: remove interrupt_controller from naca Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5553 bytes --]
Hi Andrew,
This patch just removes the page table size field from the naca (and makes
it ppc64_pft_size instead).
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.1/arch/ppc64/kernel/pSeries_lpar.c linus-bk-naca.2/arch/ppc64/kernel/pSeries_lpar.c
--- linus-bk-naca.1/arch/ppc64/kernel/pSeries_lpar.c 2004-12-14 04:07:06.000000000 +1100
+++ linus-bk-naca.2/arch/ppc64/kernel/pSeries_lpar.c 2004-12-31 15:16:48.000000000 +1100
@@ -33,7 +33,6 @@
#include <asm/mmu_context.h>
#include <asm/ppcdebug.h>
#include <asm/iommu.h>
-#include <asm/naca.h>
#include <asm/tlbflush.h>
#include <asm/tlb.h>
#include <asm/prom.h>
@@ -368,7 +367,7 @@
static void pSeries_lpar_hptab_clear(void)
{
- unsigned long size_bytes = 1UL << naca->pftSize;
+ unsigned long size_bytes = 1UL << ppc64_pft_size;
unsigned long hpte_count = size_bytes >> 4;
unsigned long dummy1, dummy2;
int i;
diff -ruN linus-bk-naca.1/arch/ppc64/kernel/prom.c linus-bk-naca.2/arch/ppc64/kernel/prom.c
--- linus-bk-naca.1/arch/ppc64/kernel/prom.c 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.2/arch/ppc64/kernel/prom.c 2004-12-31 14:52:56.000000000 +1100
@@ -844,12 +844,12 @@
/* On LPAR, look for the first ibm,pft-size property for the hash table size
*/
- if (systemcfg->platform == PLATFORM_PSERIES_LPAR && naca->pftSize == 0) {
+ if (systemcfg->platform == PLATFORM_PSERIES_LPAR && ppc64_pft_size == 0) {
u32 *pft_size;
pft_size = (u32 *)get_flat_dt_prop(node, "ibm,pft-size", NULL);
if (pft_size != NULL) {
/* pft_size[0] is the NUMA CEC cookie */
- naca->pftSize = pft_size[1];
+ ppc64_pft_size = pft_size[1];
}
}
@@ -1018,7 +1018,7 @@
initial_boot_params = params;
/* By default, hash size is not set */
- naca->pftSize = 0;
+ ppc64_pft_size = 0;
/* Retreive various informations from the /chosen node of the
* device-tree, including the platform type, initrd location and
@@ -1047,7 +1047,7 @@
/* If hash size wasn't obtained above, we calculate it now based on
* the total RAM size
*/
- if (naca->pftSize == 0) {
+ if (ppc64_pft_size == 0) {
unsigned long rnd_mem_size, pteg_count;
/* round mem_size up to next power of 2 */
@@ -1058,10 +1058,10 @@
/* # pages / 2 */
pteg_count = (rnd_mem_size >> (12 + 1));
- naca->pftSize = __ilog2(pteg_count << 7);
+ ppc64_pft_size = __ilog2(pteg_count << 7);
}
- DBG("Hash pftSize: %x\n", (int)naca->pftSize);
+ DBG("Hash pftSize: %x\n", (int)ppc64_pft_size);
DBG(" <- early_init_devtree()\n");
}
diff -ruN linus-bk-naca.1/arch/ppc64/kernel/setup.c linus-bk-naca.2/arch/ppc64/kernel/setup.c
--- linus-bk-naca.1/arch/ppc64/kernel/setup.c 2004-12-31 16:22:00.000000000 +1100
+++ linus-bk-naca.2/arch/ppc64/kernel/setup.c 2004-12-31 16:22:49.000000000 +1100
@@ -55,6 +55,7 @@
#include <asm/iommu.h>
#include <asm/serial.h>
#include <asm/cache.h>
+#include <asm/page.h>
#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
@@ -111,6 +112,7 @@
int boot_cpuid = 0;
int boot_cpuid_phys = 0;
dev_t boot_dev;
+u64 ppc64_pft_size;
struct ppc64_caches ppc64_caches;
@@ -660,7 +662,7 @@
printk("-----------------------------------------------------\n");
printk("naca = 0x%p\n", naca);
- printk("naca->pftSize = 0x%lx\n", naca->pftSize);
+ printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
printk("naca->debug_switch = 0x%lx\n", naca->debug_switch);
printk("naca->interrupt_controller = 0x%ld\n", naca->interrupt_controller);
printk("systemcfg = 0x%p\n", systemcfg);
diff -ruN linus-bk-naca.1/arch/ppc64/mm/hash_utils.c linus-bk-naca.2/arch/ppc64/mm/hash_utils.c
--- linus-bk-naca.1/arch/ppc64/mm/hash_utils.c 2004-10-29 07:03:21.000000000 +1000
+++ linus-bk-naca.2/arch/ppc64/mm/hash_utils.c 2004-12-31 14:52:56.000000000 +1100
@@ -41,7 +41,6 @@
#include <asm/types.h>
#include <asm/system.h>
#include <asm/uaccess.h>
-#include <asm/naca.h>
#include <asm/machdep.h>
#include <asm/lmb.h>
#include <asm/abs_addr.h>
@@ -147,7 +146,7 @@
* Calculate the required size of the htab. We want the number of
* PTEGs to equal one half the number of real pages.
*/
- htab_size_bytes = 1UL << naca->pftSize;
+ htab_size_bytes = 1UL << ppc64_pft_size;
pteg_count = htab_size_bytes >> 7;
/* For debug, make the HTAB 1/8 as big as it normally would be. */
diff -ruN linus-bk-naca.1/include/asm-ppc64/naca.h linus-bk-naca.2/include/asm-ppc64/naca.h
--- linus-bk-naca.1/include/asm-ppc64/naca.h 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.2/include/asm-ppc64/naca.h 2004-12-31 14:52:56.000000000 +1100
@@ -26,8 +26,6 @@
u64 log; /* Ptr to log buffer 0x30 */
u64 serialPortAddr; /* Phy addr of serial port 0x38 */
u64 interrupt_controller; /* Type of int controller 0x40 */
- u64 unused1; /* was SLB size in entries 0x48 */
- u64 pftSize; /* Log 2 of page table size 0x50 */
};
extern struct naca_struct *naca;
diff -ruN linus-bk-naca.1/include/asm-ppc64/page.h linus-bk-naca.2/include/asm-ppc64/page.h
--- linus-bk-naca.1/include/asm-ppc64/page.h 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.2/include/asm-ppc64/page.h 2004-12-31 14:52:56.000000000 +1100
@@ -183,6 +183,8 @@
extern int page_is_ram(unsigned long pfn);
+extern u64 ppc64_pft_size; /* Log 2 of page table size */
+
#endif /* __ASSEMBLY__ */
#ifdef MODULE
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/11] PPC64: remove interrupt_controller from naca
2005-01-04 4:08 ` [PATCH 2/11] PPC64: remove the page table size from the naca Stephen Rothwell
@ 2005-01-04 4:12 ` Stephen Rothwell
2005-01-04 4:19 ` [PATCH 4/11] PPC64: remove /proc/ppc64/{naca,paca/xx} Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:12 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 8301 bytes --]
Hi Andrew,
This patch just moves the interrupt_controller field of the naca into a
global variable.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/irq.c linus-bk-naca.3/arch/ppc64/kernel/irq.c
--- linus-bk-naca.2/arch/ppc64/kernel/irq.c 2004-10-21 07:17:18.000000000 +1000
+++ linus-bk-naca.3/arch/ppc64/kernel/irq.c 2004-12-31 14:53:21.000000000 +1100
@@ -65,6 +65,7 @@
int __irq_offset_value;
int ppc_spurious_interrupts;
unsigned long lpevent_count;
+u64 ppc64_interrupt_controller;
int show_interrupts(struct seq_file *p, void *v)
{
@@ -360,7 +361,7 @@
unsigned int virq, first_virq;
static int warned;
- if (naca->interrupt_controller == IC_OPEN_PIC)
+ if (ppc64_interrupt_controller == IC_OPEN_PIC)
return real_irq; /* no mapping for openpic (for now) */
/* don't map interrupts < MIN_VIRT_IRQ */
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/maple_setup.c linus-bk-naca.3/arch/ppc64/kernel/maple_setup.c
--- linus-bk-naca.2/arch/ppc64/kernel/maple_setup.c 2004-10-30 08:33:22.000000000 +1000
+++ linus-bk-naca.3/arch/ppc64/kernel/maple_setup.c 2004-12-31 14:53:21.000000000 +1100
@@ -155,7 +155,7 @@
}
/* Setup interrupt mapping options */
- naca->interrupt_controller = IC_OPEN_PIC;
+ ppc64_interrupt_controller = IC_OPEN_PIC;
DBG(" <- maple_init_early\n");
}
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/pSeries_pci.c linus-bk-naca.3/arch/ppc64/kernel/pSeries_pci.c
--- linus-bk-naca.2/arch/ppc64/kernel/pSeries_pci.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/pSeries_pci.c 2004-12-31 14:53:21.000000000 +1100
@@ -353,7 +353,7 @@
unsigned int *opprop = NULL;
struct device_node *root = of_find_node_by_path("/");
- if (naca->interrupt_controller == IC_OPEN_PIC) {
+ if (ppc64_interrupt_controller == IC_OPEN_PIC) {
opprop = (unsigned int *)get_property(root,
"platform-open-pic", NULL);
}
@@ -375,7 +375,7 @@
pci_process_bridge_OF_ranges(phb, node);
pci_setup_phb_io(phb, index == 0);
- if (naca->interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
+ if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) {
int addr = root_size_cells * (index + 2) - 1;
mpic_assign_isu(pSeries_mpic, index, opprop[addr]);
}
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/pSeries_setup.c linus-bk-naca.3/arch/ppc64/kernel/pSeries_setup.c
--- linus-bk-naca.2/arch/ppc64/kernel/pSeries_setup.c 2004-12-14 04:07:06.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/pSeries_setup.c 2004-12-31 15:22:17.000000000 +1100
@@ -196,7 +196,7 @@
static void __init pSeries_setup_arch(void)
{
/* Fixup ppc_md depending on the type of interrupt controller */
- if (naca->interrupt_controller == IC_OPEN_PIC) {
+ if (ppc64_interrupt_controller == IC_OPEN_PIC) {
ppc_md.init_IRQ = pSeries_init_mpic;
ppc_md.get_irq = mpic_get_irq;
/* Allocate the mpic now, so that find_and_init_phbs() can
@@ -308,13 +308,13 @@
* to properly parse the OF interrupt tree & do the virtual irq mapping
*/
__irq_offset_value = NUM_ISA_INTERRUPTS;
- naca->interrupt_controller = IC_INVALID;
+ ppc64_interrupt_controller = IC_INVALID;
for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) {
typep = (char *)get_property(np, "compatible", NULL);
if (strstr(typep, "open-pic"))
- naca->interrupt_controller = IC_OPEN_PIC;
+ ppc64_interrupt_controller = IC_OPEN_PIC;
else if (strstr(typep, "ppc-xicp"))
- naca->interrupt_controller = IC_PPC_XIC;
+ ppc64_interrupt_controller = IC_PPC_XIC;
else
printk("initialize_naca: failed to recognize"
" interrupt-controller\n");
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/pSeries_smp.c linus-bk-naca.3/arch/ppc64/kernel/pSeries_smp.c
--- linus-bk-naca.2/arch/ppc64/kernel/pSeries_smp.c 2004-12-14 04:07:06.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/pSeries_smp.c 2004-12-31 15:22:45.000000000 +1100
@@ -348,7 +348,7 @@
DBG(" -> smp_init_pSeries()\n");
- if (naca->interrupt_controller == IC_OPEN_PIC)
+ if (ppc64_interrupt_controller == IC_OPEN_PIC)
smp_ops = &pSeries_mpic_smp_ops;
else
smp_ops = &pSeries_xics_smp_ops;
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/pmac_setup.c linus-bk-naca.3/arch/ppc64/kernel/pmac_setup.c
--- linus-bk-naca.2/arch/ppc64/kernel/pmac_setup.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/pmac_setup.c 2004-12-31 14:53:21.000000000 +1100
@@ -70,7 +70,6 @@
#include <asm/time.h>
#include <asm/of_device.h>
#include <asm/lmb.h>
-#include <asm/naca.h>
#include "pmac.h"
#include "mpic.h"
@@ -316,7 +315,7 @@
}
/* Setup interrupt mapping options */
- naca->interrupt_controller = IC_OPEN_PIC;
+ ppc64_interrupt_controller = IC_OPEN_PIC;
DBG(" <- pmac_init_early\n");
}
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/prom.c linus-bk-naca.3/arch/ppc64/kernel/prom.c
--- linus-bk-naca.2/arch/ppc64/kernel/prom.c 2004-12-31 14:52:56.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/prom.c 2004-12-31 14:53:21.000000000 +1100
@@ -44,7 +44,6 @@
#include <asm/system.h>
#include <asm/mmu.h>
#include <asm/pgtable.h>
-#include <asm/naca.h>
#include <asm/pci.h>
#include <asm/iommu.h>
#include <asm/bootinfo.h>
@@ -557,7 +556,7 @@
DBG(" -> finish_device_tree\n");
- if (naca->interrupt_controller == IC_INVALID) {
+ if (ppc64_interrupt_controller == IC_INVALID) {
DBG("failed to configure interrupt controller type\n");
panic("failed to configure interrupt controller type\n");
}
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/setup.c linus-bk-naca.3/arch/ppc64/kernel/setup.c
--- linus-bk-naca.2/arch/ppc64/kernel/setup.c 2004-12-31 16:22:49.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/setup.c 2004-12-31 16:23:03.000000000 +1100
@@ -664,7 +664,7 @@
printk("naca = 0x%p\n", naca);
printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
printk("naca->debug_switch = 0x%lx\n", naca->debug_switch);
- printk("naca->interrupt_controller = 0x%ld\n", naca->interrupt_controller);
+ printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
printk("systemcfg = 0x%p\n", systemcfg);
printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
printk("systemcfg->processorCount = 0x%lx\n", systemcfg->processorCount);
diff -ruN linus-bk-naca.2/arch/ppc64/kernel/xics.c linus-bk-naca.3/arch/ppc64/kernel/xics.c
--- linus-bk-naca.2/arch/ppc64/kernel/xics.c 2004-12-14 04:07:06.000000000 +1100
+++ linus-bk-naca.3/arch/ppc64/kernel/xics.c 2004-12-31 15:24:20.000000000 +1100
@@ -24,7 +24,6 @@
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/smp.h>
-#include <asm/naca.h>
#include <asm/rtas.h>
#include <asm/xics.h>
#include <asm/hvcall.h>
@@ -575,7 +574,7 @@
*/
static int __init xics_setup_i8259(void)
{
- if (naca->interrupt_controller == IC_PPC_XIC &&
+ if (ppc64_interrupt_controller == IC_PPC_XIC &&
xics_irq_8259_cascade != -1) {
if (request_irq(irq_offset_up(xics_irq_8259_cascade),
no_action, 0, "8259 cascade", NULL))
diff -ruN linus-bk-naca.2/include/asm-ppc64/naca.h linus-bk-naca.3/include/asm-ppc64/naca.h
--- linus-bk-naca.2/include/asm-ppc64/naca.h 2004-12-31 14:52:56.000000000 +1100
+++ linus-bk-naca.3/include/asm-ppc64/naca.h 2004-12-31 14:53:21.000000000 +1100
@@ -25,7 +25,6 @@
u64 banner; /* Ptr to banner string 0x28 */
u64 log; /* Ptr to log buffer 0x30 */
u64 serialPortAddr; /* Phy addr of serial port 0x38 */
- u64 interrupt_controller; /* Type of int controller 0x40 */
};
extern struct naca_struct *naca;
diff -ruN linus-bk-naca.2/include/asm-ppc64/processor.h linus-bk-naca.3/include/asm-ppc64/processor.h
--- linus-bk-naca.2/include/asm-ppc64/processor.h 2004-12-31 15:01:17.000000000 +1100
+++ linus-bk-naca.3/include/asm-ppc64/processor.h 2004-12-31 15:25:17.000000000 +1100
@@ -484,6 +484,7 @@
#ifdef __KERNEL__
extern int have_of;
+extern u64 ppc64_interrupt_controller;
struct task_struct;
void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp);
[-- Attachment #1.2: 00000000.mimetmp --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 4/11] PPC64: remove /proc/ppc64/{naca,paca/xx}
2005-01-04 4:12 ` [PATCH 3/11] PPC64: remove interrupt_controller from naca Stephen Rothwell
@ 2005-01-04 4:19 ` Stephen Rothwell
2005-01-04 4:23 ` [PATCH 5/11] PPC64: remove the paca pointer form the naca Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:19 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 7817 bytes --]
Hi Andrew,
This patch removes the (unused) /proc entries for the naca and the (per
cpu) pacas. Also it removes a lot of no longer necessary includes of
<asm/naca.h>.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/iSeries_pci.c linus-bk-naca.4/arch/ppc64/kernel/iSeries_pci.c
--- linus-bk-naca.3/arch/ppc64/kernel/iSeries_pci.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-naca.4/arch/ppc64/kernel/iSeries_pci.c 2004-12-10 16:26:54.000000000 +1100
@@ -35,7 +35,6 @@
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include <asm/ppcdebug.h>
-#include <asm/naca.h>
#include <asm/iommu.h>
#include <asm/iSeries/HvCallPci.h>
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/iSeries_proc.c linus-bk-naca.4/arch/ppc64/kernel/iSeries_proc.c
--- linus-bk-naca.3/arch/ppc64/kernel/iSeries_proc.c 2004-10-22 07:00:21.000000000 +1000
+++ linus-bk-naca.4/arch/ppc64/kernel/iSeries_proc.c 2004-12-10 16:26:54.000000000 +1100
@@ -24,7 +24,6 @@
#include <asm/paca.h>
#include <asm/processor.h>
#include <asm/time.h>
-#include <asm/naca.h>
#include <asm/iSeries/ItLpPaca.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/iSeries/HvCallXm.h>
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/iSeries_smp.c linus-bk-naca.4/arch/ppc64/kernel/iSeries_smp.c
--- linus-bk-naca.3/arch/ppc64/kernel/iSeries_smp.c 2004-10-30 08:33:22.000000000 +1000
+++ linus-bk-naca.4/arch/ppc64/kernel/iSeries_smp.c 2004-12-10 16:26:54.000000000 +1100
@@ -37,7 +37,6 @@
#include <asm/pgtable.h>
#include <asm/io.h>
#include <asm/smp.h>
-#include <asm/naca.h>
#include <asm/paca.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCall.h>
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/pSeries_pci.c linus-bk-naca.4/arch/ppc64/kernel/pSeries_pci.c
--- linus-bk-naca.3/arch/ppc64/kernel/pSeries_pci.c 2004-12-31 14:53:21.000000000 +1100
+++ linus-bk-naca.4/arch/ppc64/kernel/pSeries_pci.c 2004-12-10 16:26:54.000000000 +1100
@@ -36,7 +36,6 @@
#include <asm/prom.h>
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
-#include <asm/naca.h>
#include <asm/iommu.h>
#include <asm/rtas.h>
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/pSeries_smp.c linus-bk-naca.4/arch/ppc64/kernel/pSeries_smp.c
--- linus-bk-naca.3/arch/ppc64/kernel/pSeries_smp.c 2004-12-31 15:22:45.000000000 +1100
+++ linus-bk-naca.4/arch/ppc64/kernel/pSeries_smp.c 2004-12-31 15:27:45.000000000 +1100
@@ -38,7 +38,6 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
-#include <asm/naca.h>
#include <asm/paca.h>
#include <asm/time.h>
#include <asm/ppcdebug.h>
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/pci_dn.c linus-bk-naca.4/arch/ppc64/kernel/pci_dn.c
--- linus-bk-naca.3/arch/ppc64/kernel/pci_dn.c 2004-10-25 18:18:33.000000000 +1000
+++ linus-bk-naca.4/arch/ppc64/kernel/pci_dn.c 2004-12-10 16:26:54.000000000 +1100
@@ -33,7 +33,6 @@
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include <asm/ppcdebug.h>
-#include <asm/naca.h>
#include <asm/iommu.h>
#include "pci.h"
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/proc_ppc64.c linus-bk-naca.4/arch/ppc64/kernel/proc_ppc64.c
--- linus-bk-naca.3/arch/ppc64/kernel/proc_ppc64.c 2004-10-27 07:32:57.000000000 +1000
+++ linus-bk-naca.4/arch/ppc64/kernel/proc_ppc64.c 2004-12-10 16:26:54.000000000 +1100
@@ -25,8 +25,6 @@
#include <linux/slab.h>
#include <linux/kernel.h>
-#include <asm/naca.h>
-#include <asm/paca.h>
#include <asm/systemcfg.h>
#include <asm/rtas.h>
#include <asm/uaccess.h>
@@ -58,26 +56,6 @@
#endif
/*
- * NOTE: since paca data is always in flux the values will never be a
- * consistant set.
- */
-static void __init proc_create_paca(struct proc_dir_entry *dir, int num)
-{
- struct proc_dir_entry *ent;
- struct paca_struct *lpaca = paca + num;
- char buf[16];
-
- sprintf(buf, "%02x", num);
- ent = create_proc_entry(buf, S_IRUSR, dir);
- if (ent) {
- ent->nlink = 1;
- ent->data = lpaca;
- ent->size = 4096;
- ent->proc_fops = &page_map_fops;
- }
-}
-
-/*
* Create the ppc64 and ppc64/rtas directories early. This allows us to
* assume that they have been previously created in drivers.
*/
@@ -104,17 +82,8 @@
static int __init proc_ppc64_init(void)
{
- unsigned long i;
struct proc_dir_entry *pde;
- pde = create_proc_entry("ppc64/naca", S_IRUSR, NULL);
- if (!pde)
- return 1;
- pde->nlink = 1;
- pde->data = naca;
- pde->size = 4096;
- pde->proc_fops = &page_map_fops;
-
pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
if (!pde)
return 1;
@@ -123,13 +92,6 @@
pde->size = 4096;
pde->proc_fops = &page_map_fops;
- /* /proc/ppc64/paca/XX -- raw paca contents. Only readable to root */
- pde = proc_mkdir("ppc64/paca", NULL);
- if (!pde)
- return 1;
- for_each_cpu(i)
- proc_create_paca(pde, i);
-
#ifdef CONFIG_PPC_PSERIES
if ((systemcfg->platform & PLATFORM_PSERIES))
proc_ppc64_create_ofdt();
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/prom_init.c linus-bk-naca.4/arch/ppc64/kernel/prom_init.c
--- linus-bk-naca.3/arch/ppc64/kernel/prom_init.c 2004-12-08 12:07:34.000000000 +1100
+++ linus-bk-naca.4/arch/ppc64/kernel/prom_init.c 2004-12-10 16:26:54.000000000 +1100
@@ -43,7 +43,6 @@
#include <asm/system.h>
#include <asm/mmu.h>
#include <asm/pgtable.h>
-#include <asm/naca.h>
#include <asm/pci.h>
#include <asm/iommu.h>
#include <asm/bootinfo.h>
diff -ruN linus-bk-naca.3/arch/ppc64/kernel/smp.c linus-bk-naca.4/arch/ppc64/kernel/smp.c
--- linus-bk-naca.3/arch/ppc64/kernel/smp.c 2004-12-14 04:07:06.000000000 +1100
+++ linus-bk-naca.4/arch/ppc64/kernel/smp.c 2004-12-31 15:29:14.000000000 +1100
@@ -41,7 +41,6 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
-#include <asm/naca.h>
#include <asm/paca.h>
#include <asm/time.h>
#include <asm/ppcdebug.h>
diff -ruN linus-bk-naca.3/arch/ppc64/mm/init.c linus-bk-naca.4/arch/ppc64/mm/init.c
--- linus-bk-naca.3/arch/ppc64/mm/init.c 2004-11-04 16:05:08.000000000 +1100
+++ linus-bk-naca.4/arch/ppc64/mm/init.c 2004-12-10 16:26:54.000000000 +1100
@@ -52,7 +52,6 @@
#include <asm/smp.h>
#include <asm/machdep.h>
#include <asm/tlb.h>
-#include <asm/naca.h>
#include <asm/eeh.h>
#include <asm/processor.h>
#include <asm/mmzone.h>
diff -ruN linus-bk-naca.3/arch/ppc64/mm/slb.c linus-bk-naca.4/arch/ppc64/mm/slb.c
--- linus-bk-naca.3/arch/ppc64/mm/slb.c 2004-09-06 10:19:04.000000000 +1000
+++ linus-bk-naca.4/arch/ppc64/mm/slb.c 2004-12-10 16:26:54.000000000 +1100
@@ -19,7 +19,6 @@
#include <asm/mmu.h>
#include <asm/mmu_context.h>
#include <asm/paca.h>
-#include <asm/naca.h>
#include <asm/cputable.h>
extern void slb_allocate(unsigned long ea);
diff -ruN linus-bk-naca.3/arch/ppc64/mm/stab.c linus-bk-naca.4/arch/ppc64/mm/stab.c
--- linus-bk-naca.3/arch/ppc64/mm/stab.c 2004-09-16 21:51:57.000000000 +1000
+++ linus-bk-naca.4/arch/ppc64/mm/stab.c 2004-12-10 16:26:54.000000000 +1100
@@ -17,7 +17,6 @@
#include <asm/mmu.h>
#include <asm/mmu_context.h>
#include <asm/paca.h>
-#include <asm/naca.h>
#include <asm/cputable.h>
/* Both the segment table and SLB code uses the following cache */
diff -ruN linus-bk-naca.3/include/asm-ppc64/iSeries/LparData.h linus-bk-naca.4/include/asm-ppc64/iSeries/LparData.h
--- linus-bk-naca.3/include/asm-ppc64/iSeries/LparData.h 2002-09-18 12:00:50.000000000 +1000
+++ linus-bk-naca.4/include/asm-ppc64/iSeries/LparData.h 2004-12-10 16:26:54.000000000 +1100
@@ -24,11 +24,9 @@
#include <asm/page.h>
#include <asm/abs_addr.h>
-#include <asm/naca.h>
#include <asm/iSeries/ItLpNaca.h>
#include <asm/iSeries/ItLpPaca.h>
#include <asm/iSeries/ItLpRegSave.h>
-#include <asm/paca.h>
#include <asm/iSeries/HvReleaseData.h>
#include <asm/iSeries/LparMap.h>
#include <asm/iSeries/ItVpdAreas.h>
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 5/11] PPC64: remove the paca pointer form the naca
2005-01-04 4:19 ` [PATCH 4/11] PPC64: remove /proc/ppc64/{naca,paca/xx} Stephen Rothwell
@ 2005-01-04 4:23 ` Stephen Rothwell
2005-01-04 4:27 ` [PATCH 6/11] PPC64: remove serialPortAddr from " Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3027 bytes --]
Hi Andrew,
The only place that was using the paca pointer that was in the naca was
some assembler that used it to find a parameter to pass to some C code.
That C code did not even declare that parameter!
Remove the paca pointer.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.4/arch/ppc64/kernel/asm-offsets.c linus-bk-naca.5/arch/ppc64/kernel/asm-offsets.c
--- linus-bk-naca.4/arch/ppc64/kernel/asm-offsets.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.5/arch/ppc64/kernel/asm-offsets.c 2004-12-10 17:27:14.000000000 +1100
@@ -28,7 +28,6 @@
#include <asm/pgtable.h>
#include <asm/processor.h>
-#include <asm/naca.h>
#include <asm/paca.h>
#include <asm/iSeries/ItLpPaca.h>
#include <asm/iSeries/ItLpQueue.h>
@@ -68,8 +67,6 @@
#endif /* CONFIG_ALTIVEC */
DEFINE(MM, offsetof(struct task_struct, mm));
- /* naca */
- DEFINE(PACA, offsetof(struct naca_struct, paca));
DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
diff -ruN linus-bk-naca.4/arch/ppc64/kernel/head.S linus-bk-naca.5/arch/ppc64/kernel/head.S
--- linus-bk-naca.4/arch/ppc64/kernel/head.S 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.5/arch/ppc64/kernel/head.S 2004-12-10 18:40:24.000000000 +1100
@@ -517,12 +517,7 @@
__start_naca:
#ifdef CONFIG_PPC_ISERIES
.llong itVpdAreas
-#else
- .llong 0x0
#endif
- .llong 0x0
- .llong 0x0
- .llong paca
. = SYSTEMCFG_PHYS_ADDR
.globl __end_naca
@@ -1241,6 +1236,7 @@
#endif
#endif
b 3b /* Loop until told to go */
+
#ifdef CONFIG_PPC_ISERIES
_STATIC(__start_initialization_iSeries)
/* Clear out the BSS */
@@ -1278,10 +1274,6 @@
SET_REG_TO_CONST(r4, NACA_VIRT_ADDR)
std r4,0(r9) /* set the naca pointer */
- /* Get the pointer to the segment table */
- ld r6,PACA(r4) /* Get the base paca pointer */
- ld r4,PACASTABVIRT(r6)
-
bl .iSeries_early_setup
/* relocation is on at this point */
diff -ruN linus-bk-naca.4/include/asm-ppc64/naca.h linus-bk-naca.5/include/asm-ppc64/naca.h
--- linus-bk-naca.4/include/asm-ppc64/naca.h 2004-12-31 14:53:21.000000000 +1100
+++ linus-bk-naca.5/include/asm-ppc64/naca.h 2004-12-10 18:42:14.000000000 +1100
@@ -11,7 +11,6 @@
*/
#include <asm/types.h>
-#include <asm/systemcfg.h>
#ifndef __ASSEMBLY__
@@ -20,7 +19,6 @@
void *xItVpdAreas; /* VPD Data 0x00 */
void *xRamDisk; /* iSeries ramdisk 0x08 */
u64 xRamDiskSize; /* In pages 0x10 */
- struct paca_struct *paca; /* Ptr to an array of pacas 0x18 */
u64 debug_switch; /* Debug print control 0x20 */
u64 banner; /* Ptr to banner string 0x28 */
u64 log; /* Ptr to log buffer 0x30 */
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 6/11] PPC64: remove serialPortAddr from the naca
2005-01-04 4:23 ` [PATCH 5/11] PPC64: remove the paca pointer form the naca Stephen Rothwell
@ 2005-01-04 4:27 ` Stephen Rothwell
2005-01-04 4:31 ` [PATCH 7/11] PPC64: remove debug_switch " Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 4731 bytes --]
Hi Andrew,
The serialPortAddr field of the naca was only being used locally, remove
it.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.5/arch/ppc64/kernel/maple_setup.c linus-bk-naca.6/arch/ppc64/kernel/maple_setup.c
--- linus-bk-naca.5/arch/ppc64/kernel/maple_setup.c 2004-12-31 14:53:21.000000000 +1100
+++ linus-bk-naca.6/arch/ppc64/kernel/maple_setup.c 2004-12-11 00:53:42.000000000 +1100
@@ -75,7 +75,8 @@
extern void maple_pci_init(void);
extern void maple_pcibios_fixup(void);
extern int maple_pci_get_legacy_ide_irq(struct pci_dev *dev, int channel);
-extern void generic_find_legacy_serial_ports(unsigned int *default_speed);
+extern void generic_find_legacy_serial_ports(u64 *physport,
+ unsigned int *default_speed);
static void maple_restart(char *cmd)
@@ -129,6 +130,7 @@
static void __init maple_init_early(void)
{
unsigned int default_speed;
+ u64 physport;
DBG(" -> maple_init_early\n");
@@ -138,14 +140,14 @@
hpte_init_native();
/* Find the serial port */
- generic_find_legacy_serial_ports(&default_speed);
+ generic_find_legacy_serial_ports(&physport, &default_speed);
- DBG("naca->serialPortAddr: %lx\n", (long)naca->serialPortAddr);
+ DBG("phys port addr: %lx\n", (long)physport);
- if (naca->serialPortAddr) {
+ if (physport) {
void *comport;
/* Map the uart for udbg. */
- comport = (void *)__ioremap(naca->serialPortAddr, 16, _PAGE_NO_CACHE);
+ comport = (void *)__ioremap(physport, 16, _PAGE_NO_CACHE);
udbg_init_uart(comport, default_speed);
ppc_md.udbg_putc = udbg_putc;
diff -ruN linus-bk-naca.5/arch/ppc64/kernel/pSeries_setup.c linus-bk-naca.6/arch/ppc64/kernel/pSeries_setup.c
--- linus-bk-naca.5/arch/ppc64/kernel/pSeries_setup.c 2004-12-31 15:22:17.000000000 +1100
+++ linus-bk-naca.6/arch/ppc64/kernel/pSeries_setup.c 2004-12-31 15:35:13.000000000 +1100
@@ -81,7 +81,8 @@
extern int pSeries_set_rtc_time(struct rtc_time *rtc_time);
extern void find_udbg_vterm(void);
extern void SystemReset_FWNMI(void), MachineCheck_FWNMI(void); /* from head.S */
-extern void generic_find_legacy_serial_ports(unsigned int *default_speed);
+extern void generic_find_legacy_serial_ports(u64 *physport,
+ unsigned int *default_speed);
int fwnmi_active; /* TRUE if an FWNMI handler is present */
@@ -344,6 +345,7 @@
void *comport;
int iommu_off = 0;
unsigned int default_speed;
+ u64 physport;
DBG(" -> pSeries_init_early()\n");
@@ -357,13 +359,13 @@
get_property(of_chosen, "linux,iommu-off", NULL));
}
- generic_find_legacy_serial_ports(&default_speed);
+ generic_find_legacy_serial_ports(&physport, &default_speed);
if (systemcfg->platform & PLATFORM_LPAR)
find_udbg_vterm();
- else if (naca->serialPortAddr) {
+ else if (physport) {
/* Map the uart for udbg. */
- comport = (void *)__ioremap(naca->serialPortAddr, 16, _PAGE_NO_CACHE);
+ comport = (void *)__ioremap(physport, 16, _PAGE_NO_CACHE);
udbg_init_uart(comport, default_speed);
ppc_md.udbg_putc = udbg_putc;
diff -ruN linus-bk-naca.5/arch/ppc64/kernel/setup.c linus-bk-naca.6/arch/ppc64/kernel/setup.c
--- linus-bk-naca.5/arch/ppc64/kernel/setup.c 2004-12-31 16:24:54.000000000 +1100
+++ linus-bk-naca.6/arch/ppc64/kernel/setup.c 2004-12-31 16:23:30.000000000 +1100
@@ -1154,7 +1154,8 @@
static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
static unsigned int old_serial_count;
-void __init generic_find_legacy_serial_ports(unsigned int *default_speed)
+void __init generic_find_legacy_serial_ports(u64 *physport,
+ unsigned int *default_speed)
{
struct device_node *np;
u32 *sizeprop;
@@ -1172,7 +1173,7 @@
DBG(" -> generic_find_legacy_serial_port()\n");
- naca->serialPortAddr = 0;
+ *physport = 0;
if (default_speed)
*default_speed = 0;
@@ -1294,7 +1295,7 @@
io_base = (io_base << 32) | rangesp[4];
}
if (io_base != 0) {
- naca->serialPortAddr = io_base + reg->address;
+ *physport = io_base + reg->address;
if (default_speed && spd)
*default_speed = *spd;
}
diff -ruN linus-bk-naca.5/include/asm-ppc64/naca.h linus-bk-naca.6/include/asm-ppc64/naca.h
--- linus-bk-naca.5/include/asm-ppc64/naca.h 2004-12-10 18:42:14.000000000 +1100
+++ linus-bk-naca.6/include/asm-ppc64/naca.h 2004-12-11 00:03:55.000000000 +1100
@@ -22,7 +22,6 @@
u64 debug_switch; /* Debug print control 0x20 */
u64 banner; /* Ptr to banner string 0x28 */
u64 log; /* Ptr to log buffer 0x30 */
- u64 serialPortAddr; /* Phy addr of serial port 0x38 */
};
extern struct naca_struct *naca;
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 7/11] PPC64: remove debug_switch from the naca
2005-01-04 4:27 ` [PATCH 6/11] PPC64: remove serialPortAddr from " Stephen Rothwell
@ 2005-01-04 4:31 ` Stephen Rothwell
2005-01-04 4:34 ` [PATCH 8/11] PPC64: remove the naca from all but iSeries Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:31 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 8653 bytes --]
Hi Andrew,
The patch moves the debug_switch from the naca to a global variable.
Also, a couple of trivial naming tidy ups.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.6/arch/ppc64/kernel/pSeries_setup.c linus-bk-naca.7/arch/ppc64/kernel/pSeries_setup.c
--- linus-bk-naca.6/arch/ppc64/kernel/pSeries_setup.c 2004-12-31 15:35:13.000000000 +1100
+++ linus-bk-naca.7/arch/ppc64/kernel/pSeries_setup.c 2004-12-31 15:39:01.000000000 +1100
@@ -56,7 +56,6 @@
#include <asm/dma.h>
#include <asm/machdep.h>
#include <asm/irq.h>
-#include <asm/naca.h>
#include <asm/time.h>
#include <asm/nvram.h>
@@ -317,7 +316,7 @@
else if (strstr(typep, "ppc-xicp"))
ppc64_interrupt_controller = IC_PPC_XIC;
else
- printk("initialize_naca: failed to recognize"
+ printk("pSeries_discover_pic: failed to recognize"
" interrupt-controller\n");
break;
}
diff -ruN linus-bk-naca.6/arch/ppc64/kernel/setup.c linus-bk-naca.7/arch/ppc64/kernel/setup.c
--- linus-bk-naca.6/arch/ppc64/kernel/setup.c 2004-12-31 16:23:30.000000000 +1100
+++ linus-bk-naca.7/arch/ppc64/kernel/setup.c 2004-12-31 16:25:02.000000000 +1100
@@ -41,7 +41,6 @@
#include <asm/elf.h>
#include <asm/machdep.h>
#include <asm/iSeries/LparData.h>
-#include <asm/naca.h>
#include <asm/paca.h>
#include <asm/ppcdebug.h>
#include <asm/time.h>
@@ -113,6 +112,7 @@
int boot_cpuid_phys = 0;
dev_t boot_dev;
u64 ppc64_pft_size;
+u64 ppc64_debug_switch;
struct ppc64_caches ppc64_caches;
@@ -161,7 +161,7 @@
*/
void __init ppcdbg_initialize(void)
{
- naca->debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
+ ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
/* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
}
@@ -399,7 +399,7 @@
DBG(" -> early_setup()\n");
/*
- * Fill the default DBG level in naca (do we want to keep
+ * Fill the default DBG level (do we want to keep
* that old mecanism around forever ?)
*/
ppcdbg_initialize();
@@ -453,17 +453,17 @@
/*
- * Initialize some remaining members of the naca and systemcfg structures
+ * Initialize some remaining members of the ppc64_caches and systemcfg structures
* (at least until we get rid of them completely). This is mostly some
* cache informations about the CPU that will be used by cache flush
* routines and/or provided to userland
*/
-static void __init initialize_naca(void)
+static void __init initialize_cache_info(void)
{
struct device_node *np;
unsigned long num_cpus = 0;
- DBG(" -> initialize_naca()\n");
+ DBG(" -> initialize_cache_info()\n");
for (np = NULL; (np = of_find_node_by_type(np, "cpu"));) {
num_cpus += 1;
@@ -530,7 +530,7 @@
systemcfg->version.minor = SYSTEMCFG_MINOR;
systemcfg->processor = mfspr(SPRN_PVR);
- DBG(" <- initialize_naca()\n");
+ DBG(" <- initialize_cache_info()\n");
}
static void __init check_for_initrd(void)
@@ -591,7 +591,7 @@
unflatten_device_tree();
/*
- * Fill the naca & systemcfg structures with informations
+ * Fill the ppc64_caches & systemcfg structures with informations
* retreived from the device-tree. Need to be called before
* finish_device_tree() since the later requires some of the
* informations filled up here to properly parse the interrupt
@@ -600,7 +600,7 @@
* routines like flush_icache_range (used by the hash init
* later on).
*/
- initialize_naca();
+ initialize_cache_info();
#ifdef CONFIG_PPC_PSERIES
/*
@@ -661,9 +661,8 @@
printk("Starting Linux PPC64 %s\n", UTS_RELEASE);
printk("-----------------------------------------------------\n");
- printk("naca = 0x%p\n", naca);
printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
- printk("naca->debug_switch = 0x%lx\n", naca->debug_switch);
+ printk("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
printk("systemcfg = 0x%p\n", systemcfg);
printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
diff -ruN linus-bk-naca.6/arch/ppc64/kernel/udbg.c linus-bk-naca.7/arch/ppc64/kernel/udbg.c
--- linus-bk-naca.6/arch/ppc64/kernel/udbg.c 2004-11-22 14:05:02.000000000 +1100
+++ linus-bk-naca.7/arch/ppc64/kernel/udbg.c 2004-12-11 02:31:17.000000000 +1100
@@ -15,7 +15,6 @@
#include <linux/types.h>
#include <asm/ppcdebug.h>
#include <asm/processor.h>
-#include <asm/naca.h>
#include <asm/uaccess.h>
#include <asm/machdep.h>
#include <asm/io.h>
@@ -323,7 +322,7 @@
/* Special print used by PPCDBG() macro */
void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
{
- unsigned long active_debugs = debug_flags & naca->debug_switch;
+ unsigned long active_debugs = debug_flags & ppc64_debug_switch;
if (active_debugs) {
va_list ap;
@@ -357,5 +356,5 @@
unsigned long udbg_ifdebug(unsigned long flags)
{
- return (flags & naca->debug_switch);
+ return (flags & ppc64_debug_switch);
}
diff -ruN linus-bk-naca.6/arch/ppc64/xmon/xmon.c linus-bk-naca.7/arch/ppc64/xmon/xmon.c
--- linus-bk-naca.6/arch/ppc64/xmon/xmon.c 2004-11-26 12:08:51.000000000 +1100
+++ linus-bk-naca.7/arch/ppc64/xmon/xmon.c 2004-12-11 02:33:00.000000000 +1100
@@ -26,7 +26,6 @@
#include <asm/pgtable.h>
#include <asm/mmu.h>
#include <asm/mmu_context.h>
-#include <asm/naca.h>
#include <asm/paca.h>
#include <asm/ppcdebug.h>
#include <asm/cputable.h>
@@ -2360,9 +2359,9 @@
if (cmd == '\n') {
/* show current state */
unsigned long i;
- printf("naca->debug_switch = 0x%lx\n", naca->debug_switch);
+ printf("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
for (i = 0; i < PPCDBG_NUM_FLAGS ;i++) {
- on = PPCDBG_BITVAL(i) & naca->debug_switch;
+ on = PPCDBG_BITVAL(i) & ppc64_debug_switch;
printf("%02x %s %12s ", i, on ? "on " : "off", trace_names[i] ? trace_names[i] : "");
if (((i+1) % 3) == 0)
printf("\n");
@@ -2376,7 +2375,7 @@
on = (cmd == '+');
cmd = inchar();
if (cmd == ' ' || cmd == '\n') { /* Turn on or off based on + or - */
- naca->debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE;
+ ppc64_debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE;
printf("Setting all values to %s...\n", on ? "on" : "off");
if (cmd == '\n') return;
else cmd = skipbl();
@@ -2391,10 +2390,10 @@
return;
}
if (on) {
- naca->debug_switch |= PPCDBG_BITVAL(val);
+ ppc64_debug_switch |= PPCDBG_BITVAL(val);
printf("enable debug %x %s\n", val, trace_names[val] ? trace_names[val] : "");
} else {
- naca->debug_switch &= ~PPCDBG_BITVAL(val);
+ ppc64_debug_switch &= ~PPCDBG_BITVAL(val);
printf("disable debug %x %s\n", val, trace_names[val] ? trace_names[val] : "");
}
cmd = skipbl();
diff -ruN linus-bk-naca.6/include/asm-ppc64/naca.h linus-bk-naca.7/include/asm-ppc64/naca.h
--- linus-bk-naca.6/include/asm-ppc64/naca.h 2004-12-11 00:03:55.000000000 +1100
+++ linus-bk-naca.7/include/asm-ppc64/naca.h 2004-12-11 02:41:18.000000000 +1100
@@ -19,9 +19,6 @@
void *xItVpdAreas; /* VPD Data 0x00 */
void *xRamDisk; /* iSeries ramdisk 0x08 */
u64 xRamDiskSize; /* In pages 0x10 */
- u64 debug_switch; /* Debug print control 0x20 */
- u64 banner; /* Ptr to banner string 0x28 */
- u64 log; /* Ptr to log buffer 0x30 */
};
extern struct naca_struct *naca;
diff -ruN linus-bk-naca.6/include/asm-ppc64/ppcdebug.h linus-bk-naca.7/include/asm-ppc64/ppcdebug.h
--- linus-bk-naca.6/include/asm-ppc64/ppcdebug.h 2004-02-16 08:19:48.000000000 +1100
+++ linus-bk-naca.7/include/asm-ppc64/ppcdebug.h 2004-12-13 12:05:25.000000000 +1100
@@ -16,13 +16,14 @@
********************************************************************/
#include <linux/config.h>
+#include <linux/types.h>
#include <asm/udbg.h>
#include <stdarg.h>
#define PPCDBG_BITVAL(X) ((1UL)<<((unsigned long)(X)))
/* Defined below are the bit positions of various debug flags in the
- * debug_switch variable (defined in naca.h).
+ * ppc64_debug_switch variable.
* -- When adding new values, please enter them into trace names below --
*
* Values 62 & 63 can be used to stress the hardware page table management
@@ -64,6 +65,8 @@
#define PPCDBG_NUM_FLAGS 64
+extern u64 ppc64_debug_switch;
+
#ifdef WANT_PPCDBG_TAB
/* A table of debug switch names to allow name lookup in xmon
* (and whoever else wants it.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 8/11] PPC64: remove the naca from all but iSeries
2005-01-04 4:31 ` [PATCH 7/11] PPC64: remove debug_switch " Stephen Rothwell
@ 2005-01-04 4:34 ` Stephen Rothwell
2005-01-04 4:37 ` [PATCH 9/11] PPC64: use xPMCRegsInUse Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:34 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5587 bytes --]
Hi Andrew,
This patch finally removes the naca from all architectures except legacy
iSeries and in the process makes it a structure instead of a pointer.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.7/arch/ppc64/kernel/LparData.c linus-bk-naca.8/arch/ppc64/kernel/LparData.c
--- linus-bk-naca.7/arch/ppc64/kernel/LparData.c 2004-10-26 16:06:41.000000000 +1000
+++ linus-bk-naca.8/arch/ppc64/kernel/LparData.c 2004-12-11 02:49:48.000000000 +1100
@@ -44,7 +44,7 @@
0xc8a5d9c4, /* desc = "HvRD" ebcdic */
sizeof(struct HvReleaseData),
offsetof(struct naca_struct, xItVpdAreas),
- (struct naca_struct *)(NACA_VIRT_ADDR), /* 64-bit Naca address */
+ &naca, /* 64-bit Naca address */
0x6000, /* offset of LparMap within loadarea (see head.S) */
0,
1, /* tags inactive */
diff -ruN linus-bk-naca.7/arch/ppc64/kernel/head.S linus-bk-naca.8/arch/ppc64/kernel/head.S
--- linus-bk-naca.7/arch/ppc64/kernel/head.S 2004-12-10 18:40:24.000000000 +1100
+++ linus-bk-naca.8/arch/ppc64/kernel/head.S 2004-12-11 02:56:12.000000000 +1100
@@ -512,17 +512,15 @@
*/
. = NACA_PHYS_ADDR
.globl __end_interrupts
- .globl __start_naca
__end_interrupts:
-__start_naca:
#ifdef CONFIG_PPC_ISERIES
+ .globl naca
+naca:
.llong itVpdAreas
#endif
. = SYSTEMCFG_PHYS_ADDR
- .globl __end_naca
.globl __start_systemcfg
-__end_naca:
__start_systemcfg:
. = (SYSTEMCFG_PHYS_ADDR + PAGE_SIZE)
.globl __end_systemcfg
@@ -1270,10 +1268,6 @@
SET_REG_TO_CONST(r4, SYSTEMCFG_VIRT_ADDR)
std r4,0(r9) /* set the systemcfg pointer */
- LOADADDR(r9,naca)
- SET_REG_TO_CONST(r4, NACA_VIRT_ADDR)
- std r4,0(r9) /* set the naca pointer */
-
bl .iSeries_early_setup
/* relocation is on at this point */
@@ -1873,12 +1867,6 @@
li r27,SYSTEMCFG_PHYS_ADDR
std r27,0(r6) /* set the value of systemcfg */
- /* setup the naca pointer which is needed by *tab_initialize */
- LOADADDR(r6,naca)
- sub r6,r6,r26 /* addr of the variable naca */
- li r27,NACA_PHYS_ADDR
- std r27,0(r6) /* set the value of naca */
-
#ifdef CONFIG_HMT
/* Start up the second thread on cpu 0 */
mfspr r3,PVR
@@ -2015,11 +2003,6 @@
SET_REG_TO_CONST(r8, SYSTEMCFG_VIRT_ADDR)
std r8,0(r9)
- /* setup the naca pointer */
- LOADADDR(r9,naca)
- SET_REG_TO_CONST(r8, NACA_VIRT_ADDR)
- std r8,0(r9) /* set the value of the naca ptr */
-
LOADADDR(r26, boot_cpuid)
lwz r26,0(r26)
diff -ruN linus-bk-naca.7/arch/ppc64/kernel/iSeries_setup.c linus-bk-naca.8/arch/ppc64/kernel/iSeries_setup.c
--- linus-bk-naca.7/arch/ppc64/kernel/iSeries_setup.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.8/arch/ppc64/kernel/iSeries_setup.c 2004-12-11 02:51:17.000000000 +1100
@@ -314,13 +314,13 @@
* If the init RAM disk has been configured and there is
* a non-zero starting address for it, set it up
*/
- if (naca->xRamDisk) {
- initrd_start = (unsigned long)__va(naca->xRamDisk);
- initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE;
+ if (naca.xRamDisk) {
+ initrd_start = (unsigned long)__va(naca.xRamDisk);
+ initrd_end = initrd_start + naca.xRamDiskSize * PAGE_SIZE;
initrd_below_start_ok = 1; // ramdisk in kernel space
ROOT_DEV = Root_RAM0;
- if (((rd_size * 1024) / PAGE_SIZE) < naca->xRamDiskSize)
- rd_size = (naca->xRamDiskSize * PAGE_SIZE) / 1024;
+ if (((rd_size * 1024) / PAGE_SIZE) < naca.xRamDiskSize)
+ rd_size = (naca.xRamDiskSize * PAGE_SIZE) / 1024;
} else
#endif /* CONFIG_BLK_DEV_INITRD */
{
@@ -813,9 +813,9 @@
* Change klimit to take into account any ram disk
* that may be included
*/
- if (naca->xRamDisk)
- klimit = KERNELBASE + (u64)naca->xRamDisk +
- (naca->xRamDiskSize * PAGE_SIZE);
+ if (naca.xRamDisk)
+ klimit = KERNELBASE + (u64)naca.xRamDisk +
+ (naca.xRamDiskSize * PAGE_SIZE);
else {
/*
* No ram disk was included - check and see if there
diff -ruN linus-bk-naca.7/arch/ppc64/kernel/pacaData.c linus-bk-naca.8/arch/ppc64/kernel/pacaData.c
--- linus-bk-naca.7/arch/ppc64/kernel/pacaData.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.8/arch/ppc64/kernel/pacaData.c 2004-12-11 02:50:23.000000000 +1100
@@ -18,11 +18,8 @@
#include <asm/iSeries/ItLpPaca.h>
#include <asm/iSeries/ItLpQueue.h>
-#include <asm/naca.h>
#include <asm/paca.h>
-struct naca_struct *naca;
-EXPORT_SYMBOL(naca);
struct systemcfg *systemcfg;
EXPORT_SYMBOL(systemcfg);
diff -ruN linus-bk-naca.7/include/asm-ppc64/iSeries/HvReleaseData.h linus-bk-naca.8/include/asm-ppc64/iSeries/HvReleaseData.h
--- linus-bk-naca.7/include/asm-ppc64/iSeries/HvReleaseData.h 2004-01-20 08:20:26.000000000 +1100
+++ linus-bk-naca.8/include/asm-ppc64/iSeries/HvReleaseData.h 2004-12-11 02:52:05.000000000 +1100
@@ -26,6 +26,7 @@
// address of the OS's NACA).
//
#include <asm/types.h>
+#include <asm/naca.h>
//=============================================================================
//
diff -ruN linus-bk-naca.7/include/asm-ppc64/naca.h linus-bk-naca.8/include/asm-ppc64/naca.h
--- linus-bk-naca.7/include/asm-ppc64/naca.h 2004-12-11 02:41:18.000000000 +1100
+++ linus-bk-naca.8/include/asm-ppc64/naca.h 2004-12-11 02:54:02.000000000 +1100
@@ -21,12 +21,11 @@
u64 xRamDiskSize; /* In pages 0x10 */
};
-extern struct naca_struct *naca;
+extern struct naca_struct naca;
#endif /* __ASSEMBLY__ */
#define NACA_PAGE 0x4
#define NACA_PHYS_ADDR (NACA_PAGE<<PAGE_SHIFT)
-#define NACA_VIRT_ADDR (KERNELBASE+NACA_PHYS_ADDR)
#endif /* _NACA_H */
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 9/11] PPC64: use xPMCRegsInUse
2005-01-04 4:34 ` [PATCH 8/11] PPC64: remove the naca from all but iSeries Stephen Rothwell
@ 2005-01-04 4:37 ` Stephen Rothwell
2005-01-04 4:40 ` [PATCH 10/11] PPC64: move the lppaca defining header file Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:37 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
Hi Andrew,
This fixes an aweful piece of code that could have just referenced
xPMCRegsInUse in the lppaca structure.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.8/arch/ppc64/kernel/sysfs.c linus-bk-naca.9/arch/ppc64/kernel/sysfs.c
--- linus-bk-naca.8/arch/ppc64/kernel/sysfs.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.9/arch/ppc64/kernel/sysfs.c 2004-12-13 14:49:37.000000000 +1100
@@ -14,6 +14,8 @@
#include <asm/hvcall.h>
#include <asm/prom.h>
#include <asm/systemcfg.h>
+#include <asm/paca.h>
+#include <asm/iSeries/ItLpPaca.h>
/* SMT stuff */
@@ -154,10 +156,8 @@
#ifdef CONFIG_PPC_PSERIES
/* instruct hypervisor to maintain PMCs */
- if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
- char *ptr = (char *)&paca[smp_processor_id()].lppaca;
- ptr[0xBB] = 1;
- }
+ if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
+ get_paca()->lppaca.xPMCRegsInUse = 1;
/*
* On SMT machines we have to set the run latch in the ctrl register
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 10/11] PPC64: move the lppaca defining header file
2005-01-04 4:37 ` [PATCH 9/11] PPC64: use xPMCRegsInUse Stephen Rothwell
@ 2005-01-04 4:40 ` Stephen Rothwell
2005-01-04 4:43 ` [PATCH 11/11] PPC64: remove StudlyCaps from lppaca structure Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:40 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 18637 bytes --]
Hi Andrew,
This patch just renames asm/iSeries/ItLpPaca.h to asm/lppaca.h as the
lppaca structure is no longer just legacy iSeries specific.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.9/arch/ppc64/kernel/LparData.c linus-bk-naca.10/arch/ppc64/kernel/LparData.c
--- linus-bk-naca.9/arch/ppc64/kernel/LparData.c 2004-12-11 02:49:48.000000000 +1100
+++ linus-bk-naca.10/arch/ppc64/kernel/LparData.c 2004-12-13 15:01:55.000000000 +1100
@@ -16,7 +16,7 @@
#include <asm/naca.h>
#include <asm/abs_addr.h>
#include <asm/iSeries/ItLpNaca.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
#include <asm/iSeries/ItLpRegSave.h>
#include <asm/paca.h>
#include <asm/iSeries/HvReleaseData.h>
diff -ruN linus-bk-naca.9/arch/ppc64/kernel/asm-offsets.c linus-bk-naca.10/arch/ppc64/kernel/asm-offsets.c
--- linus-bk-naca.9/arch/ppc64/kernel/asm-offsets.c 2004-12-10 17:27:14.000000000 +1100
+++ linus-bk-naca.10/arch/ppc64/kernel/asm-offsets.c 2004-12-13 15:02:03.000000000 +1100
@@ -29,7 +29,7 @@
#include <asm/processor.h>
#include <asm/paca.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/iSeries/HvLpEvent.h>
#include <asm/rtas.h>
diff -ruN linus-bk-naca.9/arch/ppc64/kernel/iSeries_proc.c linus-bk-naca.10/arch/ppc64/kernel/iSeries_proc.c
--- linus-bk-naca.9/arch/ppc64/kernel/iSeries_proc.c 2004-12-10 16:26:54.000000000 +1100
+++ linus-bk-naca.10/arch/ppc64/kernel/iSeries_proc.c 2004-12-13 15:02:14.000000000 +1100
@@ -24,7 +24,7 @@
#include <asm/paca.h>
#include <asm/processor.h>
#include <asm/time.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/iSeries/HvCallXm.h>
#include <asm/iSeries/IoHriMainStore.h>
diff -ruN linus-bk-naca.9/arch/ppc64/kernel/lparcfg.c linus-bk-naca.10/arch/ppc64/kernel/lparcfg.c
--- linus-bk-naca.9/arch/ppc64/kernel/lparcfg.c 2004-11-20 12:05:26.000000000 +1100
+++ linus-bk-naca.10/arch/ppc64/kernel/lparcfg.c 2004-12-13 15:02:29.000000000 +1100
@@ -27,7 +27,7 @@
#include <linux/seq_file.h>
#include <asm/uaccess.h>
#include <asm/iSeries/HvLpConfig.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
#include <asm/iSeries/LparData.h>
#include <asm/hvcall.h>
#include <asm/cputable.h>
diff -ruN linus-bk-naca.9/arch/ppc64/kernel/pacaData.c linus-bk-naca.10/arch/ppc64/kernel/pacaData.c
--- linus-bk-naca.9/arch/ppc64/kernel/pacaData.c 2004-12-11 02:50:23.000000000 +1100
+++ linus-bk-naca.10/arch/ppc64/kernel/pacaData.c 2004-12-13 15:02:07.000000000 +1100
@@ -16,7 +16,7 @@
#include <asm/ptrace.h>
#include <asm/page.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/paca.h>
diff -ruN linus-bk-naca.9/arch/ppc64/kernel/sysfs.c linus-bk-naca.10/arch/ppc64/kernel/sysfs.c
--- linus-bk-naca.9/arch/ppc64/kernel/sysfs.c 2004-12-13 14:49:37.000000000 +1100
+++ linus-bk-naca.10/arch/ppc64/kernel/sysfs.c 2004-12-13 15:01:19.000000000 +1100
@@ -15,7 +15,7 @@
#include <asm/prom.h>
#include <asm/systemcfg.h>
#include <asm/paca.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
/* SMT stuff */
diff -ruN linus-bk-naca.9/include/asm-ppc64/iSeries/ItLpPaca.h linus-bk-naca.10/include/asm-ppc64/iSeries/ItLpPaca.h
--- linus-bk-naca.9/include/asm-ppc64/iSeries/ItLpPaca.h 2004-01-20 08:20:26.000000000 +1100
+++ linus-bk-naca.10/include/asm-ppc64/iSeries/ItLpPaca.h 1970-01-01 10:00:00.000000000 +1000
@@ -1,134 +0,0 @@
-/*
- * ItLpPaca.h
- * Copyright (C) 2001 Mike Corrigan IBM Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#ifndef _ITLPPACA_H
-#define _ITLPPACA_H
-
-//=============================================================================
-//
-// This control block contains the data that is shared between the
-// hypervisor (PLIC) and the OS.
-//
-//
-//----------------------------------------------------------------------------
-#include <asm/types.h>
-
-struct ItLpPaca
-{
-//=============================================================================
-// CACHE_LINE_1 0x0000 - 0x007F Contains read-only data
-// NOTE: The xDynXyz fields are fields that will be dynamically changed by
-// PLIC when preparing to bring a processor online or when dispatching a
-// virtual processor!
-//=============================================================================
- u32 xDesc; // Eye catcher 0xD397D781 x00-x03
- u16 xSize; // Size of this struct x04-x05
- u16 xRsvd1_0; // Reserved x06-x07
- u16 xRsvd1_1:14; // Reserved x08-x09
- u8 xSharedProc:1; // Shared processor indicator ...
- u8 xSecondaryThread:1; // Secondary thread indicator ...
- volatile u8 xDynProcStatus:8; // Dynamic Status of this proc x0A-x0A
- u8 xSecondaryThreadCnt; // Secondary thread count x0B-x0B
- volatile u16 xDynHvPhysicalProcIndex;// Dynamic HV Physical Proc Index0C-x0D
- volatile u16 xDynHvLogicalProcIndex;// Dynamic HV Logical Proc Indexx0E-x0F
- u32 xDecrVal; // Value for Decr programming x10-x13
- u32 xPMCVal; // Value for PMC regs x14-x17
- volatile u32 xDynHwNodeId; // Dynamic Hardware Node id x18-x1B
- volatile u32 xDynHwProcId; // Dynamic Hardware Proc Id x1C-x1F
- volatile u32 xDynPIR; // Dynamic ProcIdReg value x20-x23
- u32 xDseiData; // DSEI data x24-x27
- u64 xSPRG3; // SPRG3 value x28-x2F
- u8 xRsvd1_3[80]; // Reserved x30-x7F
-
-//=============================================================================
-// CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data
-//=============================================================================
- // This Dword contains a byte for each type of interrupt that can occur.
- // The IPI is a count while the others are just a binary 1 or 0.
- union {
- u64 xAnyInt;
- struct {
- u16 xRsvd; // Reserved - cleared by #mpasmbl
- u8 xXirrInt; // Indicates xXirrValue is valid or Immed IO
- u8 xIpiCnt; // IPI Count
- u8 xDecrInt; // DECR interrupt occurred
- u8 xPdcInt; // PDC interrupt occurred
- u8 xQuantumInt; // Interrupt quantum reached
- u8 xOldPlicDeferredExtInt; // Old PLIC has a deferred XIRR pending
- } xFields;
- } xIntDword;
-
- // Whenever any fields in this Dword are set then PLIC will defer the
- // processing of external interrupts. Note that PLIC will store the
- // XIRR directly into the xXirrValue field so that another XIRR will
- // not be presented until this one clears. The layout of the low
- // 4-bytes of this Dword is upto SLIC - PLIC just checks whether the
- // entire Dword is zero or not. A non-zero value in the low order
- // 2-bytes will result in SLIC being granted the highest thread
- // priority upon return. A 0 will return to SLIC as medium priority.
- u64 xPlicDeferIntsArea; // Entire Dword
-
- // Used to pass the real SRR0/1 from PLIC to SLIC as well as to
- // pass the target SRR0/1 from SLIC to PLIC on a SetAsrAndRfid.
- u64 xSavedSrr0; // Saved SRR0 x10-x17
- u64 xSavedSrr1; // Saved SRR1 x18-x1F
-
- // Used to pass parms from the OS to PLIC for SetAsrAndRfid
- u64 xSavedGpr3; // Saved GPR3 x20-x27
- u64 xSavedGpr4; // Saved GPR4 x28-x2F
- u64 xSavedGpr5; // Saved GPR5 x30-x37
-
- u8 xRsvd2_1; // Reserved x38-x38
- u8 xCpuCtlsTaskAttributes; // Task attributes for cpuctls x39-x39
- u8 xFPRegsInUse; // FP regs in use x3A-x3A
- u8 xPMCRegsInUse; // PMC regs in use x3B-x3B
- volatile u32 xSavedDecr; // Saved Decr Value x3C-x3F
- volatile u64 xEmulatedTimeBase;// Emulated TB for this thread x40-x47
- volatile u64 xCurPLICLatency; // Unaccounted PLIC latency x48-x4F
- u64 xTotPLICLatency; // Accumulated PLIC latency x50-x57
- u64 xWaitStateCycles; // Wait cycles for this proc x58-x5F
- u64 xEndOfQuantum; // TB at end of quantum x60-x67
- u64 xPDCSavedSPRG1; // Saved SPRG1 for PMC int x68-x6F
- u64 xPDCSavedSRR0; // Saved SRR0 for PMC int x70-x77
- volatile u32 xVirtualDecr; // Virtual DECR for shared procsx78-x7B
- u16 xSLBCount; // # of SLBs to maintain x7C-x7D
- u8 xIdle; // Indicate OS is idle x7E
- u8 xRsvd2_2; // Reserved x7F
-
-
-//=============================================================================
-// CACHE_LINE_3 0x0100 - 0x007F: This line is shared with other processors
-//=============================================================================
- // This is the xYieldCount. An "odd" value (low bit on) means that
- // the processor is yielded (either because of an OS yield or a PLIC
- // preempt). An even value implies that the processor is currently
- // executing.
- // NOTE: This value will ALWAYS be zero for dedicated processors and
- // will NEVER be zero for shared processors (ie, initialized to a 1).
- volatile u32 xYieldCount; // PLIC increments each dispatchx00-x03
- u8 xRsvd3_0[124]; // Reserved x04-x7F
-
-//=============================================================================
-// CACHE_LINE_4-5 0x0100 - 0x01FF Contains PMC interrupt data
-//=============================================================================
- u8 xPmcSaveArea[256]; // PMC interrupt Area x00-xFF
-
-
-};
-
-#endif /* _ITLPPACA_H */
diff -ruN linus-bk-naca.9/include/asm-ppc64/iSeries/LparData.h linus-bk-naca.10/include/asm-ppc64/iSeries/LparData.h
--- linus-bk-naca.9/include/asm-ppc64/iSeries/LparData.h 2004-12-10 16:26:54.000000000 +1100
+++ linus-bk-naca.10/include/asm-ppc64/iSeries/LparData.h 2004-12-13 15:03:03.000000000 +1100
@@ -25,7 +25,6 @@
#include <asm/abs_addr.h>
#include <asm/iSeries/ItLpNaca.h>
-#include <asm/iSeries/ItLpPaca.h>
#include <asm/iSeries/ItLpRegSave.h>
#include <asm/iSeries/HvReleaseData.h>
#include <asm/iSeries/LparMap.h>
diff -ruN linus-bk-naca.9/include/asm-ppc64/lppaca.h linus-bk-naca.10/include/asm-ppc64/lppaca.h
--- linus-bk-naca.9/include/asm-ppc64/lppaca.h 1970-01-01 10:00:00.000000000 +1000
+++ linus-bk-naca.10/include/asm-ppc64/lppaca.h 2004-12-13 15:04:43.000000000 +1100
@@ -0,0 +1,134 @@
+/*
+ * lppaca.h
+ * Copyright (C) 2001 Mike Corrigan IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef _ASM_LPPACA_H
+#define _ASM_LPPACA_H
+
+//=============================================================================
+//
+// This control block contains the data that is shared between the
+// hypervisor (PLIC) and the OS.
+//
+//
+//----------------------------------------------------------------------------
+#include <asm/types.h>
+
+struct ItLpPaca
+{
+//=============================================================================
+// CACHE_LINE_1 0x0000 - 0x007F Contains read-only data
+// NOTE: The xDynXyz fields are fields that will be dynamically changed by
+// PLIC when preparing to bring a processor online or when dispatching a
+// virtual processor!
+//=============================================================================
+ u32 xDesc; // Eye catcher 0xD397D781 x00-x03
+ u16 xSize; // Size of this struct x04-x05
+ u16 xRsvd1_0; // Reserved x06-x07
+ u16 xRsvd1_1:14; // Reserved x08-x09
+ u8 xSharedProc:1; // Shared processor indicator ...
+ u8 xSecondaryThread:1; // Secondary thread indicator ...
+ volatile u8 xDynProcStatus:8; // Dynamic Status of this proc x0A-x0A
+ u8 xSecondaryThreadCnt; // Secondary thread count x0B-x0B
+ volatile u16 xDynHvPhysicalProcIndex;// Dynamic HV Physical Proc Index0C-x0D
+ volatile u16 xDynHvLogicalProcIndex;// Dynamic HV Logical Proc Indexx0E-x0F
+ u32 xDecrVal; // Value for Decr programming x10-x13
+ u32 xPMCVal; // Value for PMC regs x14-x17
+ volatile u32 xDynHwNodeId; // Dynamic Hardware Node id x18-x1B
+ volatile u32 xDynHwProcId; // Dynamic Hardware Proc Id x1C-x1F
+ volatile u32 xDynPIR; // Dynamic ProcIdReg value x20-x23
+ u32 xDseiData; // DSEI data x24-x27
+ u64 xSPRG3; // SPRG3 value x28-x2F
+ u8 xRsvd1_3[80]; // Reserved x30-x7F
+
+//=============================================================================
+// CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data
+//=============================================================================
+ // This Dword contains a byte for each type of interrupt that can occur.
+ // The IPI is a count while the others are just a binary 1 or 0.
+ union {
+ u64 xAnyInt;
+ struct {
+ u16 xRsvd; // Reserved - cleared by #mpasmbl
+ u8 xXirrInt; // Indicates xXirrValue is valid or Immed IO
+ u8 xIpiCnt; // IPI Count
+ u8 xDecrInt; // DECR interrupt occurred
+ u8 xPdcInt; // PDC interrupt occurred
+ u8 xQuantumInt; // Interrupt quantum reached
+ u8 xOldPlicDeferredExtInt; // Old PLIC has a deferred XIRR pending
+ } xFields;
+ } xIntDword;
+
+ // Whenever any fields in this Dword are set then PLIC will defer the
+ // processing of external interrupts. Note that PLIC will store the
+ // XIRR directly into the xXirrValue field so that another XIRR will
+ // not be presented until this one clears. The layout of the low
+ // 4-bytes of this Dword is upto SLIC - PLIC just checks whether the
+ // entire Dword is zero or not. A non-zero value in the low order
+ // 2-bytes will result in SLIC being granted the highest thread
+ // priority upon return. A 0 will return to SLIC as medium priority.
+ u64 xPlicDeferIntsArea; // Entire Dword
+
+ // Used to pass the real SRR0/1 from PLIC to SLIC as well as to
+ // pass the target SRR0/1 from SLIC to PLIC on a SetAsrAndRfid.
+ u64 xSavedSrr0; // Saved SRR0 x10-x17
+ u64 xSavedSrr1; // Saved SRR1 x18-x1F
+
+ // Used to pass parms from the OS to PLIC for SetAsrAndRfid
+ u64 xSavedGpr3; // Saved GPR3 x20-x27
+ u64 xSavedGpr4; // Saved GPR4 x28-x2F
+ u64 xSavedGpr5; // Saved GPR5 x30-x37
+
+ u8 xRsvd2_1; // Reserved x38-x38
+ u8 xCpuCtlsTaskAttributes; // Task attributes for cpuctls x39-x39
+ u8 xFPRegsInUse; // FP regs in use x3A-x3A
+ u8 xPMCRegsInUse; // PMC regs in use x3B-x3B
+ volatile u32 xSavedDecr; // Saved Decr Value x3C-x3F
+ volatile u64 xEmulatedTimeBase;// Emulated TB for this thread x40-x47
+ volatile u64 xCurPLICLatency; // Unaccounted PLIC latency x48-x4F
+ u64 xTotPLICLatency; // Accumulated PLIC latency x50-x57
+ u64 xWaitStateCycles; // Wait cycles for this proc x58-x5F
+ u64 xEndOfQuantum; // TB at end of quantum x60-x67
+ u64 xPDCSavedSPRG1; // Saved SPRG1 for PMC int x68-x6F
+ u64 xPDCSavedSRR0; // Saved SRR0 for PMC int x70-x77
+ volatile u32 xVirtualDecr; // Virtual DECR for shared procsx78-x7B
+ u16 xSLBCount; // # of SLBs to maintain x7C-x7D
+ u8 xIdle; // Indicate OS is idle x7E
+ u8 xRsvd2_2; // Reserved x7F
+
+
+//=============================================================================
+// CACHE_LINE_3 0x0100 - 0x007F: This line is shared with other processors
+//=============================================================================
+ // This is the xYieldCount. An "odd" value (low bit on) means that
+ // the processor is yielded (either because of an OS yield or a PLIC
+ // preempt). An even value implies that the processor is currently
+ // executing.
+ // NOTE: This value will ALWAYS be zero for dedicated processors and
+ // will NEVER be zero for shared processors (ie, initialized to a 1).
+ volatile u32 xYieldCount; // PLIC increments each dispatchx00-x03
+ u8 xRsvd3_0[124]; // Reserved x04-x7F
+
+//=============================================================================
+// CACHE_LINE_4-5 0x0100 - 0x01FF Contains PMC interrupt data
+//=============================================================================
+ u8 xPmcSaveArea[256]; // PMC interrupt Area x00-xFF
+
+
+};
+
+#endif /* _ASM_LPPACA_H */
diff -ruN linus-bk-naca.9/include/asm-ppc64/paca.h linus-bk-naca.10/include/asm-ppc64/paca.h
--- linus-bk-naca.9/include/asm-ppc64/paca.h 2004-12-13 18:05:08.000000000 +1100
+++ linus-bk-naca.10/include/asm-ppc64/paca.h 2004-12-31 15:48:57.000000000 +1100
@@ -18,7 +18,7 @@
#include <linux/config.h>
#include <asm/types.h>
-#include <asm/iSeries/ItLpPaca.h>
+#include <asm/lppaca.h>
#include <asm/iSeries/ItLpRegSave.h>
#include <asm/mmu.h>
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 11/11] PPC64: remove StudlyCaps from lppaca structure
2005-01-04 4:40 ` [PATCH 10/11] PPC64: move the lppaca defining header file Stephen Rothwell
@ 2005-01-04 4:43 ` Stephen Rothwell
2005-01-04 11:58 ` [PATCH] PPC64: use c99 initializers Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 4:43 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 24676 bytes --]
Hi Andrew,
This patch just renames all the fields (and the structure name) of the
lppaca structure to rid us of some more StudyCaps.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/asm-offsets.c linus-bk-naca.11/arch/ppc64/kernel/asm-offsets.c
--- linus-bk-naca.10/arch/ppc64/kernel/asm-offsets.c 2004-12-13 15:02:03.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/asm-offsets.c 2004-12-31 15:51:16.000000000 +1100
@@ -102,10 +102,10 @@
DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca));
DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
- DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0));
- DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1));
- DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xIntDword.xAnyInt));
- DEFINE(LPPACADECRINT, offsetof(struct ItLpPaca, xIntDword.xFields.xDecrInt));
+ DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
+ DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
+ DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int));
+ DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int));
/* RTAS */
DEFINE(RTASBASE, offsetof(struct rtas_t, base));
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/iSeries_setup.c linus-bk-naca.11/arch/ppc64/kernel/iSeries_setup.c
--- linus-bk-naca.10/arch/ppc64/kernel/iSeries_setup.c 2004-12-11 02:51:17.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/iSeries_setup.c 2004-12-13 15:31:14.000000000 +1100
@@ -559,7 +559,7 @@
static void __init setup_iSeries_cache_sizes(void)
{
unsigned int i, n;
- unsigned int procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex;
+ unsigned int procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
systemcfg->icache_size =
ppc64_caches.isize = xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
@@ -656,7 +656,7 @@
void __init iSeries_setup_arch(void)
{
void *eventStack;
- unsigned procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex;
+ unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
/* Add an eye catcher and the systemcfg layout version number */
strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/iSeries_smp.c linus-bk-naca.11/arch/ppc64/kernel/iSeries_smp.c
--- linus-bk-naca.10/arch/ppc64/kernel/iSeries_smp.c 2004-12-10 16:26:54.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/iSeries_smp.c 2004-12-13 15:29:16.000000000 +1100
@@ -90,7 +90,7 @@
np = 0;
for (i=0; i < NR_CPUS; ++i) {
- if (paca[i].lppaca.xDynProcStatus < 2) {
+ if (paca[i].lppaca.dyn_proc_status < 2) {
cpu_set(i, cpu_possible_map);
cpu_set(i, cpu_present_map);
cpu_set(i, cpu_sibling_map[i]);
@@ -106,7 +106,7 @@
unsigned np = 0;
for (i=0; i < NR_CPUS; ++i) {
- if (paca[i].lppaca.xDynProcStatus < 2) {
+ if (paca[i].lppaca.dyn_proc_status < 2) {
/*paca[i].active = 1;*/
++np;
}
@@ -120,7 +120,7 @@
BUG_ON(nr < 0 || nr >= NR_CPUS);
/* Verify that our partition has a processor nr */
- if (paca[nr].lppaca.xDynProcStatus >= 2)
+ if (paca[nr].lppaca.dyn_proc_status >= 2)
return;
/* The processor is currently spinning, waiting
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/idle.c linus-bk-naca.11/arch/ppc64/kernel/idle.c
--- linus-bk-naca.10/arch/ppc64/kernel/idle.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/idle.c 2004-12-13 16:06:18.000000000 +1100
@@ -67,7 +67,7 @@
* The decrementer stops during the yield. Force a fake decrementer
* here and let the timer_interrupt code sort out the actual time.
*/
- get_paca()->lppaca.xIntDword.xFields.xDecrInt = 1;
+ get_paca()->lppaca.int_dword.fields.decr_int = 1;
process_iSeries_events();
}
@@ -86,7 +86,7 @@
lpaca = get_paca();
while (1) {
- if (lpaca->lppaca.xSharedProc) {
+ if (lpaca->lppaca.shared_proc) {
if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr))
process_iSeries_events();
if (!need_resched())
@@ -173,7 +173,7 @@
* Indicate to the HV that we are idle. Now would be
* a good time to find other work to dispatch.
*/
- lpaca->lppaca.xIdle = 1;
+ lpaca->lppaca.idle = 1;
oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
if (!oldval) {
@@ -194,7 +194,7 @@
HMT_medium();
- if (!(ppaca->lppaca.xIdle)) {
+ if (!(ppaca->lppaca.idle)) {
local_irq_disable();
/*
@@ -233,7 +233,7 @@
}
HMT_medium();
- lpaca->lppaca.xIdle = 0;
+ lpaca->lppaca.idle = 0;
schedule();
if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
cpu_die();
@@ -251,7 +251,7 @@
* Indicate to the HV that we are idle. Now would be
* a good time to find other work to dispatch.
*/
- lpaca->lppaca.xIdle = 1;
+ lpaca->lppaca.idle = 1;
while (!need_resched() && !cpu_is_offline(cpu)) {
local_irq_disable();
@@ -273,7 +273,7 @@
}
HMT_medium();
- lpaca->lppaca.xIdle = 0;
+ lpaca->lppaca.idle = 0;
schedule();
if (cpu_is_offline(smp_processor_id()) &&
system_state == SYSTEM_RUNNING)
@@ -352,7 +352,7 @@
#ifdef CONFIG_PPC_PSERIES
if (systemcfg->platform & PLATFORM_PSERIES) {
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
- if (get_paca()->lppaca.xSharedProc) {
+ if (get_paca()->lppaca.shared_proc) {
printk(KERN_INFO "Using shared processor idle loop\n");
idle_loop = shared_idle;
} else {
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/irq.c linus-bk-naca.11/arch/ppc64/kernel/irq.c
--- linus-bk-naca.10/arch/ppc64/kernel/irq.c 2004-12-31 14:53:21.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/irq.c 2004-12-13 15:43:22.000000000 +1100
@@ -259,8 +259,8 @@
lpaca = get_paca();
#ifdef CONFIG_SMP
- if (lpaca->lppaca.xIntDword.xFields.xIpiCnt) {
- lpaca->lppaca.xIntDword.xFields.xIpiCnt = 0;
+ if (lpaca->lppaca.int_dword.fields.ipi_cnt) {
+ lpaca->lppaca.int_dword.fields.ipi_cnt = 0;
iSeries_smp_message_recv(regs);
}
#endif /* CONFIG_SMP */
@@ -270,8 +270,8 @@
irq_exit();
- if (lpaca->lppaca.xIntDword.xFields.xDecrInt) {
- lpaca->lppaca.xIntDword.xFields.xDecrInt = 0;
+ if (lpaca->lppaca.int_dword.fields.decr_int) {
+ lpaca->lppaca.int_dword.fields.decr_int = 0;
/* Signal a fake decrementer interrupt */
timer_interrupt(regs);
}
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/lparcfg.c linus-bk-naca.11/arch/ppc64/kernel/lparcfg.c
--- linus-bk-naca.10/arch/ppc64/kernel/lparcfg.c 2004-12-13 15:02:29.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/lparcfg.c 2004-12-13 16:00:00.000000000 +1100
@@ -72,7 +72,7 @@
/*
* For iSeries legacy systems, the PPA purr function is available from the
- * xEmulatedTimeBase field in the paca.
+ * emulated_time_base field in the paca.
*/
static unsigned long get_purr(void)
{
@@ -82,11 +82,11 @@
for_each_cpu(cpu) {
lpaca = paca + cpu;
- sum_purr += lpaca->lppaca.xEmulatedTimeBase;
+ sum_purr += lpaca->lppaca.emulated_time_base;
#ifdef PURR_DEBUG
printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n",
- cpu, lpaca->lppaca.xEmulatedTimeBase);
+ cpu, lpaca->lppaca.emulated_time_base);
#endif
}
return sum_purr;
@@ -107,7 +107,7 @@
seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);
- shared = (int)(lpaca->lppaca_ptr->xSharedProc);
+ shared = (int)(lpaca->lppaca_ptr->shared_proc);
seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n",
e2a(xItExtVpdPanel.mfgID[2]),
e2a(xItExtVpdPanel.mfgID[3]),
@@ -395,7 +395,7 @@
(h_resource >> 0 * 8) & 0xffff);
/* pool related entries are apropriate for shared configs */
- if (paca[0].lppaca.xSharedProc) {
+ if (paca[0].lppaca.shared_proc) {
h_pic(&pool_idle_time, &pool_procs);
@@ -444,7 +444,7 @@
seq_printf(m, "partition_potential_processors=%d\n",
partition_potential_processors);
- seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.xSharedProc);
+ seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.shared_proc);
return 0;
}
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/pacaData.c linus-bk-naca.11/arch/ppc64/kernel/pacaData.c
--- linus-bk-naca.10/arch/ppc64/kernel/pacaData.c 2004-12-13 15:02:07.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/pacaData.c 2004-12-13 16:05:34.000000000 +1100
@@ -28,7 +28,7 @@
extern unsigned long __toc_start;
/* The Paca is an array with one entry per processor. Each contains an
- * ItLpPaca, which contains the information shared between the
+ * lppaca, which contains the information shared between the
* hypervisor and Linux. Each also contains an ItLpRegSave area which
* is used by the hypervisor to save registers.
* On systems with hardware multi-threading, there are two threads
@@ -61,13 +61,13 @@
.cpu_start = (start), /* Processor start */ \
.hw_cpu_id = 0xffff, \
.lppaca = { \
- .xDesc = 0xd397d781, /* "LpPa" */ \
- .xSize = sizeof(struct ItLpPaca), \
- .xFPRegsInUse = 1, \
- .xDynProcStatus = 2, \
- .xDecrVal = 0x00ff0000, \
- .xEndOfQuantum = 0xfffffffffffffffful, \
- .xSLBCount = 64, \
+ .desc = 0xd397d781, /* "LpPa" */ \
+ .size = sizeof(struct lppaca), \
+ .dyn_proc_status = 2, \
+ .decr_val = 0x00ff0000, \
+ .fpregs_in_use = 1, \
+ .end_of_quantum = 0xfffffffffffffffful, \
+ .slb_count = 64, \
}, \
EXTRA_INITS((number), (lpq)) \
}
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/sysfs.c linus-bk-naca.11/arch/ppc64/kernel/sysfs.c
--- linus-bk-naca.10/arch/ppc64/kernel/sysfs.c 2004-12-13 15:01:19.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/sysfs.c 2004-12-13 15:58:30.000000000 +1100
@@ -157,7 +157,7 @@
#ifdef CONFIG_PPC_PSERIES
/* instruct hypervisor to maintain PMCs */
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
- get_paca()->lppaca.xPMCRegsInUse = 1;
+ get_paca()->lppaca.pmcregs_in_use = 1;
/*
* On SMT machines we have to set the run latch in the ctrl register
diff -ruN linus-bk-naca.10/arch/ppc64/kernel/time.c linus-bk-naca.11/arch/ppc64/kernel/time.c
--- linus-bk-naca.10/arch/ppc64/kernel/time.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/kernel/time.c 2004-12-13 15:43:28.000000000 +1100
@@ -230,7 +230,7 @@
/*
* For iSeries shared processors, we have to let the hypervisor
* set the hardware decrementer. We set a virtual decrementer
- * in the ItLpPaca and call the hypervisor if the virtual
+ * in the lppaca and call the hypervisor if the virtual
* decrementer is less than the current value in the hardware
* decrementer. (almost always the new decrementer value will
* be greater than the current hardware decementer so the hypervisor
@@ -256,7 +256,7 @@
profile_tick(CPU_PROFILING, regs);
#endif
- lpaca->lppaca.xIntDword.xFields.xDecrInt = 0;
+ lpaca->lppaca.int_dword.fields.decr_int = 0;
while (lpaca->next_jiffy_update_tb <= (cur_tb = get_tb())) {
diff -ruN linus-bk-naca.10/arch/ppc64/lib/locks.c linus-bk-naca.11/arch/ppc64/lib/locks.c
--- linus-bk-naca.10/arch/ppc64/lib/locks.c 2004-09-16 21:51:57.000000000 +1000
+++ linus-bk-naca.11/arch/ppc64/lib/locks.c 2004-12-13 16:08:05.000000000 +1100
@@ -34,7 +34,7 @@
holder_cpu = lock_value & 0xffff;
BUG_ON(holder_cpu >= NR_CPUS);
holder_paca = &paca[holder_cpu];
- yield_count = holder_paca->lppaca.xYieldCount;
+ yield_count = holder_paca->lppaca.yield_count;
if ((yield_count & 1) == 0)
return; /* virtual cpu is currently running */
rmb();
@@ -66,7 +66,7 @@
holder_cpu = lock_value & 0xffff;
BUG_ON(holder_cpu >= NR_CPUS);
holder_paca = &paca[holder_cpu];
- yield_count = holder_paca->lppaca.xYieldCount;
+ yield_count = holder_paca->lppaca.yield_count;
if ((yield_count & 1) == 0)
return; /* virtual cpu is currently running */
rmb();
diff -ruN linus-bk-naca.10/arch/ppc64/xmon/xmon.c linus-bk-naca.11/arch/ppc64/xmon/xmon.c
--- linus-bk-naca.10/arch/ppc64/xmon/xmon.c 2004-12-11 02:33:00.000000000 +1100
+++ linus-bk-naca.11/arch/ppc64/xmon/xmon.c 2004-12-13 15:50:52.000000000 +1100
@@ -1489,7 +1489,7 @@
unsigned long val;
#ifdef CONFIG_PPC_ISERIES
struct paca_struct *ptrPaca = NULL;
- struct ItLpPaca *ptrLpPaca = NULL;
+ struct lppaca *ptrLpPaca = NULL;
struct ItLpRegSave *ptrLpRegSave = NULL;
#endif
@@ -1513,10 +1513,10 @@
printf(" Local Processor Control Area (LpPaca): \n");
ptrLpPaca = ptrPaca->lppaca_ptr;
printf(" Saved Srr0=%.16lx Saved Srr1=%.16lx \n",
- ptrLpPaca->xSavedSrr0, ptrLpPaca->xSavedSrr1);
+ ptrLpPaca->saved_srr0, ptrLpPaca->saved_srr1);
printf(" Saved Gpr3=%.16lx Saved Gpr4=%.16lx \n",
- ptrLpPaca->xSavedGpr3, ptrLpPaca->xSavedGpr4);
- printf(" Saved Gpr5=%.16lx \n", ptrLpPaca->xSavedGpr5);
+ ptrLpPaca->saved_gpr3, ptrLpPaca->saved_gpr4);
+ printf(" Saved Gpr5=%.16lx \n", ptrLpPaca->saved_gpr5);
printf(" Local Processor Register Save Area (LpRegSave): \n");
ptrLpRegSave = ptrPaca->reg_save_ptr;
diff -ruN linus-bk-naca.10/include/asm-ppc64/lppaca.h linus-bk-naca.11/include/asm-ppc64/lppaca.h
--- linus-bk-naca.10/include/asm-ppc64/lppaca.h 2004-12-13 15:04:43.000000000 +1100
+++ linus-bk-naca.11/include/asm-ppc64/lppaca.h 2004-12-13 16:09:08.000000000 +1100
@@ -28,7 +28,7 @@
//----------------------------------------------------------------------------
#include <asm/types.h>
-struct ItLpPaca
+struct lppaca
{
//=============================================================================
// CACHE_LINE_1 0x0000 - 0x007F Contains read-only data
@@ -36,24 +36,24 @@
// PLIC when preparing to bring a processor online or when dispatching a
// virtual processor!
//=============================================================================
- u32 xDesc; // Eye catcher 0xD397D781 x00-x03
- u16 xSize; // Size of this struct x04-x05
- u16 xRsvd1_0; // Reserved x06-x07
- u16 xRsvd1_1:14; // Reserved x08-x09
- u8 xSharedProc:1; // Shared processor indicator ...
- u8 xSecondaryThread:1; // Secondary thread indicator ...
- volatile u8 xDynProcStatus:8; // Dynamic Status of this proc x0A-x0A
- u8 xSecondaryThreadCnt; // Secondary thread count x0B-x0B
- volatile u16 xDynHvPhysicalProcIndex;// Dynamic HV Physical Proc Index0C-x0D
- volatile u16 xDynHvLogicalProcIndex;// Dynamic HV Logical Proc Indexx0E-x0F
- u32 xDecrVal; // Value for Decr programming x10-x13
- u32 xPMCVal; // Value for PMC regs x14-x17
- volatile u32 xDynHwNodeId; // Dynamic Hardware Node id x18-x1B
- volatile u32 xDynHwProcId; // Dynamic Hardware Proc Id x1C-x1F
- volatile u32 xDynPIR; // Dynamic ProcIdReg value x20-x23
- u32 xDseiData; // DSEI data x24-x27
- u64 xSPRG3; // SPRG3 value x28-x2F
- u8 xRsvd1_3[80]; // Reserved x30-x7F
+ u32 desc; // Eye catcher 0xD397D781 x00-x03
+ u16 size; // Size of this struct x04-x05
+ u16 reserved1; // Reserved x06-x07
+ u16 reserved2:14; // Reserved x08-x09
+ u8 shared_proc:1; // Shared processor indicator ...
+ u8 secondary_thread:1; // Secondary thread indicator ...
+ volatile u8 dyn_proc_status:8; // Dynamic Status of this proc x0A-x0A
+ u8 secondary_thread_count; // Secondary thread count x0B-x0B
+ volatile u16 dyn_hv_phys_proc_index;// Dynamic HV Physical Proc Index0C-x0D
+ volatile u16 dyn_hv_log_proc_index;// Dynamic HV Logical Proc Indexx0E-x0F
+ u32 decr_val; // Value for Decr programming x10-x13
+ u32 pmc_val; // Value for PMC regs x14-x17
+ volatile u32 dyn_hw_node_id; // Dynamic Hardware Node id x18-x1B
+ volatile u32 dyn_hw_proc_id; // Dynamic Hardware Proc Id x1C-x1F
+ volatile u32 dyn_pir; // Dynamic ProcIdReg value x20-x23
+ u32 dsei_data; // DSEI data x24-x27
+ u64 sprg3; // SPRG3 value x28-x2F
+ u8 reserved3[80]; // Reserved x30-x7F
//=============================================================================
// CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data
@@ -61,17 +61,17 @@
// This Dword contains a byte for each type of interrupt that can occur.
// The IPI is a count while the others are just a binary 1 or 0.
union {
- u64 xAnyInt;
+ u64 any_int;
struct {
- u16 xRsvd; // Reserved - cleared by #mpasmbl
- u8 xXirrInt; // Indicates xXirrValue is valid or Immed IO
- u8 xIpiCnt; // IPI Count
- u8 xDecrInt; // DECR interrupt occurred
- u8 xPdcInt; // PDC interrupt occurred
- u8 xQuantumInt; // Interrupt quantum reached
- u8 xOldPlicDeferredExtInt; // Old PLIC has a deferred XIRR pending
- } xFields;
- } xIntDword;
+ u16 reserved; // Reserved - cleared by #mpasmbl
+ u8 xirr_int; // Indicates xXirrValue is valid or Immed IO
+ u8 ipi_cnt; // IPI Count
+ u8 decr_int; // DECR interrupt occurred
+ u8 pdc_int; // PDC interrupt occurred
+ u8 quantum_int; // Interrupt quantum reached
+ u8 old_plic_deferred_ext_int; // Old PLIC has a deferred XIRR pending
+ } fields;
+ } int_dword;
// Whenever any fields in this Dword are set then PLIC will defer the
// processing of external interrupts. Note that PLIC will store the
@@ -81,54 +81,52 @@
// entire Dword is zero or not. A non-zero value in the low order
// 2-bytes will result in SLIC being granted the highest thread
// priority upon return. A 0 will return to SLIC as medium priority.
- u64 xPlicDeferIntsArea; // Entire Dword
+ u64 plic_defer_ints_area; // Entire Dword
// Used to pass the real SRR0/1 from PLIC to SLIC as well as to
// pass the target SRR0/1 from SLIC to PLIC on a SetAsrAndRfid.
- u64 xSavedSrr0; // Saved SRR0 x10-x17
- u64 xSavedSrr1; // Saved SRR1 x18-x1F
+ u64 saved_srr0; // Saved SRR0 x10-x17
+ u64 saved_srr1; // Saved SRR1 x18-x1F
// Used to pass parms from the OS to PLIC for SetAsrAndRfid
- u64 xSavedGpr3; // Saved GPR3 x20-x27
- u64 xSavedGpr4; // Saved GPR4 x28-x2F
- u64 xSavedGpr5; // Saved GPR5 x30-x37
-
- u8 xRsvd2_1; // Reserved x38-x38
- u8 xCpuCtlsTaskAttributes; // Task attributes for cpuctls x39-x39
- u8 xFPRegsInUse; // FP regs in use x3A-x3A
- u8 xPMCRegsInUse; // PMC regs in use x3B-x3B
- volatile u32 xSavedDecr; // Saved Decr Value x3C-x3F
- volatile u64 xEmulatedTimeBase;// Emulated TB for this thread x40-x47
- volatile u64 xCurPLICLatency; // Unaccounted PLIC latency x48-x4F
- u64 xTotPLICLatency; // Accumulated PLIC latency x50-x57
- u64 xWaitStateCycles; // Wait cycles for this proc x58-x5F
- u64 xEndOfQuantum; // TB at end of quantum x60-x67
- u64 xPDCSavedSPRG1; // Saved SPRG1 for PMC int x68-x6F
- u64 xPDCSavedSRR0; // Saved SRR0 for PMC int x70-x77
- volatile u32 xVirtualDecr; // Virtual DECR for shared procsx78-x7B
- u16 xSLBCount; // # of SLBs to maintain x7C-x7D
- u8 xIdle; // Indicate OS is idle x7E
- u8 xRsvd2_2; // Reserved x7F
+ u64 saved_gpr3; // Saved GPR3 x20-x27
+ u64 saved_gpr4; // Saved GPR4 x28-x2F
+ u64 saved_gpr5; // Saved GPR5 x30-x37
+
+ u8 reserved4; // Reserved x38-x38
+ u8 cpuctls_task_attrs; // Task attributes for cpuctls x39-x39
+ u8 fpregs_in_use; // FP regs in use x3A-x3A
+ u8 pmcregs_in_use; // PMC regs in use x3B-x3B
+ volatile u32 saved_decr; // Saved Decr Value x3C-x3F
+ volatile u64 emulated_time_base;// Emulated TB for this thread x40-x47
+ volatile u64 cur_plic_latency; // Unaccounted PLIC latency x48-x4F
+ u64 tot_plic_latency; // Accumulated PLIC latency x50-x57
+ u64 wait_state_cycles; // Wait cycles for this proc x58-x5F
+ u64 end_of_quantum; // TB at end of quantum x60-x67
+ u64 pdc_saved_sprg1; // Saved SPRG1 for PMC int x68-x6F
+ u64 pdc_saved_srr0; // Saved SRR0 for PMC int x70-x77
+ volatile u32 virtual_decr; // Virtual DECR for shared procsx78-x7B
+ u16 slb_count; // # of SLBs to maintain x7C-x7D
+ u8 idle; // Indicate OS is idle x7E
+ u8 reserved5; // Reserved x7F
//=============================================================================
// CACHE_LINE_3 0x0100 - 0x007F: This line is shared with other processors
//=============================================================================
- // This is the xYieldCount. An "odd" value (low bit on) means that
+ // This is the yield_count. An "odd" value (low bit on) means that
// the processor is yielded (either because of an OS yield or a PLIC
// preempt). An even value implies that the processor is currently
// executing.
// NOTE: This value will ALWAYS be zero for dedicated processors and
// will NEVER be zero for shared processors (ie, initialized to a 1).
- volatile u32 xYieldCount; // PLIC increments each dispatchx00-x03
- u8 xRsvd3_0[124]; // Reserved x04-x7F
+ volatile u32 yield_count; // PLIC increments each dispatchx00-x03
+ u8 reserved6[124]; // Reserved x04-x7F
//=============================================================================
// CACHE_LINE_4-5 0x0100 - 0x01FF Contains PMC interrupt data
//=============================================================================
- u8 xPmcSaveArea[256]; // PMC interrupt Area x00-xFF
-
-
+ u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF
};
#endif /* _ASM_LPPACA_H */
diff -ruN linus-bk-naca.10/include/asm-ppc64/paca.h linus-bk-naca.11/include/asm-ppc64/paca.h
--- linus-bk-naca.10/include/asm-ppc64/paca.h 2004-12-31 15:48:57.000000000 +1100
+++ linus-bk-naca.11/include/asm-ppc64/paca.h 2004-12-31 15:54:35.000000000 +1100
@@ -34,8 +34,8 @@
*
* This structure is not directly accessed by firmware or the service
* processor except for the first two pointers that point to the
- * ItLpPaca area and the ItLpRegSave area for this CPU. Both the
- * ItLpPaca and ItLpRegSave objects are currently contained within the
+ * lppaca area and the ItLpRegSave area for this CPU. Both the
+ * lppaca and ItLpRegSave objects are currently contained within the
* PACA but they do not need to be.
*/
struct paca_struct {
@@ -50,7 +50,7 @@
* MAGIC: These first two pointers can't be moved - they're
* accessed by the firmware
*/
- struct ItLpPaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
+ struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
struct ItLpRegSave *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
/*
@@ -109,7 +109,7 @@
* alignment will suffice to ensure that it doesn't
* cross a page boundary.
*/
- struct ItLpPaca lppaca __attribute__((__aligned__(0x400)));
+ struct lppaca lppaca __attribute__((__aligned__(0x400)));
#ifdef CONFIG_PPC_ISERIES
struct ItLpRegSave reg_save;
#endif
diff -ruN linus-bk-naca.10/include/asm-ppc64/spinlock.h linus-bk-naca.11/include/asm-ppc64/spinlock.h
--- linus-bk-naca.10/include/asm-ppc64/spinlock.h 2004-09-09 09:59:50.000000000 +1000
+++ linus-bk-naca.11/include/asm-ppc64/spinlock.h 2004-12-13 15:25:23.000000000 +1100
@@ -57,7 +57,7 @@
#if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES)
/* We only yield to the hypervisor if we are in shared processor mode */
-#define SHARED_PROCESSOR (get_paca()->lppaca.xSharedProc)
+#define SHARED_PROCESSOR (get_paca()->lppaca.shared_proc)
extern void __spin_yield(spinlock_t *lock);
extern void __rw_yield(rwlock_t *lock);
#else /* SPLPAR || ISERIES */
diff -ruN linus-bk-naca.10/include/asm-ppc64/time.h linus-bk-naca.11/include/asm-ppc64/time.h
--- linus-bk-naca.10/include/asm-ppc64/time.h 2004-07-05 11:49:20.000000000 +1000
+++ linus-bk-naca.11/include/asm-ppc64/time.h 2004-12-13 16:05:02.000000000 +1100
@@ -78,8 +78,8 @@
struct paca_struct *lpaca = get_paca();
int cur_dec;
- if (lpaca->lppaca.xSharedProc) {
- lpaca->lppaca.xVirtualDecr = val;
+ if (lpaca->lppaca.shared_proc) {
+ lpaca->lppaca.virtual_decr = val;
cur_dec = get_dec();
if (cur_dec > val)
HvCall_setVirtualDecr();
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] PPC64: use c99 initializers
2005-01-04 4:43 ` [PATCH 11/11] PPC64: remove StudlyCaps from lppaca structure Stephen Rothwell
@ 2005-01-04 11:58 ` Stephen Rothwell
2005-01-04 12:05 ` [PATCH] PPC64: tidy up the htab_data structure Stephen Rothwell
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 11:58 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 7199 bytes --]
Hi Andrew,
This patch is just more clean up in the ppc64 arch. It uses c99
initializers for various iSeries structures that are used to pass
information to the hypervisor. Also itLpNaca is not used by any code that
could be in a module, so don't export it.
Built and booted.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Please apply.
P.S. for the StudlyCaps brigade, changing these is on my To Do list. :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-sfr.11/arch/ppc64/kernel/LparData.c linus-bk-sfr.12/arch/ppc64/kernel/LparData.c
--- linus-bk-sfr.11/arch/ppc64/kernel/LparData.c 2004-12-13 15:01:55.000000000 +1100
+++ linus-bk-sfr.12/arch/ppc64/kernel/LparData.c 2005-01-04 18:18:37.000000000 +1100
@@ -41,24 +41,22 @@
*/
struct HvReleaseData hvReleaseData = {
- 0xc8a5d9c4, /* desc = "HvRD" ebcdic */
- sizeof(struct HvReleaseData),
- offsetof(struct naca_struct, xItVpdAreas),
- &naca, /* 64-bit Naca address */
- 0x6000, /* offset of LparMap within loadarea (see head.S) */
- 0,
- 1, /* tags inactive */
- 0, /* 64 bit */
- 0, /* shared processors */
- 0, /* HMT allowed */
- 6, /* TEMP: This allows non-GA driver */
- 4, /* We are v5r2m0 */
- 3, /* Min supported PLIC = v5r1m0 */
- 3, /* Min usable PLIC = v5r1m0 */
- { 0xd3, 0x89, 0x95, 0xa4, /* "Linux 2.4 "*/
- 0xa7, 0x40, 0xf2, 0x4b,
- 0xf4, 0x4b, 0xf6, 0xf4 },
- {0}
+ .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */
+ .xSize = sizeof(struct HvReleaseData),
+ .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas),
+ .xSlicNacaAddr = &naca, /* 64-bit Naca address */
+ .xMsNucDataOffset = 0x6000, /* offset of LparMap within loadarea (see head.S) */
+ .xTagsMode = 1, /* tags inactive */
+ .xAddressSize = 0, /* 64 bit */
+ .xNoSharedProcs = 0, /* shared processors */
+ .xNoHMT = 0, /* HMT allowed */
+ .xRsvd2 = 6, /* TEMP: This allows non-GA driver */
+ .xVrmIndex = 4, /* We are v5r2m0 */
+ .xMinSupportedPlicVrmIndex = 3, /* v5r1m0 */
+ .xMinCompatablePlicVrmIndex = 3, /* v5r1m0 */
+ .xVrmName = { 0xd3, 0x89, 0x95, 0xa4, /* "Linux 2.4.64" ebcdic */
+ 0xa7, 0x40, 0xf2, 0x4b,
+ 0xf4, 0x4b, 0xf6, 0xf4 },
};
extern void SystemReset_Iseries(void);
@@ -80,26 +78,33 @@
extern void InstructionAccessSLB_Iseries(void);
struct ItLpNaca itLpNaca = {
- 0xd397d581, /* desc = "LpNa" ebcdic */
- 0x0400, /* size of ItLpNaca */
- 0x0300, 19, /* offset to int array, # ents */
- 0, 0, 0, /* Part # of primary, serv, me */
- 0, 0x100, /* # of LP queues, offset */
- 0, 0, 0, /* Piranha stuff */
- { 0,0,0,0,0 }, /* reserved */
- 0,0,0,0,0,0,0, /* stuff */
- { 0,0,0,0,0 }, /* reserved */
- 0, /* reserved */
- 0, /* VRM index of PLIC */
- 0, 0, /* min supported, compat SLIC */
- 0, /* 64-bit addr of load area */
- 0, /* chunks for load area */
- 0, 0, /* PASE mask, seg table */
- { 0 }, /* 64 reserved bytes */
- { 0 }, /* 128 reserved bytes */
- { 0 }, /* Old LP Queue */
- { 0 }, /* 384 reserved bytes */
- {
+ .xDesc = 0xd397d581, /* "LpNa" ebcdic */
+ .xSize = 0x0400, /* size of ItLpNaca */
+ .xIntHdlrOffset = 0x0300, /* offset to int array */
+ .xMaxIntHdlrEntries = 19, /* # ents */
+ .xPrimaryLpIndex = 0, /* Part # of primary */
+ .xServiceLpIndex = 0, /* Part # of serv */
+ .xLpIndex = 0, /* Part # of me */
+ .xMaxLpQueues = 0, /* # of LP queues */
+ .xLpQueueOffset = 0x100, /* offset of start of LP queues */
+ .xPirEnvironMode = 0, /* Piranha stuff */
+ .xPirConsoleMode = 0,
+ .xPirDasdMode = 0,
+ .xLparInstalled = 0,
+ .xSysPartitioned = 0,
+ .xHwSyncedTBs = 0,
+ .xIntProcUtilHmt = 0,
+ .xSpVpdFormat = 0,
+ .xIntProcRatio = 0,
+ .xPlicVrmIndex = 0, /* VRM index of PLIC */
+ .xMinSupportedSlicVrmInd = 0, /* min supported SLIC */
+ .xMinCompatableSlicVrmInd = 0, /* min compat SLIC */
+ .xLoadAreaAddr = 0, /* 64-bit addr of load area */
+ .xLoadAreaChunks = 0, /* chunks for load area */
+ .xPaseSysCallCRMask = 0, /* PASE mask */
+ .xSlicSegmentTablePtr = 0, /* seg table */
+ .xOldLpQueue = { 0 }, /* Old LP Queue */
+ .xInterruptHdlr = {
(u64)SystemReset_Iseries, /* 0x100 System Reset */
(u64)MachineCheck_Iseries, /* 0x200 Machine Check */
(u64)DataAccess_Iseries, /* 0x300 Data Access */
@@ -153,10 +158,8 @@
u64 xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
struct SpCommArea xSpCommArea = {
- 0xE2D7C3C2,
- 1,
- {0},
- 0, 0, 0, 0, {0}
+ .xDesc = 0xE2D7C3C2,
+ .xFormat = 1,
};
/* The LparMap data is now located at offset 0x6000 in head.S
@@ -168,22 +171,21 @@
* offset into the Naca of the pointer to the ItVpdAreas.
*/
struct ItVpdAreas itVpdAreas = {
- 0xc9a3e5c1, /* "ItVA" */
- sizeof( struct ItVpdAreas ),
- 0, 0,
- 26, /* # VPD array entries */
- 10, /* # DMA array entries */
- NR_CPUS*2, maxPhysicalProcessors, /* Max logical, physical procs */
- offsetof(struct ItVpdAreas,xPlicDmaToks),/* offset to DMA toks */
- offsetof(struct ItVpdAreas,xSlicVpdAdrs),/* offset to VPD addrs */
- offsetof(struct ItVpdAreas,xPlicDmaLens),/* offset to DMA lens */
- offsetof(struct ItVpdAreas,xSlicVpdLens),/* offset to VPD lens */
- 0, /* max slot labels */
- 1, /* max LP queues */
- {0}, {0}, /* reserved */
- {0}, /* DMA lengths */
- {0}, /* DMA tokens */
- { /* VPD lengths */
+ .xSlicDesc = 0xc9a3e5c1, /* "ItVA" */
+ .xSlicSize = sizeof(struct ItVpdAreas),
+ .xSlicVpdEntries = ItVpdMaxEntries, /* # VPD array entries */
+ .xSlicDmaEntries = ItDmaMaxEntries, /* # DMA array entries */
+ .xSlicMaxLogicalProcs = NR_CPUS * 2, /* Max logical procs */
+ .xSlicMaxPhysicalProcs = maxPhysicalProcessors, /* Max physical procs */
+ .xSlicDmaToksOffset = offsetof(struct ItVpdAreas, xPlicDmaToks),
+ .xSlicVpdAdrsOffset = offsetof(struct ItVpdAreas, xSlicVpdAdrs),
+ .xSlicDmaLensOffset = offsetof(struct ItVpdAreas, xPlicDmaLens),
+ .xSlicVpdLensOffset = offsetof(struct ItVpdAreas, xSlicVpdLens),
+ .xSlicMaxSlotLabels = 0, /* max slot labels */
+ .xSlicMaxLpQueues = 1, /* max LP queues */
+ .xPlicDmaLens = { 0 }, /* DMA lengths */
+ .xPlicDmaToks = { 0 }, /* DMA tokens */
+ .xSlicVpdLens = { /* VPD lengths */
0,0,0, /* 0 - 2 */
sizeof(xItExtVpdPanel), /* 3 Extended VPD */
sizeof(struct paca_struct), /* 4 length of Paca */
@@ -201,7 +203,7 @@
sizeof(struct ItLpQueue),/* 23 length of Lp Queue */
0,0 /* 24 - 25 */
},
- { /* VPD addresses */
+ .xSlicVpdAdrs = { /* VPD addresses */
0,0,0, /* 0 - 2 */
&xItExtVpdPanel, /* 3 Extended VPD */
&paca[0], /* 4 first Paca */
diff -ruN linus-bk-sfr.11/arch/ppc64/kernel/ppc_ksyms.c linus-bk-sfr.12/arch/ppc64/kernel/ppc_ksyms.c
--- linus-bk-sfr.11/arch/ppc64/kernel/ppc_ksyms.c 2004-12-31 14:52:14.000000000 +1100
+++ linus-bk-sfr.12/arch/ppc64/kernel/ppc_ksyms.c 2005-01-04 18:07:42.000000000 +1100
@@ -68,9 +68,6 @@
EXPORT_SYMBOL(__down_interruptible);
EXPORT_SYMBOL(__up);
EXPORT_SYMBOL(__down);
-#ifdef CONFIG_PPC_ISERIES
-EXPORT_SYMBOL(itLpNaca);
-#endif
EXPORT_SYMBOL(csum_partial);
EXPORT_SYMBOL(csum_partial_copy_generic);
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] PPC64: tidy up the htab_data structure
2005-01-04 11:58 ` [PATCH] PPC64: use c99 initializers Stephen Rothwell
@ 2005-01-04 12:05 ` Stephen Rothwell
0 siblings, 0 replies; 14+ messages in thread
From: Stephen Rothwell @ 2005-01-04 12:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc64-dev, linux-kernel, paulus, anton
[-- Attachment #1: Type: text/plain, Size: 10415 bytes --]
Hi Andrew,
More tidying up.
The htab_data structure contained 5 fields or which two were completely
unused and one other was just kept for printing at boot time. I have mode
the remaining two into global variables.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Built and booted on iSeries (which is always lpar) and on pSeries without
partitioning.
Please apply.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus-bk-sfr.12/arch/ppc64/kernel/iSeries_setup.c linus-bk-sfr.13/arch/ppc64/kernel/iSeries_setup.c
--- linus-bk-sfr.12/arch/ppc64/kernel/iSeries_setup.c 2004-12-13 15:31:14.000000000 +1100
+++ linus-bk-sfr.13/arch/ppc64/kernel/iSeries_setup.c 2005-01-04 19:01:54.000000000 +1100
@@ -472,18 +472,16 @@
printk("HPT absolute addr = %016lx, size = %dK\n",
chunk_to_addr(hptFirstChunk), hptSizeChunks * 256);
- /* Fill in the htab_data structure */
- /* Fill in size of hashed page table */
+ /* Fill in the hashed page table hash mask */
num_ptegs = hptSizePages *
(PAGE_SIZE / (sizeof(HPTE) * HPTES_PER_GROUP));
- htab_data.htab_num_ptegs = num_ptegs;
- htab_data.htab_hash_mask = num_ptegs - 1;
+ htab_hash_mask = num_ptegs - 1;
/*
* The actual hashed page table is in the hypervisor,
* we have no direct access
*/
- htab_data.htab = NULL;
+ htab_address = NULL;
/*
* Determine if absolute memory has any
diff -ruN linus-bk-sfr.12/arch/ppc64/kernel/pSeries_lpar.c linus-bk-sfr.13/arch/ppc64/kernel/pSeries_lpar.c
--- linus-bk-sfr.12/arch/ppc64/kernel/pSeries_lpar.c 2004-12-31 15:16:48.000000000 +1100
+++ linus-bk-sfr.13/arch/ppc64/kernel/pSeries_lpar.c 2005-01-04 19:00:17.000000000 +1100
@@ -436,7 +436,7 @@
hash = hpt_hash(vpn, 0);
for (j = 0; j < 2; j++) {
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
for (i = 0; i < HPTES_PER_GROUP; i++) {
hpte_dw0.dword0 = pSeries_lpar_hpte_getword0(slot);
dw0 = hpte_dw0.dw0;
diff -ruN linus-bk-sfr.12/arch/ppc64/kernel/setup.c linus-bk-sfr.13/arch/ppc64/kernel/setup.c
--- linus-bk-sfr.12/arch/ppc64/kernel/setup.c 2004-12-31 16:24:11.000000000 +1100
+++ linus-bk-sfr.13/arch/ppc64/kernel/setup.c 2005-01-04 18:58:58.000000000 +1100
@@ -55,6 +55,7 @@
#include <asm/serial.h>
#include <asm/cache.h>
#include <asm/page.h>
+#include <asm/mmu.h>
#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
@@ -90,7 +91,6 @@
#endif
/* extern void *stab; */
-extern HTAB htab_data;
extern unsigned long klimit;
extern void mm_init_ppc64(void);
@@ -672,8 +672,8 @@
ppc64_caches.dline_size);
printk("ppc64_caches.icache_line_size = 0x%x\n",
ppc64_caches.iline_size);
- printk("htab_data.htab = 0x%p\n", htab_data.htab);
- printk("htab_data.num_ptegs = 0x%lx\n", htab_data.htab_num_ptegs);
+ printk("htab_address = 0x%p\n", htab_address);
+ printk("htab_hash_mask = 0x%lx\n", htab_hash_mask);
printk("-----------------------------------------------------\n");
mm_init_ppc64();
diff -ruN linus-bk-sfr.12/arch/ppc64/mm/hash_low.S linus-bk-sfr.13/arch/ppc64/mm/hash_low.S
--- linus-bk-sfr.12/arch/ppc64/mm/hash_low.S 2004-10-14 18:37:37.000000000 +1000
+++ linus-bk-sfr.13/arch/ppc64/mm/hash_low.S 2005-01-04 19:06:24.000000000 +1100
@@ -139,8 +139,8 @@
std r3,STK_PARM(r4)(r1)
/* Get htab_hash_mask */
- ld r4,htab_data@got(2)
- ld r27,16(r4) /* htab_data.htab_hash_mask -> r27 */
+ ld r4,htab_hash_mask@got(2)
+ ld r27,0(r4) /* htab_hash_mask -> r27 */
/* Check if we may already be in the hashtable, in this case, we
* go to out-of-line code to try to modify the HPTE
diff -ruN linus-bk-sfr.12/arch/ppc64/mm/hash_native.c linus-bk-sfr.13/arch/ppc64/mm/hash_native.c
--- linus-bk-sfr.12/arch/ppc64/mm/hash_native.c 2004-11-16 16:05:10.000000000 +1100
+++ linus-bk-sfr.13/arch/ppc64/mm/hash_native.c 2005-01-04 19:09:45.000000000 +1100
@@ -52,7 +52,7 @@
unsigned long hpteflags, int bolted, int large)
{
unsigned long arpn = physRpn_to_absRpn(prpn);
- HPTE *hptep = htab_data.htab + hpte_group;
+ HPTE *hptep = htab_address + hpte_group;
Hpte_dword0 dw0;
HPTE lhpte;
int i;
@@ -117,7 +117,7 @@
slot_offset = mftb() & 0x7;
for (i = 0; i < HPTES_PER_GROUP; i++) {
- hptep = htab_data.htab + hpte_group + slot_offset;
+ hptep = htab_address + hpte_group + slot_offset;
dw0 = hptep->dw0.dw0;
if (dw0.v && !dw0.bolted) {
@@ -172,9 +172,9 @@
hash = hpt_hash(vpn, 0);
for (j = 0; j < 2; j++) {
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
for (i = 0; i < HPTES_PER_GROUP; i++) {
- hptep = htab_data.htab + slot;
+ hptep = htab_address + slot;
dw0 = hptep->dw0.dw0;
if ((dw0.avpn == (vpn >> 11)) && dw0.v &&
@@ -195,7 +195,7 @@
static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
unsigned long va, int large, int local)
{
- HPTE *hptep = htab_data.htab + slot;
+ HPTE *hptep = htab_address + slot;
Hpte_dword0 dw0;
unsigned long avpn = va >> 23;
int ret = 0;
@@ -254,7 +254,7 @@
slot = native_hpte_find(vpn);
if (slot == -1)
panic("could not find page to bolt\n");
- hptep = htab_data.htab + slot;
+ hptep = htab_address + slot;
set_pp_bit(newpp, hptep);
@@ -269,7 +269,7 @@
static void native_hpte_invalidate(unsigned long slot, unsigned long va,
int large, int local)
{
- HPTE *hptep = htab_data.htab + slot;
+ HPTE *hptep = htab_address + slot;
Hpte_dword0 dw0;
unsigned long avpn = va >> 23;
unsigned long flags;
@@ -336,10 +336,10 @@
secondary = (pte_val(batch->pte[i]) & _PAGE_SECONDARY) >> 15;
if (secondary)
hash = ~hash;
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
slot += (pte_val(batch->pte[i]) & _PAGE_GROUP_IX) >> 12;
- hptep = htab_data.htab + slot;
+ hptep = htab_address + slot;
avpn = va >> 23;
if (large)
diff -ruN linus-bk-sfr.12/arch/ppc64/mm/hash_utils.c linus-bk-sfr.13/arch/ppc64/mm/hash_utils.c
--- linus-bk-sfr.12/arch/ppc64/mm/hash_utils.c 2004-12-31 14:52:56.000000000 +1100
+++ linus-bk-sfr.13/arch/ppc64/mm/hash_utils.c 2005-01-04 19:08:37.000000000 +1100
@@ -74,7 +74,8 @@
extern unsigned long dart_tablebase;
#endif /* CONFIG_U3_DART */
-HTAB htab_data = {NULL, 0, 0, 0, 0};
+HPTE *htab_address;
+unsigned long htab_hash_mask;
extern unsigned long _SDR1;
@@ -113,7 +114,7 @@
hash = hpt_hash(vpn, large);
- hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP);
+ hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
#ifdef CONFIG_PPC_PSERIES
if (systemcfg->platform & PLATFORM_LPAR)
@@ -155,12 +156,11 @@
htab_size_bytes = pteg_count << 7;
}
- htab_data.htab_num_ptegs = pteg_count;
- htab_data.htab_hash_mask = pteg_count - 1;
+ htab_hash_mask = pteg_count - 1;
if (systemcfg->platform & PLATFORM_LPAR) {
/* Using a hypervisor which owns the htab */
- htab_data.htab = NULL;
+ htab_address = NULL;
_SDR1 = 0;
} else {
/* Find storage for the HPT. Must be contiguous in
@@ -175,7 +175,7 @@
ppc64_terminate_msg(0x20, "hpt space");
loop_forever();
}
- htab_data.htab = abs_to_virt(table);
+ htab_address = abs_to_virt(table);
/* htab absolute addr + encoded htabsize */
_SDR1 = table + __ilog2(pteg_count) - 11;
@@ -356,7 +356,7 @@
secondary = (pte_val(pte) & _PAGE_SECONDARY) >> 15;
if (secondary)
hash = ~hash;
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
slot += (pte_val(pte) & _PAGE_GROUP_IX) >> 12;
ppc_md.hpte_invalidate(slot, va, huge, local);
diff -ruN linus-bk-sfr.12/arch/ppc64/mm/hugetlbpage.c linus-bk-sfr.13/arch/ppc64/mm/hugetlbpage.c
--- linus-bk-sfr.12/arch/ppc64/mm/hugetlbpage.c 2004-10-29 07:03:21.000000000 +1000
+++ linus-bk-sfr.13/arch/ppc64/mm/hugetlbpage.c 2005-01-04 19:02:45.000000000 +1100
@@ -832,7 +832,7 @@
hash = hpt_hash(vpn, 1);
if (pte_val(old_pte) & _PAGE_SECONDARY)
hash = ~hash;
- slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+ slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12;
if (ppc_md.hpte_updatepp(slot, hpteflags, va, 1, local) == -1)
@@ -846,7 +846,7 @@
prpn = pte_pfn(old_pte);
repeat:
- hpte_group = ((hash & htab_data.htab_hash_mask) *
+ hpte_group = ((hash & htab_hash_mask) *
HPTES_PER_GROUP) & ~0x7UL;
/* Update the linux pte with the HPTE slot */
@@ -863,13 +863,13 @@
/* Primary is full, try the secondary */
if (unlikely(slot == -1)) {
pte_val(new_pte) |= _PAGE_SECONDARY;
- hpte_group = ((~hash & htab_data.htab_hash_mask) *
+ hpte_group = ((~hash & htab_hash_mask) *
HPTES_PER_GROUP) & ~0x7UL;
slot = ppc_md.hpte_insert(hpte_group, va, prpn,
1, hpteflags, 0, 1);
if (slot == -1) {
if (mftb() & 0x1)
- hpte_group = ((hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL;
+ hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL;
ppc_md.hpte_remove(hpte_group);
goto repeat;
diff -ruN linus-bk-sfr.12/arch/ppc64/mm/init.c linus-bk-sfr.13/arch/ppc64/mm/init.c
--- linus-bk-sfr.12/arch/ppc64/mm/init.c 2004-12-10 16:26:54.000000000 +1100
+++ linus-bk-sfr.13/arch/ppc64/mm/init.c 2005-01-04 19:03:14.000000000 +1100
@@ -168,7 +168,7 @@
hash = hpt_hash(vpn, 0);
- hpteg = ((hash & htab_data.htab_hash_mask)*HPTES_PER_GROUP);
+ hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
/* Panic if a pte grpup is full */
if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0,
diff -ruN linus-bk-sfr.12/include/asm-ppc64/mmu.h linus-bk-sfr.13/include/asm-ppc64/mmu.h
--- linus-bk-sfr.12/include/asm-ppc64/mmu.h 2004-10-29 07:03:22.000000000 +1000
+++ linus-bk-sfr.13/include/asm-ppc64/mmu.h 2005-01-04 19:10:32.000000000 +1100
@@ -98,15 +98,8 @@
#define PP_RXRX 3 /* Supervisor read, User read */
-typedef struct {
- HPTE * htab;
- unsigned long htab_num_ptegs;
- unsigned long htab_hash_mask;
- unsigned long next_round_robin;
- unsigned long last_kernel_address;
-} HTAB;
-
-extern HTAB htab_data;
+extern HPTE * htab_address;
+extern unsigned long htab_hash_mask;
static inline unsigned long hpt_hash(unsigned long vpn, int large)
{
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2005-01-04 12:06 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04 3:53 PPC64 cleanups 0/11 Stephen Rothwell
2005-01-04 4:04 ` [PATCH 1/11] PPC64: Consolidate cache sizing variables Stephen Rothwell
2005-01-04 4:08 ` [PATCH 2/11] PPC64: remove the page table size from the naca Stephen Rothwell
2005-01-04 4:12 ` [PATCH 3/11] PPC64: remove interrupt_controller from naca Stephen Rothwell
2005-01-04 4:19 ` [PATCH 4/11] PPC64: remove /proc/ppc64/{naca,paca/xx} Stephen Rothwell
2005-01-04 4:23 ` [PATCH 5/11] PPC64: remove the paca pointer form the naca Stephen Rothwell
2005-01-04 4:27 ` [PATCH 6/11] PPC64: remove serialPortAddr from " Stephen Rothwell
2005-01-04 4:31 ` [PATCH 7/11] PPC64: remove debug_switch " Stephen Rothwell
2005-01-04 4:34 ` [PATCH 8/11] PPC64: remove the naca from all but iSeries Stephen Rothwell
2005-01-04 4:37 ` [PATCH 9/11] PPC64: use xPMCRegsInUse Stephen Rothwell
2005-01-04 4:40 ` [PATCH 10/11] PPC64: move the lppaca defining header file Stephen Rothwell
2005-01-04 4:43 ` [PATCH 11/11] PPC64: remove StudlyCaps from lppaca structure Stephen Rothwell
2005-01-04 11:58 ` [PATCH] PPC64: use c99 initializers Stephen Rothwell
2005-01-04 12:05 ` [PATCH] PPC64: tidy up the htab_data structure Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®