target/i386/bpt_helper: Perform comparison pass with qemu

Keep formatting and code in sync where applicable
This commit is contained in:
Lioncash 2018-03-12 13:28:49 -04:00
parent fc7eaf7f77
commit e9d9ed5eaa
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -138,16 +138,16 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7)
for (i = 0; i < DR7_MAX_BP; i++) { for (i = 0; i < DR7_MAX_BP; i++) {
if ((mod & (2 << i * 2)) && !hw_breakpoint_enabled(new_dr7, i)) { if ((mod & (2 << i * 2)) && !hw_breakpoint_enabled(new_dr7, i)) {
iobpt |= hw_breakpoint_insert(env, i); hw_breakpoint_remove(env, i);
} else if (hw_breakpoint_type(new_dr7, i) == DR7_TYPE_IO_RW
&& hw_breakpoint_enabled(new_dr7, i)) {
iobpt |= HF_IOBPT_MASK;
} }
} }
env->dr[7] = new_dr7; env->dr[7] = new_dr7;
for (i = 0; i < DR7_MAX_BP; i++) { for (i = 0; i < DR7_MAX_BP; i++) {
if (mod & (2 << i * 2) && hw_breakpoint_enabled(new_dr7, i)) { if (mod & (2 << i * 2) && hw_breakpoint_enabled(new_dr7, i)) {
hw_breakpoint_insert(env, i); iobpt |= hw_breakpoint_insert(env, i);
} else if (hw_breakpoint_type(new_dr7, i) == DR7_TYPE_IO_RW
&& hw_breakpoint_enabled(new_dr7, i)) {
iobpt |= HF_IOBPT_MASK;
} }
} }
} else { } else {
@ -270,7 +270,7 @@ void helper_set_dr(CPUX86State *env, int reg, target_ulong t0)
} }
/* fallthru */ /* fallthru */
case 6: case 6:
env->dr[6] = t0; env->dr[6] = t0 | DR6_FIXED_1;
return; return;
case 5: case 5:
if (env->cr[4] & CR4_DE_MASK) { if (env->cr[4] & CR4_DE_MASK) {