openblt

a hobby OS from the late 90s
git clone http://frotz.net/git/openblt.git
Log | Files | Refs | LICENSE

init.h (919B)


      1 /* Copyright 1998-1999, Sidney Cammeresi. All rights reserved.
      2 ** Distributed under the terms of the OpenBLT License
      3 */
      4 
      5 #ifndef _INIT_H_
      6 #define _INIT_H_
      7 
      8 /*
      9  * Behold macros to place functions or variables in special elf sections.  To
     10  * use these jewels, write your functions like this
     11  *
     12  *         void __init__ foo_init (int a, int b)
     13  *         {
     14  *         }
     15  *
     16  * and your function prototypes like this
     17  *
     18  *         extern void foo_init (int a, int b) __init__;
     19  *
     20  * and your data like this
     21  *
     22  *         static char *foo_stuff __initdata__ = "Foo rules the world.";
     23  *
     24  * At some point in the future, the .text.init and .data.init sections of the
     25  * kernel may be discarded at the end of the kernel's initialisation to free
     26  * up a bit of memory.
     27  */
     28 
     29 #define __init__            __attribute__ ((__section__ (".text.init")))
     30 #define __initdata__        __attribute__ ((__section__ (".data.init")))
     31 
     32 #endif
     33