]> err.no Git - linux-2.6/blob - include/asm-ppc64/iSeries/HvCallHpt.h
[PATCH] ppc64 iSeries: header file white space cleanups
[linux-2.6] / include / asm-ppc64 / iSeries / HvCallHpt.h
1 /*
2  * HvCallHpt.h
3  * Copyright (C) 2001  Mike Corrigan IBM Corporation
4  *
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
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
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
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18  */
19 #ifndef _HVCALLHPT_H
20 #define _HVCALLHPT_H
21
22 /*
23  * This file contains the "hypervisor call" interface which is used to
24  * drive the hypervisor from the OS.
25  */
26
27 #include <asm/iSeries/HvCallSc.h>
28 #include <asm/iSeries/HvTypes.h>
29 #include <asm/mmu.h>
30
31 #define HvCallHptGetHptAddress          HvCallHpt +  0
32 #define HvCallHptGetHptPages            HvCallHpt +  1
33 #define HvCallHptSetPp                  HvCallHpt +  5
34 #define HvCallHptSetSwBits              HvCallHpt +  6
35 #define HvCallHptUpdate                 HvCallHpt +  7
36 #define HvCallHptInvalidateNoSyncICache HvCallHpt +  8
37 #define HvCallHptGet                    HvCallHpt + 11
38 #define HvCallHptFindNextValid          HvCallHpt + 12
39 #define HvCallHptFindValid              HvCallHpt + 13
40 #define HvCallHptAddValidate            HvCallHpt + 16
41 #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18
42
43
44 static inline u64 HvCallHpt_getHptAddress(void)
45 {
46         u64 retval = HvCall0(HvCallHptGetHptAddress);
47         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
48         return retval;
49 }
50
51 static inline u64 HvCallHpt_getHptPages(void)
52 {
53         u64 retval = HvCall0(HvCallHptGetHptPages);
54         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
55         return retval;
56 }
57
58 static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
59 {
60         HvCall2(HvCallHptSetPp, hpteIndex, value);
61         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
62 }
63
64 static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
65 {
66         HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
67         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
68 }
69
70 static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
71 {
72         HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
73         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
74 }
75
76 static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
77                 u8 bitsoff)
78 {
79         u64 compressedStatus;
80
81         compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
82                         hpteIndex, bitson, bitsoff, 1);
83         HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
84         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
85         return compressedStatus;
86 }
87
88 static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn)
89 {
90         u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 );
91         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
92         return retIndex;
93 }
94
95 static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex,
96                 u8 bitson, u8 bitsoff)
97 {
98         u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff );
99         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
100         return retIndex;
101 }
102
103 static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex)
104 {
105         HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
106         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
107 }
108
109 static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte)
110 {
111         HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)),
112                         (*(((u64 *)hpte)+1)));
113         // getPaca()->adjustHmtForNoOfSpinLocksHeld();
114 }
115
116 #endif /* _HVCALLHPT_H */