From 58742095de3cb5cabb38ca4ec83abfdf98774a78 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 30 Jan 2018 08:37:44 +0000 Subject: [PATCH] add GFP_USER/__user/vmalloc() --- sys/dev/pci/drm/drm_linux.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h index 25a83ea3b81..8c8fd178c04 100644 --- a/sys/dev/pci/drm/drm_linux.h +++ b/sys/dev/pci/drm/drm_linux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_linux.h,v 1.71 2018/01/30 08:35:21 jsg Exp $ */ +/* $OpenBSD: drm_linux.h,v 1.72 2018/01/30 08:37:44 jsg Exp $ */ /* * Copyright (c) 2013, 2014, 2015 Mark Kettenis * Copyright (c) 2017 Martin Pieuchot @@ -92,6 +92,10 @@ typedef off_t loff_t; #define __init #define __exit +#ifndef __user +#define __user +#endif + #define __printf(x, y) #define barrier() __asm __volatile("" : : : "memory"); @@ -994,6 +998,7 @@ ktime_us_delta(struct timeval a, struct timeval b) #define GFP_ATOMIC M_NOWAIT #define GFP_NOWAIT M_NOWAIT #define GFP_KERNEL (M_WAITOK | M_CANFAIL) +#define GFP_USER (M_WAITOK | M_CANFAIL) #define GFP_TEMPORARY (M_WAITOK | M_CANFAIL) #define GFP_HIGHUSER 0 #define GFP_DMA32 0 @@ -1065,6 +1070,12 @@ kasprintf(int flags, const char *fmt, ...) return buf; } +static inline void * +vmalloc(unsigned long size) +{ + return malloc(size, M_DRM, M_WAITOK | M_CANFAIL); +} + static inline void * vzalloc(unsigned long size) { -- 2.20.1