[PATCH 5/15] ppc64: Move initialisation of xItLpQueue into ItLpQueue.c

Michael Ellerman michael at ellerman.id.au
Tue Jun 28 09:17:24 EST 2005


Hi,

The xItLpQueue is initalised manually in iSeries_setup_arch(). Move this code
into ItLpQueue.c for a cleaner seperation.


Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
--
 arch/ppc64/kernel/ItLpQueue.c         |   23 +++++++++++++++++++++++
 arch/ppc64/kernel/iSeries_setup.c     |   20 +-------------------
 include/asm-ppc64/iSeries/ItLpQueue.h |    1 +
 3 files changed, 25 insertions(+), 19 deletions(-)

Index: work/arch/ppc64/kernel/ItLpQueue.c
===================================================================
--- work.orig/arch/ppc64/kernel/ItLpQueue.c
+++ work/arch/ppc64/kernel/ItLpQueue.c
@@ -11,6 +11,7 @@
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/bootmem.h>
 #include <asm/system.h>
 #include <asm/paca.h>
 #include <asm/iSeries/ItLpQueue.h>
@@ -166,3 +167,25 @@ unsigned ItLpQueue_process(struct pt_reg
 
 	return numIntsProcessed;
 }
+
+void hvlpevent_queue_setup(void)
+{
+	void *eventStack;
+
+	/*
+	 * Allocate a page for the Event Stack. The Hypervisor needs the
+	 * absolute real address, so we subtract out the KERNELBASE and add
+	 * in the absolute real address of the kernel load area.
+	 */
+	eventStack = alloc_bootmem_pages(LpEventStackSize);
+	memset(eventStack, 0, LpEventStackSize);
+
+	/* Invoke the hypervisor to initialize the event stack */
+	HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
+
+	xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
+	xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
+	xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +
+					(LpEventStackSize - LpEventMaxSize);
+	xItLpQueue.xIndex = 0;
+}
Index: work/arch/ppc64/kernel/iSeries_setup.c
===================================================================
--- work.orig/arch/ppc64/kernel/iSeries_setup.c
+++ work/arch/ppc64/kernel/iSeries_setup.c
@@ -676,7 +676,6 @@ static void __init iSeries_bolt_kernel(u
  */
 static void __init iSeries_setup_arch(void)
 {
-	void *eventStack;
 	unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
 
 	/* Add an eye catcher and the systemcfg layout version number */
@@ -685,24 +684,7 @@ static void __init iSeries_setup_arch(vo
 	systemcfg->version.minor = SYSTEMCFG_MINOR;
 
 	/* Setup the Lp Event Queue */
-
-	/* Allocate a page for the Event Stack
-	 * The hypervisor wants the absolute real address, so
-	 * we subtract out the KERNELBASE and add in the
-	 * absolute real address of the kernel load area
-	 */
-	eventStack = alloc_bootmem_pages(LpEventStackSize);
-	memset(eventStack, 0, LpEventStackSize);
-
-	/* Invoke the hypervisor to initialize the event stack */
-	HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
-
-	/* Initialize fields in our Lp Event Queue */
-	xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
-	xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
-	xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +
-					(LpEventStackSize - LpEventMaxSize);
-	xItLpQueue.xIndex = 0;
+	hvlpevent_queue_setup();
 
 	/* Compute processor frequency */
 	procFreqHz = ((1UL << 34) * 1000000) /
Index: work/include/asm-ppc64/iSeries/ItLpQueue.h
===================================================================
--- work.orig/include/asm-ppc64/iSeries/ItLpQueue.h
+++ work/include/asm-ppc64/iSeries/ItLpQueue.h
@@ -80,5 +80,6 @@ extern struct HvLpEvent *ItLpQueue_getNe
 extern int ItLpQueue_isLpIntPending(void);
 extern unsigned ItLpQueue_process(struct pt_regs *);
 extern void ItLpQueue_clearValid(struct HvLpEvent *);
+extern void hvlpevent_queue_setup(void);
 
 #endif /* _ITLPQUEUE_H */



More information about the Linuxppc64-dev mailing list