summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Memory.inc
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2013-02-20 18:24:30 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2013-02-20 18:24:30 +0000
commit798679e140dffa5db4ee06ca7cb5777731988255 (patch)
tree61154931baa8e472876d9ba353b24f37d9473236 /llvm/lib/Support/Unix/Memory.inc
parent623d8329e375aba72fc6537edb5dad3f738ff352 (diff)
downloadbcm5719-llvm-798679e140dffa5db4ee06ca7cb5777731988255.tar.gz
bcm5719-llvm-798679e140dffa5db4ee06ca7cb5777731988255.zip
On PowerPC, the cache-flush instructions dcbf and icbi are treated as
loads. On FreeBSD, add PROT_READ page protection flag before flushing cache. llvm-svn: 175646
Diffstat (limited to 'llvm/lib/Support/Unix/Memory.inc')
-rw-r--r--llvm/lib/Support/Unix/Memory.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
index 40d6b3fefd9..a66e3c7aeee 100644
--- a/llvm/lib/Support/Unix/Memory.inc
+++ b/llvm/lib/Support/Unix/Memory.inc
@@ -51,7 +51,11 @@ int getPosixProtectionFlags(unsigned Flags) {
llvm::sys::Memory::MF_EXEC:
return PROT_READ | PROT_WRITE | PROT_EXEC;
case llvm::sys::Memory::MF_EXEC:
+#if defined(__FreeBSD__)
+ return PROT_READ | PROT_EXEC;
+#else
return PROT_EXEC;
+#endif
default:
llvm_unreachable("Illegal memory protection flag specified!");
}
OpenPOWER on IntegriCloud