summaryrefslogtreecommitdiffstats
path: root/9/platforms/android-16/arch-mips/usr/include/linux/gfp.h
blob: 0a59fe9184d6fec4e245c8833e1e3c4d80617430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/****************************************************************************
 ****************************************************************************
 ***
 ***   This header was automatically generated from a Linux kernel header
 ***   of the same name, to make information necessary for userspace to
 ***   call into the kernel available to libc.  It contains only constants,
 ***   structures, and macros generated from the original header, and thus,
 ***   contains no copyrightable information.
 ***
 ****************************************************************************
 ****************************************************************************/
#ifndef __LINUX_GFP_H
#define __LINUX_GFP_H

#include <linux/mmzone.h>
#include <linux/stddef.h>
#include <linux/linkage.h>

struct vm_area_struct;

#define __GFP_DMA ((__force gfp_t)0x01u)
#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
#if BITS_PER_LONG < 64
#define __GFP_DMA32 ((__force gfp_t)0x00)  
#else
#define __GFP_DMA32 ((__force gfp_t)0x04)  
#endif

#define __GFP_WAIT ((__force gfp_t)0x10u)  
#define __GFP_HIGH ((__force gfp_t)0x20u)  
#define __GFP_IO ((__force gfp_t)0x40u)  
#define __GFP_FS ((__force gfp_t)0x80u)  
#define __GFP_COLD ((__force gfp_t)0x100u)  
#define __GFP_NOWARN ((__force gfp_t)0x200u)  
#define __GFP_REPEAT ((__force gfp_t)0x400u)  
#define __GFP_NOFAIL ((__force gfp_t)0x800u)  
#define __GFP_NORETRY ((__force gfp_t)0x1000u) 
#define __GFP_NO_GROW ((__force gfp_t)0x2000u) 
#define __GFP_COMP ((__force gfp_t)0x4000u) 
#define __GFP_ZERO ((__force gfp_t)0x8000u) 
#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u)  
#define __GFP_HARDWALL ((__force gfp_t)0x20000u)  

#define __GFP_BITS_SHIFT 20  
#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))

#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)

#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)

#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL |   __GFP_HIGHMEM)

#define GFP_DMA __GFP_DMA

#define GFP_DMA32 __GFP_DMA32

#ifndef HAVE_ARCH_FREE_PAGE
#endif

#define alloc_pages(gfp_mask, order)   alloc_pages_node(numa_node_id(), gfp_mask, order)
#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)

#define __get_free_page(gfp_mask)   __get_free_pages((gfp_mask),0)

#define __get_dma_pages(gfp_mask, order)   __get_free_pages((gfp_mask) | GFP_DMA,(order))

#define __free_page(page) __free_pages((page), 0)
#define free_page(addr) free_pages((addr),0)

#endif