diff options
Diffstat (limited to 'include/asm-ppc64/iSeries/HvCallHpt.h')
-rw-r--r-- | include/asm-ppc64/iSeries/HvCallHpt.h | 89 |
1 files changed, 39 insertions, 50 deletions
diff --git a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h index da769873d18b..827d26c60fc1 100644 --- a/include/asm-ppc64/iSeries/HvCallHpt.h +++ b/include/asm-ppc64/iSeries/HvCallHpt.h | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallHpt.h | 2 | * HvCallHpt.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 |
@@ -19,21 +19,15 @@ | |||
19 | #ifndef _HVCALLHPT_H | 19 | #ifndef _HVCALLHPT_H |
20 | #define _HVCALLHPT_H | 20 | #define _HVCALLHPT_H |
21 | 21 | ||
22 | //============================================================================ | 22 | /* |
23 | // | 23 | * This file contains the "hypervisor call" interface which is used to |
24 | // This file contains the "hypervisor call" interface which is used to | 24 | * drive the hypervisor from the OS. |
25 | // drive the hypervisor from the OS. | 25 | */ |
26 | // | ||
27 | //============================================================================ | ||
28 | 26 | ||
29 | #include <asm/iSeries/HvCallSc.h> | 27 | #include <asm/iSeries/HvCallSc.h> |
30 | #include <asm/iSeries/HvTypes.h> | 28 | #include <asm/iSeries/HvTypes.h> |
31 | #include <asm/mmu.h> | 29 | #include <asm/mmu.h> |
32 | 30 | ||
33 | //----------------------------------------------------------------------------- | ||
34 | // Constants | ||
35 | //----------------------------------------------------------------------------- | ||
36 | |||
37 | #define HvCallHptGetHptAddress HvCallHpt + 0 | 31 | #define HvCallHptGetHptAddress HvCallHpt + 0 |
38 | #define HvCallHptGetHptPages HvCallHpt + 1 | 32 | #define HvCallHptGetHptPages HvCallHpt + 1 |
39 | #define HvCallHptSetPp HvCallHpt + 5 | 33 | #define HvCallHptSetPp HvCallHpt + 5 |
@@ -47,81 +41,76 @@ | |||
47 | #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 | 41 | #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 |
48 | 42 | ||
49 | 43 | ||
50 | //============================================================================ | 44 | static inline u64 HvCallHpt_getHptAddress(void) |
51 | static inline u64 HvCallHpt_getHptAddress(void) | ||
52 | { | 45 | { |
53 | u64 retval = HvCall0(HvCallHptGetHptAddress); | 46 | u64 retval = HvCall0(HvCallHptGetHptAddress); |
54 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 47 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
55 | return retval; | 48 | return retval; |
56 | } | 49 | } |
57 | //============================================================================ | 50 | |
58 | static inline u64 HvCallHpt_getHptPages(void) | 51 | static inline u64 HvCallHpt_getHptPages(void) |
59 | { | 52 | { |
60 | u64 retval = HvCall0(HvCallHptGetHptPages); | 53 | u64 retval = HvCall0(HvCallHptGetHptPages); |
61 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 54 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
62 | return retval; | 55 | return retval; |
63 | } | 56 | } |
64 | //============================================================================= | 57 | |
65 | static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) | 58 | static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) |
66 | { | 59 | { |
67 | HvCall2( HvCallHptSetPp, hpteIndex, value ); | 60 | HvCall2(HvCallHptSetPp, hpteIndex, value); |
68 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 61 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
69 | } | 62 | } |
70 | //============================================================================= | 63 | |
71 | static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff ) | 64 | static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff) |
72 | { | 65 | { |
73 | HvCall3( HvCallHptSetSwBits, hpteIndex, bitson, bitsoff ); | 66 | HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff); |
74 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 67 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
75 | } | 68 | } |
76 | //============================================================================= | 69 | |
77 | static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) | 70 | static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) |
78 | |||
79 | { | 71 | { |
80 | HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); | 72 | HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); |
81 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 73 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
82 | } | 74 | } |
83 | //============================================================================= | 75 | |
84 | static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, u8 bitsoff ) | 76 | static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, |
85 | 77 | u8 bitsoff) | |
86 | { | 78 | { |
87 | u64 compressedStatus; | 79 | u64 compressedStatus; |
88 | compressedStatus = HvCall4( HvCallHptInvalidateSetSwBitsGet, hpteIndex, bitson, bitsoff, 1 ); | 80 | |
89 | HvCall1( HvCallHptInvalidateNoSyncICache, hpteIndex ); | 81 | compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet, |
82 | hpteIndex, bitson, bitsoff, 1); | ||
83 | HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); | ||
90 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 84 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
91 | return compressedStatus; | 85 | return compressedStatus; |
92 | } | 86 | } |
93 | //============================================================================= | 87 | |
94 | static inline u64 HvCallHpt_findValid( HPTE *hpte, u64 vpn ) | 88 | static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn) |
95 | { | 89 | { |
96 | u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 ); | 90 | u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 ); |
97 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 91 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
98 | return retIndex; | 92 | return retIndex; |
99 | } | 93 | } |
100 | //============================================================================= | 94 | |
101 | static inline u64 HvCallHpt_findNextValid( HPTE *hpte, u32 hpteIndex, u8 bitson, u8 bitsoff ) | 95 | static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex, |
96 | u8 bitson, u8 bitsoff) | ||
102 | { | 97 | { |
103 | u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff ); | 98 | u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff ); |
104 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 99 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
105 | return retIndex; | 100 | return retIndex; |
106 | } | 101 | } |
107 | //============================================================================= | 102 | |
108 | static inline void HvCallHpt_get( HPTE *hpte, u32 hpteIndex ) | 103 | static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex) |
109 | { | 104 | { |
110 | HvCall2Ret16( HvCallHptGet, hpte, hpteIndex, 0 ); | 105 | HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0); |
111 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 106 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
112 | } | 107 | } |
113 | //============================================================================ | 108 | |
114 | static inline void HvCallHpt_addValidate( u32 hpteIndex, | 109 | static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte) |
115 | u32 hBit, | ||
116 | HPTE *hpte ) | ||
117 | |||
118 | { | 110 | { |
119 | HvCall4( HvCallHptAddValidate, hpteIndex, | 111 | HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)), |
120 | hBit, (*((u64 *)hpte)), (*(((u64 *)hpte)+1)) ); | 112 | (*(((u64 *)hpte)+1))); |
121 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); | 113 | // getPaca()->adjustHmtForNoOfSpinLocksHeld(); |
122 | } | 114 | } |
123 | 115 | ||
124 | |||
125 | //============================================================================= | ||
126 | |||
127 | #endif /* _HVCALLHPT_H */ | 116 | #endif /* _HVCALLHPT_H */ |