Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1392)

Unified Diff: src/native_client/src/shared/imc/win/nacl_shm.cc

Issue 7068021: Dynamic loading: Fill pages with halts only when they are needed (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fix log messages Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/native_client/src/trusted/desc/nacl_desc_imc_shm.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/native_client/src/shared/imc/win/nacl_shm.cc
diff --git a/src/native_client/src/shared/imc/win/nacl_shm.cc b/src/native_client/src/shared/imc/win/nacl_shm.cc
index 26d41eefaff06430ff0df5a67daec5aa261de43e..78317646b34318b9abf39d2ca1b285b49c9404ba 100644
--- a/src/native_client/src/shared/imc/win/nacl_shm.cc
+++ b/src/native_client/src/shared/imc/win/nacl_shm.cc
@@ -10,6 +10,7 @@
#include <windows.h>
#include "native_client/src/shared/imc/nacl_imc.h"
#include "native_client/src/shared/platform/nacl_log.h"
+#include "native_client/src/trusted/service_runtime/include/sys/mman.h"
namespace nacl {
@@ -30,7 +31,7 @@ Handle CreateMemoryObject(size_t length, bool executable) {
void* Map(void* start, size_t length, int prot, int flags,
Handle memory, off_t offset) {
static DWORD prot_to_access[] = {
- FILE_MAP_READ, // TBD
+ 0, // NACL_ABI_PROT_NONE is not accepted: see below.
FILE_MAP_READ,
FILE_MAP_WRITE,
FILE_MAP_ALL_ACCESS,
@@ -40,6 +41,16 @@ void* Map(void* start, size_t length, int prot, int flags,
FILE_MAP_ALL_ACCESS | FILE_MAP_EXECUTE
};
+ if (prot == NACL_ABI_PROT_NONE) {
+ // There is no corresponding FILE_MAP_* option for PROT_NONE. In
+ // any case, this would not be very useful because the permissions
+ // cannot later be increased beyond what was passed to
+ // MapViewOfFileEx(), unlike in Unix.
+ NaClLog(LOG_INFO, "nacl::Map: PROT_NONE not supported\n");
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return kMapFailed;
+ }
+
if (!(flags & (kMapShared | kMapPrivate))) {
SetLastError(ERROR_INVALID_PARAMETER);
return kMapFailed;
« no previous file with comments | « no previous file | src/native_client/src/trusted/desc/nacl_desc_imc_shm.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698