From 4b6cfb2a8cd7520e8a747718e5c1da047697ca31 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Mon, 23 Feb 2015 16:14:31 +0100 Subject: 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 Signed-off-by: Greg Kurz Signed-off-by: Michael Ellerman --- arch/powerpc/mm/vphn.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 arch/powerpc/mm/vphn.h (limited to 'arch/powerpc/mm/vphn.h') 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 -- cgit v1.2.3-59-g8ed1b