Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef __LINUX_GFP_H
     13 #define __LINUX_GFP_H
     14 
     15 #include <linux/mmzone.h>
     16 #include <linux/stddef.h>
     17 #include <linux/linkage.h>
     18 
     19 struct vm_area_struct;
     20 
     21 #define __GFP_DMA ((__force gfp_t)0x01u)
     22 #define __GFP_HIGHMEM ((__force gfp_t)0x02u)
     23 #if BITS_PER_LONG < 64
     24 #define __GFP_DMA32 ((__force gfp_t)0x00)
     25 #else
     26 #define __GFP_DMA32 ((__force gfp_t)0x04)
     27 #endif
     28 
     29 #define __GFP_WAIT ((__force gfp_t)0x10u)
     30 #define __GFP_HIGH ((__force gfp_t)0x20u)
     31 #define __GFP_IO ((__force gfp_t)0x40u)
     32 #define __GFP_FS ((__force gfp_t)0x80u)
     33 #define __GFP_COLD ((__force gfp_t)0x100u)
     34 #define __GFP_NOWARN ((__force gfp_t)0x200u)
     35 #define __GFP_REPEAT ((__force gfp_t)0x400u)
     36 #define __GFP_NOFAIL ((__force gfp_t)0x800u)
     37 #define __GFP_NORETRY ((__force gfp_t)0x1000u)
     38 #define __GFP_NO_GROW ((__force gfp_t)0x2000u)
     39 #define __GFP_COMP ((__force gfp_t)0x4000u)
     40 #define __GFP_ZERO ((__force gfp_t)0x8000u)
     41 #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u)
     42 #define __GFP_HARDWALL ((__force gfp_t)0x20000u)
     43 
     44 #define __GFP_BITS_SHIFT 20
     45 #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
     46 
     47 #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|   __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|   __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP|   __GFP_NOMEMALLOC|__GFP_HARDWALL)
     48 
     49 #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
     50 
     51 #define GFP_ATOMIC (__GFP_HIGH)
     52 #define GFP_NOIO (__GFP_WAIT)
     53 #define GFP_NOFS (__GFP_WAIT | __GFP_IO)
     54 #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
     55 #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
     56 #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL |   __GFP_HIGHMEM)
     57 
     58 #define GFP_DMA __GFP_DMA
     59 
     60 #define GFP_DMA32 __GFP_DMA32
     61 
     62 #ifndef HAVE_ARCH_FREE_PAGE
     63 #endif
     64 
     65 #define alloc_pages(gfp_mask, order)   alloc_pages_node(numa_node_id(), gfp_mask, order)
     66 #define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
     67 #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
     68 
     69 #define __get_free_page(gfp_mask)   __get_free_pages((gfp_mask),0)
     70 
     71 #define __get_dma_pages(gfp_mask, order)   __get_free_pages((gfp_mask) | GFP_DMA,(order))
     72 
     73 #define __free_page(page) __free_pages((page), 0)
     74 #define free_page(addr) free_pages((addr),0)
     75 
     76 #endif
     77