X-Git-Url: http://git.barrelfish.org/?p=barrelfish;a=blobdiff_plain;f=usr%2Fpci%2Fpci.c;h=926bcc44bb93d2b94a928045a71ec31a08c49e33;hp=521833ceb2898bdcd755d93d7d7dda81f5cabcdd;hb=391c2e8bc4f26652121e322b86806c5ff6c2ada7;hpb=eadd9d4c5db33715fce0b121dd1f2b9453d61dfd diff --git a/usr/pci/pci.c b/usr/pci/pci.c index 521833c..926bcc4 100644 --- a/usr/pci/pci.c +++ b/usr/pci/pci.c @@ -33,6 +33,8 @@ #include #include "pci_debug.h" +#include + #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define BAR_PROBE 0xffffffff @@ -162,6 +164,7 @@ static errval_t alloc_device_bar(uint8_t idx, struct device_caps *c = &dev_caps[bus][dev][fun][idx]; errval_t err; + size = ROUND_UP(size, BASE_PAGE_SIZE); // Some BARs are less than 4 KiB // first try with maximally-sized caps (we'll reduce this if it doesn't work) uint8_t bits = log2ceil(size);