aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-03 06:12:22 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-03 06:12:22 +0000
commit7c664e2f4efbf27b1fa47ceed0c4e661fb681238 (patch)
tree1d8ab4470a80f39467579cc8061806e7e28d3376 /monitor.c
parent0cfe11ea5fff6a62dd28f116ec5d227d682b08e7 (diff)
SH4: Added monitoring of TLBs
This patch might interest some people trying (as I try to do) to fix some tlbs for kernel/user space data sharing. Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6670 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index 35f014d211..513eca9daa 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1245,6 +1245,35 @@ static void mem_info(void)
}
#endif
+#if defined(TARGET_SH4)
+
+static void print_tlb(int idx, tlb_t *tlb)
+{
+ term_printf(" tlb%i:\t"
+ "asid=%hhu vpn=%x\tppn=%x\tsz=%hhu size=%u\t"
+ "v=%hhu shared=%hhu cached=%hhu prot=%hhu "
+ "dirty=%hhu writethrough=%hhu\n",
+ idx,
+ tlb->asid, tlb->vpn, tlb->ppn, tlb->sz, tlb->size,
+ tlb->v, tlb->sh, tlb->c, tlb->pr,
+ tlb->d, tlb->wt);
+}
+
+static void tlb_info(void)
+{
+ CPUState *env = mon_get_cpu();
+ int i;
+
+ term_printf ("ITLB:\n");
+ for (i = 0 ; i < ITLB_SIZE ; i++)
+ print_tlb (i, &env->itlb[i]);
+ term_printf ("UTLB:\n");
+ for (i = 0 ; i < UTLB_SIZE ; i++)
+ print_tlb (i, &env->utlb[i]);
+}
+
+#endif
+
static void do_info_kqemu(void)
{
#ifdef USE_KQEMU
@@ -1556,9 +1585,11 @@ static const term_cmd_t info_cmds[] = {
"", "show i8259 (PIC) state", },
{ "pci", "", pci_info,
"", "show PCI info", },
-#if defined(TARGET_I386)
+#if defined(TARGET_I386) || defined(TARGET_SH4)
{ "tlb", "", tlb_info,
"", "show virtual to physical memory mappings", },
+#endif
+#if defined(TARGET_I386)
{ "mem", "", mem_info,
"", "show the active virtual memory mappings", },
{ "hpet", "", do_info_hpet,