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 return HvCall0(HvCallHptGetHptAddress
);
49 static inline u64
HvCallHpt_getHptPages(void)
51 return HvCall0(HvCallHptGetHptPages
);
54 static inline void HvCallHpt_setPp(u32 hpteIndex
, u8 value
)
56 HvCall2(HvCallHptSetPp
, hpteIndex
, value
);
59 static inline void HvCallHpt_setSwBits(u32 hpteIndex
, u8 bitson
, u8 bitsoff
)
61 HvCall3(HvCallHptSetSwBits
, hpteIndex
, bitson
, bitsoff
);
64 static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex
)
66 HvCall1(HvCallHptInvalidateNoSyncICache
, hpteIndex
);
69 static inline u64
HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex
, u8 bitson
,
74 compressedStatus
= HvCall4(HvCallHptInvalidateSetSwBitsGet
,
75 hpteIndex
, bitson
, bitsoff
, 1);
76 HvCall1(HvCallHptInvalidateNoSyncICache
, hpteIndex
);
77 return compressedStatus
;
80 static inline u64
HvCallHpt_findValid(HPTE
*hpte
, u64 vpn
)
82 return HvCall3Ret16(HvCallHptFindValid
, hpte
, vpn
, 0, 0);
85 static inline u64
HvCallHpt_findNextValid(HPTE
*hpte
, u32 hpteIndex
,
86 u8 bitson
, u8 bitsoff
)
88 return HvCall3Ret16(HvCallHptFindNextValid
, hpte
, hpteIndex
,
92 static inline void HvCallHpt_get(HPTE
*hpte
, u32 hpteIndex
)
94 HvCall2Ret16(HvCallHptGet
, hpte
, hpteIndex
, 0);
97 static inline void HvCallHpt_addValidate(u32 hpteIndex
, u32 hBit
, HPTE
*hpte
)
99 HvCall4(HvCallHptAddValidate
, hpteIndex
, hBit
, (*((u64
*)hpte
)),
100 (*(((u64
*)hpte
)+1)));
103 #endif /* _HVCALLHPT_H */