提交 9d0e6d9d 编写于 作者: G Greg Kurz 提交者: Michael Ellerman

powerpc/vphn: clarify the H_HOME_NODE_ASSOCIATIVITY API

The number of values returned by the H_HOME_NODE_ASSOCIATIVITY h_call deserves
to be explicitly defined, for a better understanding of the code.
Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 52d99627
...@@ -1247,11 +1247,15 @@ static int update_cpu_associativity_changes_mask(void) ...@@ -1247,11 +1247,15 @@ static int update_cpu_associativity_changes_mask(void)
return cpumask_weight(changes); return cpumask_weight(changes);
} }
/* 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 * 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. * the complete property we have to add the length in the first cell.
*/ */
#define VPHN_ASSOC_BUFSIZE (6*sizeof(u64)/sizeof(u32) + 1) #define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u32) + 1)
/* /*
* Convert the associativity domain numbers returned from the hypervisor * Convert the associativity domain numbers returned from the hypervisor
...@@ -1309,7 +1313,7 @@ static long hcall_vphn(unsigned long cpu, __be32 *associativity) ...@@ -1309,7 +1313,7 @@ static long hcall_vphn(unsigned long cpu, __be32 *associativity)
int i; int i;
rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu); rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu);
for (i = 0; i < 6; i++) for (i = 0; i < VPHN_REGISTER_COUNT; i++)
retbuf[i] = cpu_to_be64(retbuf[i]); retbuf[i] = cpu_to_be64(retbuf[i]);
vphn_unpack_associativity(retbuf, associativity); vphn_unpack_associativity(retbuf, associativity);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册