kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* mm_init() functions in kernel code
@ 2011-05-18  1:43 Vikram Narayanan
  2011-05-18  2:19 ` Greg
  0 siblings, 1 reply; 3+ messages in thread
From: Vikram Narayanan @ 2011-05-18  1:43 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I saw two mm_init functions in the kernel source code.
1) init/main.c    (http://lxr.linux.no/#linux+v2.6.38/init/main.c#L530)
2) kernel/fork.c (http://lxr.linux.no/#linux+v2.6.38/kernel/fork.c#L482)

Are the above functions go inside a single binary? How this doesn't
produce a redefinition error?

Thanks,
Vikram

^ permalink raw reply	[flat|nested] 3+ messages in thread

* mm_init() functions in kernel code
  2011-05-18  1:43 mm_init() functions in kernel code Vikram Narayanan
@ 2011-05-18  2:19 ` Greg
  2011-05-18  2:36   ` Vikram Narayanan
  0 siblings, 1 reply; 3+ messages in thread
From: Greg @ 2011-05-18  2:19 UTC (permalink / raw)
  To: kernelnewbies

On Tue, May 17, 2011 at 6:43 PM, Vikram Narayanan <vikram186@gmail.com> wrote:
> Hi,
>
> I saw two mm_init functions in the kernel source code.
> 1) init/main.c ? ?(http://lxr.linux.no/#linux+v2.6.38/init/main.c#L530)
> 2) kernel/fork.c (http://lxr.linux.no/#linux+v2.6.38/kernel/fork.c#L482)
>
> Are the above functions go inside a single binary? How this doesn't
> produce a redefinition error?
>
> Thanks,
> Vikram
Both of these define mm_init as static so they aren't visible outside
the source file that has them.  Plus they don't use the EXPORT_SYMBOL
macro to indicate that it can be called from elsewhere in the kernel.
There is another mm_init function in drivers/block/umem.c as well
which is also static.

Cheers,
Greg

^ permalink raw reply	[flat|nested] 3+ messages in thread

* mm_init() functions in kernel code
  2011-05-18  2:19 ` Greg
@ 2011-05-18  2:36   ` Vikram Narayanan
  0 siblings, 0 replies; 3+ messages in thread
From: Vikram Narayanan @ 2011-05-18  2:36 UTC (permalink / raw)
  To: kernelnewbies

On Wed, May 18, 2011 at 7:49 AM, Greg <groglein@gmail.com> wrote:
> On Tue, May 17, 2011 at 6:43 PM, Vikram Narayanan <vikram186@gmail.com> wrote:
>> Hi,
>>
>> I saw two mm_init functions in the kernel source code.
>> 1) init/main.c ? ?(http://lxr.linux.no/#linux+v2.6.38/init/main.c#L530)
>> 2) kernel/fork.c (http://lxr.linux.no/#linux+v2.6.38/kernel/fork.c#L482)
>>
>> Are the above functions go inside a single binary? How this doesn't
>> produce a redefinition error?
>>
>> Thanks,
>> Vikram
> Both of these define mm_init as static so they aren't visible outside
> the source file that has them. ?Plus they don't use the EXPORT_SYMBOL
> macro to indicate that it can be called from elsewhere in the kernel.
> There is another mm_init function in drivers/block/umem.c as well
> which is also static.
Thanks. (I haven't noticed the static there ;) )

-
Thanks,
Vikram

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-18  2:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-18  1:43 mm_init() functions in kernel code Vikram Narayanan
2011-05-18  2:19 ` Greg
2011-05-18  2:36   ` Vikram Narayanan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).