dde_ipxe: use io ports via device interface

Issue #1487
devel
Alexander Boettcher 8 years ago committed by Christian Helmuth
parent b7ca04ddde
commit e8854cd998

@ -374,9 +374,9 @@ extern "C" dde_addr_t dde_dma_get_physaddr(void *virt) {
** I/O port **
**************/
static Genode::Io_port_connection *_io_port;
static Genode::Io_port_session_client *_io_port;
extern "C" void dde_request_io(dde_addr_t base, dde_size_t size)
extern "C" void dde_request_io(dde_uint8_t virt_bar_ioport)
{
using namespace Genode;
@ -385,7 +385,10 @@ extern "C" void dde_request_io(dde_addr_t base, dde_size_t size)
sleep_forever();
}
_io_port = new (env()->heap()) Io_port_connection(base, size);
Pci::Device_client device(pci_drv()._cap);
Io_port_session_capability cap = device.io_port(virt_bar_ioport);
_io_port = new (env()->heap()) Io_port_session_client(cap);
}

@ -95,7 +95,7 @@ void dde_pci_writel(int, dde_uint32_t);
** I/O port **
**************/
void dde_request_io(dde_addr_t, dde_size_t);
void dde_request_io(dde_uint8_t);
dde_uint8_t dde_inb(dde_addr_t);
dde_uint16_t dde_inw(dde_addr_t);

@ -59,6 +59,7 @@ static void pci_read_bases(struct pci_device *pci_dev)
{
uint32_t bar;
int reg;
uint8_t virt_bar_ioport = 0;
for (reg = PCI_BASE_ADDRESS_0; reg <= PCI_BASE_ADDRESS_5; reg += 4) {
pci_read_config_dword(pci_dev, reg, &bar);
@ -66,10 +67,9 @@ static void pci_read_bases(struct pci_device *pci_dev)
if (!pci_dev->ioaddr) {
pci_dev->ioaddr = bar & PCI_BASE_ADDRESS_IO_MASK;
dde_addr_t base = bar & PCI_BASE_ADDRESS_IO_MASK;
dde_size_t size = pci_bar_size(pci_dev, reg);
dde_request_io(base, size);
dde_request_io(virt_bar_ioport);
}
virt_bar_ioport ++;
} else {
if (!pci_dev->membase)
pci_dev->membase = bar & PCI_BASE_ADDRESS_MEM_MASK;

Loading…
Cancel
Save