Commit adf6f48e authored by Wayne Ren's avatar Wayne Ren Committed by Andrew Boie
Browse files

arch: arc: add the support of STACK_SENTINEL



* call the _check_stack_sentinel in unnested isr
return.

* for firq, _check_stack_sentinel is called in kernel
  isr stack because the limitation of banked register

* for normal irq, _check_stak_sentinel is called in
  the interruptted thread stack

Signed-off-by: default avatarWayne Ren <wei.ren@synopsys.com>
parent 8da51ee3
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -123,8 +123,6 @@ firq_nest:

SECTION_FUNC(TEXT, _firq_exit)

	pop sp

#if CONFIG_RGF_NUM_BANKS != 1
#ifndef CONFIG_FIRQ_NO_LPCC
	/* restore lp_count, lp_start, lp_end from r23-r25 */
@@ -142,6 +140,10 @@ SECTION_FUNC(TEXT, _firq_exit)
	bne.d	_firq_no_reschedule
	st	r0, [r1]

#ifdef CONFIG_STACK_SENTINEL
	bl _check_stack_sentinel
#endif

#ifdef CONFIG_PREEMPT_ENABLED

	mov_s r1, _kernel
@@ -164,6 +166,8 @@ SECTION_FUNC(TEXT, _firq_exit)

.balign 4
_firq_no_reschedule:
	pop sp

	/*
	 * Keeping this code block close to those that use it allows using brxx
	 * instruction instead of a pair of cmp and bxx
@@ -207,6 +211,7 @@ _firq_no_reschedule:

.balign 4
_firq_reschedule:
	pop sp

#if CONFIG_RGF_NUM_BANKS != 1
	/*
+4 −0
Original line number Diff line number Diff line
@@ -95,6 +95,10 @@ SECTION_FUNC(TEXT, _rirq_exit)
	bne.d	_rirq_return_from_rirq
	st	r0, [r1]

#ifdef CONFIG_STACK_SENTINEL
	bl _check_stack_sentinel
#endif

#ifdef CONFIG_PREEMPT_ENABLED

	mov r1, _kernel