X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Fasm-powerpc%2Fiseries%2Fhv_lp_event.h;h=6ce2ce1e26909a0bc80bf84c772d6cc5338c4b77;hb=972d45fb43f0f0793fa275c4a22998106760cd61;hp=499ab1ad01854ae9deefaa3bb2b38ea17ec46ab1;hpb=2fc2991175bf77395e6b15fe6b2304d3bf72da40;p=powerpc.git diff --git a/include/asm-powerpc/iseries/hv_lp_event.h b/include/asm-powerpc/iseries/hv_lp_event.h index 499ab1ad01..6ce2ce1e26 100644 --- a/include/asm-powerpc/iseries/hv_lp_event.h +++ b/include/asm-powerpc/iseries/hv_lp_event.h @@ -1,5 +1,4 @@ /* - * HvLpEvent.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify @@ -32,17 +31,8 @@ * partitions through PLIC. */ -struct HvEventFlags { - u8 xValid:1; /* Indicates a valid request x00-x00 */ - u8 xRsvd1:4; /* Reserved ... */ - u8 xAckType:1; /* Immediate or deferred ... */ - u8 xAckInd:1; /* Indicates if ACK required ... */ - u8 xFunction:1; /* Interrupt or Acknowledge ... */ -}; - - struct HvLpEvent { - struct HvEventFlags xFlags; /* Event flags x00-x00 */ + u8 flags; /* Event flags x00-x00 */ u8 xType; /* Type of message x01-x01 */ u16 xSubtype; /* Subtype for event x02-x03 */ u8 xSourceLp; /* Source LP x04-x04 */ @@ -60,7 +50,7 @@ struct HvLpEvent { u64 xCorrelationToken; /* Unique value for source/type x10-x17 */ }; -typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); +typedef void (*LpEventHandler)(struct HvLpEvent *); /* Register a handler for an event type - returns 0 on success */ extern int HvLpEvent_registerHandler(HvLpEvent_Type eventType, @@ -126,6 +116,11 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); #define HvLpEvent_AckType_ImmediateAck 0 #define HvLpEvent_AckType_DeferredAck 1 +#define HV_LP_EVENT_INT 0x01 +#define HV_LP_EVENT_DO_ACK 0x02 +#define HV_LP_EVENT_DEFERRED_ACK 0x04 +#define HV_LP_EVENT_VALID 0x80 + #define HvLpDma_Direction_LocalToRemote 0 #define HvLpDma_Direction_RemoteToLocal 1 @@ -139,4 +134,29 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); #define HvLpDma_Rc_InvalidAddress 4 #define HvLpDma_Rc_InvalidLength 5 +static inline int hvlpevent_is_valid(struct HvLpEvent *h) +{ + return h->flags & HV_LP_EVENT_VALID; +} + +static inline void hvlpevent_invalidate(struct HvLpEvent *h) +{ + h->flags &= ~ HV_LP_EVENT_VALID; +} + +static inline int hvlpevent_is_int(struct HvLpEvent *h) +{ + return h->flags & HV_LP_EVENT_INT; +} + +static inline int hvlpevent_is_ack(struct HvLpEvent *h) +{ + return !hvlpevent_is_int(h); +} + +static inline int hvlpevent_need_ack(struct HvLpEvent *h) +{ + return h->flags & HV_LP_EVENT_DO_ACK; +} + #endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */