2 * Copyright (c) 2009 The Regents of the University of California
3 * Barret Rhoden <brho@cs.berkeley.edu>
4 * See LICENSE for details.
6 * Memory management flags, currently used in mmap().
7 * Try to keep these in sync with /usr/include/bits/mman.h so we have less
8 * issues with userspace.
13 /* Memory protection states (what you're allowed to do */
15 #define PROT_WRITE 0x2
18 #define PROT_GROWSDOWN 0x01000000
19 #define PROT_GROWSUP 0x02000000
20 // TODO NOT A REAL STATE
21 #define PROT_UNMAP 0x100
23 /* mmap flags, only anonymous is supported now, feel free to pass others */
24 #define MAP_SHARED 0x01
25 #define MAP_PRIVATE 0x02
26 #define MAP_FIXED 0x10
27 #define MAP_ANONYMOUS 0x20
28 #define MAP_ANON MAP_ANONYMOUS
30 #define MAP_GROWSDOWN 0x00100
31 #define MAP_DENYWRITE 0x00800
32 #define MAP_EXECUTABLE 0x01000
33 #define MAP_LOCKED 0x02000
34 #define MAP_NORESERVE 0x04000
35 #define MAP_POPULATE 0x08000
36 #define MAP_NONBLOCK 0x10000
37 #define MAP_STACK 0x20000
39 #define MAP_FAILED ((void*)-1)
41 /* Other mmap flags, which we probably won't support