<br><br><div class="gmail_quote">On Mon, Jan 14, 2013 at 4:50 AM, horseriver <span dir="ltr"><<a href="mailto:horserivers@gmail.com" target="_blank">horserivers@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, Jan 13, 2013 at 09:27:45PM -0800, Dave Hylands wrote:<br>
</div><div class="im">> Hi,<br>
><br>
> On Sun, Jan 13, 2013 at 11:29 AM, horseriver <<a href="mailto:horserivers@gmail.com">horserivers@gmail.com</a>> wrote:<br>
> ><br>
> > hi:<br>
> ><br>
> > In kernel code . some function is defined by<br>
> __attribute__((__section__(".initcall" level ".init")))<br>
> ><br>
> > what does this do ?<br>
><br>
> It puts the address of the function in a linker section named<br>
> .initcallX.init where X is replaced by the level.<br>
><br>
> These functions are called in order to initialize various subsystems and<br>
> drivers during kernel bootup.<br>
<br>
</div> Thanks!<br>
<br>
Another question:<br>
<br>
__attribute__((regparm(3))) ; what does this do ?<br>
<div class="im HOEnZb"><br>
<br>
<br></div></blockquote><div>A simple google search should have answered this<br><a href="http://ohse.de/uwe/articles/gcc-attributes.html">http://ohse.de/uwe/articles/gcc-attributes.html</a><br><br>Synopsis<br> <br><dt><a name="func-regparm">regparm (NUMBER)
</a></dt><dd><a name="func-regparm">Found in versions: 2.7-3.4
</a></dd><dd><a name="func-regparm">Description:
<pre> On the Intel 386, the `regparm' attribute causes the compiler to
pass up to NUMBER integer arguments in registers EAX, EDX, and ECX
instead of on the stack. Functions that take a variable number of
arguments will continue to be passed all of their arguments on the
stack.
Beware that on some ELF systems this attribute is unsuitable for
global functions in shared libraries with lazy binding (which is
the default). Lazy binding will send the first call via resolving
code in the loader, which might assume EAX, EDX and ECX can be
clobbered, as per the standard calling conventions. Solaris 8 is
affected by this. GNU systems with GLIBC 2.1 or higher, and
FreeBSD, are believed to be safe since the loaders there save all
registers. (Lazy binding can be disabled with the linker or the
loader if desired, to avoid the problem.)
</pre>
</a></dd></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im HOEnZb">
<br>
> --<br>
> Dave Hylands<br>
> Shuswap, BC, Canada<br>
> <a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thank you <br>Warm Regards<br>Anuz<br>