X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fpci.c;h=e7927b7d2de5e27d5bb7cede3f43bac211f45df0;hb=858d2c8b868730326ef499d916590fdbae4da223;hp=19eb21da7b6cc7b8299d17859107ca17f607366a;hpb=deff53b15d1de2f4371a22fb99fafd145de51ce4;p=palacios.git 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);