diff options
author | Ian Munsie <imunsie@au1.ibm.com> | 2012-11-07 23:57:04 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-11-14 23:08:07 -0500 |
commit | 798042da4e039ef551ff6e1b1ead50a763181daa (patch) | |
tree | eff3a8e36256b98610c009c2fed9347b9ff531b3 /arch/powerpc/platforms | |
parent | d8f48ecc0e81cbc52a8eac907e02916d98dbfb5a (diff) |
powerpc: Add wrappers to enable/disable relocation on exceptions
These wrappers hide the parameters that have to be passed to H_SET_MODE
to enable/disable relocation on during exceptions.
As noted in the comments, since these have partition wide scope, they
may take some time to complete and must be periodically retried until
H_SUCCESS is returned.
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/pseries/plpar_wrappers.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index 44ad21403452..e6cc34a67053 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -279,4 +279,29 @@ static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, | |||
279 | { | 279 | { |
280 | return plpar_hcall_norets(H_SET_MODE, mflags, resource, value1, value2); | 280 | return plpar_hcall_norets(H_SET_MODE, mflags, resource, value1, value2); |
281 | } | 281 | } |
282 | |||
283 | /* | ||
284 | * Enable relocation on exceptions on this partition | ||
285 | * | ||
286 | * Note: this call has a partition wide scope and can take a while to complete. | ||
287 | * If it returns H_LONG_BUSY_* it should be retried periodically until it | ||
288 | * returns H_SUCCESS. | ||
289 | */ | ||
290 | static inline long enable_reloc_on_exceptions(void) | ||
291 | { | ||
292 | /* mflags = 3: Exceptions at 0xC000000000004000 */ | ||
293 | return plpar_set_mode(3, 3, 0, 0); | ||
294 | } | ||
295 | |||
296 | /* | ||
297 | * Disable relocation on exceptions on this partition | ||
298 | * | ||
299 | * Note: this call has a partition wide scope and can take a while to complete. | ||
300 | * If it returns H_LONG_BUSY_* it should be retried periodically until it | ||
301 | * returns H_SUCCESS. | ||
302 | */ | ||
303 | static inline long disable_reloc_on_exceptions(void) { | ||
304 | return plpar_set_mode(0, 3, 0, 0); | ||
305 | } | ||
306 | |||
282 | #endif /* _PSERIES_PLPAR_WRAPPERS_H */ | 307 | #endif /* _PSERIES_PLPAR_WRAPPERS_H */ |