From ac26b51503dfedf422d6ae49518adcf41dff1af3 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Sun, 27 Aug 2006 19:45:38 +0200 Subject: Have TTM create and reference ioctl call return the actual TTM size. --- linux-core/drmP.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 43589342..d7494c23 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1363,14 +1363,23 @@ extern int drm_bo_ioctl(DRM_IOCTL_ARGS); static __inline__ unsigned long combine_64(uint32_t lo, uint32_t hi) { unsigned long ret = lo; - - if (sizeof(ret) > 4) { - int shift = 32; - lo |= (hi << shift); - } +#if (BITS_PER_LONG == 64) + ret |= (hi << 32); +#endif return ret; } +static __inline__ void split_32(unsigned long val, uint32_t *lo, uint32_t *hi) +{ + *lo = val & 0xFFFFFFFFUL; +#if (BITS_PER_LONG == 64) + *hi = val >> 32; +#else + *hi = 0; +#endif +} + + /* Inline replacements for DRM_IOREMAP macros */ static __inline__ void drm_core_ioremap(struct drm_map *map, struct drm_device *dev) -- cgit v1.2.3