Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2012 15:36:10 +0200
From:      Giovanni Trematerra <gianni@freebsd.org>
To:        Mahesh Babu <maheshbabu90@yahoo.co.in>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Context Switch
Message-ID:  <CACfq09232Vj5JEdZa=2YUnX%2BpXGD7EcoDA0sHQ%2BPfeyjdZT%2B_g@mail.gmail.com>
In-Reply-To: <1333041495.92141.YahooMailNeo@web193201.mail.sg3.yahoo.com>
References:  <1333041495.92141.YahooMailNeo@web193201.mail.sg3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 29, 2012 at 7:18 PM, Mahesh Babu <maheshbabu90@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACfq09232Vj5JEdZa=2YUnX%2BpXGD7EcoDA0sHQ%2BPfeyjdZT%2B_g>