diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-01-11 21:47:43 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-12 04:09:29 -0500 |
commit | 677f8c0d0455a35aaff08a0292ba9c6232ef4eb1 (patch) | |
tree | ebac30f3413ecc2eeb2b1f8788b379ac6b56a237 /arch | |
parent | 6814350b80e0e7dfb87d2faebbcbef876573897c (diff) |
[PATCH] powerpc: remove bitfields from HvLpEvent
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/iseries/irq.c | 13 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/lpevents.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/mf.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/viopath.c | 12 |
4 files changed, 16 insertions, 37 deletions
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 42e978e4897a..3d023856405a 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c | |||
@@ -147,20 +147,11 @@ static void int_received(struct pci_event *event, struct pt_regs *regs) | |||
147 | static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) | 147 | static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) |
148 | { | 148 | { |
149 | if (event && (event->xType == HvLpEvent_Type_PciIo)) { | 149 | if (event && (event->xType == HvLpEvent_Type_PciIo)) { |
150 | switch (event->xFlags.xFunction) { | 150 | if (hvlpevent_is_int(event)) |
151 | case HvLpEvent_Function_Int: | ||
152 | int_received((struct pci_event *)event, regs); | 151 | int_received((struct pci_event *)event, regs); |
153 | break; | 152 | else |
154 | case HvLpEvent_Function_Ack: | ||
155 | printk(KERN_ERR | 153 | printk(KERN_ERR |
156 | "pci_event_handler: unexpected ack received\n"); | 154 | "pci_event_handler: unexpected ack received\n"); |
157 | break; | ||
158 | default: | ||
159 | printk(KERN_ERR | ||
160 | "pci_event_handler: unexpected event function %d\n", | ||
161 | (int)event->xFlags.xFunction); | ||
162 | break; | ||
163 | } | ||
164 | } else if (event) | 155 | } else if (event) |
165 | printk(KERN_ERR | 156 | printk(KERN_ERR |
166 | "pci_event_handler: Unrecognized PCI event type 0x%x\n", | 157 | "pci_event_handler: Unrecognized PCI event type 0x%x\n", |
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index e9fb98bf895f..0b885300d1d1 100644 --- a/arch/powerpc/platforms/iseries/lpevents.c +++ b/arch/powerpc/platforms/iseries/lpevents.c | |||
@@ -53,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpevent(void) | |||
53 | struct HvLpEvent * event; | 53 | struct HvLpEvent * event; |
54 | event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; | 54 | event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; |
55 | 55 | ||
56 | if (event->xFlags.xValid) { | 56 | if (hvlpevent_is_valid(event)) { |
57 | /* rmb() needed only for weakly consistent machines (regatta) */ | 57 | /* rmb() needed only for weakly consistent machines (regatta) */ |
58 | rmb(); | 58 | rmb(); |
59 | /* Set pointer to next potential event */ | 59 | /* Set pointer to next potential event */ |
@@ -84,7 +84,7 @@ int hvlpevent_is_pending(void) | |||
84 | 84 | ||
85 | next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; | 85 | next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; |
86 | 86 | ||
87 | return next_event->xFlags.xValid | | 87 | return hvlpevent_is_valid(next_event) || |
88 | hvlpevent_queue.xPlicOverflowIntPending; | 88 | hvlpevent_queue.xPlicOverflowIntPending; |
89 | } | 89 | } |
90 | 90 | ||
@@ -101,18 +101,18 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event) | |||
101 | switch (extra) { | 101 | switch (extra) { |
102 | case 3: | 102 | case 3: |
103 | tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign); | 103 | tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign); |
104 | tmp->xFlags.xValid = 0; | 104 | hvlpevent_invalidate(tmp); |
105 | case 2: | 105 | case 2: |
106 | tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign); | 106 | tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign); |
107 | tmp->xFlags.xValid = 0; | 107 | hvlpevent_invalidate(tmp); |
108 | case 1: | 108 | case 1: |
109 | tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign); | 109 | tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign); |
110 | tmp->xFlags.xValid = 0; | 110 | hvlpevent_invalidate(tmp); |
111 | } | 111 | } |
112 | 112 | ||
113 | mb(); | 113 | mb(); |
114 | 114 | ||
115 | event->xFlags.xValid = 0; | 115 | hvlpevent_invalidate(event); |
116 | } | 116 | } |
117 | 117 | ||
118 | void process_hvlpevents(struct pt_regs *regs) | 118 | void process_hvlpevents(struct pt_regs *regs) |
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 49e7e4b85847..a41d8b78c0cd 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -251,10 +251,7 @@ static struct pending_event *new_pending_event(void) | |||
251 | } | 251 | } |
252 | memset(ev, 0, sizeof(struct pending_event)); | 252 | memset(ev, 0, sizeof(struct pending_event)); |
253 | hev = &ev->event.hp_lp_event; | 253 | hev = &ev->event.hp_lp_event; |
254 | hev->xFlags.xValid = 1; | 254 | hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | HV_LP_EVENT_INT; |
255 | hev->xFlags.xAckType = HvLpEvent_AckType_ImmediateAck; | ||
256 | hev->xFlags.xAckInd = HvLpEvent_AckInd_DoAck; | ||
257 | hev->xFlags.xFunction = HvLpEvent_Function_Int; | ||
258 | hev->xType = HvLpEvent_Type_MachineFac; | 255 | hev->xType = HvLpEvent_Type_MachineFac; |
259 | hev->xSourceLp = HvLpConfig_getLpIndex(); | 256 | hev->xSourceLp = HvLpConfig_getLpIndex(); |
260 | hev->xTargetLp = primary_lp; | 257 | hev->xTargetLp = primary_lp; |
@@ -518,17 +515,10 @@ static void handle_ack(struct io_mf_lp_event *event) | |||
518 | static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) | 515 | static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) |
519 | { | 516 | { |
520 | if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { | 517 | if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { |
521 | switch(event->xFlags.xFunction) { | 518 | if (hvlpevent_is_ack(event)) |
522 | case HvLpEvent_Function_Ack: | ||
523 | handle_ack((struct io_mf_lp_event *)event); | 519 | handle_ack((struct io_mf_lp_event *)event); |
524 | break; | 520 | else |
525 | case HvLpEvent_Function_Int: | ||
526 | handle_int((struct io_mf_lp_event *)event); | 521 | handle_int((struct io_mf_lp_event *)event); |
527 | break; | ||
528 | default: | ||
529 | printk(KERN_ERR "mf.c: non ack/int event received\n"); | ||
530 | break; | ||
531 | } | ||
532 | } else | 522 | } else |
533 | printk(KERN_ERR "mf.c: alien event received\n"); | 523 | printk(KERN_ERR "mf.c: alien event received\n"); |
534 | } | 524 | } |
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index 842672695598..622a30149b48 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c | |||
@@ -270,7 +270,7 @@ static void handleMonitorEvent(struct HvLpEvent *event) | |||
270 | * First see if this is just a normal monitor message from the | 270 | * First see if this is just a normal monitor message from the |
271 | * other partition | 271 | * other partition |
272 | */ | 272 | */ |
273 | if (event->xFlags.xFunction == HvLpEvent_Function_Int) { | 273 | if (hvlpevent_is_int(event)) { |
274 | remoteLp = event->xSourceLp; | 274 | remoteLp = event->xSourceLp; |
275 | if (!viopathStatus[remoteLp].isActive) | 275 | if (!viopathStatus[remoteLp].isActive) |
276 | sendMonMsg(remoteLp); | 276 | sendMonMsg(remoteLp); |
@@ -331,13 +331,12 @@ static void handleConfig(struct HvLpEvent *event) | |||
331 | { | 331 | { |
332 | if (!event) | 332 | if (!event) |
333 | return; | 333 | return; |
334 | if (event->xFlags.xFunction == HvLpEvent_Function_Int) { | 334 | if (hvlpevent_is_int(event)) { |
335 | printk(VIOPATH_KERN_WARN | 335 | printk(VIOPATH_KERN_WARN |
336 | "unexpected config request from partition %d", | 336 | "unexpected config request from partition %d", |
337 | event->xSourceLp); | 337 | event->xSourceLp); |
338 | 338 | ||
339 | if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && | 339 | if (hvlpevent_need_ack(event)) { |
340 | (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) { | ||
341 | event->xRc = HvLpEvent_Rc_InvalidSubtype; | 340 | event->xRc = HvLpEvent_Rc_InvalidSubtype; |
342 | HvCallEvent_ackLpEvent(event); | 341 | HvCallEvent_ackLpEvent(event); |
343 | } | 342 | } |
@@ -377,7 +376,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) | |||
377 | int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK) | 376 | int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK) |
378 | >> VIOMAJOR_SUBTYPE_SHIFT; | 377 | >> VIOMAJOR_SUBTYPE_SHIFT; |
379 | 378 | ||
380 | if (event->xFlags.xFunction == HvLpEvent_Function_Int) { | 379 | if (hvlpevent_is_int(event)) { |
381 | remoteLp = event->xSourceLp; | 380 | remoteLp = event->xSourceLp; |
382 | /* | 381 | /* |
383 | * The isActive is checked because if the hosting partition | 382 | * The isActive is checked because if the hosting partition |
@@ -436,8 +435,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs) | |||
436 | "unexpected virtual io event subtype %d from partition %d\n", | 435 | "unexpected virtual io event subtype %d from partition %d\n", |
437 | event->xSubtype, remoteLp); | 436 | event->xSubtype, remoteLp); |
438 | /* No handler. Ack if necessary */ | 437 | /* No handler. Ack if necessary */ |
439 | if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && | 438 | if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) { |
440 | (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) { | ||
441 | event->xRc = HvLpEvent_Rc_InvalidSubtype; | 439 | event->xRc = HvLpEvent_Rc_InvalidSubtype; |
442 | HvCallEvent_ackLpEvent(event); | 440 | HvCallEvent_ackLpEvent(event); |
443 | } | 441 | } |