[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] Evas FB engine PAGE_MASK fix



Hi all,

while compiling Evas for powerpc I've encountered a problem with
PAGE_MASK being undefined. The proper way to detect the kernel page size
at runtime is through _SC_PAGE_SIZE, if I'm not mistaken.

If noone objects I'll commit the attached patch.


Falko
--- evas_fb_main.c	2006-09-30 09:02:41.000000000 +0000
+++ /root/evas_fb_main.c	2006-12-11 17:42:57.000000000 +0000
@@ -530,7 +530,7 @@
       fb_cleanup();
       exit(1);
     }
-  mode->mem_offset = (unsigned)(fb_fix.smem_start) & (~PAGE_MASK);
+  mode->mem_offset = (unsigned)(fb_fix.smem_start) & ~(sysconf(_SC_PAGE_SIZE));
   mode->mem = (unsigned char *)mmap(NULL, fb_fix.smem_len + mode->mem_offset,
 				 PROT_WRITE | PROT_READ, MAP_SHARED, fb, 0);
   if ((int)mode->mem == -1)