From b2c2f30388c682520ae2d07c8852b4225dd4a4d7 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Tue, 28 Oct 2008 15:57:49 +0800 Subject: [PATCH] Blackfin arch: fix bug - shared lib function in L2 failed be called Allow user space to access L2 SRAM. Signed-off-by: Jie Zhang Signed-off-by: Bryan Wu --- arch/blackfin/kernel/process.c | 7 ++++++- arch/blackfin/mm/sram-alloc.c | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 77800dd83e57..0c3ea118b657 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c @@ -351,9 +351,14 @@ int _access_ok(unsigned long addr, unsigned long size) return 1; #endif #if L1_DATA_B_LENGTH != 0 - if (addr >= L1_DATA_B_START + if (addr >= L1_DATA_B_START + (_ebss_b_l1 - _sdata_b_l1) && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH) return 1; +#endif +#if L2_LENGTH != 0 + if (addr >= L2_START + (_ebss_l2 - _stext_l2) + && addr + size <= L2_START + L2_LENGTH) + return 1; #endif return 0; } diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c index 0f1ca6930c16..cc6f336e7313 100644 --- a/arch/blackfin/mm/sram-alloc.c +++ b/arch/blackfin/mm/sram-alloc.c @@ -183,10 +183,10 @@ static void __init l2_sram_init(void) return; } - free_l2_sram_head.next->paddr = (void *)L2_START + - (_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); - free_l2_sram_head.next->size = L2_LENGTH - - (_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); + free_l2_sram_head.next->paddr = + (void *)L2_START + (_ebss_l2 - _stext_l2); + free_l2_sram_head.next->size = + L2_LENGTH - (_ebss_l2 - _stext_l2); free_l2_sram_head.next->pid = 0; free_l2_sram_head.next->next = NULL; -- 2.34.1