From owner-freebsd-hackers@FreeBSD.ORG Fri May 6 02:46:55 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A36A116A4CE for ; Fri, 6 May 2005 02:46:55 +0000 (GMT) Received: from duchess.speedfactory.net (duchess.speedfactory.net [66.23.201.84]) by mx1.FreeBSD.org (Postfix) with SMTP id B13C143D8A for ; Fri, 6 May 2005 02:46:53 +0000 (GMT) (envelope-from ups@tree.com) Received: (qmail 902 invoked by uid 89); 5 May 2005 23:20:31 -0000 Received: from duchess.speedfactory.net (66.23.201.84) by duchess.speedfactory.net with SMTP; 5 May 2005 23:20:31 -0000 Received: (qmail 24351 invoked by uid 89); 5 May 2005 21:29:31 -0000 Received: from unknown (HELO palm.tree.com) (66.23.216.49) by duchess.speedfactory.net with SMTP; 5 May 2005 21:29:31 -0000 Received: from [127.0.0.1] (localhost.tree.com [127.0.0.1]) by palm.tree.com (8.12.10/8.12.10) with ESMTP id j45LIMw6021128; Thu, 5 May 2005 17:18:26 -0400 (EDT) (envelope-from ups@tree.com) From: Stephan Uphoff To: Halil Demirezen In-Reply-To: <200505060010.26184.halil@enderunix.org> References: <200505060010.26184.halil@enderunix.org> Content-Type: text/plain Message-Id: <1115327902.96600.6358.camel@palm> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 05 May 2005 17:18:22 -0400 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: A bit confused with the sched_4bsd.c code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2005 02:46:55 -0000 On Thu, 2005-05-05 at 20:10, Halil Demirezen wrote: > Hello, > > First of all, I am not sure if this is the correct mail list with posting this > mail. I apologize for that.. Second, I may seem to have little > C knowledge, though I am using C for about 5 years and plus. > > Let's start with the question. I am digging the FreeBSD-5.3 kernel codes. > Watson's Cross Reference is really helpful. In the schedcpu(void) function > there is an assignment like "ke = td->td_kse;" on line 438 (see: > http://fxr.watson.org/fxr/source/kern/sched_4bsd.c?v=RELENG53#L438"). > When I look at the thread structure at sys/proc.h, I could not see such an > entry td_kse in the "thread" structure. How has this structure been extended > or this entry added to the thread structure? > > Although the kernel codes seem to be simply understandable, there still lies > some difficulties to understand for an average C programmer: magic stuff done > by professionals. :) > > Anyway, any help really will be appreciated... > > Thanks. #define td_kse td_sched http://fxr.watson.org/fxr/source/kern/sched_4bsd.c?v=RELENG53#L95