hi,Baruch<br><br>thanks for you kindly replay;<br>I am still lost in this maze, so does extern "C" help user space C++ program to call schedule/printk?<br>sys_xxx functions are called through SWI ,not directly called from user space C++ program;<br><br>BR<br><pre>rocky<br><br>At&nbsp;2010-11-22&nbsp;16:30:10,"Baruch&nbsp;Siach"&nbsp;&lt;baruch@tkos.co.il&gt;&nbsp;wrote:

&gt;Hi&nbsp;rocky,
&gt;
&gt;On&nbsp;Sat,&nbsp;Nov&nbsp;20,&nbsp;2010&nbsp;at&nbsp;12:17:02PM&nbsp;+0800,&nbsp;rocky&nbsp;wrote:
&gt;&gt;&nbsp;I&nbsp;am&nbsp;a&nbsp;little&nbsp;confused&nbsp;about&nbsp;the&nbsp;following&nbsp;definition&nbsp;:
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;--------------include/linux/linkage.h-----------
&gt;&gt;&nbsp;#ifdef&nbsp;__cplusplus
&gt;&gt;&nbsp;#define&nbsp;CPP_ASMLINKAGE&nbsp;extern&nbsp;"C"
&gt;&gt;&nbsp;#else
&gt;&gt;&nbsp;#define&nbsp;CPP_ASMLINKAGE
&gt;&gt;&nbsp;#endif
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;#ifndef&nbsp;asmlinkage
&gt;&gt;&nbsp;#define&nbsp;asmlinkage&nbsp;CPP_ASMLINKAGE
&gt;&gt;&nbsp;#endif
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;all&nbsp;system&nbsp;call&nbsp;functions&nbsp;are&nbsp;marked&nbsp;with&nbsp;asmlinkage,&nbsp;as&nbsp;well&nbsp;as&nbsp;other&nbsp;kernel&nbsp;function&nbsp;like&nbsp;printk/schedule/do_softirq
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;so&nbsp;every&nbsp;asmlinkage&nbsp;function&nbsp;has&nbsp;extern&nbsp;"C"&nbsp;&nbsp;attribute&nbsp;if&nbsp;cplusplus&nbsp;is&nbsp;defined,&nbsp;which&nbsp;definitely&nbsp;happens&nbsp;&nbsp;when&nbsp;compiling&nbsp;C++&nbsp;code.
&gt;&gt;&nbsp;
&gt;&gt;&nbsp;I&nbsp;dont&nbsp;get&nbsp;it&nbsp;when&nbsp;cplusplus&nbsp;is&nbsp;needed&nbsp;when&nbsp;compiling&nbsp;kernel?
&gt;
&gt;It&nbsp;isn't.
&gt;
&gt;&gt;&nbsp;Can&nbsp;anyone&nbsp;help&nbsp;me&nbsp;out&nbsp;of&nbsp;this&nbsp;little&nbsp;misunderstanding?
&gt;
&gt;Userspace&nbsp;C++&nbsp;code&nbsp;may&nbsp;include&nbsp;kernel&nbsp;header&nbsp;files.&nbsp;Making&nbsp;the&nbsp;exported&nbsp;
&gt;function&nbsp;calls&nbsp;extern&nbsp;"C"&nbsp;makes&nbsp;it&nbsp;easier&nbsp;to&nbsp;build&nbsp;such&nbsp;applications.
&gt;
&gt;baruch
&gt;
&gt;--&nbsp;
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;~.&nbsp;.~&nbsp;&nbsp;&nbsp;Tk&nbsp;Open&nbsp;Systems
&gt;=}------------------------------------------------ooO--U--Ooo------------{=
&gt;&nbsp;&nbsp;&nbsp;-&nbsp;baruch@tkos.co.il&nbsp;-&nbsp;tel:&nbsp;+972.2.679.5364,&nbsp;http://www.tkos.co.il&nbsp;-
&gt;
&gt;_______________________________________________
&gt;linux-arm-kernel&nbsp;mailing&nbsp;list
&gt;linux-arm-kernel@lists.infradead.org
&gt;http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
</pre><br><br><span title="neteasefooter"><span id="netease_mail_footer"><hr/>
<a href="http://help.163.com/10/1108/18/6L03I4G500753VB8.html" target="_blank">网易163/126邮箱百分百兼容iphone ipad邮件收发</a>
</span></span>