[pypy-commit] pypy arm-backend-2: (arigo, bivab): move this hack to rmmap and make it a bit cleaner
bivab
noreply at buildbot.pypy.org
Mon Dec 5 10:05:42 CET 2011
Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r50163:7873941fd23b
Date: 2011-12-02 12:23 +0100
http://bitbucket.org/pypy/pypy/changeset/7873941fd23b/
Log: (arigo, bivab): move this hack to rmmap and make it a bit cleaner
diff --git a/pypy/rlib/rmmap.py b/pypy/rlib/rmmap.py
--- a/pypy/rlib/rmmap.py
+++ b/pypy/rlib/rmmap.py
@@ -14,6 +14,8 @@
_MS_WINDOWS = os.name == "nt"
_LINUX = "linux" in sys.platform
_64BIT = "64bit" in platform.architecture()[0]
+_ARM = platform.machine().startswith('arm')
+_PPC = platform.machine().startswith('ppc')
class RValueError(Exception):
def __init__(self, message):
@@ -112,7 +114,11 @@
if _POSIX:
has_mremap = cConfig['has_mremap']
- c_mmap, c_mmap_safe = external('mmap', [PTR, size_t, rffi.INT, rffi.INT,
+ if _ARM or _PPC:
+ funcname = 'mmap64'
+ else:
+ funcname = 'mmap'
+ c_mmap, c_mmap_safe = external(funcname, [PTR, size_t, rffi.INT, rffi.INT,
rffi.INT, off_t], PTR)
_, c_munmap_safe = external('munmap', [PTR, size_t], rffi.INT)
c_msync, _ = external('msync', [PTR, size_t, rffi.INT], rffi.INT)
diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -1024,9 +1024,6 @@
old_eci = funcptr._obj.compilation_info
funcname = funcptr._obj._name
- #XXX Fix this, hack for ARM
- if funcname == 'mmap':
- funcname = 'mmap64'
if hasattr(old_eci, '_with_ctypes'):
old_eci = old_eci._with_ctypes
More information about the pypy-commit
mailing list