|
| 1 | +/* |
| 2 | + * File : mman.h |
| 3 | + * This file is part of RT-Thread RTOS |
| 4 | + * COPYRIGHT (C) 2017, RT-Thread Development Team |
| 5 | + * |
| 6 | + * This program is free software; you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU General Public License as published by |
| 8 | + * the Free Software Foundation; either version 2 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU General Public License along |
| 17 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | + * |
| 20 | + * Change Logs: |
| 21 | + * Date Author Notes |
| 22 | + * 2017/11/30 Bernard The first version. |
| 23 | + */ |
| 24 | + |
| 25 | +#ifndef _SYS_MMAN_H |
| 26 | +#define _SYS_MMAN_H |
| 27 | + |
| 28 | +#ifdef __cplusplus |
| 29 | +extern "C" { |
| 30 | +#endif |
| 31 | + |
| 32 | +#define MAP_FAILED ((void *) -1) |
| 33 | + |
| 34 | +#define MAP_SHARED 0x01 |
| 35 | +#define MAP_PRIVATE 0x02 |
| 36 | +#define MAP_TYPE 0x0f |
| 37 | +#define MAP_FIXED 0x10 |
| 38 | +#define MAP_ANON 0x20 |
| 39 | +#define MAP_ANONYMOUS MAP_ANON |
| 40 | +#define MAP_NORESERVE 0x4000 |
| 41 | +#define MAP_GROWSDOWN 0x0100 |
| 42 | +#define MAP_DENYWRITE 0x0800 |
| 43 | +#define MAP_EXECUTABLE 0x1000 |
| 44 | +#define MAP_LOCKED 0x2000 |
| 45 | +#define MAP_POPULATE 0x8000 |
| 46 | +#define MAP_NONBLOCK 0x10000 |
| 47 | +#define MAP_STACK 0x20000 |
| 48 | +#define MAP_HUGETLB 0x40000 |
| 49 | +#define MAP_FILE 0 |
| 50 | + |
| 51 | +#define PROT_NONE 0 |
| 52 | +#define PROT_READ 1 |
| 53 | +#define PROT_WRITE 2 |
| 54 | +#define PROT_EXEC 4 |
| 55 | +#define PROT_GROWSDOWN 0x01000000 |
| 56 | +#define PROT_GROWSUP 0x02000000 |
| 57 | + |
| 58 | +#define MS_ASYNC 1 |
| 59 | +#define MS_INVALIDATE 2 |
| 60 | +#define MS_SYNC 4 |
| 61 | + |
| 62 | +#define MCL_CURRENT 1 |
| 63 | +#define MCL_FUTURE 2 |
| 64 | +#define MCL_ONFAULT 4 |
| 65 | + |
| 66 | +void *mmap (void *start, size_t len, int prot, int flags, int fd, off_t off); |
| 67 | +int munmap (void *start, size_t len); |
| 68 | + |
| 69 | +#ifdef __cplusplus |
| 70 | +} |
| 71 | +#endif |
| 72 | +#endif |
0 commit comments