qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [patch 1/2] qemu: move pci devfn "first free" assignmen


From: Avi Kivity
Subject: Re: [Qemu-devel] [patch 1/2] qemu: move pci devfn "first free" assignment to separate function
Date: Mon, 13 Apr 2009 11:08:33 +0300
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Marcelo Tosatti wrote:
Move pci device address assignment to a separate function.

Index: trunk/hw/pci.c
===================================================================
--- trunk.orig/hw/pci.c
+++ trunk/hw/pci.c
@@ -121,6 +121,16 @@ int pci_bus_num(PCIBus *s)
     return s->bus_num;
 }
+int pci_bus_assign_dev_addr(PCIBus *bus)
+{
+    int devfn;
+
+    for(devfn = bus->devfn_min ; devfn < 256; devfn += 8)
+        if (!bus->devices[devfn])
+                return devfn;
+    return -1;
+}

s/assign/allocate/ or get_free, to avoid confusion with device assignment (and given that you aren't assigning anything).


--
error compiling committee.c: too many arguments to function





reply via email to

[Prev in Thread] Current Thread [Next in Thread]