Context Switch

Giovanni Trematerra gianni at freebsd.org
Fri Mar 30 13:36:12 UTC 2012


On Thu, Mar 29, 2012 at 7:18 PM, Mahesh Babu <maheshbabu90 at yahoo.co.in> wrote:
> Which part of the source code in FreeBSD 9 is responsible for making context switching i.e. storing and restoring the process state.
>

Context switch is split up in machine indipendent code (MI Code) and
machine dependent code (MD Code)

For MI part take a look at
mi_switch in sys/kern/kern_sync.c
sched_switch in sys/kern/sched_ule.c and sys/kern_4bsd.c depending on
configurated scheduler in the kernel config file.

For MD part search for symbol cpu_switch inside the specific arch directory.

--
Gianni


More information about the freebsd-hackers mailing list