Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * HvLpConfig.h |
| 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 4 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 9 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 14 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 _HVLPCONFIG_H |
| 20 | #define _HVLPCONFIG_H |
| 21 | |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 22 | /* |
| 23 | * This file contains the interface to the LPAR configuration data |
| 24 | * to determine which resources should be allocated to each partition. |
| 25 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | #include <asm/iSeries/HvCallCfg.h> |
| 28 | #include <asm/iSeries/HvTypes.h> |
| 29 | #include <asm/iSeries/ItLpNaca.h> |
| 30 | #include <asm/iSeries/LparData.h> |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | extern HvLpIndex HvLpConfig_getLpIndex_outline(void); |
| 33 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | static inline HvLpIndex HvLpConfig_getLpIndex(void) |
| 35 | { |
| 36 | return itLpNaca.xLpIndex; |
| 37 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 38 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void) |
| 40 | { |
| 41 | return itLpNaca.xPrimaryLpIndex; |
| 42 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | static inline HvLpIndex HvLpConfig_getLps(void) |
| 45 | { |
| 46 | return HvCallCfg_getLps(); |
| 47 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 48 | |
| 49 | static inline HvLpIndexMap HvLpConfig_getActiveLpMap(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | { |
| 51 | return HvCallCfg_getActiveLpMap(); |
| 52 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 53 | |
| 54 | static inline u64 HvLpConfig_getSystemMsMegs(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | { |
| 56 | return HvCallCfg_getSystemMsChunks() / HVCHUNKSPERMEG; |
| 57 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 58 | |
| 59 | static inline u64 HvLpConfig_getSystemMsChunks(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | { |
| 61 | return HvCallCfg_getSystemMsChunks(); |
| 62 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 63 | |
| 64 | static inline u64 HvLpConfig_getSystemMsPages(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | { |
| 66 | return HvCallCfg_getSystemMsChunks() * HVPAGESPERCHUNK; |
| 67 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 68 | |
| 69 | static inline u64 HvLpConfig_getMsMegs(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 71 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur) |
| 72 | / HVCHUNKSPERMEG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 74 | |
| 75 | static inline u64 HvLpConfig_getMsChunks(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 77 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 79 | |
| 80 | static inline u64 HvLpConfig_getMsPages(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 82 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur) |
| 83 | * HVPAGESPERCHUNK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 85 | |
| 86 | static inline u64 HvLpConfig_getMinMsMegs(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 88 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min) |
| 89 | / HVCHUNKSPERMEG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 91 | |
| 92 | static inline u64 HvLpConfig_getMinMsChunks(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 94 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 96 | |
| 97 | static inline u64 HvLpConfig_getMinMsPages(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 99 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min) |
| 100 | * HVPAGESPERCHUNK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 102 | |
| 103 | static inline u64 HvLpConfig_getMinRuntimeMsMegs(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 105 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) |
| 106 | / HVCHUNKSPERMEG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 108 | |
| 109 | static inline u64 HvLpConfig_getMinRuntimeMsChunks(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | { |
| 111 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()); |
| 112 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 113 | |
| 114 | static inline u64 HvLpConfig_getMinRuntimeMsPages(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 116 | return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex()) |
| 117 | * HVPAGESPERCHUNK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 119 | |
| 120 | static inline u64 HvLpConfig_getMaxMsMegs(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 122 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max) |
| 123 | / HVCHUNKSPERMEG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 125 | |
| 126 | static inline u64 HvLpConfig_getMaxMsChunks(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 128 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 130 | |
| 131 | static inline u64 HvLpConfig_getMaxMsPages(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 133 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max) |
| 134 | * HVPAGESPERCHUNK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 136 | |
| 137 | static inline u64 HvLpConfig_getInitMsMegs(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 139 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init) |
| 140 | / HVCHUNKSPERMEG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 142 | |
| 143 | static inline u64 HvLpConfig_getInitMsChunks(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 145 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 147 | |
| 148 | static inline u64 HvLpConfig_getInitMsPages(void) |
| 149 | { |
| 150 | return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init) |
| 151 | * HVPAGESPERCHUNK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 153 | |
| 154 | static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | { |
| 156 | return HvCallCfg_getSystemPhysicalProcessors(); |
| 157 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 158 | |
| 159 | static inline u64 HvLpConfig_getSystemLogicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 161 | return HvCallCfg_getSystemPhysicalProcessors() |
| 162 | * (/*getPaca()->getSecondaryThreadCount() +*/ 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 163 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 164 | |
| 165 | static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | { |
| 167 | return HvCallCfg_getNumProcsInSharedPool(sPI); |
| 168 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 169 | |
| 170 | static inline u64 HvLpConfig_getPhysicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 172 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 173 | HvCallCfg_Cur); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 175 | |
| 176 | static inline u64 HvLpConfig_getLogicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 178 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 179 | HvCallCfg_Cur) |
| 180 | * (/*getPaca()->getSecondaryThreadCount() +*/ 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 182 | |
| 183 | static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | { |
| 185 | return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex()); |
| 186 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 187 | |
| 188 | static inline u64 HvLpConfig_getSharedProcUnits(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 190 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(), |
| 191 | HvCallCfg_Cur); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 193 | |
| 194 | static inline u64 HvLpConfig_getMinSharedProcUnits(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 196 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(), |
| 197 | HvCallCfg_Min); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 199 | |
| 200 | static inline u64 HvLpConfig_getMaxSharedProcUnits(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 202 | return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(), |
| 203 | HvCallCfg_Max); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 205 | |
| 206 | static inline u64 HvLpConfig_getMinPhysicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 208 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 209 | HvCallCfg_Min); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 211 | |
| 212 | static inline u64 HvLpConfig_getMinLogicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 214 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 215 | HvCallCfg_Min) |
| 216 | * (/*getPaca()->getSecondaryThreadCount() +*/ 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 218 | |
| 219 | static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 221 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 222 | HvCallCfg_Max); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 224 | |
| 225 | static inline u64 HvLpConfig_getMaxLogicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 227 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 228 | HvCallCfg_Max) |
| 229 | * (/*getPaca()->getSecondaryThreadCount() +*/ 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 231 | |
| 232 | static inline u64 HvLpConfig_getInitPhysicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 234 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 235 | HvCallCfg_Init); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 237 | |
| 238 | static inline u64 HvLpConfig_getInitLogicalProcessors(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 240 | return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), |
| 241 | HvCallCfg_Init) |
| 242 | * (/*getPaca()->getSecondaryThreadCount() +*/ 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 244 | |
| 245 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | { |
| 247 | return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline()); |
| 248 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 249 | |
| 250 | static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp( |
| 251 | HvLpIndex lp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | { |
| 253 | return HvCallCfg_getVirtualLanIndexMap(lp); |
| 254 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 255 | |
| 256 | static inline HvLpIndex HvLpConfig_getBusOwner(HvBusNumber busNumber) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | { |
| 258 | return HvCallCfg_getBusOwner(busNumber); |
| 259 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 260 | |
| 261 | static inline int HvLpConfig_isBusDedicated(HvBusNumber busNumber) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | { |
| 263 | return HvCallCfg_isBusDedicated(busNumber); |
| 264 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 265 | |
| 266 | static inline HvLpIndexMap HvLpConfig_getBusAllocation(HvBusNumber busNumber) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | { |
| 268 | return HvCallCfg_getBusAllocation(busNumber); |
| 269 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 270 | |
| 271 | /* returns the absolute real address of the load area */ |
| 272 | static inline u64 HvLpConfig_getLoadAddress(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 273 | { |
| 274 | return itLpNaca.xLoadAreaAddr & 0x7fffffffffffffff; |
| 275 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 276 | |
| 277 | static inline u64 HvLpConfig_getLoadPages(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | { |
| 279 | return itLpNaca.xLoadAreaChunks * HVPAGESPERCHUNK; |
| 280 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 281 | |
| 282 | static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | { |
| 284 | HvLpIndex busOwner = HvLpConfig_getBusOwner(busNumber); |
| 285 | return (busOwner == HvLpConfig_getLpIndex()); |
| 286 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 287 | |
| 288 | static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, |
| 289 | HvLpIndex lp2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | { |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 291 | HvLpVirtualLanIndexMap virtualLanIndexMap1 = |
| 292 | HvCallCfg_getVirtualLanIndexMap(lp1); |
| 293 | HvLpVirtualLanIndexMap virtualLanIndexMap2 = |
| 294 | HvCallCfg_getVirtualLanIndexMap(lp2); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | return ((virtualLanIndexMap1 & virtualLanIndexMap2) != 0); |
| 296 | } |
Stephen Rothwell | 45dc76a | 2005-06-21 17:15:33 -0700 | [diff] [blame] | 297 | |
| 298 | static inline HvLpIndex HvLpConfig_getHostingLpIndex(HvLpIndex lp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | { |
| 300 | return HvCallCfg_getHostingLpIndex(lp); |
| 301 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | |
| 303 | #endif /* _HVLPCONFIG_H */ |