1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>__init/__exit/__initdata include/linux/init.h</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Unreliable Guide To Hacking The Linux Kernel"><link rel="up" href="common-routines.html" title="Chapter 6. Common Routines"><link rel="prev" href="routines-processorids.html" title="smp_processor_id() include/asm/smp.h"><link rel="next" href="routines-init-again.html" title="__initcall()/module_init() include/linux/init.h"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="type">__init</span>/<span class="type">__exit</span>/<span class="type">__initdata</span> 2 <code class="filename">include/linux/init.h</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="routines-processorids.html">Prev</a> </td><th width="60%" align="center">Chapter 6. Common Routines</th><td width="20%" align="right"> <a accesskey="n" href="routines-init-again.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="routines-init"></a><span class="type">__init</span>/<span class="type">__exit</span>/<span class="type">__initdata</span> 3 <code class="filename">include/linux/init.h</code></h2></div></div></div><p> 4 After boot, the kernel frees up a special section; functions 5 marked with <span class="type">__init</span> and data structures marked with 6 <span class="type">__initdata</span> are dropped after boot is complete: similarly 7 modules discard this memory after initialization. <span class="type">__exit</span> 8 is used to declare a function which is only required on exit: the 9 function will be dropped if this file is not compiled as a module. 10 See the header file for use. Note that it makes no sense for a function 11 marked with <span class="type">__init</span> to be exported to modules with 12 <code class="function">EXPORT_SYMBOL()</code> - this will break. 13 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="routines-processorids.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="common-routines.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="routines-init-again.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><code class="function">smp_processor_id</code>() 14 <code class="filename">include/asm/smp.h</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <code class="function">__initcall()</code>/<code class="function">module_init()</code> 15 <code class="filename">include/linux/init.h</code></td></tr></table></div></body></html> 16