Assorted cleanups I've discovered over time

This commit is contained in:
Jasmine Iwanek
2022-07-21 20:50:05 -04:00
parent 8d0e6289c7
commit c430fbe84c
6 changed files with 806 additions and 806 deletions

View File

@@ -1458,7 +1458,7 @@ acpi_apm_out(uint16_t port, uint8_t val, void *p)
dev->apm->cmd = val; dev->apm->cmd = val;
if (dev->vendor == VEN_INTEL) if (dev->vendor == VEN_INTEL)
dev->regs.glbsts |= 0x20; dev->regs.glbsts |= 0x20;
acpi_raise_smi(dev, dev->apm->do_smi); acpi_raise_smi(dev, dev->apm->do_smi);
} else } else
dev->apm->stat = val; dev->apm->stat = val;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -51,21 +51,21 @@
enum { enum {
CPUID_FPU = (1 << 0), CPUID_FPU = (1 << 0),
CPUID_VME = (1 << 1), CPUID_VME = (1 << 1),
CPUID_PSE = (1 << 3), CPUID_PSE = (1 << 3),
CPUID_TSC = (1 << 4), CPUID_TSC = (1 << 4),
CPUID_MSR = (1 << 5), CPUID_MSR = (1 << 5),
CPUID_PAE = (1 << 6), CPUID_PAE = (1 << 6),
CPUID_MCE = (1 << 7), CPUID_MCE = (1 << 7),
CPUID_CMPXCHG8B = (1 << 8), CPUID_CMPXCHG8B = (1 << 8),
CPUID_AMDSEP = (1 << 10), CPUID_AMDSEP = (1 << 10),
CPUID_SEP = (1 << 11), CPUID_SEP = (1 << 11),
CPUID_MTRR = (1 << 12), CPUID_MTRR = (1 << 12),
CPUID_MCA = (1 << 14), CPUID_MCA = (1 << 14),
CPUID_CMOV = (1 << 15), CPUID_CMOV = (1 << 15),
CPUID_MMX = (1 << 23), CPUID_MMX = (1 << 23),
CPUID_FXSR = (1 << 24) CPUID_FXSR = (1 << 24)
}; };
/*Addition flags returned by CPUID function 0x80000001*/ /*Addition flags returned by CPUID function 0x80000001*/

View File

@@ -39,7 +39,7 @@
# define EMU_NVRPS2_H # define EMU_NVRPS2_H
extern const device_t ps2_nvr_device; extern const device_t ps2_nvr_device;
extern const device_t ps2_nvr_55ls_device; extern const device_t ps2_nvr_55ls_device;

View File

@@ -10,44 +10,44 @@
#define VAR_ROW1_MA14 (1 << 3) #define VAR_ROW1_MA14 (1 << 3)
#define ADDRESS_REMAP_FUNC(nr) \ #define ADDRESS_REMAP_FUNC(nr) \
static uint32_t address_remap_func_ ## nr(ega_t *ega, uint32_t in_addr) \ static uint32_t address_remap_func_ ## nr(ega_t *ega, uint32_t in_addr) \
{ \ { \
uint32_t out_addr; \ uint32_t out_addr; \
\ \
switch (nr & VAR_MODE_MASK) \ switch (nr & VAR_MODE_MASK) \
{ \ { \
case VAR_BYTE_MODE: \ case VAR_BYTE_MODE: \
out_addr = in_addr; \ out_addr = in_addr; \
break; \ break; \
\ \
case VAR_WORD_MODE_MA13: \ case VAR_WORD_MODE_MA13: \
out_addr = ((in_addr << 1) & 0x1fff8) | \ out_addr = ((in_addr << 1) & 0x1fff8) | \
((in_addr >> 13) & 0x4) | \ ((in_addr >> 13) & 0x4) | \
(in_addr & ~0x1ffff); \ (in_addr & ~0x1ffff); \
break; \ break; \
\ \
case VAR_WORD_MODE_MA15: \ case VAR_WORD_MODE_MA15: \
out_addr = ((in_addr << 1) & 0x1fff8) | \ out_addr = ((in_addr << 1) & 0x1fff8) | \
((in_addr >> 15) & 0x4) | \ ((in_addr >> 15) & 0x4) | \
(in_addr & ~0x1ffff); \ (in_addr & ~0x1ffff); \
break; \ break; \
\ \
case VAR_DWORD_MODE: \ case VAR_DWORD_MODE: \
out_addr = ((in_addr << 2) & 0x3fff0) | \ out_addr = ((in_addr << 2) & 0x3fff0) | \
((in_addr >> 14) & 0xc) | \ ((in_addr >> 14) & 0xc) | \
(in_addr & ~0x3ffff); \ (in_addr & ~0x3ffff); \
break; \ break; \
} \ } \
\ \
if (nr & VAR_ROW0_MA13) \ if (nr & VAR_ROW0_MA13) \
out_addr = (out_addr & ~0x8000) | \ out_addr = (out_addr & ~0x8000) | \
((ega->sc & 1) ? 0x8000 : 0); \ ((ega->sc & 1) ? 0x8000 : 0); \
if (nr & VAR_ROW1_MA14) \ if (nr & VAR_ROW1_MA14) \
out_addr = (out_addr & ~0x10000) | \ out_addr = (out_addr & ~0x10000) | \
((ega->sc & 2) ? 0x10000 : 0); \ ((ega->sc & 2) ? 0x10000 : 0); \
\ \
return out_addr; \ return out_addr; \
} }
ADDRESS_REMAP_FUNC(0) ADDRESS_REMAP_FUNC(0)
ADDRESS_REMAP_FUNC(1) ADDRESS_REMAP_FUNC(1)
@@ -68,22 +68,22 @@ ADDRESS_REMAP_FUNC(15)
static uint32_t (*address_remap_funcs[16])(ega_t *ega, uint32_t in_addr) = static uint32_t (*address_remap_funcs[16])(ega_t *ega, uint32_t in_addr) =
{ {
address_remap_func_0, address_remap_func_0,
address_remap_func_1, address_remap_func_1,
address_remap_func_2, address_remap_func_2,
address_remap_func_3, address_remap_func_3,
address_remap_func_4, address_remap_func_4,
address_remap_func_5, address_remap_func_5,
address_remap_func_6, address_remap_func_6,
address_remap_func_7, address_remap_func_7,
address_remap_func_8, address_remap_func_8,
address_remap_func_9, address_remap_func_9,
address_remap_func_10, address_remap_func_10,
address_remap_func_11, address_remap_func_11,
address_remap_func_12, address_remap_func_12,
address_remap_func_13, address_remap_func_13,
address_remap_func_14, address_remap_func_14,
address_remap_func_15 address_remap_func_15
}; };
void ega_recalc_remap_func(ega_t *ega) void ega_recalc_remap_func(ega_t *ega)

View File

@@ -61,7 +61,6 @@ static uint16_t smi_irq_mask = 0x0000,
static void (*update_pending)(void); static void (*update_pending)(void);
#ifdef ENABLE_PIC_LOG #ifdef ENABLE_PIC_LOG
int pic_do_log = ENABLE_PIC_LOG; int pic_do_log = ENABLE_PIC_LOG;