aboutsummaryrefslogtreecommitdiffstats
path: root/fbtools.c
diff options
context:
space:
mode:
authorkraxel <kraxel>2006-03-17 12:46:41 +0000
committerkraxel <kraxel>2006-03-17 12:46:41 +0000
commit9583914ba076818ce50dbce10cce990649742952 (patch)
tree95babab75dd8d7a1d7a442311cda8332529fdd2a /fbtools.c
parentf356778e6134001ac1543918f77d7d1217a1a3e7 (diff)
downloadfbida-9583914ba076818ce50dbce10cce990649742952.tar.gz
sync up, minor fixes
Diffstat (limited to 'fbtools.c')
-rw-r--r--fbtools.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fbtools.c b/fbtools.c
index a5d4815..563df90 100644
--- a/fbtools.c
+++ b/fbtools.c
@@ -323,6 +323,7 @@ fb_init(char *device, char *mode, int vt)
{
char fbdev[16];
struct vt_stat vts;
+ unsigned long page_mask;
dev_init();
tty = 0;
@@ -424,15 +425,14 @@ fb_init(char *device, char *mode, int vt)
goto err;
}
#endif
- fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~PAGE_MASK);
+ page_mask = getpagesize()-1;
+ fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~page_mask);
fb_mem = mmap(NULL,fb_fix.smem_len+fb_mem_offset,
PROT_READ|PROT_WRITE,MAP_SHARED,fb,0);
if (-1L == (long)fb_mem) {
perror("mmap");
goto err;
}
-// fprintf(stderr,"fb_mem = %p\n",fb_mem);
-
/* move viewport to upper left corner */
if (fb_var.xoffset != 0 || fb_var.yoffset != 0) {
fb_var.xoffset = 0;