This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: ecos newbie question: the stack for interrupt_end()
- From: Andrew Lunn <andrew at lunn dot ch>
- To: wyb <wyb at topsec dot com dot cn>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Sun, 11 Apr 2004 13:28:55 +0200
- Subject: Re: [ECOS] ecos newbie question: the stack for interrupt_end()
- References: <004901c41dff$0d52e960$a663a8c0@codingman>
On Fri, Apr 09, 2004 at 02:51:12PM +0800, wyb wrote:
> In arm HAL, the following code said that interrupt_end() should be called on
> the thread stack.
>
> =========================================
> spurious_IRQ:
> #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
> // If we are returning from the last nested interrupt, move back
> // to the thread stack. interrupt_end() must be called on the
> // thread stack since it potentially causes a context switch.
> ldr r2,.irq_level
> ldr r3,[r2]
> subs r1,r3,#1
> str r1,[r2]
> ldreq sp,[sp] // This should be the saved stack pointer
> #endif
> ==========================================
>
> But if the thread was in user mode, the "ldreq sp, [sp]" still loaded SP
> with svc_sp,not usr_sp.
The thread should not be in user mode. eCos runs everything in
supervisor mode.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss