#endif
#define MEMO_FREE_UNUSED /* Free unused pages immediately */
#define MEMO_WARN 1
-#define MEMO_GFP_FLAGS GFP_ATOMIC
#define MEMO_CLUSTER_SHIFT (PAGE_SHIFT+MEMO_PAGE_ORDER)
#define MEMO_CLUSTER_SIZE (1UL << MEMO_CLUSTER_SHIFT)
#define MEMO_CLUSTER_MASK (MEMO_CLUSTER_SIZE-1)
}
-/*
- * With pci bus iommu support, we use a default pool of unmapped memory
- * for memory we donnot need to DMA from/to and one pool per pcidev for
- * memory accessed by the PCI chip. `mp0' is the default not DMAable pool.
- */
-
-static m_addr_t ___mp0_getp(m_pool_s *mp)
-{
- m_addr_t m = __get_free_pages(MEMO_GFP_FLAGS, MEMO_PAGE_ORDER);
- if (m)
- ++mp->nump;
- return m;
-}
-
-static void ___mp0_freep(m_pool_s *mp, m_addr_t m)
-{
- free_pages(m, MEMO_PAGE_ORDER);
- --mp->nump;
-}
-
-static m_pool_s mp0 = {NULL, ___mp0_getp, ___mp0_freep};
+static m_pool_s *mempools;
/*
* DMAable pools.
static inline m_pool_s *___get_dma_pool(m_bush_t bush)
{
m_pool_s *mp;
- for (mp = mp0.next; mp && mp->bush != bush; mp = mp->next);
+ for (mp = mempools; mp && mp->bush != bush; mp = mp->next);
return mp;
}
mp->bush = bush;
mp->getp = ___dma_getp;
mp->freep = ___dma_freep;
- mp->next = mp0.next;
- mp0.next = mp;
+ mp->next = mempools;
+ mempools = mp;
}
return mp;
}
static void ___del_dma_pool(m_pool_s *p)
{
- struct m_pool **pp = &mp0.next;
+ struct m_pool **pp = &mempools;
while (*pp && *pp != p)
pp = &(*pp)->next;