From 97983e9c6024ec8ae12275e5afff8122c733a3c8 Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Thu, 24 May 2018 20:03:54 +0300 Subject: gpu: nvgpu: Make the header compile for userspace builds Do the quick fixes to make the header compile on userspace builds without changes. Namely: - define __packed only if not yet defined - Fix the NVGPU_NO_TIMEOUT definition ((u32)~0) --> ((__u32)~0U) - Remove the left-over definition of NVGPU_AS_IOCTL_MAP_BUFFER. It refers to a struct that no longer exists. Bug 1777616 Bug 1902982 Change-Id: I964aa5eff7bfade6af4fd0635680fd6af29d623b Signed-off-by: Sami Kiminki Reviewed-on: https://git-master.nvidia.com/r/1729654 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/uapi/linux/nvgpu.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include/uapi') diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index b14610bd..b36509b0 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -21,8 +21,13 @@ #if !defined(__KERNEL__) #define __user + +/* Some userspace builds have __packed defined already */ +#if !defined(__packed) #define __packed __attribute__((packed)) -#endif +#endif /* __packed */ + +#endif /* __KERNEL__ */ /* * /dev/nvhost-ctrl-gpu device @@ -1376,7 +1381,7 @@ struct nvgpu_dbg_gpu_profiler_reserve_args { */ #define NVGPU_IOCTL_MAGIC 'H' -#define NVGPU_NO_TIMEOUT ((u32)~0) +#define NVGPU_NO_TIMEOUT ((__u32)~0U) #define NVGPU_TIMEOUT_FLAG_DISABLE_DUMP 0 /* this is also the hardware memory format */ @@ -1996,8 +2001,6 @@ struct nvgpu_as_get_sync_ro_map_args { _IOWR(NVGPU_AS_IOCTL_MAGIC, 2, struct nvgpu32_as_alloc_space_args) #define NVGPU_AS_IOCTL_FREE_SPACE \ _IOWR(NVGPU_AS_IOCTL_MAGIC, 3, struct nvgpu_as_free_space_args) -#define NVGPU_AS_IOCTL_MAP_BUFFER \ - _IOWR(NVGPU_AS_IOCTL_MAGIC, 4, struct nvgpu_as_map_buffer_args) #define NVGPU_AS_IOCTL_UNMAP_BUFFER \ _IOWR(NVGPU_AS_IOCTL_MAGIC, 5, struct nvgpu_as_unmap_buffer_args) #define NVGPU_AS_IOCTL_ALLOC_SPACE \ -- cgit v1.2.2