# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 7825169895d0652dd16f10a9186cba5b84b6933e
# Parent 0caf1a74fecd6ed9967a9eea1cc6b3fafd6a9eb5
[XEN][POWERPC] Implement H_READ from the PAPR
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
xen/arch/powerpc/papr/xlate.c | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff -r 0caf1a74fecd -r 7825169895d0 xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c Thu Aug 24 21:07:46 2006 -0400
+++ b/xen/arch/powerpc/papr/xlate.c Fri Aug 25 14:34:51 2006 -0400
@@ -30,12 +30,6 @@
#include <asm/papr.h>
#include <asm/hcalls.h>
-static void not_yet(struct cpu_user_regs *regs)
-{
- printk("not implemented yet: 0x%lx\n", regs->gprs[3]);
- for (;;);
-}
-
#ifdef USE_PTE_INSERT
static inline void pte_insert(union pte volatile *pte,
ulong vsid, ulong rpn, ulong lrpn)
@@ -493,8 +487,42 @@ static void h_remove(struct cpu_user_reg
pte_tlbie(&lpte, ptex);
}
+static void h_read(struct cpu_user_regs *regs)
+{
+ ulong flags = regs->gprs[4];
+ ulong ptex = regs->gprs[5];
+ struct vcpu *v = get_current();
+ struct domain *d = v->domain;
+ struct domain_htab *htab = &d->arch.htab;
+ union pte volatile *pte;
+
+ if (flags & H_READ_4)
+ ptex &= ~0x3UL;
+
+ if (ptex > (1UL << htab->log_num_ptes)) {
+ regs->gprs[3] = H_Parameter;
+ printk("%s: bad ptex: 0x%lx\n", __func__, ptex);
+ return;
+ }
+ pte = &htab->map[ptex];
+ regs->gprs[4] = pte[0].words.vsid;
+ regs->gprs[5] = pte[0].words.rpn;
+
+ if (!(flags & H_READ_4)) {
+ /* dump another 3 PTEs */
+ regs->gprs[6] = pte[1].words.vsid;
+ regs->gprs[7] = pte[1].words.rpn;
+ regs->gprs[8] = pte[2].words.vsid;
+ regs->gprs[9] = pte[2].words.rpn;
+ regs->gprs[10] = pte[3].words.vsid;
+ regs->gprs[11] = pte[3].words.rpn;
+ }
+
+ regs->gprs[3] = H_Success;
+}
+
__init_papr_hcall(H_ENTER, h_enter);
-__init_papr_hcall(H_READ, not_yet);
+__init_papr_hcall(H_READ, h_read);
__init_papr_hcall(H_REMOVE, h_remove);
__init_papr_hcall(H_CLEAR_MOD, h_clear_mod);
__init_papr_hcall(H_CLEAR_REF, h_clear_ref);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|