Re: what is static inline void tvec_base

2010-08-28 Thread James Bond
On Sun, Aug 29, 2010 at 2:02 AM, Greg Freemyer wrote: > > http://lxr.linux.no/#linux+v2.6.35/Documentation/CodingStyle#L692 > > You can see they complain about over use of inline, especially since > gcc will find the obvious cases on its own. > > This was really interesting Greg.Thanks for making

Re: what is static inline void tvec_base

2010-08-28 Thread Greg Freemyer
On Sat, Aug 28, 2010 at 1:05 PM, James Bond wrote: > > > On Sat, Aug 28, 2010 at 5:39 PM, Greg Freemyer > wrote: >> >> http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Inline.html >> >> note the last sentence of that doc >> >>               GCC does not inline any functions when not optimizing >> unle

Re: what is static inline void tvec_base

2010-08-28 Thread James Bond
On Sat, Aug 28, 2010 at 5:39 PM, Greg Freemyer wrote: > > http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Inline.html > > note the last sentence of that doc > > GCC does not inline any functions when not optimizing > unless you specify the `always_inline' attribute for the function, > li

Re: what is static inline void tvec_base

2010-08-28 Thread James Bond
On Sat, Aug 28, 2010 at 5:39 PM, Greg Freemyer wrote: > > HTH (Hope That Helps) > Greg > > Hi Greg yes.Thanks for the wonderful explanation yes it did helped. -- To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment

Re: what is static inline void tvec_base

2010-08-28 Thread Greg Freemyer
On Fri, Aug 27, 2010 at 11:41 PM, James Bond wrote: > Hi, > Stephan thanks a lot for the link. > I also have a small doubt.Please see if you can resolve > > As per my understanding > > 1) Defining any function as static tells the compiler that the > function can only be used in the file the functi

Re: what is static inline void tvec_base

2010-08-28 Thread Tapas Mishra
On Sat, Aug 28, 2010 at 12:06 PM, James Bond wrote: > No not yet clear. > To make a function call CPU has to save registers and pass on ret instructions when ever the function call ends if we have a small fucntion which is used in a file and a function call via CPU then over head of saving flag

Re: what is static inline void tvec_base

2010-08-28 Thread Tapas Mishra
On Fri, Aug 27, 2010 at 10:53 PM, James Bond wrote: > > > > Hi, > I am new to kernel development. > So after being able to have some basic understand of some things I just went > through source code. > I was going through a file known as > linux-2.6.34/kernel/timer.c and found following code. > I

Re: what is static inline void tvec_base

2010-08-27 Thread James Bond
On Sat, Aug 28, 2010 at 11:07 AM, Mulyadi Santosa wrote: > > casual "inline" is at the mercy of compiler to decide, whether to > really inline the functions or not. > > while "always inline"...you surely have the good guess now :D > > No not yet clear. -- To be yourself in a world that is cons

Re: what is static inline void tvec_base

2010-08-27 Thread arshad hussain
On 8/28/2010 11:07 AM, Mulyadi Santosa wrote: On Sat, Aug 28, 2010 at 12:19, James Bond wrote: Please don't top post :) What is that top post I never came across such a thing in timer code? top post is a way to put your reply on top of the quoted previous message...while what we do in kerne

Re: what is static inline void tvec_base

2010-08-27 Thread James Bond
On Sat, Aug 28, 2010 at 10:41 AM, Mulyadi Santosa wrote: > On Sat, Aug 28, 2010 at 12:09, Tapas Mishra > wrote: > > Sorry in previous post I did not made clear actually what I wanted to > > say is if you have a function is used at 10 places and you declare it > > inline 10 times then there would

Re: what is static inline void tvec_base

2010-08-27 Thread Mulyadi Santosa
On Sat, Aug 28, 2010 at 12:19, James Bond wrote: >> Please don't top post :) >> > What is that top post I never came across such a thing in timer code? top post is a way to put your reply on top of the quoted previous message...while what we do in kernelnewbies is the other way around... >> That

Re: what is static inline void tvec_base

2010-08-27 Thread Mulyadi Santosa
On Sat, Aug 28, 2010 at 12:09, Tapas Mishra wrote: > Sorry in previous post I did not made clear actually what I wanted to > say is if you have a function is used at 10 places and you declare it > inline 10 times then there would be cache miss more and then it will > have disadvantage. Please don

Re: what is static inline void tvec_base

2010-08-27 Thread Tapas Mishra
Sorry in previous post I did not made clear actually what I wanted to say is if you have a function is used at 10 places and you declare it inline 10 times then there would be cache miss more and then it will have disadvantage. On Sat, Aug 28, 2010 at 10:37 AM, Tapas Mishra wrote: > I forgot to m

Re: what is static inline void tvec_base

2010-08-27 Thread Tapas Mishra
What I understand with respect to static and inline functions is To make a function call CPU has to save registers and pass on ret instructions when ever the function call ends if we have a small fucntion which is used in a file and a function call via CPU then over head of saving flag registers

Re: what is static inline void tvec_base

2010-08-27 Thread Mulyadi Santosa
Hi.. Sorry for crossing ,... On Sat, Aug 28, 2010 at 11:23, James Bond wrote: >> > 1) Defining any function as static tells the compiler that the >> > function can only be used in the file the function was defined in >> > >> Yes. >> > So why is that used in the code timer.c? > > AFAIK, static

Re: what is static inline void tvec_base

2010-08-27 Thread James Bond
On Sat, Aug 28, 2010 at 9:44 AM, zeal wrote: > On Sat, Aug 28, 2010 at 11:41 AM, James Bond > wrote: > > Hi, > > Stephan thanks a lot for the link. > > I also have a small doubt.Please see if you can resolve > > > > As per my understanding > > > > 1) Defining any function as static tells the com

Re: what is static inline void tvec_base

2010-08-27 Thread zeal
On Sat, Aug 28, 2010 at 11:41 AM, James Bond wrote: > Hi, > Stephan thanks a lot for the link. > I also have a small doubt.Please see if you can resolve > > As per my understanding > > 1) Defining any function as static tells the compiler that the > function can only be used in the file the functi

Re: what is static inline void tvec_base

2010-08-27 Thread James Bond
Hi, Stephan thanks a lot for the link. I also have a small doubt.Please see if you can resolve As per my understanding 1) Defining any function as static tells the compiler that the function can only be used in the file the function was defined in 2) inline function is that, even though you can

Re: what is static inline void tvec_base

2010-08-27 Thread StephanT
> Please give some online link to what you said I will go through it. http://www.google.com/search?hl=en&client=firefox-a&hs=yTX&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&q=dennis+ritchie+c+pdf&cts=1282966271211&aq=2sx&aqi=g-s1g-sx9&aql=&oq=denis+ritc&gs_rfai= Say a short prayer every time

Re: what is static inline void tvec_base

2010-08-27 Thread James Bond
On Sat, Aug 28, 2010 at 1:51 AM, Greg Freemyer wrote: > > in the kernel use advance C constructs which even advanced user space > C programmers find hard to grasp. Questions about those types of > usage are very appropriate for this list and will often be better > addressed in kernel specific boo

Re: what is static inline void tvec_base

2010-08-27 Thread Greg Freemyer
On Fri, Aug 27, 2010 at 1:23 PM, James Bond wrote: > > Hi, > I am new to kernel development. > So after being able to have some basic understand of some things I just went > through source code. > I was going through a file known as > linux-2.6.34/kernel/timer.c and found following code. > I want

what is static inline void tvec_base

2010-08-27 Thread James Bond
Hi, I am new to kernel development. So after being able to have some basic understand of some things I just went through source code. I was going through a file known as linux-2.6.34/kernel/timer.c and found following code. I want to understand what is it doing. What should I be reading to be able