Commit b2c2f303 authored by Jie Zhang's avatar Jie Zhang Committed by Bryan Wu

Blackfin arch: fix bug - shared lib function in L2 failed be called

Allow user space to access L2 SRAM.
Signed-off-by: default avatarJie Zhang <jie.zhang@analog.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 72edff8d
...@@ -351,9 +351,14 @@ int _access_ok(unsigned long addr, unsigned long size) ...@@ -351,9 +351,14 @@ int _access_ok(unsigned long addr, unsigned long size)
return 1; return 1;
#endif #endif
#if L1_DATA_B_LENGTH != 0 #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) && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH)
return 1; return 1;
#endif
#if L2_LENGTH != 0
if (addr >= L2_START + (_ebss_l2 - _stext_l2)
&& addr + size <= L2_START + L2_LENGTH)
return 1;
#endif #endif
return 0; return 0;
} }
......
...@@ -183,10 +183,10 @@ static void __init l2_sram_init(void) ...@@ -183,10 +183,10 @@ static void __init l2_sram_init(void)
return; return;
} }
free_l2_sram_head.next->paddr = (void *)L2_START + free_l2_sram_head.next->paddr =
(_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); (void *)L2_START + (_ebss_l2 - _stext_l2);
free_l2_sram_head.next->size = L2_LENGTH - free_l2_sram_head.next->size =
(_etext_l2 - _stext_l2) + (_edata_l2 - _sdata_l2); L2_LENGTH - (_ebss_l2 - _stext_l2);
free_l2_sram_head.next->pid = 0; free_l2_sram_head.next->pid = 0;
free_l2_sram_head.next->next = NULL; free_l2_sram_head.next->next = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment