cygwin: mmap: fix comment and formatting, drop unused code
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
67a657cb1d
commit
0c201166f5
|
@ -1177,12 +1177,9 @@ go_ahead:
|
||||||
protection as the file's pages, then as much pages as necessary
|
protection as the file's pages, then as much pages as necessary
|
||||||
to accomodate the requested length, but as reserved pages which
|
to accomodate the requested length, but as reserved pages which
|
||||||
raise a SIGBUS when trying to access them. AT_ROUND_TO_PAGE
|
raise a SIGBUS when trying to access them. AT_ROUND_TO_PAGE
|
||||||
and page protection on shared pages is only supported by 32 bit NT,
|
and page protection on shared pages is only supported by the
|
||||||
so don't even try on WOW64. This is accomplished by not setting
|
32 bit environment, so don't even try on 64 bit or even WOW64.
|
||||||
orig_len on WOW64 above. */
|
This is accomplished by not setting orig_len on 64 bit above. */
|
||||||
#if 0
|
|
||||||
orig_len = roundup2 (orig_len, pagesize);
|
|
||||||
#endif
|
|
||||||
len = roundup2 (len, wincap.page_size ());
|
len = roundup2 (len, wincap.page_size ());
|
||||||
if (orig_len - len)
|
if (orig_len - len)
|
||||||
{
|
{
|
||||||
|
@ -1465,7 +1462,7 @@ mlock (const void *addr, size_t len)
|
||||||
|
|
||||||
/* Align address and length values to page size. */
|
/* Align address and length values to page size. */
|
||||||
size_t pagesize = wincap.allocation_granularity ();
|
size_t pagesize = wincap.allocation_granularity ();
|
||||||
PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
|
PVOID base = (PVOID) rounddown ((uintptr_t) addr, pagesize);
|
||||||
SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
|
SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
|
||||||
pagesize);
|
pagesize);
|
||||||
NTSTATUS status = 0;
|
NTSTATUS status = 0;
|
||||||
|
@ -1523,7 +1520,7 @@ munlock (const void *addr, size_t len)
|
||||||
|
|
||||||
/* Align address and length values to page size. */
|
/* Align address and length values to page size. */
|
||||||
size_t pagesize = wincap.allocation_granularity ();
|
size_t pagesize = wincap.allocation_granularity ();
|
||||||
PVOID base = (PVOID) rounddown((uintptr_t) addr, pagesize);
|
PVOID base = (PVOID) rounddown ((uintptr_t) addr, pagesize);
|
||||||
SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
|
SIZE_T size = roundup2 (((uintptr_t) addr - (uintptr_t) base) + len,
|
||||||
pagesize);
|
pagesize);
|
||||||
NTSTATUS status = NtUnlockVirtualMemory (NtCurrentProcess (), &base, &size,
|
NTSTATUS status = NtUnlockVirtualMemory (NtCurrentProcess (), &base, &size,
|
||||||
|
|
Loading…
Reference in New Issue