1
2
3
4 package joeq.Scheduler;
5
6 import joeq.Assembler.x86.x86Constants;
7 import joeq.Class.jq_DontAlign;
8 import joeq.Memory.CodeAddress;
9 import joeq.Memory.StackAddress;
10
11
12
13
14
15 public class jq_x86RegisterState extends jq_RegisterState implements x86Constants, jq_DontAlign {
16
17
18
19
20
21 int ContextFlags;
22
23 int Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
24
25 int ControlWord, StatusWord, TagWord, ErrorOffset, ErrorSelector, DataOffset, DataSelector;
26 long fp0_L; short fp0_H;
27 long fp1_L; short fp1_H;
28 long fp2_L; short fp2_H;
29 long fp3_L; short fp3_H;
30 long fp4_L; short fp4_H;
31 long fp5_L; short fp5_H;
32 long fp6_L; short fp6_H;
33 long fp7_L; short fp7_H;
34 int Cr0NpxState;
35
36 int SegGs, SegFs, SegEs, SegDs;
37
38 int Edi, Esi, Ebx, Edx, Ecx, Eax;
39
40 StackAddress Ebp;
41 CodeAddress Eip;
42 int SegCs, EFlags;
43 StackAddress Esp;
44 int SegSs;
45
46 public static final int EFLAGS_CARRY = 0x00000001;
47 public static final int EFLAGS_PARITY = 0x00000004;
48 public static final int EFLAGS_AUXCARRY = 0x00000010;
49 public static final int EFLAGS_ZERO = 0x00000040;
50 public static final int EFLAGS_SIGN = 0x00000080;
51 public static final int EFLAGS_TRAP = 0x00000100;
52 public static final int EFLAGS_INTERRUPT = 0x00000200;
53 public static final int EFLAGS_DIRECTION = 0x00000400;
54 public static final int EFLAGS_OVERFLOW = 0x00000800;
55 public static final int EFLAGS_NESTEDTASK = 0x00004000;
56
57 public static final int EFLAGS_IOPRIV_MASK = 0x00003000;
58 public static final int EFLAGS_IOPRIV_SHIFT = 12;
59
60 public jq_x86RegisterState() {
61 ControlWord = 0x027f;
62 StatusWord = 0x4000;
63 TagWord = 0xffff;
64 }
65
66 public StackAddress getEbp() {
67 return Ebp;
68 }
69
70 public StackAddress getEsp() {
71 return Esp;
72 }
73
74 public CodeAddress getEip() {
75 return Eip;
76 }
77
78 public void setEbp(StackAddress a) {
79 Ebp = a;
80 }
81
82 public void setEip(CodeAddress a) {
83 Eip = a;
84 }
85
86 public void setEsp(StackAddress a) {
87 Esp = a;
88 }
89
90 public void setControlWord(int x) {
91 ControlWord = x;
92 }
93
94 public void setStatusWord(int x) {
95 StatusWord = x;
96 }
97
98 public void setTagWord(int x) {
99 TagWord = x;
100 }
101
102 public void setContextFlags(int x) {
103 ContextFlags = x;
104 }
105
106 static {
107 initFactory();
108 }
109
110 public static void initFactory() {
111
112
113 if (factory == null) {
114 factory = new Factory() {
115 public jq_RegisterState create() {
116 return new jq_x86RegisterState();
117 }
118 };
119 }
120 }
121
122 }