Re: what is static inline void tvec_base

2010-08-28 Thread arshad hussain
On 8/28/2010 11:07 AM, Mulyadi Santosa wrote: On Sat, Aug 28, 2010 at 12:19, James Bondjamesbond.2...@gmail.com 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

Re: what is static inline void tvec_base

2010-08-28 Thread James Bond
On Sat, Aug 28, 2010 at 11:07 AM, Mulyadi Santosa mulyadi.sant...@gmail.com 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

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 jamesbond.2...@gmail.com 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

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 jamesbond.2...@gmail.com 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

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 jamesbond.2...@gmail.com 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

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 greg.freem...@gmail.comwrote: 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

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 jamesbond.2...@gmail.com wrote: On Sat, Aug 28, 2010 at 5:39 PM, Greg Freemyer greg.freem...@gmail.com 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

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 greg.freem...@gmail.comwrote: 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

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

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 jamesbond.2...@gmail.com 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

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 greg.freem...@gmail.comwrote: 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

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=enclient=firefox-ahs=yTXrls=org.mozilla%3Aen-US%3Aofficialchannel=sq=dennis+ritchie+c+pdfcts=1282966271211aq=2sxaqi=g-s1g-sx9aql=oq=denis+ritcgs_rfai= Say a short prayer every time you open

Re: what is static inline void tvec_base

2010-08-27 Thread James Bond
On Sat, Aug 28, 2010 at 9:44 AM, zeal zealc...@gmail.com wrote: On Sat, Aug 28, 2010 at 11:41 AM, James Bond jamesbond.2...@gmail.com 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

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 jamesbond.2...@gmail.com 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?

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 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 mightydre...@gmail.com

Re: what is static inline void tvec_base

2010-08-27 Thread Mulyadi Santosa
On Sat, Aug 28, 2010 at 12:09, Tapas Mishra mightydre...@gmail.com 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

Re: what is static inline void tvec_base

2010-08-27 Thread Mulyadi Santosa
On Sat, Aug 28, 2010 at 12:19, James Bond jamesbond.2...@gmail.com 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

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 mulyadi.sant...@gmail.com wrote: On Sat, Aug 28, 2010 at 12:09, Tapas Mishra mightydre...@gmail.com 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