From: Jack Lange Date: Mon, 16 Mar 2009 21:42:41 +0000 (-0500) Subject: updated device number in pci X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=858d2c8b868730326ef499d916590fdbae4da223 updated device number in pci --- diff --git a/palacios/src/devices/pci.c b/palacios/src/devices/pci.c index 19eb21d..e7927b7 100644 --- a/palacios/src/devices/pci.c +++ b/palacios/src/devices/pci.c @@ -125,7 +125,7 @@ static int get_free_dev_num(struct pci_bus * bus) { // availability for (j = 0; j < 8; j++) { if (!(bus->dev_map[i] & (0x1 << j))) { - return i * 8 + j; + return ((i * 8) + j) * 8; } } } @@ -135,7 +135,7 @@ static int get_free_dev_num(struct pci_bus * bus) { } static void allocate_dev_num(struct pci_bus * bus, int dev_num) { - int major = dev_num / 8; + int major = (dev_num / 8) / 8; int minor = dev_num % 8; bus->dev_map[major] |= (0x1 << minor);