Fixed ToXdkProtectFlags returning bad protection flags when
nocache/writecombine were present.
This commit is contained in:
parent
6729ec182b
commit
919d84ad73
|
@ -31,10 +31,10 @@ uint32_t ToXdkProtectFlags(uint32_t protect) {
|
||||||
result = X_PAGE_READWRITE;
|
result = X_PAGE_READWRITE;
|
||||||
}
|
}
|
||||||
if (protect & kMemoryProtectNoCache) {
|
if (protect & kMemoryProtectNoCache) {
|
||||||
result = X_PAGE_NOCACHE;
|
result |= X_PAGE_NOCACHE;
|
||||||
}
|
}
|
||||||
if (protect & kMemoryProtectWriteCombine) {
|
if (protect & kMemoryProtectWriteCombine) {
|
||||||
result = X_PAGE_WRITECOMBINE;
|
result |= X_PAGE_WRITECOMBINE;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -42,10 +42,10 @@ uint32_t ToXdkProtectFlags(uint32_t protect) {
|
||||||
uint32_t FromXdkProtectFlags(uint32_t protect) {
|
uint32_t FromXdkProtectFlags(uint32_t protect) {
|
||||||
uint32_t result = 0;
|
uint32_t result = 0;
|
||||||
if ((protect & X_PAGE_READONLY) | (protect & X_PAGE_EXECUTE_READ)) {
|
if ((protect & X_PAGE_READONLY) | (protect & X_PAGE_EXECUTE_READ)) {
|
||||||
result |= kMemoryProtectRead;
|
result = kMemoryProtectRead;
|
||||||
} else if ((protect & X_PAGE_READWRITE) |
|
} else if ((protect & X_PAGE_READWRITE) |
|
||||||
(protect & X_PAGE_EXECUTE_READWRITE)) {
|
(protect & X_PAGE_EXECUTE_READWRITE)) {
|
||||||
result |= kMemoryProtectRead | kMemoryProtectWrite;
|
result = kMemoryProtectRead | kMemoryProtectWrite;
|
||||||
}
|
}
|
||||||
if (protect & X_PAGE_NOCACHE) {
|
if (protect & X_PAGE_NOCACHE) {
|
||||||
result |= kMemoryProtectNoCache;
|
result |= kMemoryProtectNoCache;
|
||||||
|
|
Loading…
Reference in New Issue