public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Lars Poeschel <larsi@wh2.tu-dresden.de>
To: "eCos Discussion" <ecos-discuss@ecos.sourceware.org>
Subject: [ECOS] RTC intr, context switch question
Date: Fri, 30 Mar 2007 09:23:00 -0000	[thread overview]
Message-ID: <200703301100.36190.larsi@wh2.tu-dresden.de> (raw)

Hello!
I am implementing context switch mechanism for fr30 architecture and maybe I 
did understand something wrong. My current interrupt handling is as follows:
An interrupt causes a lookup in hal_vsr_table and a jump to the location read 
there (normally contains address of __default_interrupt_vsr).
__default_interrupt_vsr then completly saves CPU context, and calls 
hal_interrupt_handlers[vector](vector, hal_interrupt_data[vector]).
After that interrupt_end(return_val, hal_interrupt_objects[vector], 
regster_state) is called, once this returns, saved CPU state is restored and 
return to program happens.

The kernel installs a scheduler_isr into the hal_interrupt _handlers, where 
HAL_THREAD_SWITCH_CONTEXT macro is called to switch from current to next 
thread. Is it right that HAL_THREAD_SWITCH_CONTEXT again saves CPU context to 
current threads stack ? Then I would have 2 contexts on stack and only one 
would be restored, because HAL_THREAD_SWITCH_CONTEXT immediately returns to 
next thread without using the rest of __default_interrupt_vsr where the 
context saved at the beginning of __default_interrupt_vsr is finnally 
restored.
I think this is not the way it should work. Please point me to the right 
direction.
Thanks,

Lars

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

                 reply	other threads:[~2007-03-30  8:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703301100.36190.larsi@wh2.tu-dresden.de \
    --to=larsi@wh2.tu-dresden.de \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).