* IN THE SOFTWARE.
*/
-#include <linux/memfd.h>
#include <sys/mman.h>
#include <sys/syscall.h>
+#include "util/anon_file.h"
#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)
{
- int fd = memfd_create("fake bo", MFD_CLOEXEC);
+ int fd = os_create_anonymous_file(size, "fake bo");
if (fd == -1)
return 0;
assert(fd != 0);
- if (ftruncate(fd, size) == -1)
- return 0;
-
return fd;
}
uint32_t
anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
{
- return -1;
+ int fd = os_create_anonymous_file(size, "fake bo");
+ if (fd == -1)
+ return 0;
+
+ assert(fd != 0);
+
+ return fd;
}
int
}
int
-anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t *value)
+anv_gem_set_context_param(int fd, int context, uint32_t param, uint64_t value)
{
unreachable("Unused");
}
int
-anv_gem_get_aperture(int fd, uint64_t *size)
+anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t *value)
{
unreachable("Unused");
}
bool
-anv_gem_supports_48b_addresses(int fd)
+anv_gem_has_context_priority(int fd)
+{
+ unreachable("Unused");
+}
+
+int
+anv_gem_get_aperture(int fd, uint64_t *size)
{
unreachable("Unused");
}
{
unreachable("Unused");
}
+
+int
+anv_gem_reg_read(struct anv_device *device,
+ uint32_t offset, uint64_t *result)
+{
+ unreachable("Unused");
+}