diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-31 23:31:56 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-31 23:31:56 +0000 |
commit | acd64becb15c5105fae0875575d14858fb106cb1 (patch) | |
tree | b03cc2e360a4a0cbb9f86ed65eaaaef6e648647d /llvm/lib/Support/Unix/Memory.inc | |
parent | 15dcad9e36029d715163d1c374a042d1e50f281f (diff) | |
download | bcm5719-llvm-acd64becb15c5105fae0875575d14858fb106cb1.tar.gz bcm5719-llvm-acd64becb15c5105fae0875575d14858fb106cb1.zip |
Go ahead and get rid of the old page size interface and convert all the
users over to the new one. No sense maintaining this "compatibility"
layer it seems.
llvm-svn: 171331
Diffstat (limited to 'llvm/lib/Support/Unix/Memory.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Memory.inc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc index 9a8abd27f15..40d6b3fefd9 100644 --- a/llvm/lib/Support/Unix/Memory.inc +++ b/llvm/lib/Support/Unix/Memory.inc @@ -73,7 +73,7 @@ Memory::allocateMappedMemory(size_t NumBytes, if (NumBytes == 0) return MemoryBlock(); - static const size_t PageSize = Process::GetPageSize(); + static const size_t PageSize = process::get_self()->page_size(); const size_t NumPages = (NumBytes+PageSize-1)/PageSize; int fd = -1; @@ -166,8 +166,8 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock, std::string *ErrMsg) { if (NumBytes == 0) return MemoryBlock(); - size_t pageSize = Process::GetPageSize(); - size_t NumPages = (NumBytes+pageSize-1)/pageSize; + size_t PageSize = process::get_self()->page_size(); + size_t NumPages = (NumBytes+PageSize-1)/PageSize; int fd = -1; #ifdef NEED_DEV_ZERO_FOR_MMAP @@ -191,10 +191,10 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock, NearBlock->size() : 0; #if defined(__APPLE__) && defined(__arm__) - void *pa = ::mmap(start, pageSize*NumPages, PROT_READ|PROT_EXEC, + void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_EXEC, flags, fd, 0); #else - void *pa = ::mmap(start, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC, + void *pa = ::mmap(start, PageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC, flags, fd, 0); #endif if (pa == MAP_FAILED) { @@ -207,7 +207,7 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock, #if defined(__APPLE__) && defined(__arm__) kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)pa, - (vm_size_t)(pageSize*NumPages), 0, + (vm_size_t)(PageSize*NumPages), 0, VM_PROT_READ | VM_PROT_EXECUTE | VM_PROT_COPY); if (KERN_SUCCESS != kr) { MakeErrMsg(ErrMsg, "vm_protect max RX failed"); @@ -215,7 +215,7 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock, } kr = vm_protect(mach_task_self(), (vm_address_t)pa, - (vm_size_t)(pageSize*NumPages), 0, + (vm_size_t)(PageSize*NumPages), 0, VM_PROT_READ | VM_PROT_WRITE); if (KERN_SUCCESS != kr) { MakeErrMsg(ErrMsg, "vm_protect RW failed"); @@ -225,7 +225,7 @@ Memory::AllocateRWX(size_t NumBytes, const MemoryBlock* NearBlock, MemoryBlock result; result.Address = pa; - result.Size = NumPages*pageSize; + result.Size = NumPages*PageSize; return result; } |