Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2005 09:39:21 +0200
From:      gerarra@tin.it
To:        freebsd-hackers@freebsd.org
Subject:   Re: A bit confused with the sched_4bsd.c code
Message-ID:  <427AE2F700000446@ims3a.cp.tin.it>
In-Reply-To: <427A94C0.1020205@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help


>Halil Demirezen wrote:
>> Hello,
>> 
>> First of all, I am not sure if this is the correct mail list with post=
ing
>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 cod=
es.
>> Watson's Cross Reference is really helpful. In the schedcpu(void) func=
tion
>> there is an assignment like "ke =3D td->td_kse;" on line 438  (see: 
>> http://fxr.watson.org/fxr/source/kern/sched_4bsd.c?v=3DRELENG53#L438")=
.
>> When I look at the thread structure at sys/proc.h, I could not see suc=
h
>an
>> entry td_kse in the "thread" structure. How has this structure been ex=
tended
>
>> or this entry added to the thread structure?
>> 
>> Although the kernel codes seem to be simply understandable, there stil=
l
>lies
>> some difficulties to understand for an average C programmer: magic stu=
ff
>done
>> by professionals. :)
>> 
>> Anyway, any help really will be appreciated...
>> 
>> Thanks.
>
>Look near the top of the file for:
>
>#define td_kse td_sched
>
>That makes td->td_kse resolve to td->td_sched.  Now, there is
>other magic associated with td_sched in each scheduler source
>file, but that's different matter =3D-)

If you *really* want to dig inside sources remind that grep is your frien=
d

rookie




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?427AE2F700000446>