Page MenuHomeFreeBSD

D21643.id62051.diff
No OneTemporary

D21643.id62051.diff

Index: sys/powerpc/aim/moea64_native.c
===================================================================
--- sys/powerpc/aim/moea64_native.c
+++ sys/powerpc/aim/moea64_native.c
@@ -212,6 +212,18 @@
static volatile struct pate *moea64_part_table;
+/*
+ * Dump data and functions.
+ */
+static struct dump_context {
+ u_long ptex;
+ u_long ptex_end;
+ size_t blksz;
+} dump_ctx;
+
+static u_long moea64_dump_pmap_native(mmu_t mmu, void *ctx, void *buf);
+static void *moea64_dump_pmap_init_native(mmu_t mmu, unsigned blkpgs);
+
/*
* PTE calls.
*/
@@ -233,6 +245,8 @@
/* Internal interfaces */
MMUMETHOD(mmu_bootstrap, moea64_bootstrap_native),
MMUMETHOD(mmu_cpu_bootstrap, moea64_cpu_bootstrap_native),
+ MMUMETHOD(mmu_dump_pmap_init, moea64_dump_pmap_init_native),
+ MMUMETHOD(mmu_dump_pmap, moea64_dump_pmap_native),
MMUMETHOD(moea64_pte_synch, moea64_pte_synch_native),
MMUMETHOD(moea64_pte_clear, moea64_pte_clear_native),
@@ -787,3 +801,35 @@
return (-1);
}
+static void *
+moea64_dump_pmap_init_native(mmu_t mmu, unsigned blkpgs)
+{
+ dump_ctx.ptex = 0;
+ dump_ctx.ptex_end = moea64_pteg_count * 8;
+ dump_ctx.blksz = blkpgs * PAGE_SIZE;
+ return (&dump_ctx);
+}
+
+static u_long
+moea64_dump_pmap_native(mmu_t mmu, void *ctx, void *buf)
+{
+ volatile struct lpte *pt;
+ struct dump_context *dctx;
+ struct lpte *pbuf;
+ int bufidx;
+ u_long count, ptex, ptex_end;
+
+ dctx = (struct dump_context *)ctx;
+ pbuf = (struct lpte *)buf;
+ bufidx = 0;
+ ptex = dctx->ptex;
+ ptex_end = ptex + dctx->blksz / sizeof(struct lpte);
+ ptex_end = MIN(ptex_end, dctx->ptex_end);
+ count = ptex_end - ptex;
+
+ for (pt = moea64_pteg_table + ptex; ptex < ptex_end; ptex++, pt++)
+ pbuf[bufidx++] = *pt;
+
+ dctx->ptex = ptex;
+ return (count * sizeof(struct lpte));
+}

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 20, 5:23 PM (8 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31853592
Default Alt Text
D21643.id62051.diff (1 KB)

Event Timeline