[lkml]   [1999]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC] Unifying kernel initialization
    ----- Original Message -----
    From: Martijn van Oosterhout <>
    To: linux kernel <>
    Sent: Tuesday, May 04, 1999 9:08 AM
    Subject: [RFC] Unifying kernel initialization

    > If it was built into the kernel, you'd have to
    > add it to the mess in init/main.c or similar
    > and add a call for it somewhere.


    > I was thinking that a better way to do it would be to have a
    > macro REGISTER_INIT_FUNC(function,priority),
    > which would add the nessesary info to the
    > object file. Then, the kernel would need only
    > to loop over this list and all the kernel would
    > be initialized in order.

    FreeBSD has macros like you describe for defining
    init functions and calling order, so it is doable.
    The macro creates entries in a global init table that is processed during

    The thing I like this approach is that it keeps the definition in the
    same source file as the implementation,. allowing you to add
    a kernel function (device or otherwise) without necessarily
    having to modify init/main.c.

    On the other hand, it could be argued that explicitly adding
    the init function call to init/main.c makes it easier to know what
    is called and in what order. With the macro, you would have to
    grep for all instances of the macro in all the kernel files and then
    piece together the load order based on the macro arguments.
    (or look at compiler listing files)

    Paul Fulghum
    Microgate Corporation
    9501 Capital of Texas Hwy
    Austin, Texas 78759

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:51    [W:0.029 / U:2.504 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site