Fixed SYSENTER, SYSEXIT, SYSCALL, and SYSRET;

SYSCALL and SYSRET are now perfectly in line with AMD's specification;
Improvements to the API call to gracefully stop the emulator.
This commit is contained in:
OBattler
2020-11-16 17:47:05 +01:00
parent e1a19a308e
commit 1d4988221f
6 changed files with 59 additions and 34 deletions

View File

@@ -16,7 +16,11 @@
static int
opSYSCALL(uint32_t fetchdat)
{
int ret = syscall(fetchdat);
int ret;
ILLEGAL_ON(!(amd_efer & 0x0000000000000001));
ret = syscall(fetchdat);
if (ret <= 1) {
CLOCK_CYCLES(20);
@@ -32,7 +36,11 @@ opSYSCALL(uint32_t fetchdat)
static int
opSYSRET(uint32_t fetchdat)
{
int ret = sysret(fetchdat);
int ret;
ILLEGAL_ON(!(amd_efer & 0x0000000000000001));
ret = sysret(fetchdat);
if (ret <= 1) {
CLOCK_CYCLES(20);