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 2010-11-22 16:30:10,"Baruch Siach" <baruch@tkos.co.il> wrote:
>Hi rocky,
>
>On Sat, Nov 20, 2010 at 12:17:02PM +0800, rocky wrote:
>> I am a little confused about the following definition :
>>
>> --------------include/linux/linkage.h-----------
>> #ifdef __cplusplus
>> #define CPP_ASMLINKAGE extern "C"
>> #else
>> #define CPP_ASMLINKAGE
>> #endif
>>
>> #ifndef asmlinkage
>> #define asmlinkage CPP_ASMLINKAGE
>> #endif
>>
>> all system call functions are marked with asmlinkage, as well as other kernel function like printk/schedule/do_softirq
>>
>>
>> so every asmlinkage function has extern "C" attribute if cplusplus is defined, which definitely happens when compiling C++ code.
>>
>> I dont get it when cplusplus is needed when compiling kernel?
>
>It isn't.
>
>> Can anyone help me out of this little misunderstanding?
>
>Userspace C++ code may include kernel header files. Making the exported
>function calls extern "C" makes it easier to build such applications.
>
>baruch
>
>--
> ~. .~ Tk Open Systems
>=}------------------------------------------------ooO--U--Ooo------------{=
> - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
>
>_______________________________________________
>linux-arm-kernel mailing list
>linux-arm-kernel@lists.infradead.org
>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>