Ooops,

Embarrassingly, 0001-use-different-base-address-for-sh4.patch didn't
work as expected...
and 
0002-waste-less-memory-on-sh4.patch has whitespace fixed now.

so I'm resending those two...


a.

>From 7e750c308d62451f4154a089d5796a9773bd008b Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Andr=C3=A9=20Draszik?= <andre.dras...@st.com>
Date: Tue, 14 Apr 2009 19:52:38 +0100
Subject: [PATCH] use different base address for sh4
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

as the default one is in the sh4 shared library address space

Signed-off-by: André Draszik <andre.dras...@st.com>
---
 linux/drivers/char/fusion/shmpool.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/char/fusion/shmpool.h b/linux/drivers/char/fusion/shmpool.h
index 4f10d58..8feebeb 100644
--- a/linux/drivers/char/fusion/shmpool.h
+++ b/linux/drivers/char/fusion/shmpool.h
@@ -18,8 +18,10 @@
 #include "fusiondev.h"
 #include "types.h"
 
-#ifdef __mips__
+#if defined(__mips__)
 #define FUSION_SHM_BASE_32	0x50010000	/* virtual base address */
+#elif defined(CONFIG_CPU_SH4)
+#define FUSION_SHM_BASE_32	0x30010000	/* virtual base address */
 #else
 #define FUSION_SHM_BASE_32	0x20010000	/* virtual base address */
 #endif
-- 
1.5.6.3

>From ec15d5bb56a2cd44492ded9b2a9a0baf2e56a212 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Andr=C3=A9=20Draszik?= <andre.dras...@st.com>
Date: Tue, 14 Apr 2009 19:54:27 +0100
Subject: [PATCH] waste less memory on sh4
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

shared memory needs only to be 16k aligned on sh4, not 64k which is the
default assumption fusion makes

Signed-off-by: André Draszik <andre.dras...@st.com>
---
 linux/drivers/char/fusion/shmpool.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/char/fusion/shmpool.c b/linux/drivers/char/fusion/shmpool.c
index 9954edc..ec61a45 100644
--- a/linux/drivers/char/fusion/shmpool.c
+++ b/linux/drivers/char/fusion/shmpool.c
@@ -110,7 +110,17 @@ fusion_shmpool_construct(FusionEntry * entry, void *ctx, void *create_ctx)
 	shmpool->addr_base = poolnew->addr_base = addr_base;
 
 	addr_base += PAGE_ALIGN(poolnew->max_size) + PAGE_SIZE;
-	addr_base = (void*)((unsigned long)(addr_base + 0xffff) & ~0xffff);
+#if defined(CONFIG_CPU_SH4)
+	/* a generic kernel api for retrieving information about mmap
+	   restrictions would be nice! On sh4, shm_align_mask is 16k-1 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
+#  define shm_align_mask   0x3fff
+#endif
+#else
+/* FIXME: might have a different value on other arches, we are conservative and use 64k-1 */
+#  define shm_align_mask   0xffff
+#endif
+	addr_base = (void*)((unsigned long)(addr_base + shm_align_mask) & ~shm_align_mask);
 
 	shmpool->addr_entry = add_addr_entry(addr_base);
 
-- 
1.5.6.3

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to