@@ -81,23 +81,23 @@ static bx_address last_read_address = (bx_address)-1; /* for RMW cycles */
8181 bx_cpu.sregs [BX_SEG_REG_SS].cache .u .segment .limit = 0xffff ;
8282 bx_cpu.sregs [BX_SEG_REG_SS].cache .u .segment .limit_scaled = 0xffffffff ;
8383
84- bx_cpu.gen_reg [BX_64BIT_REG_RAX].dword . erx = 0 ;
85- bx_cpu.gen_reg [BX_64BIT_REG_RBX].dword . erx = 0 ;
86- bx_cpu.gen_reg [BX_64BIT_REG_RCX].dword . erx = 0 ;
87- bx_cpu.gen_reg [BX_64BIT_REG_RDX].dword . erx = 0 ;
88- bx_cpu.gen_reg [BX_64BIT_REG_RSP].dword . erx = 0 ;
89- bx_cpu.gen_reg [BX_64BIT_REG_RBP].dword . erx = 0 ;
90- bx_cpu.gen_reg [BX_64BIT_REG_RSI].dword . erx = 0 ;
91- bx_cpu.gen_reg [BX_64BIT_REG_RDI].dword . erx = 0 ;
92- bx_cpu.gen_reg [BX_64BIT_REG_R8]. dword . erx = 0 ;
93- bx_cpu.gen_reg [BX_64BIT_REG_R9]. dword . erx = 0 ;
94- bx_cpu.gen_reg [BX_64BIT_REG_R10].dword . erx = 0 ;
95- bx_cpu.gen_reg [BX_64BIT_REG_R11].dword . erx = 0 ;
96- bx_cpu.gen_reg [BX_64BIT_REG_R12].dword . erx = 0 ;
97- bx_cpu.gen_reg [BX_64BIT_REG_R13].dword . erx = 0 ;
98- bx_cpu.gen_reg [BX_64BIT_REG_R14].dword . erx = 0 ;
99- bx_cpu.gen_reg [BX_64BIT_REG_R15].dword . erx = 0 ;
100- bx_cpu.gen_reg [BX_64BIT_REG_RIP].dword . erx = 0 ;
84+ bx_cpu.gen_reg [BX_64BIT_REG_RAX].rrx = 0 ;
85+ bx_cpu.gen_reg [BX_64BIT_REG_RBX].rrx = 0 ;
86+ bx_cpu.gen_reg [BX_64BIT_REG_RCX].rrx = 0 ;
87+ bx_cpu.gen_reg [BX_64BIT_REG_RDX].rrx = 0 ;
88+ bx_cpu.gen_reg [BX_64BIT_REG_RSP].rrx = 0 ;
89+ bx_cpu.gen_reg [BX_64BIT_REG_RBP].rrx = 0 ;
90+ bx_cpu.gen_reg [BX_64BIT_REG_RSI].rrx = 0 ;
91+ bx_cpu.gen_reg [BX_64BIT_REG_RDI].rrx = 0 ;
92+ bx_cpu.gen_reg [BX_64BIT_REG_R8 ]. rrx = 0 ;
93+ bx_cpu.gen_reg [BX_64BIT_REG_R9 ]. rrx = 0 ;
94+ bx_cpu.gen_reg [BX_64BIT_REG_R10].rrx = 0 ;
95+ bx_cpu.gen_reg [BX_64BIT_REG_R11].rrx = 0 ;
96+ bx_cpu.gen_reg [BX_64BIT_REG_R12].rrx = 0 ;
97+ bx_cpu.gen_reg [BX_64BIT_REG_R13].rrx = 0 ;
98+ bx_cpu.gen_reg [BX_64BIT_REG_R14].rrx = 0 ;
99+ bx_cpu.gen_reg [BX_64BIT_REG_R15].rrx = 0 ;
100+ bx_cpu.gen_reg [BX_64BIT_REG_RIP].rrx = 0 ;
101101 bx_cpu.efer .set_LMA (1 ); /* Hack. The old version we use have doesn't support set_EFER */
102102 bx_cpu.SetCR0 (0x80000101 ); // Enter protected mode
103103 return bx_cpu.cpu_mode == BX_MODE_LONG_64
@@ -119,7 +119,7 @@ static bx_address last_read_address = (bx_address)-1; /* for RMW cycles */
119119 minReadAddress = minAddr;
120120 minWriteAddress = minWriteMaxExecAddr;
121121 if ((theErrorAcorn = setjmp (anx64->jmp_buf_env )) != 0 ) {
122- anx64->gen_reg [BX_64BIT_REG_RIP].dword . erx = anx64->prev_rip ;
122+ anx64->gen_reg [BX_64BIT_REG_RIP].rrx = anx64->prev_rip ;
123123 return theErrorAcorn;
124124 }
125125
@@ -151,7 +151,7 @@ static bx_address last_read_address = (bx_address)-1; /* for RMW cycles */
151151 minReadAddress = minAddr;
152152 minWriteAddress = minWriteMaxExecAddr;
153153 if ((theErrorAcorn = setjmp (anx64->jmp_buf_env )) != 0 ) {
154- anx64->gen_reg [BX_64BIT_REG_RIP].dword . erx = anx64->prev_rip ;
154+ anx64->gen_reg [BX_64BIT_REG_RIP].rrx = anx64->prev_rip ;
155155 return theErrorAcorn;
156156 }
157157
@@ -168,7 +168,7 @@ static bx_address last_read_address = (bx_address)-1; /* for RMW cycles */
168168 bx_pc_system.kill_bochs_request = 0 ;
169169 anx64->cpu_loop (0 /* = "run forever" until exception or interupt */ );
170170 if (anx64->stop_reason != STOP_NO_REASON) {
171- anx64->gen_reg [BX_64BIT_REG_RIP].dword . erx = anx64->prev_rip ;
171+ anx64->gen_reg [BX_64BIT_REG_RIP].rrx = anx64->prev_rip ;
172172 if (theErrorAcorn == NoError)
173173 theErrorAcorn = ExecutionError;
174174 return theErrorAcorn;
@@ -247,6 +247,29 @@ static bx_address last_read_address = (bx_address)-1; /* for RMW cycles */
247247 *len = blidx;
248248 return bochs_log;
249249 }
250+ void
251+ storeIntegerRegisterStateOfinto (void *cpu, long long *registerState)
252+ {
253+ /* N.B. RAX=0,RCX=1,RDX=2,RBX=3,RSP=4,RBP=5,RSI=6,RDI=7 */
254+ registerState[0 ] = bx_cpu.gen_reg [BX_64BIT_REG_RAX].rrx ;
255+ registerState[1 ] = bx_cpu.gen_reg [BX_64BIT_REG_RBX].rrx ;
256+ registerState[2 ] = bx_cpu.gen_reg [BX_64BIT_REG_RCX].rrx ;
257+ registerState[3 ] = bx_cpu.gen_reg [BX_64BIT_REG_RDX].rrx ;
258+ registerState[4 ] = bx_cpu.gen_reg [BX_64BIT_REG_RSP].rrx ;
259+ registerState[5 ] = bx_cpu.gen_reg [BX_64BIT_REG_RBP].rrx ;
260+ registerState[6 ] = bx_cpu.gen_reg [BX_64BIT_REG_RDI].rrx ;
261+ registerState[7 ] = bx_cpu.gen_reg [BX_64BIT_REG_RSI].rrx ;
262+ registerState[8 ] = bx_cpu.gen_reg [BX_64BIT_REG_R8 ].rrx ;
263+ registerState[9 ] = bx_cpu.gen_reg [BX_64BIT_REG_R9 ].rrx ;
264+ registerState[10 ] = bx_cpu.gen_reg [BX_64BIT_REG_R10].rrx ;
265+ registerState[11 ] = bx_cpu.gen_reg [BX_64BIT_REG_R11].rrx ;
266+ registerState[12 ] = bx_cpu.gen_reg [BX_64BIT_REG_R12].rrx ;
267+ registerState[13 ] = bx_cpu.gen_reg [BX_64BIT_REG_R13].rrx ;
268+ registerState[14 ] = bx_cpu.gen_reg [BX_64BIT_REG_R14].rrx ;
269+ registerState[15 ] = bx_cpu.gen_reg [BX_64BIT_REG_R15].rrx ;
270+ registerState[16 ] = bx_cpu.gen_reg [BX_64BIT_REG_RIP].rrx ;
271+ registerState[17 ] = bx_cpu.eflags ;
272+ }
250273} // extern "C"
251274
252275/*
0 commit comments