aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBernd Schmidt <bernds_cb1@t-online.de>2008-04-24 03:06:15 +0800
committerBryan Wu <cooloney@kernel.org>2008-04-24 03:06:15 +0800
commitd5adb029efad3c51db376d620319abe65d1efc21 (patch)
tree660caff4c28e904f00a040c0ed4a17d5010c6f20 /arch
parent1ebc723cf04b55e7aeeec2e758293575d29a9c2b (diff)
downloadkernel_samsung_smdk4412-d5adb029efad3c51db376d620319abe65d1efc21.zip
kernel_samsung_smdk4412-d5adb029efad3c51db376d620319abe65d1efc21.tar.gz
kernel_samsung_smdk4412-d5adb029efad3c51db376d620319abe65d1efc21.tar.bz2
[Blackfin] arch: This allows XIP to work with FD-PIC.
Previously, init failed to do anything meaningful; it turns out that the reason is that FD-PIC has a readonly data section which can be located in the XIP filesystem, and various address checks in the kernel reject such addresses for syscall arguments. Hence, init's execve ("/bin/sh", ...) failed with error code EFAULT. There's room for improvement here: in case people want to have filesystems on flash rather than in main memory, _access_ok should be modified to allow this. This bug fix is also dedicated to Michael Hennerich. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/kernel/process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index fb94cbe..be9fdd0 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -324,6 +324,12 @@ int _access_ok(unsigned long addr, unsigned long size)
return 1;
if (addr >= memory_mtd_end && (addr + size) <= physical_mem_end)
return 1;
+
+#ifdef CONFIG_ROMFS_MTD_FS
+ /* For XIP, allow user space to use pointers within the ROMFS. */
+ if (addr >= memory_mtd_start && (addr + size) <= memory_mtd_end)
+ return 1;
+#endif
#else
if (addr >= memory_start && (addr + size) <= physical_mem_end)
return 1;