Commit 8c1e4b1a authored by Vinson Lee's avatar Vinson Lee

anv: Check if memfd_create is already defined.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103909Signed-off-by: Vinson Lee's avatarVinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
parent 8620f7eb
......@@ -849,6 +849,7 @@ AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
AC_CHECK_FUNC([memfd_create], [DEFINES="$DEFINES -DHAVE_MEMFD_CREATE"])
AC_MSG_CHECKING([whether strtod has locale support])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
......
......@@ -617,7 +617,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h']
endif
endforeach
foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get']
foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
if cc.has_function(f)
pre_args += '-DHAVE_@0@'.format(f.to_upper())
endif
......
......@@ -109,11 +109,13 @@ struct anv_mmap_cleanup {
#define ANV_MMAP_CLEANUP_INIT ((struct anv_mmap_cleanup){0})
#ifndef HAVE_MEMFD_CREATE
static inline int
memfd_create(const char *name, unsigned int flags)
{
return syscall(SYS_memfd_create, name, flags);
}
#endif
static inline uint32_t
ilog2_round_up(uint32_t value)
......
......@@ -27,11 +27,13 @@
#include "anv_private.h"
#ifndef HAVE_MEMFD_CREATE
static inline int
memfd_create(const char *name, unsigned int flags)
{
return syscall(SYS_memfd_create, name, flags);
}
#endif
uint32_t
anv_gem_create(struct anv_device *device, uint64_t size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment