提交 1cbd2220 编写于 作者: B Benjamin Herrenschmidt 提交者: David Gibson

ppc/xics: Implement H_IPOLL using an accessor

None of the other presenter functions directly mucks with the
internal state, so don't do it there either.
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NNikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
上级 9c7027ba
......@@ -288,6 +288,14 @@ uint32_t icp_accept(ICPState *ss)
return xirr;
}
uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr)
{
if (mfrr) {
*mfrr = ss->mfrr;
}
return ss->xirr;
}
void icp_eoi(XICSState *icp, int server, uint32_t xirr)
{
ICPState *ss = icp->ss + server;
......
......@@ -99,10 +99,11 @@ static target_ulong h_ipoll(PowerPCCPU *cpu, sPAPRMachineState *spapr,
target_ulong opcode, target_ulong *args)
{
CPUState *cs = CPU(cpu);
ICPState *ss = &spapr->icp->ss[cs->cpu_index];
uint32_t mfrr;
uint32_t xirr = icp_ipoll(spapr->icp->ss + cs->cpu_index, &mfrr);
args[0] = ss->xirr;
args[1] = ss->mfrr;
args[0] = xirr;
args[1] = mfrr;
return H_SUCCESS;
}
......
......@@ -186,6 +186,7 @@ int xics_get_cpu_index_by_dt_id(int cpu_dt_id);
void icp_set_cppr(XICSState *icp, int server, uint8_t cppr);
void icp_set_mfrr(XICSState *icp, int server, uint8_t mfrr);
uint32_t icp_accept(ICPState *ss);
uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr);
void icp_eoi(XICSState *icp, int server, uint32_t xirr);
void ics_write_xive(ICSState *ics, int nr, int server,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册