Contents of /trunk/libsdl/patches/libsdl-1.2.11-fbcon-page-header.patch
Parent Directory | Revision Log
Revision 144 -
(show annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 2387 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years, 4 months ago) by niro
File size: 2387 byte(s)
-import
1 | Backport from current libsdl svn so we can work with newer kernel headers |
2 | |
3 | http://bugs.gentoo.org/159923 |
4 | http://bugs.gentoo.org/169388 |
5 | |
6 | --- configure.in |
7 | +++ configure.in |
8 | @@ -807,6 +807,7 @@ |
9 | ]) |
10 | AC_MSG_RESULT($video_fbcon) |
11 | if test x$video_fbcon = xyes; then |
12 | + AC_CHECK_FUNCS(getpagesize) |
13 | AC_DEFINE(SDL_VIDEO_DRIVER_FBCON) |
14 | SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c" |
15 | have_video=yes |
16 | --- include/SDL_config.h.in |
17 | +++ include/SDL_config.h.in |
18 | @@ -302,4 +302,6 @@ |
19 | #undef SDL_HERMES_BLITTERS |
20 | #undef SDL_ALTIVEC_BLITTERS |
21 | |
22 | +#undef HAVE_GETPAGESIZE |
23 | + |
24 | #endif /* _SDL_config_h */ |
25 | --- src/video/fbcon/SDL_fbvideo.c |
26 | +++ src/video/fbcon/SDL_fbvideo.c |
27 | @@ -29,7 +29,9 @@ |
28 | #include <unistd.h> |
29 | #include <sys/ioctl.h> |
30 | #include <sys/mman.h> |
31 | +#ifndef HAVE_GETPAGESIZE |
32 | #include <asm/page.h> /* For definition of PAGE_SIZE */ |
33 | +#endif |
34 | #include <linux/vt.h> |
35 | |
36 | #include "SDL_video.h" |
37 | @@ -149,6 +151,18 @@ |
38 | struct fb_var_screeninfo *vinfo); |
39 | static void FB_RestorePalette(_THIS); |
40 | |
41 | +static int SDL_getpagesize(void) |
42 | +{ |
43 | +#ifdef HAVE_GETPAGESIZE |
44 | + return getpagesize(); |
45 | +#elif defined(PAGE_SIZE) |
46 | + return PAGE_SIZE; |
47 | +#else |
48 | +#error Can not determine system page size. |
49 | + return 4096; /* this is what it USED to be in Linux... */ |
50 | +#endif |
51 | +} |
52 | + |
53 | /* Small wrapper for mmap() so we can play nicely with no-mmu hosts |
54 | * (non-mmu hosts disallow the MAP_SHARED flag) */ |
55 | |
56 | @@ -547,7 +561,7 @@ |
57 | |
58 | /* Memory map the device, compensating for buggy PPC mmap() */ |
59 | mapped_offset = (((long)finfo.smem_start) - |
60 | - (((long)finfo.smem_start)&~(PAGE_SIZE-1))); |
61 | + (((long)finfo.smem_start)&~(SDL_getpagesize()-1))); |
62 | mapped_memlen = finfo.smem_len+mapped_offset; |
63 | mapped_mem = do_mmap(NULL, mapped_memlen, |
64 | PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); |
65 | --- src/video/Xext/Xxf86dga/XF86DGA.c 2007/03/13 23:11:02 1.1 |
66 | +++ src/video/Xext/Xxf86dga/XF86DGA.c 2007/03/13 23:15:14 |
67 | @@ -18,7 +18,8 @@ Copyright (c) 1995,1996 The XFree86 Pro |
68 | #define HAS_MMAP_ANON |
69 | #include <sys/types.h> |
70 | #include <sys/mman.h> |
71 | -#include <asm/page.h> /* PAGE_SIZE */ |
72 | +/* kernel header doesn't work with -ansi */ |
73 | +/* #include <asm/page.h> */ /* PAGE_SIZE */ |
74 | #define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */ |
75 | #define HAS_GETPAGESIZE |
76 | #endif /* linux */ |