From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 30 13:36:12 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C3C0106564A for ; Fri, 30 Mar 2012 13:36:12 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from mail-qa0-f42.google.com (mail-qa0-f42.google.com [209.85.216.42]) by mx1.freebsd.org (Postfix) with ESMTP id CAEB68FC1D for ; Fri, 30 Mar 2012 13:36:11 +0000 (UTC) Received: by qafi31 with SMTP id i31so499094qaf.15 for ; Fri, 30 Mar 2012 06:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=I48UusXnvdCISul1KXXNKF+jI3NyN0u3kp0ppYBpsI4=; b=Kgb93yy8XOoDgsjfT/kO4wkYEWX2W5xX7YjwGJxSeYHRQ9MYesfxZTkBE9sejOCFAE 3pNNxIl8mYOpPJDfcZNMetadtuLnrMnnpTZ/+6HulrEtuSmxYj29B9z3HlhRZFw9Trme 69Ah9wTqdRnDe1EmxA33V/TvEuzag2ldQIkbaN73VdtDeXSg9z2Fi+u97+isAtd5DK3h 4/VHE5wQeksGluP/cmr6w3fakAJqcyd+TSD+tlMTP4w5plgFefBhXBAiuwVhfd6Nno0F OZrj6xz9j69MDs8u6tjFOvjWH27ZAzBwbA/Nc07I0Qrku9bhHv3OdR0O7eUh+fqxg3FP lF6A== MIME-Version: 1.0 Received: by 10.229.136.200 with SMTP id s8mr865748qct.9.1333114570796; Fri, 30 Mar 2012 06:36:10 -0700 (PDT) Sender: giovanni.trematerra@gmail.com Received: by 10.229.36.14 with HTTP; Fri, 30 Mar 2012 06:36:10 -0700 (PDT) In-Reply-To: <1333041495.92141.YahooMailNeo@web193201.mail.sg3.yahoo.com> References: <1333041495.92141.YahooMailNeo@web193201.mail.sg3.yahoo.com> Date: Fri, 30 Mar 2012 15:36:10 +0200 X-Google-Sender-Auth: 6EqUXwQHpj0TjRZqOXSiGfNudJ8 Message-ID: From: Giovanni Trematerra To: Mahesh Babu Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-hackers@freebsd.org" Subject: Re: Context Switch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2012 13:36:12 -0000 On Thu, Mar 29, 2012 at 7:18 PM, Mahesh Babu 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