arch: armv7-a: Fix heap corruption in SMP mode
Currently up_allocate_heap() assumes that g_idle_topstack points top of the heap memory. However, g_idle_topstack pointed incorrect address in SMP mode which resulted in heap corruption. This PR moves g_idle_topstack at the end of .noinit to avoid this issue. Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
7513cb6921
commit
e7d44ee16e
@ -494,5 +494,14 @@ g_cpu3_idlestack:
|
||||
#endif /* CONFIG_SMP_NCPUS > 3 */
|
||||
#endif /* CONFIG_SMP_NCPUS > 2 */
|
||||
#endif /* CONFIG_SMP_NCPUS > 1 */
|
||||
#endif
|
||||
|
||||
.align 8
|
||||
.globl g_idle_topstack
|
||||
.type g_idle_topstack, object
|
||||
|
||||
g_idle_topstack:
|
||||
.long _enoinit
|
||||
.size g_idle_topstack, .-g_idle_topstack
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
.end
|
||||
|
@ -784,6 +784,7 @@ arm_data_initialize:
|
||||
* Data section variables
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SMP
|
||||
/* This global variable is unsigned long g_idle_topstack and is
|
||||
* exported from here only because of its coupling to .Linitparms
|
||||
* above.
|
||||
@ -804,3 +805,4 @@ g_idle_topstack:
|
||||
.size g_idle_topstack, .-g_idle_topstack
|
||||
#endif
|
||||
.end
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user