Cast register maps and offsets to vm_offset_t

MFC after:	3 days
This commit is contained in:
rnoland 2009-03-17 03:39:09 +00:00
parent f718488412
commit 12867b8e80

View File

@ -240,17 +240,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))