diff --git a/src/kernel/qpixmapcache.cpp b/src/kernel/qpixmapcache.cpp
-index c2e7d9b..b2d42b5 100644
+index c2e7d9b..8d39585 100644
--- a/src/kernel/qpixmapcache.cpp
+++ b/src/kernel/qpixmapcache.cpp
-@@ -122,7 +122,9 @@ void cleanup_pixmap_cache();
-
+@@ -123,9 +123,13 @@ void cleanup_pixmap_cache();
#ifdef THROW_AWAY_UNUSED_PAGES
# include <sys/mman.h> // madvise
-+# define __KERNEL__
# include <asm/page.h> // PAGE_SIZE,PAGE_MASK,PAGE_ALIGN
-+# undef __KERNEL__
++# include <unistd.h> // getpagesize()
++# if (!defined(PAGE_ALIGN)) && defined(PAGE_SIZE) && defined(PAGE_MASK)
++# define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
++# endif
# ifndef PAGE_ALIGN
- # define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
- # endif // PAGE_ALIGN
+-# define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
+-# endif // PAGE_ALIGN
++# define PAGE_ALIGN(addr) (((addr)+getpagesize()-1)&~(getpagesize()-1))
++# endif
+ #endif // THROW_AWAY_UNUSED_PAGES
+
+
EXTRA_OECONF_CONFIG_c7x0 = "-qconfig qpe -accel-w100"
EXTRA_OECONF_CONFIG_native = "-qconfig qpe -qvfb"
EXTRA_OECONF = "-system-jpeg -system-libpng -system-zlib -no-qvfb -no-xft -no-vnc -gif \
- -xplatform ${TARGET_OS}-${QTE_ARCH}-g++ ${EXTRA_OECONF_CONFIG} -depths 8,16,32 \
- -I${STAGING_KERNEL_DIR}/include"
+ -xplatform ${TARGET_OS}-${QTE_ARCH}-g++ ${EXTRA_OECONF_CONFIG} -depths 8,16,32"
EXTRA_OEMAKE = "-e"
#