<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>UbixOS V2: src/sys/include/lib/kmalloc.h File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.7 --> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="classes.html"><span>Data Structures</span></a></li> <li id="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label> <u>S</u>earch for </label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul></div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul></div> <div class="nav"> <a class="el" href="dir_897b6a2d7bab147dd1db58381aad3984.html">src</a> » <a class="el" href="dir_832905b1f7f5feaf61a306b40c0ac817.html">sys</a> » <a class="el" href="dir_caf4200c438ae9601464168e21e8e4d8.html">include</a> » <a class="el" href="dir_538938396c33f4585b2c9d510e98cbd2.html">lib</a></div> <h1>kmalloc.h File Reference</h1><code>#include <<a class="el" href="types_8h-source.html">ubixos/types.h</a>></code><br> <p> Include dependency graph for kmalloc.h:<p><center><img src="kmalloc_8h__incl.png" border="0" usemap="#src/sys/include/lib/kmalloc.h_map" alt=""></center> <map name="src/sys/include/lib/kmalloc.h_map"> <area href="types_8h.html" shape="rect" coords="268,5,388,32" alt=""> <area href="__types_8h.html" shape="rect" coords="439,5,543,32" alt=""> </map> <p> This graph shows which files directly or indirectly include this file:<p><center><img src="kmalloc_8h__dep__incl.png" border="0" usemap="#src/sys/include/lib/kmalloc.hdep_map" alt=""></center> <map name="src/sys/include/lib/kmalloc.hdep_map"> <area href="devfs_8c.html" shape="rect" coords="295,5,458,32" alt=""> <area href="main_8c.html" shape="rect" coords="304,56,448,83" alt=""> <area href="atkbd_8c.html" shape="rect" coords="303,107,450,133" alt=""> <area href="fdc_8c.html" shape="rect" coords="312,157,440,184" alt=""> <area href="ne2k_8c.html" shape="rect" coords="306,208,447,235" alt=""> <area href="bioscall_8c.html" shape="rect" coords="286,259,467,285" alt=""> <area href="elf_8c.html" shape="rect" coords="303,309,450,336" alt=""> <area href="exec_8c.html" shape="rect" coords="296,360,456,387" alt=""> <area href="gen__calls_8c.html" shape="rect" coords="280,411,472,437" alt=""> <area href="kern__descrip_8c.html" shape="rect" coords="268,461,484,488" alt=""> <area href="kern__sig_8c.html" shape="rect" coords="283,512,470,539" alt=""> <area href="kern__sysctl_8c.html" shape="rect" coords="274,563,479,589" alt=""> <area href="ld_8c.html" shape="rect" coords="306,613,447,640" alt=""> <area href="sched_8c.html" shape="rect" coords="291,664,462,691" alt=""> <area href="syscall_8c.html" shape="rect" coords="288,715,464,741" alt=""> <area href="systemtask_8c.html" shape="rect" coords="274,765,479,792" alt=""> <area href="tty_8c.html" shape="rect" coords="303,816,450,843" alt=""> <area href="ubthread_8c.html" shape="rect" coords="280,867,472,893" alt=""> <area href="vitals_8c.html" shape="rect" coords="294,917,459,944" alt=""> <area href="kmod_8c.html" shape="rect" coords="291,968,462,995" alt=""> <area href="kmalloc_8c.html" shape="rect" coords="298,1019,455,1045" alt=""> <area href="libcpp_8cc.html" shape="rect" coords="300,1069,452,1096" alt=""> <area href="system_8c.html" shape="rect" coords="295,1120,458,1147" alt=""> <area href="hd_8c.html" shape="rect" coords="314,1171,439,1197" alt=""> <area href="lnc_8c.html" shape="rect" coords="312,1221,440,1248" alt=""> <area href="device_8c.html" shape="rect" coords="299,1272,454,1299" alt=""> <area href="idt_8c.html" shape="rect" coords="312,1323,440,1349" alt=""> <area href="dirCache_8c.html" shape="rect" coords="282,1373,471,1400" alt=""> <area href="directory_8c.html" shape="rect" coords="283,1424,470,1451" alt=""> <area href="ubixfs_8c.html" shape="rect" coords="291,1475,462,1501" alt=""> <area href="ffs_8c.html" shape="rect" coords="314,1525,439,1552" alt=""> <area href="ufs_8c.html" shape="rect" coords="312,1576,440,1603" alt=""> <area href="file_8c.html" shape="rect" coords="312,1627,440,1653" alt=""> <area href="mount_8c.html" shape="rect" coords="300,1677,452,1704" alt=""> <area href="vfs_8c.html" shape="rect" coords="312,1728,440,1755" alt=""> <area href="paging_8c.html" shape="rect" coords="292,1779,460,1805" alt=""> <area href="vmm__memory_8c.html" shape="rect" coords="267,1829,486,1856" alt=""> </map> <p> <a href="kmalloc_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmemDescriptor.html">memDescriptor</a></td></tr> <tr><td colspan="2"><br><h2>Defines</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="kmalloc_8h.html#f0fa0ac2c51032ef234e92b127e59a74">MALLOC_ALIGN</a>(size) (size + ((((size) % (MALLOC_ALIGN_SIZE)) == 0)? 0 : ((MALLOC_ALIGN_SIZE) - ((size) % (MALLOC_ALIGN_SIZE)))))</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="kmalloc_8h.html#507e7ea478c4d42970730698da5c1470">MALLOC_ALIGN_SIZE</a> 32</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="kmalloc_8h.html#81d09bc848b49133401b3efeeb65f1af">sysID</a> -2</td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="kmalloc_8h.html#aa9ed6886459604cf73ccdbf6410e487">kfree</a> (void *baseAddr)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="kmalloc_8h.html#150eab2ac4ce4553e21ca10e7f441762">kmalloc</a> (<a class="el" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> len)</td></tr> </table> <hr><h2>Define Documentation</h2> <a class="anchor" name="f0fa0ac2c51032ef234e92b127e59a74"></a><!-- doxytag: member="kmalloc.h::MALLOC_ALIGN" ref="f0fa0ac2c51032ef234e92b127e59a74" args="(size)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MALLOC_ALIGN </td> <td>(</td> <td class="paramtype">size </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> (size + ((((size) % (MALLOC_ALIGN_SIZE)) == 0)? 0 : ((MALLOC_ALIGN_SIZE) - ((size) % (MALLOC_ALIGN_SIZE)))))</td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="kmalloc_8h-source.html#l00041">41</a> of file <a class="el" href="kmalloc_8h-source.html">kmalloc.h</a>. <p> Referenced by <a class="el" href="kmalloc_8c-source.html#l00247">kmalloc()</a>. </div> </div><p> <a class="anchor" name="507e7ea478c4d42970730698da5c1470"></a><!-- doxytag: member="kmalloc.h::MALLOC_ALIGN_SIZE" ref="507e7ea478c4d42970730698da5c1470" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MALLOC_ALIGN_SIZE 32 </td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="kmalloc_8h-source.html#l00040">40</a> of file <a class="el" href="kmalloc_8h-source.html">kmalloc.h</a>. </div> </div><p> <a class="anchor" name="81d09bc848b49133401b3efeeb65f1af"></a><!-- doxytag: member="kmalloc.h::sysID" ref="81d09bc848b49133401b3efeeb65f1af" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define sysID -2 </td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="kmalloc_8h-source.html#l00039">39</a> of file <a class="el" href="kmalloc_8h-source.html">kmalloc.h</a>. <p> Referenced by <a class="el" href="paging_8c-source.html#l00401">vmm_getFreeMallocPage()</a>, <a class="el" href="paging_8c-source.html#l00059">vmm_pagingInit()</a>, and <a class="el" href="vmm__memory_8c-source.html#l00186">vmmFindFreePage()</a>. </div> </div><p> <hr><h2>Function Documentation</h2> <a class="anchor" name="aa9ed6886459604cf73ccdbf6410e487"></a><!-- doxytag: member="kmalloc.h::kfree" ref="aa9ed6886459604cf73ccdbf6410e487" args="(void *baseAddr)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void kfree </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"> <em>baseAddr</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="kmalloc_8c-source.html#l00351">351</a> of file <a class="el" href="kmalloc_8c-source.html">kmalloc.c</a>. <p> References <a class="el" href="assert_8h-source.html#l00064">assert</a>, <a class="el" href="kmalloc_8h-source.html#l00046">memDescriptor::baseAddr</a>, <a class="el" href="kmalloc_8c-source.html#l00124">insertFreeDesc()</a>, <a class="el" href="kprintf_8c-source.html#l00038">kprintf()</a>, <a class="el" href="kmalloc_8h-source.html#l00047">memDescriptor::limit</a>, <a class="el" href="kmalloc_8c-source.html#l00054">mallocSpinLock</a>, <a class="el" href="memset_8c-source.html#l00037">memset()</a>, <a class="el" href="kmalloc_8h-source.html#l00045">memDescriptor::next</a>, <a class="el" href="kmalloc_8h-source.html#l00044">memDescriptor::prev</a>, <a class="el" href="spinlock_8c-source.html#l00056">spinLock()</a>, <a class="el" href="spinlock_8c-source.html#l00037">spinUnlock()</a>, and <a class="el" href="kmalloc_8c-source.html#l00047">usedKernDesc</a>. <p> Referenced by <a class="el" href="kern__descrip_8c-source.html#l00090">close()</a>, <a class="el" href="device_8c-source.html#l00110">device_remove()</a>, <a class="el" href="elf_8c-source.html#l00111">elf_loadfile()</a>, <a class="el" href="exec_8c-source.html#l00143">execFile()</a>, <a class="el" href="file_8c-source.html#l00398">fclose()</a>, <a class="el" href="file_8c-source.html#l00274">fopen()</a>, <a class="el" href="kmod_8c-source.html#l00075">kmod_load()</a>, <a class="el" href="ld_8c-source.html#l00042">ldEnable()</a>, <a class="el" href="system_8c-source.html#l00234">mpi_destroyMbox()</a>, <a class="el" href="system_8c-source.html#l00189">mpi_fetchMessage()</a>, <a class="el" href="ne2k_8c-source.html#l00353">ne2kFreeBuffer()</a>, <a class="el" href="libcpp_8cc-source.html#l00064">operator delete()</a>, <a class="el" href="libcpp_8cc-source.html#l00051">operator delete[]()</a>, <a class="el" href="exec_8c-source.html#l00552">sys_exec()</a>, <a class="el" href="gen__calls_8c-source.html#l00067">sys_write()</a>, <a class="el" href="exec_8c-source.html#l00334">sysExec()</a>, <a class="el" href="systemtask_8c-source.html#l00048">systemTask()</a>, <a class="el" href="dirCache_8c-source.html#l00202">ubixfs_cacheDelete()</a>, <a class="el" href="directory_8c-source.html#l00094">ubixFSmkDir()</a>, <a class="el" href="ubthread_8c-source.html#l00064">ubthread_cond_destroy()</a>, <a class="el" href="ubthread_8c-source.html#l00070">ubthread_mutex_destroy()</a>, <a class="el" href="mount_8c-source.html#l00047">vfs_mount()</a>, and <a class="el" href="ubixfs_8c-source.html#l00232">writeUbixFS()</a>. <p> Here is the call graph for this function:<p><center><img src="kmalloc_8h_aa9ed6886459604cf73ccdbf6410e487_cgraph.png" border="0" usemap="#kmalloc_8h_aa9ed6886459604cf73ccdbf6410e487_cgraph_map" alt=""></center> <map name="kmalloc_8h_aa9ed6886459604cf73ccdbf6410e487_cgraph_map"> <area href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0" shape="rect" coords="109,56,232,83" alt=""> <area href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8" shape="rect" coords="441,107,508,134" alt=""> <area href="lib_2string_8h.html#ce4b911463887af5e748326323e99a23" shape="rect" coords="132,158,209,184" alt=""> <area href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1" shape="rect" coords="131,208,211,235" alt=""> <area href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65" shape="rect" coords="123,259,219,286" alt=""> <area href="kpanic_8h.html#db9a182aa071791a306163d50d653deb" shape="rect" coords="297,56,364,83" alt=""> <area href="8259_8h.html#2b9ec30943ddb0a2ef3bd7ccfd2026c0" shape="rect" coords="429,6,520,32" alt=""> <area href="stdarg_8h.html#621577c2df0ad5faa281223c56eeb7a5" shape="rect" coords="439,56,511,83" alt=""> <area href="vsprintf_8c.html#c2f4c669c6f6aa6caa5ab8adb1b07dd0" shape="rect" coords="604,31,679,58" alt=""> <area href="vsprintf_8c.html#3fa7c8ef8597579301cb4b5c59bc6d9a" shape="rect" coords="601,82,681,108" alt=""> <area href="sched_8h.html#08933fe6d593a1c78b9080359f15a0b7" shape="rect" coords="280,183,381,210" alt=""> <area href="spinlock_8h.html#8f9173fadeddafa01754d6cbcc630198" shape="rect" coords="592,234,691,260" alt=""> <area href="sched_8h.html#549a0c1cc47933fa045b200690965cbd" shape="rect" coords="444,183,505,210" alt=""> <area href="sched_8h.html#e969273d772018d111e1f0344eb550f8" shape="rect" coords="568,132,715,159" alt=""> <area href="sched_8h.html#086cc0adc0b6a3860ceeeb5bc5ea94ea" shape="rect" coords="572,183,711,210" alt=""> </map> </div> </div><p> <a class="anchor" name="150eab2ac4ce4553e21ca10e7f441762"></a><!-- doxytag: member="kmalloc.h::kmalloc" ref="150eab2ac4ce4553e21ca10e7f441762" args="(uInt32 len)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* kmalloc </td> <td>(</td> <td class="paramtype"><a class="el" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> </td> <td class="paramname"> <em>len</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> <p> Definition at line <a class="el" href="kmalloc_8c-source.html#l00247">247</a> of file <a class="el" href="kmalloc_8c-source.html">kmalloc.c</a>. <p> References <a class="el" href="assert_8h-source.html#l00064">assert</a>, <a class="el" href="kmalloc_8h-source.html#l00046">memDescriptor::baseAddr</a>, <a class="el" href="kmalloc_8c-source.html#l00048">freeKernDesc</a>, <a class="el" href="kmalloc_8c-source.html#l00067">getEmptyDesc()</a>, <a class="el" href="kmalloc_8c-source.html#l00124">insertFreeDesc()</a>, <a class="el" href="kprintf_8c-source.html#l00038">kprintf()</a>, <a class="el" href="kmalloc_8h-source.html#l00047">memDescriptor::limit</a>, <a class="el" href="kmalloc_8h-source.html#l00041">MALLOC_ALIGN</a>, <a class="el" href="kmalloc_8c-source.html#l00054">mallocSpinLock</a>, <a class="el" href="kmalloc_8h-source.html#l00045">memDescriptor::next</a>, <a class="el" href="kmalloc_8h-source.html#l00044">memDescriptor::prev</a>, <a class="el" href="spinlock_8c-source.html#l00056">spinLock()</a>, <a class="el" href="spinlock_8c-source.html#l00037">spinUnlock()</a>, and <a class="el" href="kmalloc_8c-source.html#l00047">usedKernDesc</a>. <p> Referenced by <a class="el" href="directory_8c-source.html#l00066">addDirEntry()</a>, <a class="el" href="bioscall_8c-source.html#l00050">biosCall()</a>, <a class="el" href="devfs_8c-source.html#l00050">devfs_initialize()</a>, <a class="el" href="devfs_8c-source.html#l00178">devfs_makeNode()</a>, <a class="el" href="device_8c-source.html#l00051">device_add()</a>, <a class="el" href="elf_8c-source.html#l00111">elf_loadfile()</a>, <a class="el" href="exec_8c-source.html#l00143">execFile()</a>, <a class="el" href="kern__descrip_8c-source.html#l00067">falloc()</a>, <a class="el" href="fdc_8c-source.html#l00063">fdc_init()</a>, <a class="el" href="file_8c-source.html#l00274">fopen()</a>, <a class="el" href="hd_8c-source.html#l00039">initHardDisk()</a>, <a class="el" href="lnc_8c-source.html#l00104">initLNC()</a>, <a class="el" href="main_8c-source.html#l00097">kmain()</a>, <a class="el" href="kmod_8c-source.html#l00046">kmod_add()</a>, <a class="el" href="kmod_8c-source.html#l00075">kmod_load()</a>, <a class="el" href="ld_8c-source.html#l00042">ldEnable()</a>, <a class="el" href="lnc_8c-source.html#l00246">lncAttach()</a>, <a class="el" href="system_8c-source.html#l00069">mpi_createMbox()</a>, <a class="el" href="system_8c-source.html#l00143">mpi_postMessage()</a>, <a class="el" href="system_8c-source.html#l00108">mpi_spam()</a>, <a class="el" href="ne2k_8c-source.html#l00070">ne2k_init()</a>, <a class="el" href="ne2k_8c-source.html#l00313">ne2kAllocBuffer()</a>, <a class="el" href="ubixfs_8c-source.html#l00046">openFileUbixFS()</a>, <a class="el" href="libcpp_8cc-source.html#l00058">operator new()</a>, <a class="el" href="libcpp_8cc-source.html#l00046">operator new[]()</a>, <a class="el" href="sched_8c-source.html#l00069">sched_init()</a>, <a class="el" href="sched_8c-source.html#l00143">schedNewTask()</a>, <a class="el" href="exec_8c-source.html#l00552">sys_exec()</a>, <a class="el" href="gen__calls_8c-source.html#l00067">sys_write()</a>, <a class="el" href="kern__sysctl_8c-source.html#l00205">sysctl_add()</a>, <a class="el" href="kern__sysctl_8c-source.html#l00065">sysctl_init()</a>, <a class="el" href="exec_8c-source.html#l00334">sysExec()</a>, <a class="el" href="tty_8c-source.html#l00042">tty_init()</a>, <a class="el" href="dirCache_8c-source.html#l00185">ubixfs_cacheNew()</a>, <a class="el" href="ubixfs_8c-source.html#l00376">ubixfs_initialize()</a>, <a class="el" href="directory_8c-source.html#l00041">ubixFSLoadDir()</a>, <a class="el" href="directory_8c-source.html#l00094">ubixFSmkDir()</a>, <a class="el" href="ubixfs_8c-source.html#l00309">ubixFSUnlink()</a>, <a class="el" href="ubthread_8c-source.html#l00048">ubthread_cond_init()</a>, <a class="el" href="ubthread_8c-source.html#l00076">ubthread_create()</a>, <a class="el" href="ubthread_8c-source.html#l00056">ubthread_mutex_init()</a>, <a class="el" href="ufs_8c-source.html#l00272">ufs_openFile()</a>, <a class="el" href="mount_8c-source.html#l00047">vfs_mount()</a>, <a class="el" href="vfs_8c-source.html#l00081">vfsRegisterFS()</a>, <a class="el" href="vitals_8c-source.html#l00048">vitals_init()</a>, and <a class="el" href="ubixfs_8c-source.html#l00232">writeUbixFS()</a>. <p> Here is the call graph for this function:<p><center><img src="kmalloc_8h_150eab2ac4ce4553e21ca10e7f441762_cgraph.png" border="0" usemap="#kmalloc_8h_150eab2ac4ce4553e21ca10e7f441762_cgraph_map" alt=""></center> <map name="kmalloc_8h_150eab2ac4ce4553e21ca10e7f441762_cgraph_map"> <area href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4" shape="rect" coords="129,198,249,224" alt=""> <area href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8" shape="rect" coords="551,46,617,72" alt=""> <area href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1" shape="rect" coords="544,324,624,351" alt=""> <area href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65" shape="rect" coords="536,223,632,250" alt=""> <area href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0" shape="rect" coords="128,71,251,98" alt=""> <area href="kpanic_8h.html#db9a182aa071791a306163d50d653deb" shape="rect" coords="360,71,427,98" alt=""> <area href="lib_2string_8h.html#ce4b911463887af5e748326323e99a23" shape="rect" coords="355,172,432,199" alt=""> <area href="paging_8h.html#541f0b43826a40b9e978f5479080bb0e" shape="rect" coords="299,274,488,300" alt=""> </map> </div> </div><p> <hr size="1"><address style="align: right;"><small>Generated on Fri Dec 15 11:19:34 2006 for UbixOS V2 by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> </body> </html>