summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2009-03-16 00:01:47 -0500
committerRobert Noland <rnoland@2hip.net>2009-03-16 00:01:47 -0500
commitf78040266bbddf6cf020fb957e3f92000c2bc69b (patch)
tree8f3324fff8870d4c16d03d9e2c5d51a0a0b7276c
parent82eac8060b98b425f29051bfd7830ba3622be7d8 (diff)
FreeBSD: Cast map handles to vm_offset_t
This prevents some warnings with nouveau.
-rw-r--r--bsd-core/drmP.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index b1ae993c..32573b83 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -237,17 +237,23 @@ typedef u_int8_t u8;
#endif
#define DRM_READ8(map, offset) \
- *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset))
+ *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset))
#define DRM_READ16(map, offset) \
- *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset))
+ *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset))
#define DRM_READ32(map, offset) \
- *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset))
+ *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset))
#define DRM_WRITE8(map, offset, val) \
- *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) = val
+ *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset)) = val
#define DRM_WRITE16(map, offset, val) \
- *(volatile u_int16_t *) (((unsigned long)(map)->handle) + (offset)) = val
+ *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset)) = val
#define DRM_WRITE32(map, offset, val) \
- *(volatile u_int32_t *)(((unsigned long)(map)->handle) + (offset)) = val
+ *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \
+ (vm_offset_t)(offset)) = val
#define DRM_VERIFYAREA_READ( uaddr, size ) \
(!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ))