3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
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.
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.
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
23 * This file contains the "hypervisor call" interface which is used to
24 * drive the hypervisor from the OS.
27 #include <asm/iSeries/HvCallSc.h>
28 #include <asm/iSeries/HvTypes.h>
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
44 static inline u64 HvCallHpt_getHptAddress(void)
46 u64 retval = HvCall0(HvCallHptGetHptAddress);
47 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
51 static inline u64 HvCallHpt_getHptPages(void)
53 u64 retval = HvCall0(HvCallHptGetHptPages);
54 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
58 static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
60 HvCall2(HvCallHptSetPp, hpteIndex, value);
61 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
64 static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
66 HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
67 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
70 static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
72 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
73 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
76 static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
81 compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
82 hpteIndex, bitson, bitsoff, 1);
83 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
84 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
85 return compressedStatus;
88 static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn)
90 u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 );
91 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
95 static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex,
96 u8 bitson, u8 bitsoff)
98 u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff );
99 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
103 static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex)
105 HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
106 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
109 static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte)
111 HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)),
112 (*(((u64 *)hpte)+1)));
113 // getPaca()->adjustHmtForNoOfSpinLocksHeld();
116 #endif /* _HVCALLHPT_H */