386_common: Optimize I/O permission checking for word and dword operations (based on qemu)
This commit is contained in:
@@ -804,7 +804,7 @@ opINSB_a16(uint32_t fetchdat)
|
||||
addr64 = 0x00000000;
|
||||
|
||||
SEG_CHECK_WRITE(&cpu_state.seg_es);
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX, 1);
|
||||
CHECK_WRITE(&cpu_state.seg_es, DI, DI);
|
||||
high_page = 0;
|
||||
do_mmut_wb(es, DI, &addr64);
|
||||
@@ -830,7 +830,7 @@ opINSB_a32(uint32_t fetchdat)
|
||||
addr64 = 0x00000000;
|
||||
|
||||
SEG_CHECK_WRITE(&cpu_state.seg_es);
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX, 1);
|
||||
high_page = 0;
|
||||
CHECK_WRITE(&cpu_state.seg_es, EDI, EDI);
|
||||
do_mmut_wb(es, EDI, &addr64);
|
||||
@@ -857,8 +857,7 @@ opINSW_a16(uint32_t fetchdat)
|
||||
addr64a[0] = addr64a[1] = 0x00000000;
|
||||
|
||||
SEG_CHECK_WRITE(&cpu_state.seg_es);
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX, 2);
|
||||
CHECK_WRITE(&cpu_state.seg_es, DI, DI + 1UL);
|
||||
high_page = 0;
|
||||
do_mmut_ww(es, DI, addr64a);
|
||||
@@ -885,8 +884,7 @@ opINSW_a32(uint32_t fetchdat)
|
||||
|
||||
SEG_CHECK_WRITE(&cpu_state.seg_es);
|
||||
high_page = 0;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX, 2);
|
||||
CHECK_WRITE(&cpu_state.seg_es, EDI, EDI + 1UL);
|
||||
do_mmut_ww(es, EDI, addr64a);
|
||||
if (cpu_state.abrt)
|
||||
@@ -912,10 +910,7 @@ opINSL_a16(uint32_t fetchdat)
|
||||
addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000;
|
||||
|
||||
SEG_CHECK_WRITE(&cpu_state.seg_es);
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX + 2);
|
||||
check_io_perm(DX + 3);
|
||||
check_io_perm(DX, 4);
|
||||
CHECK_WRITE(&cpu_state.seg_es, DI, DI + 3UL);
|
||||
high_page = 0;
|
||||
do_mmut_wl(es, DI, addr64a);
|
||||
@@ -941,10 +936,7 @@ opINSL_a32(uint32_t fetchdat)
|
||||
addr64a[0] = addr64a[1] = addr64a[2] = addr64a[3] = 0x00000000;
|
||||
|
||||
SEG_CHECK_WRITE(&cpu_state.seg_es);
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX + 2);
|
||||
check_io_perm(DX + 3);
|
||||
check_io_perm(DX, 4);
|
||||
CHECK_WRITE(&cpu_state.seg_es, EDI, EDI + 3UL);
|
||||
high_page = 0;
|
||||
do_mmut_wl(es, DI, addr64a);
|
||||
@@ -973,7 +965,7 @@ opOUTSB_a16(uint32_t fetchdat)
|
||||
temp = readmemb(cpu_state.ea_seg->base, SI);
|
||||
if (cpu_state.abrt)
|
||||
return 1;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX, 1);
|
||||
if (cpu_state.flags & D_FLAG)
|
||||
SI--;
|
||||
else
|
||||
@@ -993,7 +985,7 @@ opOUTSB_a32(uint32_t fetchdat)
|
||||
temp = readmemb(cpu_state.ea_seg->base, ESI);
|
||||
if (cpu_state.abrt)
|
||||
return 1;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX, 1);
|
||||
if (cpu_state.flags & D_FLAG)
|
||||
ESI--;
|
||||
else
|
||||
@@ -1014,8 +1006,7 @@ opOUTSW_a16(uint32_t fetchdat)
|
||||
temp = readmemw(cpu_state.ea_seg->base, SI);
|
||||
if (cpu_state.abrt)
|
||||
return 1;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX, 2);
|
||||
if (cpu_state.flags & D_FLAG)
|
||||
SI -= 2;
|
||||
else
|
||||
@@ -1035,8 +1026,7 @@ opOUTSW_a32(uint32_t fetchdat)
|
||||
temp = readmemw(cpu_state.ea_seg->base, ESI);
|
||||
if (cpu_state.abrt)
|
||||
return 1;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX, 2);
|
||||
if (cpu_state.flags & D_FLAG)
|
||||
ESI -= 2;
|
||||
else
|
||||
@@ -1057,10 +1047,7 @@ opOUTSL_a16(uint32_t fetchdat)
|
||||
temp = readmeml(cpu_state.ea_seg->base, SI);
|
||||
if (cpu_state.abrt)
|
||||
return 1;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX + 2);
|
||||
check_io_perm(DX + 3);
|
||||
check_io_perm(DX, 4);
|
||||
if (cpu_state.flags & D_FLAG)
|
||||
SI -= 4;
|
||||
else
|
||||
@@ -1080,10 +1067,7 @@ opOUTSL_a32(uint32_t fetchdat)
|
||||
temp = readmeml(cpu_state.ea_seg->base, ESI);
|
||||
if (cpu_state.abrt)
|
||||
return 1;
|
||||
check_io_perm(DX);
|
||||
check_io_perm(DX + 1);
|
||||
check_io_perm(DX + 2);
|
||||
check_io_perm(DX + 3);
|
||||
check_io_perm(DX, 4);
|
||||
if (cpu_state.flags & D_FLAG)
|
||||
ESI -= 4;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user