From c8a57ae33c55a1fc9fa029a3e49bd7fdf069d68a Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Wed, 9 Jun 2004 22:05:28 +0000 Subject: [PATCH] - pci_ide: fixed pointer to device object if SMF = 1 - pcivga: fixed memory access flag in PCI command register --- bochs/iodev/pci_ide.cc | 12 +++++++----- bochs/iodev/pci_ide.h | 4 +++- bochs/iodev/pcivga.cc | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bochs/iodev/pci_ide.cc b/bochs/iodev/pci_ide.cc index 058135433..ec9303f61 100644 --- a/bochs/iodev/pci_ide.cc +++ b/bochs/iodev/pci_ide.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pci_ide.cc,v 1.1 2004-06-09 20:55:58 vruppert Exp $ +// $Id: pci_ide.cc,v 1.2 2004-06-09 22:05:28 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -274,10 +274,10 @@ bx_pci_ide_c::pci_write(Bit8u address, Bit32u value, unsigned io_len) } if (bmide_change) { if (BX_PIDE_THIS s.bmide_addr > 0) { - DEV_unregister_ioread_handler_range(this, read_handler, + DEV_unregister_ioread_handler_range(BX_PIDE_THIS_PTR, read_handler, BX_PIDE_THIS s.bmide_addr, BX_PIDE_THIS s.bmide_addr + 0x0F, 7); - DEV_unregister_iowrite_handler_range(this, write_handler, + DEV_unregister_iowrite_handler_range(BX_PIDE_THIS_PTR, write_handler, BX_PIDE_THIS s.bmide_addr, BX_PIDE_THIS s.bmide_addr + 0x0F, 7); } @@ -285,10 +285,12 @@ bx_pci_ide_c::pci_write(Bit8u address, Bit32u value, unsigned io_len) (BX_PIDE_THIS s.pci_conf[0x21] << 8); BX_INFO(("new BM-IDE address: 0x%04x", BX_PIDE_THIS s.bmide_addr)); if (BX_PIDE_THIS s.bmide_addr > 0) { - DEV_register_ioread_handler_range(this, read_handler, BX_PIDE_THIS s.bmide_addr, + DEV_register_ioread_handler_range(BX_PIDE_THIS_PTR, read_handler, + BX_PIDE_THIS s.bmide_addr, BX_PIDE_THIS s.bmide_addr + 0x0F, "PIIX3 PCI IDE controller", 7); - DEV_register_iowrite_handler_range(this, write_handler, BX_PIDE_THIS s.bmide_addr, + DEV_register_iowrite_handler_range(BX_PIDE_THIS_PTR, write_handler, + BX_PIDE_THIS s.bmide_addr, BX_PIDE_THIS s.bmide_addr + 0x0F, "PIIX3 PCI IDE controller", 7); } diff --git a/bochs/iodev/pci_ide.h b/bochs/iodev/pci_ide.h index 5bd468c57..7950e8714 100644 --- a/bochs/iodev/pci_ide.h +++ b/bochs/iodev/pci_ide.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pci_ide.h,v 1.1 2004-06-09 20:55:58 vruppert Exp $ +// $Id: pci_ide.h,v 1.2 2004-06-09 22:05:28 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2004 MandrakeSoft S.A. @@ -28,9 +28,11 @@ #if BX_USE_PIDE_SMF # define BX_PIDE_SMF static # define BX_PIDE_THIS thePciIdeController-> +# define BX_PIDE_THIS_PTR thePciIdeController #else # define BX_PIDE_SMF # define BX_PIDE_THIS this-> +# define BX_PIDE_THIS_PTR this #endif diff --git a/bochs/iodev/pcivga.cc b/bochs/iodev/pcivga.cc index 71c9ccc83..2dbd3bb23 100644 --- a/bochs/iodev/pcivga.cc +++ b/bochs/iodev/pcivga.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pcivga.cc,v 1.2 2003-01-23 19:31:28 vruppert Exp $ +// $Id: pcivga.cc,v 1.3 2004-06-09 22:05:28 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002,2003 Mike Nordell @@ -109,7 +109,7 @@ bx_pcivga_c::reset(unsigned type) unsigned addr; unsigned char val; } reset_vals[] = { - { 0x04, 0x01 }, { 0x05, 0x00 }, // command_io + { 0x04, 0x03 }, { 0x05, 0x00 }, // command_io + command_mem { 0x06, 0x00 }, { 0x07, 0x02 } // status_devsel_medium }; for (unsigned i = 0; i < sizeof(reset_vals) / sizeof(*reset_vals); ++i) {