vserver 1.9.5.x5
[linux-2.6.git] / arch / ia64 / hp / common / sba_iommu.c
index e50c446..272291d 100644 (file)
 #include <linux/seq_file.h>
 #include <linux/acpi.h>
 #include <linux/efi.h>
+#include <linux/nodemask.h>
+#include <linux/bitops.h>         /* hweight64() */
 
 #include <asm/delay.h>         /* ia64_get_itc() */
 #include <asm/io.h>
 #include <asm/page.h>          /* PAGE_OFFSET */
 #include <asm/dma.h>
 #include <asm/system.h>                /* wmb() */
-#include <asm/bitops.h>                /* hweight64() */
 
 #include <asm/acpi-ext.h>
 
@@ -478,7 +479,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted)
         * purges IOTLB entries in power-of-two sizes, so we also
         * allocate IOVA space in power-of-two sizes.
         */
-       bits_wanted = 1UL << get_iovp_order(bits_wanted << PAGE_SHIFT);
+       bits_wanted = 1UL << get_iovp_order(bits_wanted << iovp_shift);
 
        if (likely(bits_wanted == 1)) {
                unsigned int bitshiftcnt;
@@ -687,7 +688,7 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size)
        unsigned long m;
 
        /* Round up to power-of-two size: see AR2305 note above */
-       bits_not_wanted = 1UL << get_iovp_order(bits_not_wanted << PAGE_SHIFT);
+       bits_not_wanted = 1UL << get_iovp_order(bits_not_wanted << iovp_shift);
        for (; bits_not_wanted > 0 ; res_ptr++) {
                
                if (unlikely(bits_not_wanted > BITS_PER_LONG)) {
@@ -1556,7 +1557,7 @@ ioc_iova_init(struct ioc *ioc)
        ** We program the next pdir index after we stop w/ a key for
        ** the GART code to handshake on.
        */
-       while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
+       for_each_pci_dev(device)        
                agp_found |= pci_find_capability(device, PCI_CAP_ID_AGP);
 
        if (agp_found && reserve_sba_gart) {