path: root/sys/sys/fbio.h
diff options
authorJustin Hibbits <jhibbits@FreeBSD.org>2017-12-06 02:05:21 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2017-12-06 02:05:21 +0000
commit97d24081dab5fada8516937b2f67633bb93e0ccf (patch)
tree5446b7aa31b899beda088910f143a7d776ba9133 /sys/sys/fbio.h
parente294a1269f3c3f58e13ca6ee391c20b047d86f57 (diff)
Use unsigned intptr_t type for framebuffer addresses
Summary: Some architectures (powerpc Book-E) have a vm_paddr_t larger than intptr_t. Casting from the intptr_t to vm_paddr_t causes sign extension, leading to a potentially invalid address. This was seen when running X on a PowerPC P1022 machine, which mapped the backing framebuffer at 0xc1800000. When mmap()d by X, this yielded an invalid address of 0xffffffffc1800000, or, as the hardware would see it, 0xfc1800000. Reviewed By: ray Differential Revision: https://reviews.freebsd.org/D13332
Notes: svn path=/head/; revision=326611
Diffstat (limited to 'sys/sys/fbio.h')
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/fbio.h b/sys/sys/fbio.h
index 9dfaa04b2439..4cc0cc6debba 100644
--- a/sys/sys/fbio.h
+++ b/sys/sys/fbio.h
@@ -136,8 +136,8 @@ struct fb_info {
fb_leave_t *leave;
fb_setblankmode_t *setblankmode;
- intptr_t fb_pbase; /* For FB mmap. */
- intptr_t fb_vbase; /* if NULL, use fb_write/fb_read. */
+ uintptr_t fb_pbase; /* For FB mmap. */
+ uintptr_t fb_vbase; /* if NULL, use fb_write/fb_read. */
void *fb_priv; /* First argument for read/write. */
const char *fb_name;
uint32_t fb_flags;