what does this do ?
Anuz Pratap Singh Tomar
chambilkethakur at gmail.com
Mon Jan 14 09:44:11 EST 2013
On Mon, Jan 14, 2013 at 4:50 AM, horseriver <horserivers at gmail.com> wrote:
> On Sun, Jan 13, 2013 at 09:27:45PM -0800, Dave Hylands wrote:
> > Hi,
> > On Sun, Jan 13, 2013 at 11:29 AM, horseriver <horserivers at gmail.com>
> > >
> > > hi:
> > >
> > > In kernel code . some function is defined by
> > __attribute__((__section__(".initcall" level ".init")))
> > >
> > > what does this do ?
> > It puts the address of the function in a linker section named
> > .initcallX.init where X is replaced by the level.
> > These functions are called in order to initialize various subsystems and
> > drivers during kernel bootup.
> Another question:
> __attribute__((regparm(3))) ; what does this do ?
> A simple google search should have answered this
regparm (NUMBER) Found in versions: 2.7-3.4 Description:
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
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.)
> > --
> > Dave Hylands
> > Shuswap, BC, Canada
> > http://www.davehylands.com
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies