From 38557b33dc5325e3db4a1200fcc28de5559f493b Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 25 May 2024 17:24:43 +0200 Subject: [PATCH 1/2] Removed the VM_FLAG access from DRx access again. --- src/cpu/x86_ops_mov_ctrl.h | 8 ++++---- src/cpu/x86_ops_mov_ctrl_2386.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cpu/x86_ops_mov_ctrl.h b/src/cpu/x86_ops_mov_ctrl.h index 5d6e44e34b..bcfed831b7 100644 --- a/src/cpu/x86_ops_mov_ctrl.h +++ b/src/cpu/x86_ops_mov_ctrl.h @@ -82,7 +82,7 @@ opMOV_r_CRx_a32(uint32_t fetchdat) static int opMOV_r_DRx_a16(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -126,7 +126,7 @@ opMOV_r_DRx_a16(uint32_t fetchdat) static int opMOV_r_DRx_a32(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -286,7 +286,7 @@ opMOV_CRx_r_a32(uint32_t fetchdat) static int opMOV_DRx_r_a16(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -334,7 +334,7 @@ opMOV_DRx_r_a16(uint32_t fetchdat) static int opMOV_DRx_r_a32(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } diff --git a/src/cpu/x86_ops_mov_ctrl_2386.h b/src/cpu/x86_ops_mov_ctrl_2386.h index 6bb00d8dad..cae6c9957b 100644 --- a/src/cpu/x86_ops_mov_ctrl_2386.h +++ b/src/cpu/x86_ops_mov_ctrl_2386.h @@ -82,7 +82,7 @@ opMOV_r_CRx_a32(uint32_t fetchdat) static int opMOV_r_DRx_a16(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -124,7 +124,7 @@ opMOV_r_DRx_a16(uint32_t fetchdat) static int opMOV_r_DRx_a32(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -282,7 +282,7 @@ opMOV_CRx_r_a32(uint32_t fetchdat) static int opMOV_DRx_r_a16(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -325,7 +325,7 @@ opMOV_DRx_r_a16(uint32_t fetchdat) static int opMOV_DRx_r_a32(uint32_t fetchdat) { - if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { + if ((CPL > 0) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } From e61c6205584e4414fc4a64494be5c6f1aab3e6ff Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 25 May 2024 20:12:25 +0200 Subject: [PATCH 2/2] ALi M1543(C): USB IRQ level/edge control. --- src/chipset/ali1543.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chipset/ali1543.c b/src/chipset/ali1543.c index 5598f30fbc..f35ec7590e 100644 --- a/src/chipset/ali1543.c +++ b/src/chipset/ali1543.c @@ -413,6 +413,7 @@ ali1533_write(int func, int addr, uint8_t val, void *priv) case 0x74: /* USB IRQ Routing - we cheat and use MIRQ4 */ dev->pci_conf[addr] = val & 0xdf; /* TODO: MIRQ level/edge control - if bit 4 = 1, it's level */ + pci_set_mirq_level(PCI_MIRQ4, !(val & 0x10)); pci_set_mirq_routing(PCI_MIRQ4, ali1533_irq_routing[val & 0x0f]); break;