--- 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 #include #include -#include #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,