MFi386: revision 1.658

Add "show sysregs" command to ddb.  On i386, this gives gdt, idt, ldt,
  cr0-4, etc.  Support should be added for other platforms that have a
  different set of registers for system use.
This commit is contained in:
Yoshihiro Takahashi 2008-02-29 05:01:10 +00:00
parent 8a35feb1e2
commit 533b49d0ab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176655

View File

@ -1581,6 +1581,25 @@ DB_SHOW_COMMAND(idt, db_show_idt)
ip++;
}
}
/* Show privileged registers. */
DB_SHOW_COMMAND(sysregs, db_show_sysregs)
{
uint64_t idtr, gdtr;
idtr = ridt();
db_printf("idtr\t0x%08x/%04x\n",
(u_int)(idtr >> 16), (u_int)idtr & 0xffff);
gdtr = rgdt();
db_printf("gdtr\t0x%08x/%04x\n",
(u_int)(gdtr >> 16), (u_int)gdtr & 0xffff);
db_printf("ldtr\t0x%04x\n", rldt());
db_printf("tr\t0x%04x\n", rtr());
db_printf("cr0\t0x%08x\n", rcr0());
db_printf("cr2\t0x%08x\n", rcr2());
db_printf("cr3\t0x%08x\n", rcr3());
db_printf("cr4\t0x%08x\n", rcr4());
}
#endif
void