Aman Deep Gautam
Aman Deep Gautam

Reputation: 8737

function declaration in core.c

I found this declaration in kernel/sched/core.c and I do not understand what does this specify.

static void __sched __schedule(void)

Any help appreciated.

[EDIT] kernel version 3.5.4

Upvotes: 1

Views: 120

Answers (1)

Mike Kwan
Mike Kwan

Reputation: 24447

__sched is actually a macro defined as __attribute__((__section__(".sched.text"))) in include/linux/sched.h. This attribute is picked up by the GCC compiler:

Normally, the compiler places the objects it generates in sections like data and bss. Sometimes, however, you need additional sections, or you need certain particular variables to appear in special sections, for example to map to special hardware. The section attribute specifies that a variable (or function) lives in a particular section.

Upvotes: 8

Related Questions