mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
* Stop hard-coding a value for beginning of emitted code on Sparc since we can
now handle far calls (i.e., beyond the 30-bit limit in call instructions). * As a side-effect, this allows us to unify and clean up the mmap() call and code around it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -76,20 +76,16 @@ static void *getMemory(unsigned NumPages) {
|
|||||||
/* Linux and *BSD tend to have these flags named differently. */
|
/* Linux and *BSD tend to have these flags named differently. */
|
||||||
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
||||||
# define MAP_ANONYMOUS MAP_ANON
|
# define MAP_ANONYMOUS MAP_ANON
|
||||||
#endif
|
#endif /* defined(MAP_ANON) && !defined(MAP_ANONYMOUS) */
|
||||||
pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
|
#define fd 0
|
||||||
MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); /* fd = 0 */
|
|
||||||
#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
|
#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
|
||||||
static unsigned long Counter = 0;
|
#define fd -1
|
||||||
pa = mmap((void*)(0x140000000UL+Counter), pageSize*NumPages,
|
|
||||||
PROT_READ|PROT_WRITE|PROT_EXEC,
|
|
||||||
MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); /* fd = -1 */
|
|
||||||
Counter += pageSize*NumPages;
|
|
||||||
#else
|
#else
|
||||||
std::cerr << "This architecture is not supported by the JIT\n";
|
std::cerr << "This architecture is not supported by the JIT!\n";
|
||||||
abort();
|
abort();
|
||||||
#endif
|
#endif
|
||||||
|
pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC,
|
||||||
|
MAP_PRIVATE|MAP_ANONYMOUS, fd, 0);
|
||||||
if (pa == MAP_FAILED) {
|
if (pa == MAP_FAILED) {
|
||||||
perror("mmap");
|
perror("mmap");
|
||||||
abort();
|
abort();
|
||||||
|
Reference in New Issue
Block a user