summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/vphn.h
diff options
context:
space:
mode:
authorGreg Kurz <gkurz@linux.vnet.ibm.com>2015-02-23 18:14:31 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-18 02:48:59 +0300
commit4b6cfb2a8cd7520e8a747718e5c1da047697ca31 (patch)
tree4c11bb5e691f12eec899ae7350a743920541e96b /arch/powerpc/mm/vphn.h
parentb1fc9484aa339c19bd57702dc88fb046702b6092 (diff)
downloadlinux-4b6cfb2a8cd7520e8a747718e5c1da047697ca31.tar.xz
powerpc/vphn: move VPHN parsing logic to a separate file
The goal behind this patch is to be able to write userland tests for the VPHN parsing code. Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/vphn.h')
-rw-r--r--arch/powerpc/mm/vphn.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/mm/vphn.h b/arch/powerpc/mm/vphn.h
new file mode 100644
index 000000000000..96af9a474693
--- /dev/null
+++ b/arch/powerpc/mm/vphn.h
@@ -0,0 +1,16 @@
+#ifndef _ARCH_POWERPC_MM_VPHN_H_
+#define _ARCH_POWERPC_MM_VPHN_H_
+
+/* The H_HOME_NODE_ASSOCIATIVITY h_call returns 6 64-bit registers.
+ */
+#define VPHN_REGISTER_COUNT 6
+
+/*
+ * 6 64-bit registers unpacked into 12 32-bit associativity values. To form
+ * the complete property we have to add the length in the first cell.
+ */
+#define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u32) + 1)
+
+extern int vphn_unpack_associativity(const long *packed, __be32 *unpacked);
+
+#endif