You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-laptop/radeontool/files/radeontool-1.5-pagesize.patch

34 lines
1018 B

--- radeontool.c.orig 2007-03-15 11:25:23.000000000 +0000
+++ radeontool.c 2007-03-15 11:27:30.000000000 +0000
@@ -21,7 +21,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
-#include <asm/page.h>
#include "radeon_reg.h"
@@ -87,6 +86,7 @@
{
int mem_fd;
unsigned char *device_mem;
+ long page_size = sysconf(_SC_PAGESIZE);
/* open /dev/mem */
if ((mem_fd = open("/dev/mem", O_RDWR) ) < 0) {
@@ -94,11 +94,11 @@
}
/* mmap graphics memory */
- if ((device_mem = malloc(length + (PAGE_SIZE-1))) == NULL) {
+ if ((device_mem = malloc(length + (page_size-1))) == NULL) {
fatal("allocation error \n");
}
- if ((unsigned long)device_mem % PAGE_SIZE)
- device_mem += PAGE_SIZE - ((unsigned long)device_mem % PAGE_SIZE);
+ if ((unsigned long)device_mem % page_size)
+ device_mem += page_size - ((unsigned long)device_mem % page_size);
device_mem = (unsigned char *)mmap(
(caddr_t)device_mem,
length,