Your message dated Mon, 21 Jun 2010 17:00:53 -0700
with message-id <20100622000053.ga16...@dario.dodds.net>
and subject line Re: Don't use <asm/page.h>
has caused the Debian Bug report #393611,
regarding Don't use <asm/page.h>
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
393611: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=393611
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: bogl-bterm
Version: 0.1.18-1.2
Tags: patch

bogl.c currently uses PAGE_MASK from <asm/page.h>.  Recent kernel
versions on IA-64 define PAGE_MASK only #ifdef __KERNEL__, and even then
it represents the kernel internal page size, which depends on kernel
config, not the ABI page size.

The attached patch replaces the PAGE_MASK use by portable
sysconf(_SC_PAGE_SIZE).  This fixes the build on IA-64, but I haven't
tested the resulting IA-64 binary.

Thanks,
        Mirek
--- bogl-0.1.18/bogl.c.page_size	2006-10-17 02:41:01.000000000 +0200
+++ bogl-0.1.18/bogl.c	2006-10-17 02:47:20.000000000 +0200
@@ -40,10 +40,6 @@
 #include <termios.h>
 #include <unistd.h>
 
-/* Yes, I know, we shouldn't be including headers from the kernel.  But
-   XFree86 also uses this one (to get PAGE_MASK) so it's probably safe.  */
-#include <asm/page.h>
-
 #include "bogl.h"
 #include "boglP.h"
 #if BOGL_VGA16_FB
@@ -115,6 +111,7 @@
 bogl_init (void)
 {
   unsigned long bogl_frame_offset, bogl_frame_len;
+  long page_size;
   struct fb_var_screeninfo fb_var;
   struct vt_stat vts;
 
@@ -178,9 +175,14 @@
   if (!init_fb())
     return 0;
 
-  bogl_frame_offset = fb_fix.smem_start & ~PAGE_MASK;
-  bogl_frame_len = ((bogl_frame_offset + fb_fix.smem_len + ~PAGE_MASK)
-		    & PAGE_MASK);
+  errno = 0;
+  page_size = sysconf(_SC_PAGE_SIZE);
+  if (page_size == -1 && errno != 0)
+    return bogl_fail ("can't get PAGE_SIZE: %s", strerror (errno));
+
+  bogl_frame_offset = fb_fix.smem_start & (page_size - 1);
+  bogl_frame_len = ((bogl_frame_offset + fb_fix.smem_len + page_size - 1)
+		    & ~(page_size - 1));
 
   bogl_frame_mapped
     = mmap (NULL, bogl_frame_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0);

--- End Message ---
--- Begin Message ---
This bug is a duplicate of bug #393023 was fixed in bogl 0.1.18-1.5.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org

Attachment: signature.asc
Description: Digital signature


--- End Message ---

Reply via email to