summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/pseries/pseries.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-11-14 16:28:10 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-17 17:11:46 +1100
commit8f272a5dd6826f14e47110eccd37b6782bf74901 (patch)
tree49f5af47334affaa0fea6f0d73d8914401a8fa34 /arch/powerpc/platforms/pseries/pseries.h
parentac8d3818aab7e08332a79e4252118297cb28e995 (diff)
powerpc/pseries: Move CMO code from plapr_wrappers.h to platforms/pseries
Currently there's some CMO (Cooperative Memory Overcommit) code, in plpar_wrappers.h. Some of it is #ifdef CONFIG_PSERIES and some of it isn't. The end result being if a file includes plpar_wrappers.h it won't build with CONFIG_PSERIES=n. Fix it by moving the CMO code into platforms/pseries. The two hcall wrappers can just be moved into their only caller, cmm.c, and the accessors can go in pseries.h. Note we need the accessors because cmm.c can be built as a module, so there needs to be a split between the built-in code vs the module, and that's achieved by using those accessors. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/pseries/pseries.h')
-rw-r--r--arch/powerpc/platforms/pseries/pseries.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index b1be7b713fe6..1361a9db534b 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -79,4 +79,23 @@ extern struct pci_controller_ops pseries_pci_controller_ops;
unsigned long pseries_memory_block_size(void);
+extern int CMO_PrPSP;
+extern int CMO_SecPSP;
+extern unsigned long CMO_PageSize;
+
+static inline int cmo_get_primary_psp(void)
+{
+ return CMO_PrPSP;
+}
+
+static inline int cmo_get_secondary_psp(void)
+{
+ return CMO_SecPSP;
+}
+
+static inline unsigned long cmo_get_page_size(void)
+{
+ return CMO_PageSize;
+}
+
#endif /* _PSERIES_PSERIES_H */