Peter Tyser | 2f8d396 | 2009-03-13 18:54:51 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 Extreme Engineering Solutions, Inc. |
| 3 | * |
Wolfgang Denk | a53002f | 2013-07-08 11:58:49 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: LGPL-2.0+ |
Peter Tyser | 2f8d396 | 2009-03-13 18:54:51 -0500 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __MINGW_SUPPORT_H_ |
| 8 | #define __WINGW_SUPPORT_H_ 1 |
| 9 | |
| 10 | /* Defining __INSIDE_MSYS__ helps to prevent u-boot/mingw overlap */ |
| 11 | #define __INSIDE_MSYS__ 1 |
| 12 | |
| 13 | #include <windows.h> |
| 14 | |
| 15 | /* mmap protections */ |
| 16 | #define PROT_READ 0x1 /* Page can be read */ |
| 17 | #define PROT_WRITE 0x2 /* Page can be written */ |
| 18 | #define PROT_EXEC 0x4 /* Page can be executed */ |
| 19 | #define PROT_NONE 0x0 /* Page can not be accessed */ |
| 20 | |
| 21 | /* Sharing types (must choose one and only one of these) */ |
| 22 | #define MAP_SHARED 0x01 /* Share changes */ |
| 23 | #define MAP_PRIVATE 0x02 /* Changes are private */ |
| 24 | |
Mike Frysinger | 4f7136e | 2012-07-18 16:59:45 +0000 | [diff] [blame] | 25 | /* File perms */ |
| 26 | #ifndef S_IRGRP |
| 27 | # define S_IRGRP 0 |
| 28 | #endif |
| 29 | #ifndef S_IWGRP |
| 30 | # define S_IWGRP 0 |
| 31 | #endif |
| 32 | |
Peter Tyser | 2f8d396 | 2009-03-13 18:54:51 -0500 | [diff] [blame] | 33 | /* Windows 64-bit access macros */ |
| 34 | #define LODWORD(x) ((DWORD)((DWORDLONG)(x))) |
| 35 | #define HIDWORD(x) ((DWORD)(((DWORDLONG)(x) >> 32) & 0xffffffff)) |
| 36 | |
| 37 | typedef UINT uint; |
| 38 | typedef ULONG ulong; |
| 39 | |
| 40 | int fsync(int fd); |
| 41 | void *mmap(void *, size_t, int, int, int, int); |
| 42 | int munmap(void *, size_t); |
Remy Bohmer | faf36c1 | 2009-10-28 22:13:36 +0100 | [diff] [blame] | 43 | char *strtok_r(char *s, const char *delim, char **save_ptr); |
Mike Frysinger | 64b1502 | 2010-01-08 02:48:03 -0500 | [diff] [blame] | 44 | #include "getline.h" |
Peter Tyser | 2f8d396 | 2009-03-13 18:54:51 -0500 | [diff] [blame] | 45 | |
| 46 | #endif /* __MINGW_SUPPORT_H_ */ |