Thread Dispatch via Interrupts
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Apr 29 11:31:41 UTC 2009
Chris Johns wrote:
> Sebastian Huber wrote:
>> Hi,
>>
>> a common task of interrupt handlers is to do a thread dispatch after the actual
>> interrupt processing. On many architectures this is done in assembler code
>> which lead recently to problems due to a data type size change, see also
>>
>> https://www.rtems.org/bugzilla/show_bug.cgi?id=1385
>>
>> On PowerPC we where not affected by this kind of problems, since we use this:
>>
>> void _ISR_Thread_dispatch(void)
>> {
>> if (_Context_Switch_necessary) {
>> _Thread_Dispatch();
>> } else if (_ISR_Signals_to_thread_executing) {
>> _ISR_Signals_to_thread_executing = false;
>> if (
>> _Thread_Do_post_task_switch_extension
>> || _Thread_Executing->do_post_task_switch_extension
>> ) {
>> _Thread_Executing->do_post_task_switch_extension = false;
>> _API_extensions_Run_postswitch();
>> }
>> }
>> }
>>
>> We should add this or a similar function to the super core.
>>
>> The ARM and m68k for example the thread dispatch is not done in this way. Is
>> there a reason for this?
>>
>
> The code you provided is not the same logic as the m68k. It does not handle
> _Thread_Do_post_task_switch_extension. I wonder if it should.
This is also an open point for me.
>
> Where do the stacks get managed in the C version ?
The lower level has to get this right. _ISR_Thread_dispatch() needs the same
environment as _Thread_Dispatch().
[...]
--
Sebastian Huber, Embedded Brains GmbH
Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the users
mailing list