Merge branch 'drm-forlinus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / arch / powerpc / platforms / iseries / lpevents.c
index 8836030..0b88530 100644 (file)
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
+#include <linux/module.h>
+
 #include <asm/system.h>
 #include <asm/paca.h>
-#include <asm/iSeries/ItLpQueue.h>
-#include <asm/iSeries/HvLpEvent.h>
-#include <asm/iSeries/HvCallEvent.h>
-#include <asm/iSeries/ItLpNaca.h>
+#include <asm/iseries/it_lp_queue.h>
+#include <asm/iseries/hv_lp_event.h>
+#include <asm/iseries/hv_call_event.h>
+#include <asm/iseries/it_lp_naca.h>
 
 /*
  * The LpQueue is used to pass event data from the hypervisor to
@@ -51,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpevent(void)
        struct HvLpEvent * event;
        event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
 
-       if (event->xFlags.xValid) {
+       if (hvlpevent_is_valid(event)) {
                /* rmb() needed only for weakly consistent machines (regatta) */
                rmb();
                /* Set pointer to next potential event */
@@ -82,7 +84,7 @@ int hvlpevent_is_pending(void)
 
        next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
 
-       return next_event->xFlags.xValid |
+       return hvlpevent_is_valid(next_event) ||
                hvlpevent_queue.xPlicOverflowIntPending;
 }
 
@@ -99,18 +101,18 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event)
        switch (extra) {
        case 3:
                tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);
-               tmp->xFlags.xValid = 0;
+               hvlpevent_invalidate(tmp);
        case 2:
                tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);
-               tmp->xFlags.xValid = 0;
+               hvlpevent_invalidate(tmp);
        case 1:
                tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);
-               tmp->xFlags.xValid = 0;
+               hvlpevent_invalidate(tmp);
        }
 
        mb();
 
-       event->xFlags.xValid = 0;
+       hvlpevent_invalidate(event);
 }
 
 void process_hvlpevents(struct pt_regs *regs)
@@ -182,11 +184,7 @@ 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.
-        */
+       /* Allocate a page for the Event Stack. */
        eventStack = alloc_bootmem_pages(LpEventStackSize);
        memset(eventStack, 0, LpEventStackSize);