| 1 | #ifndef __LINUX_GFP_H
|
|---|
| 2 | #define __LINUX_GFP_H
|
|---|
| 3 |
|
|---|
| 4 | #include <asm/page.h>
|
|---|
| 5 | #include <linux/export.h>
|
|---|
| 6 | #include <linux/mm.h>
|
|---|
| 7 | #include <linux/types.h>
|
|---|
| 8 |
|
|---|
| 9 | /* Plain integer GFP bitmasks. Do not use this directly. */
|
|---|
| 10 | #define ___GFP_DMA 0x01u
|
|---|
| 11 | #define ___GFP_HIGHMEM 0x02u
|
|---|
| 12 | #define ___GFP_DMA32 0x04u
|
|---|
| 13 | #define ___GFP_MOVABLE 0x08u
|
|---|
| 14 | #define ___GFP_RECLAIMABLE 0x10u
|
|---|
| 15 | #define ___GFP_HIGH 0x20u
|
|---|
| 16 | #define ___GFP_IO 0x40u
|
|---|
| 17 | #define ___GFP_FS 0x80u
|
|---|
| 18 | #define ___GFP_ZERO 0x100u
|
|---|
| 19 | #define ___GFP_ATOMIC 0x200u
|
|---|
| 20 | #define ___GFP_DIRECT_RECLAIM 0x400u
|
|---|
| 21 | #define ___GFP_KSWAPD_RECLAIM 0x800u
|
|---|
| 22 | #define ___GFP_WRITE 0x1000u
|
|---|
| 23 | #define ___GFP_NOWARN 0x2000u
|
|---|
| 24 | #define ___GFP_RETRY_MAYFAIL 0x4000u
|
|---|
| 25 | #define ___GFP_NOFAIL 0x8000u
|
|---|
| 26 | #define ___GFP_NORETRY 0x10000u
|
|---|
| 27 | #define ___GFP_MEMALLOC 0x20000u
|
|---|
| 28 | #define ___GFP_COMP 0x40000u
|
|---|
| 29 | #define ___GFP_NOMEMALLOC 0x80000u
|
|---|
| 30 | #define ___GFP_HARDWALL 0x100000u
|
|---|
| 31 | #define ___GFP_THISNODE 0x200000u
|
|---|
| 32 | #define ___GFP_ACCOUNT 0x400000u
|
|---|
| 33 | #ifdef CONFIG_LOCKDEP
|
|---|
| 34 | #define ___GFP_NOLOCKDEP 0x800000u
|
|---|
| 35 | #else
|
|---|
| 36 | #define ___GFP_NOLOCKDEP 0
|
|---|
| 37 | #endif
|
|---|
| 38 | /* If the above are modified, __GFP_BITS_SHIFT may need updating */
|
|---|
| 39 |
|
|---|
| 40 | #define __GFP_NORETRY 0
|
|---|
| 41 | #define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN)
|
|---|
| 42 | #define __GFP_COMP ((__force gfp_t)___GFP_COMP)
|
|---|
| 43 | #define __GFP_ZERO ((__force gfp_t)___GFP_ZERO)
|
|---|
| 44 | #define __GFP_RETRY_MAYFAIL ((__force gfp_t)___GFP_RETRY_MAYFAIL)
|
|---|
| 45 | #define GFP_DMA32 0 /* driver must check for 32-bit address */
|
|---|
| 46 |
|
|---|
| 47 | /*
|
|---|
| 48 | * Physical address zone modifiers (see linux/mmzone.h - low four bits)
|
|---|
| 49 | *
|
|---|
| 50 | * Do not put any conditional on these. If necessary modify the definitions
|
|---|
| 51 | * without the underscores and use them consistently. The definitions here may
|
|---|
| 52 | * be used in bit comparisons.
|
|---|
| 53 | */
|
|---|
| 54 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA)
|
|---|
| 55 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM)
|
|---|
| 56 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32)
|
|---|
| 57 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */
|
|---|
| 58 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE)
|
|---|
| 59 | void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
|
|---|
| 60 | void free_pages_exact(void *virt, size_t size);
|
|---|
| 61 |
|
|---|
| 62 | #endif /* __LINUX_GFP_H */
|
|---|
| 63 |
|
|---|