David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ART_LIBARTBASE_BASE_MMAN_H_ |
| 18 | #define ART_LIBARTBASE_BASE_MMAN_H_ |
| 19 | |
| 20 | #ifdef _WIN32 |
| 21 | |
| 22 | // There is no sys/mman.h in mingw. |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 23 | |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 24 | #define PROT_READ 0x1 |
| 25 | #define PROT_WRITE 0x2 |
| 26 | #define PROT_EXEC 0x4 |
| 27 | #define PROT_NONE 0x0 |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 28 | |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 29 | #define MAP_SHARED 0x01 |
| 30 | #define MAP_PRIVATE 0x02 |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 31 | |
David Sehr | 9d9227a | 2018-12-19 12:32:50 -0800 | [diff] [blame] | 32 | #define MAP_FAILED ((void*) -1) |
| 33 | #define MAP_FIXED 0x10 |
| 34 | #define MAP_ANONYMOUS 0x20 |
David Sehr | 10db8fe | 2018-07-18 11:01:20 -0700 | [diff] [blame] | 35 | |
| 36 | #else |
| 37 | |
| 38 | #include <sys/mman.h> |
| 39 | |
| 40 | #endif |
| 41 | |
| 42 | |
| 43 | #endif // ART_LIBARTBASE_BASE_MMAN_H_ |