Fix x87_op being outside of structure, fixing crashes in ARM64 NDR

This commit is contained in:
Cacodemon345
2025-04-26 23:17:32 +06:00
parent fc06963a1a
commit e076c1051d
6 changed files with 20 additions and 3 deletions

View File

@@ -113,8 +113,6 @@ uint8_t is_smint = 0;
uint16_t io_port = 0x0000;
uint32_t io_val = 0x00000000;
uint32_t x87_op = 0x00000000;
int opcode_has_modrm[256] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/

View File

@@ -416,6 +416,8 @@ typedef struct {
uint16_t eflags;
uint32_t _smbase;
uint32_t x87_op;
} cpu_state_t;
#define in_smm cpu_state._in_smm
@@ -784,7 +786,7 @@ typedef struct {
uint32_t smhr;
} cyrix_t;
extern uint32_t x87_op;
#define x87_op cpu_state.x87_op
extern uint32_t addr64;
extern uint32_t addr64_2;

View File

@@ -272,6 +272,7 @@ reset_common(int hard)
msr.fcr = (1 << 8) | (1 << 9) | (1 << 12) | (1 << 16) | (1 << 19) | (1 << 21);
msw = 0;
new_ne = 0;
x87_op = 0;
ccr0 = ccr1 = ccr2 = ccr3 = ccr4 = ccr5 = ccr6 = ccr7 = 0;
ccr4 = 0x85;