Richi,
inside the contextswitch function, the current context ist suspended (so it is stuck/frozen die nside the context switch code) and execution switches to a different task. When the first task is reactivated, it leaves the contextswitch function. Therefore all the code around the context switch function handles the same task it was called for.
--------------------------------------------
embedded brains GmbH
Thomas Doerfler
Dornierstr. 4
D-82178 Puchheim
Germany
email: thomas.doerf...@embedded-brains.de
Phone: +49-89-18 94 741-12
Fax: +49-89-18 94 741-09
PGP: Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
embedded brains GmbH
Thomas Doerfler
Dornierstr. 4
D-82178 Puchheim
Germany
email: thomas.doerf...@embedded-brains.de
Phone: +49-89-18 94 741-12
Fax: +49-89-18 94 741-09
PGP: Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Am 31.10.2020 16:49 schrieb Richi Dubey <richidu...@gmail.com>:
Hi,I want to learn more about how context switching works in RTEMS. I saw the following lines in theaddispatch.c:_Thread_Save_fp( executing );
_Context_Switch( &executing->Registers, &heir->Registers );
_Thread_Restore_fp( executing );I do not understand how it works. Here, the executing process saves its context by calling _Thread_Save_fp( executing ), then if a different process resumes execution after the context switch, why does it get the context of previous process (executing)?Can someone help me learn more about this?Thanks,Richi.
_______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel