Commit 512d31d6 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

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

The xItLpQueue is initalised manually in iSeries_setup_arch().  Move
this code into ItLpQueue.c for a cleaner separation.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 1b19bc72
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/iSeries/ItLpQueue.h> #include <asm/iSeries/ItLpQueue.h>
...@@ -186,3 +187,24 @@ static int set_spread_lpevents(char *str) ...@@ -186,3 +187,24 @@ static int set_spread_lpevents(char *str)
} }
__setup("spread_lpevents=", set_spread_lpevents); __setup("spread_lpevents=", set_spread_lpevents);
void setup_hvlpevent_queue(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;
}
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/param.h> #include <linux/param.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/bootmem.h>
#include <linux/initrd.h> #include <linux/initrd.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
...@@ -676,7 +675,6 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr) ...@@ -676,7 +675,6 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
*/ */
static void __init iSeries_setup_arch(void) static void __init iSeries_setup_arch(void)
{ {
void *eventStack;
unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
/* Add an eye catcher and the systemcfg layout version number */ /* Add an eye catcher and the systemcfg layout version number */
...@@ -685,24 +683,7 @@ static void __init iSeries_setup_arch(void) ...@@ -685,24 +683,7 @@ static void __init iSeries_setup_arch(void)
systemcfg->version.minor = SYSTEMCFG_MINOR; systemcfg->version.minor = SYSTEMCFG_MINOR;
/* Setup the Lp Event Queue */ /* Setup the Lp Event Queue */
setup_hvlpevent_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;
/* Compute processor frequency */ /* Compute processor frequency */
procFreqHz = ((1UL << 34) * 1000000) / procFreqHz = ((1UL << 34) * 1000000) /
......
...@@ -80,5 +80,6 @@ extern struct HvLpEvent *ItLpQueue_getNextLpEvent(void); ...@@ -80,5 +80,6 @@ extern struct HvLpEvent *ItLpQueue_getNextLpEvent(void);
extern int ItLpQueue_isLpIntPending(void); extern int ItLpQueue_isLpIntPending(void);
extern unsigned ItLpQueue_process(struct pt_regs *); extern unsigned ItLpQueue_process(struct pt_regs *);
extern void ItLpQueue_clearValid(struct HvLpEvent *); extern void ItLpQueue_clearValid(struct HvLpEvent *);
extern void setup_hvlpevent_queue(void);
#endif /* _ITLPQUEUE_H */ #endif /* _ITLPQUEUE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment