Skip to content

Commit

Permalink
And reverted io.c, since the stuff was Pentium-only anyway, so pointl…
Browse files Browse the repository at this point in the history
…ess.
  • Loading branch information
OBattler committed Jan 14, 2024
1 parent 9ce2ce3 commit 540273b
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,60 +279,6 @@ io_handler_interleaved(int set, uint16_t base, int size,
io_handler_common(set, base, size, inb, inw, inl, outb, outw, outl, priv, 2);
}

extern int trap;
/* Set trap for I/O address breakpoints. */
void
io_debug_check_addr(uint16_t addr)
{
int i = 0;
int set_trap = 0;

/* Do nothing on 486+. */
if (is486)
return;

if (!(dr[7] & 0xFF))
return;

if (!(cr4 & 0x8))
return; /* No I/O debug trap. */

for (i = 0; i < 4; i++) {
uint16_t dr_addr = dr[i] & 0xFFFF;
int breakpoint_enabled = !!(dr[7] & (0x3 << (2 * i)));
int len_type_pair = ((dr[7] >> 16) & (0xF << (4 * i))) >> (4 * i);
if (!breakpoint_enabled)
continue;
if ((len_type_pair & 3) != 2)
continue;

switch ((len_type_pair >> 2) & 3)
{
case 0x00:
if (dr_addr == addr) {
set_trap = 1;
dr[6] |= (1 << i);
}
break;
case 0x01:
if ((dr_addr & ~1) == addr || ((dr_addr & ~1) + 1) == (addr + 1)) {
set_trap = 1;
dr[6] |= (1 << i);
}
break;
case 0x03:
dr_addr &= ~3;
if (addr >= dr_addr && addr < (dr_addr + 4)) {
set_trap = 1;
dr[6] |= (1 << i);
}
break;
}
}
if (set_trap)
trap |= 4;
}

uint8_t
inb(uint16_t port)
{
Expand All @@ -344,8 +290,6 @@ inb(uint16_t port)
int qfound = 0;
#endif

io_debug_check_addr(port);

if ((pci_flags & FLAG_CONFIG_IO_ON) && (port >= pci_base) && (port < (pci_base + pci_size))) {
ret = pci_read(port, NULL);
found = 1;
Expand Down Expand Up @@ -406,8 +350,6 @@ outb(uint16_t port, uint8_t val)
int qfound = 0;
#endif

io_debug_check_addr(port);

if ((pci_flags & FLAG_CONFIG_IO_ON) && (port >= pci_base) && (port < (pci_base + pci_size))) {
pci_write(port, val, NULL);
found = 1;
Expand Down Expand Up @@ -460,8 +402,6 @@ inw(uint16_t port)
#endif
uint8_t ret8[2];

io_debug_check_addr(port);

if ((pci_flags & FLAG_CONFIG_IO_ON) && (port >= pci_base) && (port < (pci_base + pci_size))) {
ret = pci_readw(port, NULL);
found = 2;
Expand Down Expand Up @@ -534,8 +474,6 @@ outw(uint16_t port, uint16_t val)
int qfound = 0;
#endif

io_debug_check_addr(port);

if ((pci_flags & FLAG_CONFIG_IO_ON) && (port >= pci_base) && (port < (pci_base + pci_size))) {
pci_writew(port, val, NULL);
found = 2;
Expand Down Expand Up @@ -604,8 +542,6 @@ inl(uint16_t port)
int qfound = 0;
#endif

io_debug_check_addr(port);

if ((pci_flags & FLAG_CONFIG_IO_ON) && (port >= pci_base) && (port < (pci_base + pci_size))) {
ret = pci_readl(port, NULL);
found = 4;
Expand Down Expand Up @@ -710,8 +646,6 @@ outl(uint16_t port, uint32_t val)
#endif
int i = 0;

io_debug_check_addr(port);

if ((pci_flags & FLAG_CONFIG_IO_ON) && (port >= pci_base) && (port < (pci_base + pci_size))) {
pci_writel(port, val, NULL);
found = 4;
Expand Down

0 comments on commit 540273b

Please sign in to comment.