1 /*===- WindowsMMap.h - Support library for PGO instrumentation ------------===*\
3 |* The LLVM Compiler Infrastructure
5 |* This file is distributed under the University of Illinois Open Source
6 |* License. See LICENSE.TXT for details.
8 \*===----------------------------------------------------------------------===*/
10 #ifndef PROFILE_INSTRPROFILING_WINDOWS_MMAP_H
11 #define PROFILE_INSTRPROFILING_WINDOWS_MMAP_H
17 #include <sys/types.h>
23 #define PROT_WRITE 0x2
27 #define MAP_SHARED 0x01
28 #define MAP_PRIVATE 0x02
29 #define MAP_ANONYMOUS 0x20
30 #define MAP_ANON MAP_ANONYMOUS
31 #define MAP_FAILED ((void *) -1)
36 #define MS_ASYNC 0x0001 /* return immediately */
37 #define MS_INVALIDATE 0x0002 /* invalidate all cached data */
38 #define MS_SYNC 0x0010 /* msync synchronously */
43 #define LOCK_SH 1 /* shared lock */
44 #define LOCK_EX 2 /* exclusive lock */
45 #define LOCK_NB 4 /* don't block when locking */
46 #define LOCK_UN 8 /* unlock */
48 #ifdef __USE_FILE_OFFSET64
49 # define DWORD_HI(x) (x >> 32)
50 # define DWORD_LO(x) ((x) & 0xffffffff)
52 # define DWORD_HI(x) (0)
53 # define DWORD_LO(x) (x)
56 void *mmap(void *start, size_t length, int prot, int flags, int fd,
59 void munmap(void *addr, size_t length);
61 int msync(void *addr, size_t length, int flags);
63 int flock(int fd, int operation);
67 #endif /* PROFILE_INSTRPROFILING_WINDOWS_MMAP_H */