1 diff -urN SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c
2 --- SDL-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c 2006-05-17 06:16:06.000000000 +0300
3 +++ SDL-1.2.11/src/video/fbcon/SDL_fbvideo.c 2007-06-24 22:19:41.000000000 +0300
8 -#include <asm/page.h> /* For definition of PAGE_SIZE */
12 +#define HAS_MMAP_ANON
13 +#include <sys/types.h>
14 +#include <sys/mman.h>
15 +#include <asm/page.h> /* PAGE_SIZE */
16 +#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
17 +#define HAS_GETPAGESIZE
20 #include "SDL_video.h"
21 #include "SDL_mouse.h"
22 #include "../SDL_sysvideo.h"
24 unsigned int current_h;
25 const char *SDL_fbdev;
29 /* Initialize the library */
30 SDL_fbdev = SDL_getenv("SDL_FBDEV");
35 +#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE)
36 + pagesize = sysconf(_SC_PAGESIZE);
40 + pagesize = sysconf(_SC_PAGE_SIZE);
42 +#ifdef HAS_GETPAGESIZE
44 + pagesize = getpagesize();
48 + pagesize = PAGE_SIZE;
53 /* Memory map the device, compensating for buggy PPC mmap() */
54 mapped_offset = (((long)finfo.smem_start) -
55 - (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
56 + (((long)finfo.smem_start)&~(pagesize-1)));
57 mapped_memlen = finfo.smem_len+mapped_offset;
58 mapped_mem = do_mmap(NULL, mapped_memlen,
59 PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);