mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Fix call to mmap, so that it can be used on sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6424 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
139f0c279d
commit
6607fbec94
@ -77,20 +77,15 @@ MachineCodeEmitter *VM::createSparcEmitter(VM &V) {
|
|||||||
// FIXME: This should be rewritten to support a real memory manager for
|
// FIXME: This should be rewritten to support a real memory manager for
|
||||||
// executable memory pages!
|
// executable memory pages!
|
||||||
void * SparcEmitter::getMemory(unsigned NumPages) {
|
void * SparcEmitter::getMemory(unsigned NumPages) {
|
||||||
#if 0
|
void *pa;
|
||||||
void *pa = mmap(0, 4096*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
|
if (NumPages == 0) return 0;
|
||||||
MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
|
static const long pageSize = sysconf (_SC_PAGESIZE);
|
||||||
|
pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
|
||||||
|
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
||||||
if (pa == MAP_FAILED) {
|
if (pa == MAP_FAILED) {
|
||||||
perror("mmap");
|
perror("mmap");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
void *pa = malloc(4096*NumPages);
|
|
||||||
if (!pa) {
|
|
||||||
perror("malloc");
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
funcMemory.push_back(pa);
|
|
||||||
return pa;
|
return pa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user