mmap.c (99c44988d5ba1866a411450c877ed818b1b70081) | mmap.c (948516a3fac0bdd47eb127fe1a86148ed86d5c65) |
---|---|
1/* 2 * mmap support for qemu 3 * 4 * Copyright (c) 2003 - 2008 Fabrice Bellard 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 --- 166 unchanged lines hidden (view full) --- 175 176 /* read the corresponding file data */ 177 pread(fd, g2h_untagged(start), end - start, offset); 178 179 /* put final protection */ 180 if (prot_new != (prot1 | PROT_WRITE)) 181 mprotect(host_start, qemu_host_page_size, prot_new); 182 } else { | 1/* 2 * mmap support for qemu 3 * 4 * Copyright (c) 2003 - 2008 Fabrice Bellard 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 --- 166 unchanged lines hidden (view full) --- 175 176 /* read the corresponding file data */ 177 pread(fd, g2h_untagged(start), end - start, offset); 178 179 /* put final protection */ 180 if (prot_new != (prot1 | PROT_WRITE)) 181 mprotect(host_start, qemu_host_page_size, prot_new); 182 } else { |
183 /* just update the protection */ | |
184 if (prot_new != prot1) { 185 mprotect(host_start, qemu_host_page_size, prot_new); 186 } | 183 if (prot_new != prot1) { 184 mprotect(host_start, qemu_host_page_size, prot_new); 185 } |
186 if (prot_new & PROT_WRITE) { 187 memset(g2h_untagged(start), 0, end - start); 188 } |
|
187 } 188 return 0; 189} 190 191#if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64 192# define TASK_UNMAPPED_BASE (1ul << 38) 193#else 194# define TASK_UNMAPPED_BASE 0x40000000 --- 588 unchanged lines hidden --- | 189 } 190 return 0; 191} 192 193#if HOST_LONG_BITS == 64 && TARGET_ABI_BITS == 64 194# define TASK_UNMAPPED_BASE (1ul << 38) 195#else 196# define TASK_UNMAPPED_BASE 0x40000000 --- 588 unchanged lines hidden --- |