public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Separate interrupt stack for i386
@ 2000-11-28 20:00 Fabrice Gautier
  2000-11-29  3:00 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Gautier @ 2000-11-28 20:00 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

As far as i know there is no separate interrupt stack for the i386-PC
target, am I right?

So how should this be done ? Any advice ? Someone already thought of that?

Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Separate interrupt stack for i386
  2000-11-28 20:00 [ECOS] Separate interrupt stack for i386 Fabrice Gautier
@ 2000-11-29  3:00 ` Nick Garnett
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2000-11-29  3:00 UTC (permalink / raw)
  To: ecos-discuss

Fabrice Gautier <Fabrice_Gautier@sdesigns.com> writes:

> Hi,
> 
> As far as i know there is no separate interrupt stack for the i386-PC
> target, am I right?
> 
> So how should this be done ? Any advice ? Someone already thought of that?
> 

The basic advice here is to take a look at an architecture that
already has this done, I always suggest MIPS. Take a look at the bits
surrounded by the CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
ifdefs in vectors.S.

There are basically three pieces of code that need to be written:

1. Early in the interrupt VSR detect whether you are already on the
   interrupt stack and move to it if not.

2. Before calling interrupt_end() move back to the thread stack for
   the last nested interrupt to be returned from. The technique of
   always pushing the original stack address in step 1 and just
   popping it here makes this very simple.

3. Write the hal_interrupt_stack_call_pending_DSRs function. This just
   switches to the interrupt stack, enables interrupts and calls back
   into the kernel to call DSRs. The only complication here is to make
   sure that the original interrupt state is restored before
   returning.

And that's all there it to it.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-11-29  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-28 20:00 [ECOS] Separate interrupt stack for i386 Fabrice Gautier
2000-11-29  3:00 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).