diff options
author | Stefan Weil <weil@mail.berlios.de> | 2011-04-30 22:40:09 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-05-05 16:05:42 +0300 |
commit | 3fd3d0b463d5c959c3a08a665eed1a2cd4e1d3da (patch) | |
tree | fcaa2f558316b084fb81638de85ccba276999fd4 /hw | |
parent | e5e23ab83bfaf07c1a5bf685b1adf311e2326b74 (diff) | |
download | qemu-3fd3d0b463d5c959c3a08a665eed1a2cd4e1d3da.zip qemu-3fd3d0b463d5c959c3a08a665eed1a2cd4e1d3da.tar.gz qemu-3fd3d0b463d5c959c3a08a665eed1a2cd4e1d3da.tar.bz2 |
eepro100: Support byte/word writes to port address
port is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/eepro100.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/hw/eepro100.c b/hw/eepro100.c index 6315fe8..37d6fb7 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -1317,8 +1317,9 @@ static uint32_t eepro100_read_port(EEPRO100State * s) return 0; } -static void eepro100_write_port(EEPRO100State * s, uint32_t val) +static void eepro100_write_port(EEPRO100State *s) { + uint32_t val = e100_read_reg4(s, SCBPort); uint32_t address = (val & ~PORT_SELECTION_MASK); uint8_t selection = (val & PORT_SELECTION_MASK); switch (selection) { @@ -1472,7 +1473,15 @@ static void eepro100_write1(EEPRO100State * s, uint32_t addr, uint8_t val) } eepro100_interrupt(s, 0); break; + case SCBPort: + case SCBPort + 1: + case SCBPort + 2: + TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val)); + break; case SCBPort + 3: + TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val)); + eepro100_write_port(s); + break; case SCBFlow: /* does not exist on 82557 */ case SCBFlow + 1: case SCBFlow + 2: @@ -1507,6 +1516,13 @@ static void eepro100_write2(EEPRO100State * s, uint32_t addr, uint16_t val) eepro100_write_command(s, val); eepro100_write1(s, SCBIntmask, val >> 8); break; + case SCBPort: + TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(addr), val)); + break; + case SCBPort + 2: + TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(addr), val)); + eepro100_write_port(s); + break; case SCBeeprom: TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(addr), val)); eepro100_write_eeprom(s->eeprom, val); @@ -1529,7 +1545,7 @@ static void eepro100_write4(EEPRO100State * s, uint32_t addr, uint32_t val) break; case SCBPort: TRACE(OTHER, logout("addr=%s val=0x%08x\n", regname(addr), val)); - eepro100_write_port(s, val); + eepro100_write_port(s); break; case SCBCtrlMDI: eepro100_write_mdi(s, val); |