kernel: some boottime sanitychecks
[minix.git] / include / sys / mman.h
blob28484d3c32e1e9fc3665b103fa390ac4cd78f6c4
1 #ifndef _SYS_MMAN_H_
2 #define _SYS_MMAN_H_
4 #include <sys/featuretest.h>
6 #include <machine/ansi.h>
7 #include <minix/type.h>
9 #ifdef _BSD_SIZE_T_
10 typedef _BSD_SIZE_T_ size_t;
11 #undef _BSD_SIZE_T_
12 #endif
14 #include <sys/ansi.h>
16 #ifndef mode_t
17 typedef __mode_t mode_t;
18 #define mode_t __mode_t
19 #endif
21 #ifndef off_t
22 typedef __off_t off_t; /* file offset */
23 #define off_t __off_t
24 #endif
28 * Protections are chosen from these bits, or-ed together
30 #define PROT_NONE 0x00 /* no permissions */
31 #define PROT_READ 0x01 /* pages can be read */
32 #define PROT_WRITE 0x02 /* pages can be written */
33 #define PROT_EXEC 0x04 /* pages can be executed */
36 * Flags contain sharing type and options.
37 * Sharing types; choose one.
39 #ifndef __minix
40 #define MAP_SHARED 0x0001 /* share changes */
41 #endif
42 #define MAP_PRIVATE 0x0002 /* changes are private */
45 * Mapping type
47 #define MAP_ANON 0x0004 /* anonymous memory */
50 * Minix specific flags.
52 #define MAP_PREALLOC 0x0008 /* not on-demand */
53 #define MAP_CONTIG 0x0010 /* contiguous in physical memory */
54 #define MAP_LOWER16M 0x0020 /* physically below 16MB */
55 #define MAP_ALIGN64K 0x0040 /* physically aligned at 64kB */
56 #define MAP_LOWER1M 0x0080 /* physically below 16MB */
57 #define MAP_ALIGNMENT_64KB MAP_ALIGN64K
59 #define MAP_FIXED 0x0200 /* require mapping to happen at hint */
60 #define MAP_THIRDPARTY 0x0400 /* perform on behalf of any process */
61 #define MAP_UNINITIALIZED 0x0800 /* do not clear memory */
64 * Error indicator returned by mmap(2)
66 #define MAP_FAILED ((void *) -1) /* mmap() failed */
68 #include <sys/cdefs.h>
70 __BEGIN_DECLS
71 #ifndef __minix
72 void * mmap(void *, size_t, int, int, int, off_t);
73 int munmap(void *, size_t);
74 #else
75 void * minix_mmap(void *, size_t, int, int, int, off_t);
76 void * minix_mmap_for(endpoint_t, void *, size_t, int, int, int, off_t);
77 int minix_munmap(void *, size_t);
78 void * vm_remap(int d, int s, void *da, void *sa, size_t si);
79 void * vm_remap_ro(int d, int s, void *da, void *sa, size_t si);
80 int vm_unmap(int endpt, void *addr);
81 unsigned long vm_getphys(int endpt, void *addr);
82 u8_t vm_getrefcount(int endpt, void *addr);
83 #endif /* __minix */
84 __END_DECLS
86 #endif /* !_SYS_MMAN_H_ */