Implement GFP_DMA32 flag in the LinuxKPI.

Define all FreeBSD native GFP bits as GFP_NATIVE_MASK.

Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-02-17 13:31:11 +00:00
parent 43b00aeb88
commit 269d8c86e9
2 changed files with 6 additions and 3 deletions

View File

@ -129,8 +129,10 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
if (dev->dma_mask)
high = *dev->dma_mask;
else
else if (flag & GFP_DMA32)
high = BUS_SPACE_MAXADDR_32BIT;
else
high = BUS_SPACE_MAXADDR;
align = PAGE_SIZE << get_order(size);
mem = (void *)kmem_alloc_contig(kmem_arena, size, flag, 0, high, align,
0, VM_MEMATTR_DEFAULT);

View File

@ -53,7 +53,7 @@
#define __GFP_IO 0
#define __GFP_NO_KSWAPD 0
#define __GFP_WAIT M_WAITOK
#define __GFP_DMA32 0
#define __GFP_DMA32 (1U << 24) /* LinuxKPI only */
#define GFP_NOWAIT M_NOWAIT
#define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE)
@ -63,8 +63,9 @@
#define GFP_HIGHUSER_MOVABLE M_WAITOK
#define GFP_IOFS M_NOWAIT
#define GFP_NOIO M_NOWAIT
#define GFP_DMA32 0
#define GFP_DMA32 __GFP_DMA32
#define GFP_TEMPORARY M_NOWAIT
#define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO)
static inline void *
page_address(struct page *page)