mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
anv: Check if memfd_create is already defined.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103909 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
8620f7ebbc
commit
8c1e4b1afc
4 changed files with 6 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue