From 7eda3929f43a687dbb00ed733eef227abdc72e85 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sat, 3 Aug 2024 18:48:30 -0400 Subject: [PATCH] Updates and fixes --- src/acpi.c | 9 +++++++-- src/chipset/intel_815ep.c | 1 + src/cpu/cpu.h | 7 +++---- src/cpu/x86seg.c | 4 ++-- src/device/pci_bridge.c | 2 +- src/machine/machine_table.c | 10 +++++----- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/acpi.c b/src/acpi.c index 9453c970c..405b5449e 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -136,8 +136,7 @@ acpi_timer_overflow(void *priv) dev->regs.pmsts |= TMROF_STS; /* - if (dev->regs.pmen & 1) /* Timer Overflow Interrupt Enable */ - { + if (dev->regs.pmen & 1) { /* Timer Overflow Interrupt Enable */ acpi_log("ACPI: Overflow detected. Provoking an %s\n", sci_en ? "SCI" : "SMI"); if (sci_en) /* Trigger an SCI or SMI depending on the status of the SCI_EN register */ @@ -2162,6 +2161,9 @@ acpi_reg_read_common(int size, uint16_t addr, void *priv) case VEN_INTEL: ret = acpi_reg_read_intel(size, addr, priv); break; + case VEN_INTEL_ICH2: + ret = acpi_reg_read_intel_ich2(size, addr, priv); + break; case VEN_SMC: ret = acpi_reg_read_smc(size, addr, priv); break; @@ -2209,6 +2211,9 @@ acpi_reg_write_common(int size, uint16_t addr, uint8_t val, void *priv) case VEN_INTEL: acpi_reg_write_intel(size, addr, val, priv); break; + case VEN_INTEL_ICH2: + acpi_reg_write_intel_ich2(size, addr, val, priv); + break; case VEN_SMC: acpi_reg_write_smc(size, addr, val, priv); break; diff --git a/src/chipset/intel_815ep.c b/src/chipset/intel_815ep.c index 17c22d27a..e9b03dd14 100644 --- a/src/chipset/intel_815ep.c +++ b/src/chipset/intel_815ep.c @@ -129,6 +129,7 @@ intel_lsmm_segment_recalc(intel_815ep_t *dev, uint8_t val) case 3: smram_enable(dev->lsmm_segment, 0x000a0000, 0x000a0000, 0x20000, 0, 1); break; + default: break; } diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 6917b7a7e..91575cdac 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -307,10 +307,9 @@ typedef struct { uint64_t mtrr_fix16k_8000; /* 0x00000258 */ uint64_t mtrr_fix16k_a000; /* 0x00000259 */ uint64_t mtrr_fix4k[8]; /* 0x00000268 - 0x0000026f */ - uint64_t mtrr_deftype; /* 0x000002ff */ /* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's */ - uint64_t pat; /* 0x00000277 - Pentium II Deschutes and later */ + uint64_t pat; /* 0x00000277 - Pentium II Deschutes and later */ /* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's that are also on the VIA Cyrix III */ @@ -323,7 +322,7 @@ typedef struct { uint64_t ecx19d; /* 0x0000019d */ /* Pentium Pro, Pentium II Klamath, and Pentium II Deschutes MSR's */ - uint64_t mca_ctl[5]; /* 0x00000400, 0x00000404, 0x00000408, 0x0000040c, 0x00000410 */ + uint64_t mca_ctl[5]; /* 0x00000400, 0x00000404, 0x00000408, 0x0000040c, 0x00000410 - Machine Check Architecture */ uint64_t ecx570; /* 0x00000570 */ /* Other/Unclassified MSRs */ @@ -420,7 +419,7 @@ typedef struct { #define in_smm cpu_state._in_smm #define smi_line cpu_state._smi_line -#define smbase cpu_state._smbase +#define smbase cpu_state._smbase /*The cpu_state.flags below must match in both cpu_cur_status and block->status for a block to be valid*/ diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index 61e9e558a..d4a874c50 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -1808,8 +1808,8 @@ pmodeiret(int is32) { uint16_t newss; uint16_t seg = 0; - uint16_t segdat[4]; - uint16_t segdat2[4]; + uint16_t segdat[4] = { 0 }; + uint16_t segdat2[4] = { 0 }; uint16_t segs[4]; uint32_t tempflags; uint32_t flagmask; diff --git a/src/device/pci_bridge.c b/src/device/pci_bridge.c index c05e0783b..338be8cb3 100644 --- a/src/device/pci_bridge.c +++ b/src/device/pci_bridge.c @@ -154,7 +154,7 @@ pci_bridge_write(int func, int addr, uint8_t val, void *priv) val &= 0x01; else if (AGP_BRIDGE_ALI(dev->local)) val &= 0x01; - else if (PCI_BRIDGE_INTEL_ICH2) + else if (dev->local == PCI_BRIDGE_INTEL_ICH2) val &= 0x01; else val &= 0x03; diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 6863dcfca..08abb2f41 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -15723,7 +15723,7 @@ const machine_t machines[] = { .gpio = 0, .device = NULL, .fdc_device = NULL, - .sio_device = NULL, + .sio_device = &it8702_device, .vid_device = NULL, .snd_device = NULL, .net_device = NULL @@ -15761,7 +15761,7 @@ const machine_t machines[] = { .gpio = 0, .device = NULL, .fdc_device = NULL, - .sio_device = NULL, + .sio_device = &w83627hf_device, .vid_device = NULL, .snd_device = NULL, .net_device = NULL @@ -15800,7 +15800,7 @@ const machine_t machines[] = { .gpio = 0, .device = NULL, .fdc_device = NULL, - .sio_device = NULL, + .sio_device = &nsc366_device, .vid_device = NULL, .snd_device = NULL, .net_device = NULL @@ -15838,7 +15838,7 @@ const machine_t machines[] = { .gpio = 0, .device = NULL, .fdc_device = NULL, - .sio_device = NULL, + .sio_device = &nsc366_device, .vid_device = NULL, .snd_device = NULL, .net_device = NULL @@ -15876,7 +15876,7 @@ const machine_t machines[] = { .gpio = 0, .device = NULL, .fdc_device = NULL, - .sio_device = NULL, + .sio_device = &nsc366_device, .vid_device = NULL, .snd_device = NULL, .net_device = NULL