473,566 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

inline usage in C linux kernel

hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_outpu t(struct sk_buff *skb)
{
return __ip_finish_out put(skb);
}

and also __ip_finish_out put is written as
static __inline__ int __ip_finish_out put(struct sk_buff *skb)
what are these changes in kernel? Does they are for optimization?

2)Also ip_output is calling __ip_finish_out put instead ip_finish_outpu t
why?
3) what is difference between declaring following 2 inline functions
static inline int ip_finish_outpu t2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_out put(struct sk_buff *skb)
please correct me.
regards,
rahul.

Nov 14 '05 #1
4 2688
In article <11************ *********@z14g2 000cwz.googlegr oups.com>,
<ra*******@gmai l.com> wrote:
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_outpu t(struct sk_buff *skb)
{
return __ip_finish_out put(skb);
}
You should ask that in a Linux developer's newsgroup, as it
is not a point that has to do with C itself.

3) what is difference between declaring following 2 inline functions
static inline int ip_finish_outpu t2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_out put(struct sk_buff *skb)


'inline' is not part of C89 (I don't know about C99),
so the two could be there for reasons having to do with
two different implimentations of 'inline'.
--
'ignorandus (Latin): "deserving not to be known"'
-- Journal of Self-Referentialism
Nov 14 '05 #2
ra*******@gmail .com wrote:
hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_outpu t(struct sk_buff *skb)
{
return __ip_finish_out put(skb);
}

and also __ip_finish_out put is written as
static __inline__ int __ip_finish_out put(struct sk_buff *skb)
what are these changes in kernel? Does they are for optimization?

7.1.3 Reserved identifiers

[...]
-- All identifiers that begin with an underscore and
either an uppercase letter or another underscore are
always reserved for any use.

__ip_finish_out put is reserved for the implementation. In this case,
the implementors (the Linux kernel coders) have decided that this
roughly means "do not use for general kernel code; use it only if you
really know what you're doing." This is getting off-topic; see your
friendly Linux newsgroup for details (comp.os.linux. development*)

If you're not writing kernel or other very special purpose code, do not
ever infringe upon anything reserved for the implementation.

<snip> 3) what is difference between declaring following 2 inline functions
static inline int ip_finish_outpu t2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_out put(struct sk_buff *skb)


Once again, by its double underscore prefix, __inline__ is reserved for
the implementation. In this case it's for the compiler, and offtopic
here, so go consult your version of gcc's manual for the details.
Mark F. Haigh
mf*****@sbcglob al.net

Nov 14 '05 #3
rahul8143 wrote:
hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_outpu t(struct sk_buff *skb)
{
return __ip_finish_out put(skb);
}


Wrong newsgroup. Try comp.os.linux.d evelopment.syst em
Nov 14 '05 #4
In article <11************ *********@z14g2 000cwz.googlegr oups.com>,
ra*******@gmail .com wrote:
hello,
I have some inline declaration questions.
1)why new kernel 2.4.30 has intermediate function of __ instead of
direct calling it?
int ip_finish_outpu t(struct sk_buff *skb)
{
return __ip_finish_out put(skb);
}

and also __ip_finish_out put is written as
static __inline__ int __ip_finish_out put(struct sk_buff *skb)
what are these changes in kernel? Does they are for optimization?

2)Also ip_output is calling __ip_finish_out put instead ip_finish_outpu t
why?
3) what is difference between declaring following 2 inline functions
static inline int ip_finish_outpu t2(struct sk_buff *skb)
and
static __inline__ int __ip_finish_out put(struct sk_buff *skb)
please correct me.
regards,


I looked through my copy of the C Standard, and I just couldn't find
this "new kernel 2.4.30" thing anywhere mentioned in it. Are you sure
you are posting to the right newsgroup here?
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5870
by: bouchia.nazha | last post by:
Hello I have encountered a problem using tomcat, linux and ssl. My problem seem to be a JVM memory deallocation problem on Linux. This is my configuration: OS: Redhat7.2 Tomcat: 4.0 Jdk: 1.3.1_07
34
5058
by: Maboroshi | last post by:
Hello My question has to do with python and linux - I was interested in finding out what it would take to reimplement the Linux Kernel in python basically just taking the source code from linux and rewriting it in python Would this idea make sense to do - if so what would be the benefits of doing this and in what way would this not be a...
3
3319
by: Steven T. Hatton | last post by:
http://netlab.ru.is/exception/LinuxCXX.shtml We have implemented a complete kernel level run-time support for C++ in the Linux kernel. In particular our run-time support enables the full use of C++ exceptions in the Linux kernel, but notably also includes support for global constructors and destructors, and dynamic type checking. Our kernel...
4
6759
by: PaulR | last post by:
Hi, We have a Server running SLES 8 and 3GB memory, with 1 DB2 instance and 2 active Databases. General info... DB2level = "DB2 v8.1.0.72", "s040914", "MI00086", and FixPak "7" uname -a = Linux galahad 2.4.19-64GB-SMP #1 SMP /etc/sysctl.conf kernel.shmmax=268435456
5
2516
by: Ralf Gross | last post by:
Hi, we have a little problem with the dependencies of an application (MKS) that we want to upgrade to a new version. The application now runs on a Suse Linux 7.3 system with 2.4 kernel and DB2 7.2. We want to upgrade this application to the recent version and move it to new host. This system will be RedHat EL 4 with kernel 2.6 and DB2...
27
3847
by: Mike | last post by:
Open source programs in general suck pretty bad also. Here are some loose facts regarding why projects like Linux, PHP, MYSQL, and other open source programs suck: - Linux is simply a clone of an operating system over 20 years old similar to DOS (Unix). That's ALL Linux is. The kernal was taken, decompiled, and stolen by Linus himself....
31
1765
by: arun | last post by:
I know it is a free compiler. But does it follow any standard? If so which standard is it? (Ansi, Ecma, etc?)
12
3107
by: sethukr | last post by:
Hi everybody, Can anyone give me a simple program which would consumes more CPU usage (more than 50%) in windows? Thanks, Sethu
8
1673
by: anchitgood | last post by:
Hey, I have developed a project on C++, but under windows. But we have got to run it in an open source (LINUX). Can anyone tell me what features of C++ are not supported in Linux ? Like i have heard Linux doesn't support esception handling and destructors. Similarly what about strings and other C++ features (say class, inheritance etc.) ?...
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.