183d14054SPaolo Bonzini /*
283d14054SPaolo Bonzini * QEMU IDE disk and CD/DVD-ROM Emulator
383d14054SPaolo Bonzini *
483d14054SPaolo Bonzini * Copyright (c) 2003 Fabrice Bellard
583d14054SPaolo Bonzini * Copyright (c) 2006 Openedhand Ltd.
683d14054SPaolo Bonzini *
783d14054SPaolo Bonzini * Permission is hereby granted, free of charge, to any person obtaining a copy
883d14054SPaolo Bonzini * of this software and associated documentation files (the "Software"), to deal
983d14054SPaolo Bonzini * in the Software without restriction, including without limitation the rights
1083d14054SPaolo Bonzini * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1183d14054SPaolo Bonzini * copies of the Software, and to permit persons to whom the Software is
1283d14054SPaolo Bonzini * furnished to do so, subject to the following conditions:
1383d14054SPaolo Bonzini *
1483d14054SPaolo Bonzini * The above copyright notice and this permission notice shall be included in
1583d14054SPaolo Bonzini * all copies or substantial portions of the Software.
1683d14054SPaolo Bonzini *
1783d14054SPaolo Bonzini * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1883d14054SPaolo Bonzini * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1983d14054SPaolo Bonzini * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2083d14054SPaolo Bonzini * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2183d14054SPaolo Bonzini * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2283d14054SPaolo Bonzini * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2383d14054SPaolo Bonzini * THE SOFTWARE.
2483d14054SPaolo Bonzini */
2583d14054SPaolo Bonzini
2683d14054SPaolo Bonzini #include "qemu/osdep.h"
2783d14054SPaolo Bonzini #include "hw/isa/isa.h"
28*0316482eSPhilippe Mathieu-Daudé #include "ide-internal.h"
2983d14054SPaolo Bonzini #include "trace.h"
3083d14054SPaolo Bonzini
ide_init_ioport(IDEBus * bus,ISADevice * dev,int iobase,int iobase2)319405d87bSThomas Huth int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
3283d14054SPaolo Bonzini {
339405d87bSThomas Huth int ret;
349405d87bSThomas Huth
3583d14054SPaolo Bonzini /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA
3683d14054SPaolo Bonzini bridge has been setup properly to always register with ISA. */
379405d87bSThomas Huth ret = isa_register_portio_list(dev, &bus->portio_list,
3883d14054SPaolo Bonzini iobase, ide_portio_list, bus, "ide");
3983d14054SPaolo Bonzini
409405d87bSThomas Huth if (ret == 0 && iobase2) {
419405d87bSThomas Huth ret = isa_register_portio_list(dev, &bus->portio2_list,
4283d14054SPaolo Bonzini iobase2, ide_portio2_list, bus, "ide");
4383d14054SPaolo Bonzini }
449405d87bSThomas Huth
459405d87bSThomas Huth return ret;
4683d14054SPaolo Bonzini }
47