aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/iSeries/HvLpEvent.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ppc64/iSeries/HvLpEvent.h')
-rw-r--r--include/asm-ppc64/iSeries/HvLpEvent.h116
1 files changed, 57 insertions, 59 deletions
diff --git a/include/asm-ppc64/iSeries/HvLpEvent.h b/include/asm-ppc64/iSeries/HvLpEvent.h
index 30936e433064..865000de79b6 100644
--- a/include/asm-ppc64/iSeries/HvLpEvent.h
+++ b/include/asm-ppc64/iSeries/HvLpEvent.h
@@ -1,27 +1,24 @@
1/* 1/*
2 * HvLpEvent.h 2 * HvLpEvent.h
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
9 * 9 *
10 * This program is distributed in the hope that it will be useful, 10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 19
20//====================================================================== 20/* This file contains the class for HV events in the system. */
21// 21
22// This file contains the class for HV events in the system.
23//
24//=====================================================================
25#ifndef _HVLPEVENT_H 22#ifndef _HVLPEVENT_H
26#define _HVLPEVENT_H 23#define _HVLPEVENT_H
27 24
@@ -30,69 +27,70 @@
30#include <asm/iSeries/HvTypes.h> 27#include <asm/iSeries/HvTypes.h>
31#include <asm/iSeries/HvCallEvent.h> 28#include <asm/iSeries/HvCallEvent.h>
32 29
33//===================================================================== 30/*
34// 31 * HvLpEvent is the structure for Lp Event messages passed between
35// HvLpEvent is the structure for Lp Event messages passed between 32 * partitions through PLIC.
36// partitions through PLIC. 33 */
37// 34
38//===================================================================== 35struct HvEventFlags {
39 36 u8 xValid:1; /* Indicates a valid request x00-x00 */
40struct HvEventFlags 37 u8 xRsvd1:4; /* Reserved ... */
41{ 38 u8 xAckType:1; /* Immediate or deferred ... */
42 u8 xValid:1; // Indicates a valid request x00-x00 39 u8 xAckInd:1; /* Indicates if ACK required ... */
43 u8 xRsvd1:4; // Reserved ... 40 u8 xFunction:1; /* Interrupt or Acknowledge ... */
44 u8 xAckType:1; // Immediate or deferred ...
45 u8 xAckInd:1; // Indicates if ACK required ...
46 u8 xFunction:1; // Interrupt or Acknowledge ...
47}; 41};
48 42
49 43
50struct HvLpEvent 44struct HvLpEvent {
51{ 45 struct HvEventFlags xFlags; /* Event flags x00-x00 */
52 struct HvEventFlags xFlags; // Event flags x00-x00 46 u8 xType; /* Type of message x01-x01 */
53 u8 xType; // Type of message x01-x01 47 u16 xSubtype; /* Subtype for event x02-x03 */
54 u16 xSubtype; // Subtype for event x02-x03 48 u8 xSourceLp; /* Source LP x04-x04 */
55 u8 xSourceLp; // Source LP x04-x04 49 u8 xTargetLp; /* Target LP x05-x05 */
56 u8 xTargetLp; // Target LP x05-x05 50 u8 xSizeMinus1; /* Size of Derived class - 1 x06-x06 */
57 u8 xSizeMinus1; // Size of Derived class - 1 x06-x06 51 u8 xRc; /* RC for Ack flows x07-x07 */
58 u8 xRc; // RC for Ack flows x07-x07 52 u16 xSourceInstanceId; /* Source sides instance id x08-x09 */
59 u16 xSourceInstanceId; // Source sides instance id x08-x09 53 u16 xTargetInstanceId; /* Target sides instance id x0A-x0B */
60 u16 xTargetInstanceId; // Target sides instance id x0A-x0B
61 union { 54 union {
62 u32 xSubtypeData; // Data usable by the subtype x0C-x0F 55 u32 xSubtypeData; /* Data usable by the subtype x0C-x0F */
63 u16 xSubtypeDataShort[2]; // Data as 2 shorts 56 u16 xSubtypeDataShort[2]; /* Data as 2 shorts */
64 u8 xSubtypeDataChar[4]; // Data as 4 chars 57 u8 xSubtypeDataChar[4]; /* Data as 4 chars */
65 } x; 58 } x;
66 59
67 u64 xCorrelationToken; // Unique value for source/type x10-x17 60 u64 xCorrelationToken; /* Unique value for source/type x10-x17 */
68}; 61};
69 62
70// Lp Event handler function
71typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *); 63typedef void (*LpEventHandler)(struct HvLpEvent *, struct pt_regs *);
72 64
73// Register a handler for an event type 65/* Register a handler for an event type - returns 0 on success */
74// returns 0 on success 66extern int HvLpEvent_registerHandler(HvLpEvent_Type eventType,
75extern int HvLpEvent_registerHandler( HvLpEvent_Type eventType, LpEventHandler hdlr); 67 LpEventHandler hdlr);
76
77// Unregister a handler for an event type
78// This call will sleep until the handler being removed is guaranteed to
79// be no longer executing on any CPU. Do not call with locks held.
80//
81// returns 0 on success
82// Unregister will fail if there are any paths open for the type
83extern int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType );
84 68
85// Open an Lp Event Path for an event type 69/*
86// returns 0 on success 70 * Unregister a handler for an event type
87// openPath will fail if there is no handler registered for the event type. 71 *
88// The lpIndex specified is the partition index for the target partition 72 * This call will sleep until the handler being removed is guaranteed to
89// (for VirtualIo, VirtualLan and SessionMgr) other types specify zero) 73 * be no longer executing on any CPU. Do not call with locks held.
90extern int HvLpEvent_openPath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); 74 *
75 * returns 0 on success
76 * Unregister will fail if there are any paths open for the type
77 */
78extern int HvLpEvent_unregisterHandler(HvLpEvent_Type eventType);
91 79
80/*
81 * Open an Lp Event Path for an event type
82 * returns 0 on success
83 * openPath will fail if there is no handler registered for the event type.
84 * The lpIndex specified is the partition index for the target partition
85 * (for VirtualIo, VirtualLan and SessionMgr) other types specify zero)
86 */
87extern int HvLpEvent_openPath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
92 88
93// Close an Lp Event Path for a type and partition 89/*
94// returns 0 on sucess 90 * Close an Lp Event Path for a type and partition
95extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex ); 91 * returns 0 on sucess
92 */
93extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
96 94
97#define HvLpEvent_Type_Hypervisor 0 95#define HvLpEvent_Type_Hypervisor 0
98#define HvLpEvent_Type_MachineFac 1 96#define HvLpEvent_Type_MachineFac 1
@@ -141,4 +139,4 @@ extern int HvLpEvent_closePath( HvLpEvent_Type eventType, HvLpIndex lpIndex );
141#define HvLpDma_Rc_InvalidAddress 4 139#define HvLpDma_Rc_InvalidAddress 4
142#define HvLpDma_Rc_InvalidLength 5 140#define HvLpDma_Rc_InvalidLength 5
143 141
144#endif // _HVLPEVENT_H 142#endif /* _HVLPEVENT_H */