hey guys … i want to know about these macros … somebody please explain them
1). __initconst
2). __aligned
3). attribute
4). __used
5). __section
thank you very much in advance .
hey guys … i want to know about these macros … somebody please explain them
1). __initconst
2). __aligned
3). attribute
4). __used
5). __section
thank you very much in advance .
On 2013-05-31, amit bhaira <amit_bhaira@no-mx.forums.opensuse.org> wrote:
> hey guys … i want to know about these macros … somebody please explain
> them
>
> 1). __initconst
> 2). __aligned
> 3). attribute
> 4). __used
> 5). __section
>
> thank you very much in advance .
Hehe this sounds like an exercise on compiler directives in gcc headers. A good place to start reading about this is:
http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Type-Attributes.html
… which will cover #2 and #3.
The others I haven’t seen and they sound OS/architecture- specific (correct me if I’m wrong). It might help if you
explain why you want to know about them.
I was trying to study linux kernel source code …and these marcros are used very frequently … so they are troubling me a lot. I tried to google about them but nothing much I got. So I thought asking to kernel developers is a good choice …
On 05/31/2013 06:46 PM, amit bhaira wrote:
> So I thought asking to kernel
> developers is a good choice …
not many kernel developers around here…this forum is about 99.9%
users and not developers…
and, about 98% of all kernel hackers would tell you to search harder!
like, here are 544,000 hits on “attribute”
https://www.google.com/search?q=linux+kernel+source+macro+“attribute”
so, maybe before learning about hacking the kernel you could brush up
on your googleFU
–
dd
Look at the files in /usr/src/linux/include/linux
For example init.h contains the definition of __initconst from that you
have to work yourself backwards through the definitions.
–
PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.2 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.3 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.2 | GMA4500
On 2013-05-31, amit bhaira <amit_bhaira@no-mx.forums.opensuse.org> wrote:
>
> I was trying to study linux kernel source code …and these marcros are
> used very frequently …
The directives attribute and aligned are used extensively outside kernel code and you should have no problems
finding out what they do (and yes they are important for optimising code compilation, especially if you use assembler).
> google about them but nothing much I got. So I thought asking to kernel
> developers is a good choice …
As dd has said, the most forums members here are not kernel developers. If I was going to have to tinker with kernel
code the first thing I’d do is perform an extensive search for any kernel source code documentation and read it, before
contacting the developers. I’d rather ask specific and informed questions rather then waste their time with vague
`what’s this all about?’
You might be better of on the linux kernel page on G+