Added prefetch timing approximation for 286/386 CPUs, with configurable memory timing.

This commit is contained in:
SarahW 2016-11-25 21:32:02 +00:00
commit 1b73963997
33 changed files with 1139 additions and 261 deletions

View file

@ -4,6 +4,7 @@ static int opIN_AL_imm(uint32_t fetchdat)
check_io_perm(port);
AL = inb(port);
CLOCK_CYCLES(12);
PREFETCH_RUN(12, 2, -1, 1,0,0,0, 0);
return 0;
}
static int opIN_AX_imm(uint32_t fetchdat)
@ -13,6 +14,7 @@ static int opIN_AX_imm(uint32_t fetchdat)
check_io_perm(port + 1);
AX = inw(port);
CLOCK_CYCLES(12);
PREFETCH_RUN(12, 2, -1, 1,0,0,0, 0);
return 0;
}
static int opIN_EAX_imm(uint32_t fetchdat)
@ -24,6 +26,7 @@ static int opIN_EAX_imm(uint32_t fetchdat)
check_io_perm(port + 3);
EAX = inl(port);
CLOCK_CYCLES(12);
PREFETCH_RUN(12, 2, -1, 0,1,0,0, 0);
return 0;
}
@ -33,6 +36,7 @@ static int opOUT_AL_imm(uint32_t fetchdat)
check_io_perm(port);
outb(port, AL);
CLOCK_CYCLES(10);
PREFETCH_RUN(10, 2, -1, 0,0,1,0, 0);
if (port == 0x64)
return x86_was_reset;
return 0;
@ -44,6 +48,7 @@ static int opOUT_AX_imm(uint32_t fetchdat)
check_io_perm(port + 1);
outw(port, AX);
CLOCK_CYCLES(10);
PREFETCH_RUN(10, 2, -1, 0,0,1,0, 0);
return 0;
}
static int opOUT_EAX_imm(uint32_t fetchdat)
@ -55,6 +60,7 @@ static int opOUT_EAX_imm(uint32_t fetchdat)
check_io_perm(port + 3);
outl(port, EAX);
CLOCK_CYCLES(10);
PREFETCH_RUN(10, 2, -1, 0,0,0,1, 0);
return 0;
}
@ -63,6 +69,7 @@ static int opIN_AL_DX(uint32_t fetchdat)
check_io_perm(DX);
AL = inb(DX);
CLOCK_CYCLES(12);
PREFETCH_RUN(12, 1, -1, 1,0,0,0, 0);
return 0;
}
static int opIN_AX_DX(uint32_t fetchdat)
@ -71,6 +78,7 @@ static int opIN_AX_DX(uint32_t fetchdat)
check_io_perm(DX + 1);
AX = inw(DX);
CLOCK_CYCLES(12);
PREFETCH_RUN(12, 1, -1, 1,0,0,0, 0);
return 0;
}
static int opIN_EAX_DX(uint32_t fetchdat)
@ -81,6 +89,7 @@ static int opIN_EAX_DX(uint32_t fetchdat)
check_io_perm(DX + 3);
EAX = inl(DX);
CLOCK_CYCLES(12);
PREFETCH_RUN(12, 1, -1, 0,1,0,0, 0);
return 0;
}
@ -89,6 +98,7 @@ static int opOUT_AL_DX(uint32_t fetchdat)
check_io_perm(DX);
outb(DX, AL);
CLOCK_CYCLES(11);
PREFETCH_RUN(11, 1, -1, 0,0,1,0, 0);
return x86_was_reset;
}
static int opOUT_AX_DX(uint32_t fetchdat)
@ -98,6 +108,7 @@ static int opOUT_AX_DX(uint32_t fetchdat)
check_io_perm(DX + 1);
outw(DX, AX);
CLOCK_CYCLES(11);
PREFETCH_RUN(11, 1, -1, 0,0,1,0, 0);
return 0;
}
static int opOUT_EAX_DX(uint32_t fetchdat)
@ -107,6 +118,6 @@ static int opOUT_EAX_DX(uint32_t fetchdat)
check_io_perm(DX + 2);
check_io_perm(DX + 3);
outl(DX, EAX);
CLOCK_CYCLES(11);
PREFETCH_RUN(11, 1, -1, 0,0,0,1, 0);
return 0;
}