Skip to contentSkip to conversation

[7179] x86: Enhanced dump of segment registers (Jan Kiszka)

Qemu-devel Anthony Liguori 1 participant 1 message Apr 18, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 7179

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7179
Author:   aliguori
Date:     2009-04-18 15:36:11 +0000 (Sat, 18 Apr 2009)

Log Message:
-----------
x86: Enhanced dump of segment registers (Jan Kiszka)

Parse the descriptor flags that segment registers refer to and show the result in a more human-friendly format. The output of info registers eg. then looks like this:

[...]
ES =007b 00000000 ffffffff 00cff300 DPL=3 DS [-WA]
CS =0060 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
SS =0068 00000000 ffffffff 00c09300 DPL=0 DS [-WA]
DS =007b 00000000 ffffffff 00cff300 DPL=3 DS [-WA]
FS =0000 00000000 00000000 00000000
GS =0033 b7dd66c0 ffffffff b7dff3dd DPL=3 DS [-WA]
LDT=0000 00000000 00000000 00008200 DPL=0 LDT TR =0080 c06da700 0000206b 00008900 DPL=0 TSS32-avl [...]

Changes in this version:
- refactoring so that only a single helper is used for dumping the segment descriptor cache
- tiny typo fixed that broke 64-bit segment type names

Modified Paths:
--------------

    trunk/target-i386/cpu.h
    trunk/target-i386/helper.c

Modified: trunk/target-i386/cpu.h
===================================================================

target-i386/cpu.h +2 -1
@@ -82,9 +82,10 @@
 #define DESC_AVL_MASK   (1 << 20)
 #define DESC_P_MASK     (1 << 15)
 #define DESC_DPL_SHIFT  13
-#define DESC_DPL_MASK   (1 << DESC_DPL_SHIFT)
+#define DESC_DPL_MASK   (3 << DESC_DPL_SHIFT)
 #define DESC_S_MASK     (1 << 12)
 #define DESC_TYPE_SHIFT 8
+#define DESC_TYPE_MASK  (15 << DESC_TYPE_SHIFT)
 #define DESC_A_MASK     (1 << 8)
 
 #define DESC_CS_MASK    (1 << 11) /* 1=code segment 0=data segment */

Modified: trunk/target-i386/helper.c
===================================================================

target-i386/helper.c +62 -38

120 lines not on this page · raw message