Lines 27-43
Link Here
|
27 |
#include <stdio.h> |
27 |
#include <stdio.h> |
28 |
#include <fcntl.h> |
28 |
#include <fcntl.h> |
29 |
#include <unistd.h> |
29 |
#include <unistd.h> |
30 |
#include <sys/ioctl.h> |
30 |
#include <sys/ioctl.h> |
31 |
#include <sys/mman.h> |
31 |
#include <sys/mman.h> |
32 |
#include <asm/page.h> /* For definition of PAGE_SIZE */ |
|
|
33 |
#include <linux/vt.h> |
32 |
#include <linux/vt.h> |
34 |
|
33 |
|
35 |
#ifndef PAGE_SIZE |
|
|
36 |
# define PAGE_SIZE sysconf(_SC_PAGE_SIZE) |
37 |
#endif |
38 |
|
39 |
#include "SDL_video.h" |
34 |
#include "SDL_video.h" |
40 |
#include "SDL_mouse.h" |
35 |
#include "SDL_mouse.h" |
41 |
#include "../SDL_sysvideo.h" |
36 |
#include "../SDL_sysvideo.h" |
42 |
#include "../SDL_pixels_c.h" |
37 |
#include "../SDL_pixels_c.h" |
43 |
#include "../../events/SDL_events_c.h" |
38 |
#include "../../events/SDL_events_c.h" |
Lines 549-559
Link Here
|
549 |
} |
544 |
} |
550 |
} |
545 |
} |
551 |
|
546 |
|
552 |
/* Memory map the device, compensating for buggy PPC mmap() */ |
547 |
/* Memory map the device, compensating for buggy PPC mmap() */ |
553 |
mapped_offset = (((long)finfo.smem_start) - |
548 |
mapped_offset = (((long)finfo.smem_start) - |
554 |
(((long)finfo.smem_start)&~(PAGE_SIZE-1))); |
549 |
(((long)finfo.smem_start)&~((int)sysconf(_SC_PAGE_SIZE)-1))); |
555 |
mapped_memlen = finfo.smem_len+mapped_offset; |
550 |
mapped_memlen = finfo.smem_len+mapped_offset; |
556 |
mapped_mem = do_mmap(NULL, mapped_memlen, |
551 |
mapped_mem = do_mmap(NULL, mapped_memlen, |
557 |
PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); |
552 |
PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); |
558 |
if ( mapped_mem == (char *)-1 ) { |
553 |
if ( mapped_mem == (char *)-1 ) { |
559 |
SDL_SetError("Unable to memory map the video hardware"); |
554 |
SDL_SetError("Unable to memory map the video hardware"); |