Newer
Older
UbixOS / doc / html / kmalloc_8c-source.html
<!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/lib/kmalloc.c Source File</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&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;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>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</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&nbsp;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>&nbsp;&raquo&nbsp;<a class="el" href="dir_832905b1f7f5feaf61a306b40c0ac817.html">sys</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_d9dcf62a8e8b4cc91cbf2445d76a799b.html">lib</a></div>
<h1>kmalloc.c</h1><a href="kmalloc_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2002-2004 The UbixOS Project</span>
<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> Redistribution and use in source and binary forms, with or without modification, are</span>
<a name="l00006"></a>00006 <span class="comment"> permitted provided that the following conditions are met:</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> Redistributions of source code must retain the above copyright notice, this list of</span>
<a name="l00009"></a>00009 <span class="comment"> conditions, the following disclaimer and the list of authors.  Redistributions in binary</span>
<a name="l00010"></a>00010 <span class="comment"> form must reproduce the above copyright notice, this list of conditions, the following</span>
<a name="l00011"></a>00011 <span class="comment"> disclaimer and the list of authors in the documentation and/or other materials provided</span>
<a name="l00012"></a>00012 <span class="comment"> with the distribution. Neither the name of the UbixOS Project nor the names of its</span>
<a name="l00013"></a>00013 <span class="comment"> contributors may be used to endorse or promote products derived from this software</span>
<a name="l00014"></a>00014 <span class="comment"> without specific prior written permission.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY</span>
<a name="l00017"></a>00017 <span class="comment"> EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>
<a name="l00018"></a>00018 <span class="comment"> MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL</span>
<a name="l00019"></a>00019 <span class="comment"> THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
<a name="l00020"></a>00020 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT</span>
<a name="l00021"></a>00021 <span class="comment"> OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
<a name="l00022"></a>00022 <span class="comment"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR</span>
<a name="l00023"></a>00023 <span class="comment"> TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00024"></a>00024 <span class="comment"> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment"> $Id: kmalloc_8c-source.html 88 2016-01-12 00:11:29Z reddawg $</span>
<a name="l00027"></a>00027 <span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">*****************************************************************************************/</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;<a class="code" href="kmalloc_8h.html">lib/kmalloc.h</a>&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="kprintf_8h.html">lib/kprintf.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="kpanic_8h.html">ubixos/kpanic.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="sched_8h.html">ubixos/sched.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="spinlock_8h.html">ubixos/spinlock.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="vmm_8h.html">vmm/vmm.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="string_8h.html">string.h</a>&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="assert_8h.html">assert.h</a>&gt;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="comment">/*</span>
<a name="l00040"></a>00040 <span class="comment"> Set up three descriptor tables:</span>
<a name="l00041"></a>00041 <span class="comment"> </span>
<a name="l00042"></a>00042 <span class="comment"> kernDesc      - The inuse descriptor table </span>
<a name="l00043"></a>00043 <span class="comment"> freeKernDesc  - The free descriptor table (descriptors with memory backing just not in use)</span>
<a name="l00044"></a>00044 <span class="comment"> emptyKernDesc - The empty descriptor table (descriptors with out a memory backing)</span>
<a name="l00045"></a>00045 <span class="comment"> </span>
<a name="l00046"></a>00046 <span class="comment">*/</span>
<a name="l00047"></a><a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">00047</a> <span class="keyword">static</span> <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *<a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>  = 0x0;
<a name="l00048"></a><a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">00048</a> <span class="keyword">static</span> <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *<a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>  = 0x0;
<a name="l00049"></a><a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">00049</a> <span class="keyword">static</span> <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a> = 0x0;
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="comment">/*</span>
<a name="l00052"></a>00052 <span class="comment"> Set up our spinlocks so we do not corrupt linked lists if we have re-entrancy</span>
<a name="l00053"></a>00053 <span class="comment">*/</span>
<a name="l00054"></a><a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">00054</a> <span class="keyword">static</span> <a class="code" href="spinlock_8h.html#a240e9404b4ede1e0d714610080d1176">spinLock_t</a> <a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>    = <a class="code" href="spinlock_8h.html#0fe85a4f3642683148b25916d6c5eafd">SPIN_LOCK_INITIALIZER</a>;
<a name="l00055"></a><a class="code" href="kmalloc_8c.html#2d89e65292e7be33cb2424224396ee2d">00055</a> <span class="keyword">static</span> <a class="code" href="spinlock_8h.html#a240e9404b4ede1e0d714610080d1176">spinLock_t</a> <a class="code" href="kmalloc_8c.html#2d89e65292e7be33cb2424224396ee2d">emptyDescSpinLock</a> = <a class="code" href="spinlock_8h.html#0fe85a4f3642683148b25916d6c5eafd">SPIN_LOCK_INITIALIZER</a>;
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="comment">/************************************************************************</span>
<a name="l00058"></a>00058 <span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">Function: void *getEmptyDesc()</span>
<a name="l00060"></a>00060 <span class="comment">Description: Find An Empty Descriptor</span>
<a name="l00061"></a>00061 <span class="comment"></span>
<a name="l00062"></a>00062 <span class="comment">Notes:</span>
<a name="l00063"></a>00063 <span class="comment"></span>
<a name="l00064"></a>00064 <span class="comment">02/17/03 - Is This Efficient?</span>
<a name="l00065"></a>00065 <span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">************************************************************************/</span>    
<a name="l00067"></a><a class="code" href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4">00067</a> <span class="keyword">static</span> <span class="keywordtype">void</span> *<a class="code" href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4">getEmptyDesc</a>() {
<a name="l00068"></a>00068   <span class="keywordtype">int</span> i = 0x0;
<a name="l00069"></a>00069   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc = 0x0;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071   <a class="code" href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1">spinLock</a>(&amp;<a class="code" href="kmalloc_8c.html#2d89e65292e7be33cb2424224396ee2d">emptyDescSpinLock</a>);
<a name="l00072"></a>00072   
<a name="l00073"></a>00073   tmpDesc = <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>;
<a name="l00074"></a>00074   
<a name="l00075"></a>00075   <span class="keywordflow">if</span> (tmpDesc != 0x0) {
<a name="l00076"></a>00076     <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>       = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00077"></a>00077     <span class="keywordflow">if</span> (<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a> != 0x0) 
<a name="l00078"></a>00078       <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00079"></a>00079       
<a name="l00080"></a>00080      
<a name="l00081"></a>00081     tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>       = 0x0;
<a name="l00082"></a>00082     tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>       = 0x0;
<a name="l00083"></a>00083     <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#2d89e65292e7be33cb2424224396ee2d">emptyDescSpinLock</a>);
<a name="l00084"></a>00084     <span class="keywordflow">return</span>(tmpDesc);
<a name="l00085"></a>00085     }
<a name="l00086"></a>00086   <span class="keywordflow">if</span> ((<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a> = (<span class="keyword">struct</span> <a class="code" href="structmemDescriptor.html">memDescriptor</a> *)<a class="code" href="paging_8h.html#541f0b43826a40b9e978f5479080bb0e">vmm_getFreeMallocPage</a>(4)) == 0x0)
<a name="l00087"></a>00087     <a class="code" href="kpanic_8h.html#db9a182aa071791a306163d50d653deb">kpanic</a>(<span class="stringliteral">"Error: vmmGetFreeKernelPage returned NULL\n"</span>);
<a name="l00088"></a>00088     
<a name="l00089"></a>00089   <span class="comment">/* zero out the memory so we know there is no garbage */</span>
<a name="l00090"></a>00090   <a class="code" href="lib_2string_8h.html#ce4b911463887af5e748326323e99a23">memset</a>(<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>,0x0,0x4000);
<a name="l00091"></a>00091 
<a name="l00092"></a>00092   <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[0].<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = &amp;<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[1];
<a name="l00093"></a>00093 
<a name="l00094"></a>00094   <span class="keywordflow">for</span> (i = 0<a class="code" href="ap-boot_8S.html#1a3ac2137e21f6f0d400f1996914dd19">x1</a>;i &lt; ((0x4000/<span class="keyword">sizeof</span>(<span class="keyword">struct </span>memDescriptor)));i++) {
<a name="l00095"></a>00095     <span class="keywordflow">if</span> (i+1 &lt; (0x4000/<span class="keyword">sizeof</span>(<span class="keyword">struct</span> memDescriptor)))
<a name="l00096"></a>00096       <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[i].<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = &amp;<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[i+1];
<a name="l00097"></a>00097     <span class="keywordflow">else</span>
<a name="l00098"></a>00098       <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[i].<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = 0x0;
<a name="l00099"></a>00099     <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[i].<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = &amp;<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[i-1];
<a name="l00100"></a>00100     }
<a name="l00101"></a>00101 
<a name="l00102"></a>00102   tmpDesc = &amp;<a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>[0];
<a name="l00103"></a>00103 
<a name="l00104"></a>00104   <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>       = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00105"></a>00105   <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00106"></a>00106   tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>       = 0x0;
<a name="l00107"></a>00107   tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>       = 0x0;
<a name="l00108"></a>00108   <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#2d89e65292e7be33cb2424224396ee2d">emptyDescSpinLock</a>);
<a name="l00109"></a>00109   <span class="keywordflow">return</span>(tmpDesc);
<a name="l00110"></a>00110   }
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="comment">/************************************************************************</span>
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">Function: void insertFreeDesc(struct memDescriptor *freeDesc)</span>
<a name="l00115"></a>00115 <span class="comment">Description: This Function Inserts A Free Descriptor On The List Which Is</span>
<a name="l00116"></a>00116 <span class="comment">             Kept In Size Order</span>
<a name="l00117"></a>00117 <span class="comment"></span>
<a name="l00118"></a>00118 <span class="comment">Notes:</span>
<a name="l00119"></a>00119 <span class="comment"></span>
<a name="l00120"></a>00120 <span class="comment">02/17/03 - This Was Inspired By TCA's Great Wisdom -</span>
<a name="l00121"></a>00121 <span class="comment">           "[20:20:59] &lt;TCA&gt; You should just insert it in order"</span>
<a name="l00122"></a>00122 <span class="comment"></span>
<a name="l00123"></a>00123 <span class="comment">************************************************************************/</span>
<a name="l00124"></a><a class="code" href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0">00124</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0">insertFreeDesc</a>(<span class="keyword">struct</span> <a class="code" href="structmemDescriptor.html">memDescriptor</a> *freeDesc) {
<a name="l00125"></a>00125   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc = 0x0;
<a name="l00126"></a>00126   <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(freeDesc);
<a name="l00127"></a>00127   
<a name="l00128"></a>00128   <span class="keywordflow">if</span> (freeDesc-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> &lt;= 0x0)
<a name="l00129"></a>00129     <a class="code" href="kpanic_8h.html#db9a182aa071791a306163d50d653deb">kpanic</a>(<span class="stringliteral">"Inserting Descriptor with no limit\n"</span>);
<a name="l00130"></a>00130   
<a name="l00131"></a>00131   <span class="keywordflow">if</span> (<a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a> != 0x0) {
<a name="l00132"></a>00132  
<a name="l00133"></a>00133 <span class="preprocessor">    #if 0</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>    freeDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>;
<a name="l00135"></a>00135     freeDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00136"></a>00136     <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = freeDesc;
<a name="l00137"></a>00137     <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a> = freeDesc;
<a name="l00138"></a>00138 <span class="preprocessor">    #endif </span>
<a name="l00139"></a>00139 <span class="preprocessor"></span>    
<a name="l00140"></a>00140     <span class="keywordflow">for</span> (tmpDesc = <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>;tmpDesc != 0x0;tmpDesc = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>) {
<a name="l00141"></a>00141       <span class="keywordflow">if</span> (freeDesc-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> &lt;= tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>) {
<a name="l00142"></a>00142       
<a name="l00143"></a>00143         freeDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>;
<a name="l00144"></a>00144         if (tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> != 0x0)
<a name="l00145"></a>00145           tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = freeDesc;
<a name="l00146"></a>00146 
<a name="l00147"></a>00147         
<a name="l00148"></a>00148         tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>  = freeDesc;
<a name="l00149"></a>00149         freeDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = tmpDesc;
<a name="l00150"></a>00150         
<a name="l00151"></a>00151         if (tmpDesc == <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>)
<a name="l00152"></a>00152           <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a> = freeDesc;
<a name="l00153"></a>00153         <span class="keywordflow">return</span>(0x0);
<a name="l00154"></a>00154         }
<a name="l00155"></a>00155        <span class="keywordflow">if</span> (tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> == 0x0) {
<a name="l00156"></a>00156          tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = freeDesc;
<a name="l00157"></a>00157          freeDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc;
<a name="l00158"></a>00158          freeDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = 0x0;
<a name="l00159"></a>00159          <span class="keywordflow">return</span>(0x0);
<a name="l00160"></a>00160          }
<a name="l00161"></a>00161       }
<a name="l00162"></a>00162     <a class="code" href="kpanic_8h.html#db9a182aa071791a306163d50d653deb">kpanic</a>(<span class="stringliteral">"didnt Insert\n"</span>);
<a name="l00163"></a>00163     <span class="keywordflow">return</span>(0x0);
<a name="l00164"></a>00164     }
<a name="l00165"></a>00165   <span class="keywordflow">else</span> {
<a name="l00166"></a>00166     freeDesc-&gt;prev = 0x0;
<a name="l00167"></a>00167     freeDesc-&gt;next = 0x0;
<a name="l00168"></a>00168     <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a> = freeDesc;
<a name="l00169"></a>00169     <span class="keywordflow">return</span>(0x0);
<a name="l00170"></a>00170     }
<a name="l00171"></a>00171 
<a name="l00172"></a>00172   <span class="keywordflow">return</span>(0<a class="code" href="ap-boot_8S.html#1a3ac2137e21f6f0d400f1996914dd19">x1</a>);
<a name="l00173"></a>00173   }
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 <span class="comment">/************************************************************************</span>
<a name="l00176"></a>00176 <span class="comment"></span>
<a name="l00177"></a>00177 <span class="comment">Function: void mergeMemBlocks()</span>
<a name="l00178"></a>00178 <span class="comment">Description: This Function Will Merge Free Blocks And Free Pages</span>
<a name="l00179"></a>00179 <span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">Notes:</span>
<a name="l00181"></a>00181 <span class="comment"></span>
<a name="l00182"></a>00182 <span class="comment">03/05/03 - We Have A Problem It Seems The First Block Is Limit 0x0</span>
<a name="l00183"></a>00183 <span class="comment"></span>
<a name="l00184"></a>00184 <span class="comment">************************************************************************/</span>
<a name="l00185"></a><a class="code" href="kmalloc_8c.html#e86fd9a9efa965202367d84e53bc7c85">00185</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="kmalloc_8c.html#e86fd9a9efa965202367d84e53bc7c85">mergeMemBlocks</a>() {
<a name="l00186"></a>00186   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc1 = 0x0;
<a name="l00187"></a>00187   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc2 = 0x0;
<a name="l00188"></a>00188   <a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a>               <a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>  = 0x0;
<a name="l00189"></a>00189 
<a name="l00190"></a>00190   <span class="keywordflow">return</span>;
<a name="l00191"></a>00191 
<a name="l00192"></a>00192   <span class="comment">//Loop The Free Descriptors See If We Can Merge Them</span>
<a name="l00193"></a>00193   mergeStart:
<a name="l00194"></a>00194   <span class="keywordflow">for</span> (tmpDesc1=<a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>;tmpDesc1 != 0x0;tmpDesc1=tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>) {
<a name="l00195"></a>00195     <span class="comment">/*</span>
<a name="l00196"></a>00196 <span class="comment">     Compare The Base Addr With The Other Descriptors If You Find The One</span>
<a name="l00197"></a>00197 <span class="comment">     That You Are Looking For Lets Merge Them</span>
<a name="l00198"></a>00198 <span class="comment">    */</span>
<a name="l00199"></a>00199     <span class="keywordflow">if</span> (tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> != 0x0) {
<a name="l00200"></a>00200       baseAddr = (<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a>)tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a> + (<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a>)tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>;
<a name="l00201"></a>00201       for (tmpDesc2=<a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>;tmpDesc2;tmpDesc2=tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>) {
<a name="l00202"></a>00202         <span class="keywordflow">if</span> ((<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a>)tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a> == baseAddr) {
<a name="l00203"></a>00203           tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> += tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>;
<a name="l00204"></a>00204           tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a> = 0x0;
<a name="l00205"></a>00205           tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>    = 0x0;
<a name="l00206"></a>00206           if (tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>) {
<a name="l00207"></a>00207             tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00208"></a>00208             }
<a name="l00209"></a>00209           <span class="keywordflow">if</span> (tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>) {
<a name="l00210"></a>00210             tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>;
<a name="l00211"></a>00211             }
<a name="l00212"></a>00212           tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>      = 0x0;
<a name="l00213"></a>00213           tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>      = <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>;
<a name="l00214"></a>00214           <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc2;
<a name="l00215"></a>00215           <a class="code" href="kmalloc_8c.html#33325db110e0782930deda9b52e7224b">emptyKernDesc</a>       = tmpDesc2;
<a name="l00216"></a>00216           <span class="keywordflow">if</span> (tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>) {
<a name="l00217"></a>00217             tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00218"></a>00218             }
<a name="l00219"></a>00219           <span class="keywordflow">if</span> (tmpDesc1-&gt;next) {
<a name="l00220"></a>00220             tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>;
<a name="l00221"></a>00221             }
<a name="l00222"></a>00222           tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00223"></a>00223           tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = 0x0;
<a name="l00224"></a>00224           <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"mergememBlocks: [%i]\n"</span>,tmpDesc1-&gt;limit);
<a name="l00225"></a>00225           <a class="code" href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0">insertFreeDesc</a>(tmpDesc1);
<a name="l00226"></a>00226           <span class="comment">//tmpDesc1 = freeKernDesc;</span>
<a name="l00227"></a>00227           <span class="keywordflow">goto</span> mergeStart;
<a name="l00228"></a>00228           <span class="keywordflow">break</span>;
<a name="l00229"></a>00229           }
<a name="l00230"></a>00230         }
<a name="l00231"></a>00231       }
<a name="l00232"></a>00232     }
<a name="l00233"></a>00233   <span class="keywordflow">return</span>;
<a name="l00234"></a>00234   }
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 
<a name="l00237"></a>00237 <span class="comment">/************************************************************************</span>
<a name="l00238"></a>00238 <span class="comment"></span>
<a name="l00239"></a>00239 <span class="comment">Function: void *kmalloc(uInt32 len)</span>
<a name="l00240"></a>00240 <span class="comment">Description: Allocate Kernel Memory</span>
<a name="l00241"></a>00241 <span class="comment"></span>
<a name="l00242"></a>00242 <span class="comment">Notes:</span>
<a name="l00243"></a>00243 <span class="comment"></span>
<a name="l00244"></a>00244 <span class="comment">02/17/03 - Do I Still Need To Pass In The Pid?</span>
<a name="l00245"></a>00245 <span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">************************************************************************/</span>    
<a name="l00247"></a><a class="code" href="kmalloc_8c.html#150eab2ac4ce4553e21ca10e7f441762">00247</a> <span class="keywordtype">void</span> *<a class="code" href="kmalloc_8h.html#150eab2ac4ce4553e21ca10e7f441762">kmalloc</a>(<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> len) {
<a name="l00248"></a>00248   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc1 = 0x0;
<a name="l00249"></a>00249   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc2 = 0x0;
<a name="l00250"></a>00250   <span class="keywordtype">char</span>                 *<a class="code" href="structbuf.html">buf</a>      = 0x0;
<a name="l00251"></a>00251   <span class="keywordtype">int</span>                   i        = 0x0;
<a name="l00252"></a>00252   <a class="code" href="types_8h.html#3b65128d2644e9b80cec9a69bfa7e094">uInt16</a>                pages    = 0x0;
<a name="l00253"></a>00253 
<a name="l00254"></a>00254 
<a name="l00255"></a>00255   <a class="code" href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1">spinLock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00256"></a>00256   
<a name="l00257"></a>00257   len = <a class="code" href="kmalloc_8h.html#f0fa0ac2c51032ef234e92b127e59a74">MALLOC_ALIGN</a>(len);
<a name="l00258"></a>00258 
<a name="l00259"></a>00259   
<a name="l00260"></a>00260   <span class="keywordflow">if</span> (len == 0x0) {
<a name="l00261"></a>00261     <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00262"></a>00262         <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"kmalloc: len = 0!\n"</span>);
<a name="l00263"></a>00263     <span class="keywordflow">return</span>(0x0);
<a name="l00264"></a>00264     }
<a name="l00265"></a>00265   <span class="keywordflow">for</span> (tmpDesc1 = <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>;tmpDesc1 != 0x0;tmpDesc1=tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>) {
<a name="l00266"></a>00266     <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(tmpDesc1);
<a name="l00267"></a>00267     <span class="keywordflow">if</span> (tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> &gt;= len) {
<a name="l00268"></a>00268       if (tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> != 0x0)
<a name="l00269"></a>00269         tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00270"></a>00270       if (tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> != 0x0)
<a name="l00271"></a>00271         tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>;
<a name="l00272"></a>00272 
<a name="l00273"></a>00273       if (tmpDesc1 == <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a>)
<a name="l00274"></a>00274         <a class="code" href="kmalloc_8c.html#a0c5be194ccb3f36a4ea8e666fbd2dac">freeKernDesc</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00275"></a>00275 
<a name="l00276"></a>00276       tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00277"></a>00277       tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>;
<a name="l00278"></a>00278       if (<a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a> != 0x0)
<a name="l00279"></a>00279         <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc1;
<a name="l00280"></a>00280       <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a> = tmpDesc1; 
<a name="l00281"></a>00281       if (tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> &gt; len) {
<a name="l00282"></a>00282         tmpDesc2 = <a class="code" href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4">getEmptyDesc</a>();
<a name="l00283"></a>00283         <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(tmpDesc2);
<a name="l00284"></a>00284         tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> - len;
<a name="l00285"></a>00285         tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> = len;
<a name="l00286"></a>00286         tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a> = tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a> + len;
<a name="l00287"></a>00287         tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = 0x0;
<a name="l00288"></a>00288         tmpDesc2-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00289"></a>00289         <a class="code" href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0">insertFreeDesc</a>(tmpDesc2);
<a name="l00290"></a>00290         }
<a name="l00291"></a>00291       buf = (<span class="keywordtype">char</span> *)tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>;
<a name="l00292"></a>00292       for (i=0;i&lt;tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>;i++) {
<a name="l00293"></a>00293         (<span class="keywordtype">char</span>)buf[i] = (<span class="keywordtype">char</span>)0x0;
<a name="l00294"></a>00294         }
<a name="l00295"></a>00295       <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00296"></a>00296       <span class="comment">//kprintf("m1[%i:%i:0x%X]",tmpDesc1-&gt;limit,len,tmpDesc1-&gt;baseAddr);</span>
<a name="l00297"></a>00297         <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>);
<a name="l00298"></a>00298       <span class="keywordflow">return</span>(tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>);
<a name="l00299"></a>00299       }
<a name="l00300"></a>00300     }
<a name="l00301"></a>00301   tmpDesc1 = <a class="code" href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4">getEmptyDesc</a>();
<a name="l00302"></a>00302   <span class="comment">//kprintf("no empty desc\n");</span>
<a name="l00303"></a>00303   <span class="keywordflow">if</span> (tmpDesc1 != 0x0) {
<a name="l00304"></a>00304     pages = ((len + 4095)/4096);
<a name="l00305"></a>00305     tmpDesc1-&gt;baseAddr = (<span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *)<a class="code" href="paging_8h.html#541f0b43826a40b9e978f5479080bb0e">vmm_getFreeMallocPage</a>(pages);
<a name="l00306"></a>00306     tmpDesc1-&gt;limit    = len;
<a name="l00307"></a>00307     tmpDesc1-&gt;next     = <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>;
<a name="l00308"></a>00308     tmpDesc1-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>     = 0x0;
<a name="l00309"></a>00309     <span class="keywordflow">if</span> (<a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a> != 0x0)
<a name="l00310"></a>00310       <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>       = tmpDesc1;
<a name="l00311"></a>00311     <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>             = tmpDesc1;
<a name="l00312"></a>00312 
<a name="l00313"></a>00313     <span class="keywordflow">if</span> (((pages * 4096)-len) &gt; 0x0) {
<a name="l00314"></a>00314       tmpDesc2           = <a class="code" href="kmalloc_8c.html#f6c4ea5cb961c72548d92ff65d7e33a4">getEmptyDesc</a>();
<a name="l00315"></a>00315       <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(tmpDesc2);
<a name="l00316"></a>00316       tmpDesc2-&gt;baseAddr = tmpDesc1-&gt;baseAddr + tmpDesc1-&gt;limit;
<a name="l00317"></a>00317       tmpDesc2-&gt;limit    = ((pages * 4096)-len);
<a name="l00318"></a>00318       tmpDesc2-&gt;prev     = 0x0;
<a name="l00319"></a>00319       tmpDesc2-&gt;next     = 0x0;
<a name="l00320"></a>00320       <span class="keywordflow">if</span> (tmpDesc2-&gt;limit &lt;= 0x0)
<a name="l00321"></a>00321         <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"kmalloc-2 tmpDesc2: [%i]\n"</span>,tmpDesc2-&gt;limit);
<a name="l00322"></a>00322       <a class="code" href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0">insertFreeDesc</a>(tmpDesc2);
<a name="l00323"></a>00323       }
<a name="l00324"></a>00324 
<a name="l00325"></a>00325       <a class="code" href="structbuf.html">buf</a> = (<span class="keywordtype">char</span> *)tmpDesc1-&gt;baseAddr;
<a name="l00326"></a>00326       for (i=0;i&lt;tmpDesc1-&gt;limit;i++) {
<a name="l00327"></a>00327         (<span class="keywordtype">char</span>)<a class="code" href="structbuf.html">buf</a>[i] = (<span class="keywordtype">char</span>)0x0;
<a name="l00328"></a>00328         }
<a name="l00329"></a>00329     <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00330"></a>00330     <span class="comment">//kprintf("baseAddr2[0x%X:0x%X]",tmpDesc1,tmpDesc1-&gt;baseAddr);</span>
<a name="l00331"></a>00331     <span class="comment">//kprintf("m2[%i:%i:0x%X]",tmpDesc1-&gt;limit,len,tmpDesc1-&gt;baseAddr);</span>
<a name="l00332"></a>00332         <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(tmpDesc1-&gt;baseAddr);
<a name="l00333"></a>00333     <span class="keywordflow">return</span>(tmpDesc1-&gt;baseAddr);
<a name="l00334"></a>00334     }
<a name="l00335"></a>00335   <span class="comment">//Return Null If Unable To Malloc</span>
<a name="l00336"></a>00336   <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00337"></a>00337   <span class="comment">//kprintf("baseAddr3[0x0]");</span>
<a name="l00338"></a>00338   <span class="keywordflow">return</span>(0x0);
<a name="l00339"></a>00339   }
<a name="l00340"></a>00340   
<a name="l00341"></a>00341 <span class="comment">/************************************************************************</span>
<a name="l00342"></a>00342 <span class="comment"></span>
<a name="l00343"></a>00343 <span class="comment">Function: void kfree(void *baseAddr)</span>
<a name="l00344"></a>00344 <span class="comment">Description: This Will Find The Descriptor And Free It</span>
<a name="l00345"></a>00345 <span class="comment"></span>
<a name="l00346"></a>00346 <span class="comment">Notes:</span>
<a name="l00347"></a>00347 <span class="comment"></span>
<a name="l00348"></a>00348 <span class="comment">02/17/03 - I need To Make It Join Descriptors</span>
<a name="l00349"></a>00349 <span class="comment"></span>
<a name="l00350"></a>00350 <span class="comment">************************************************************************/</span>
<a name="l00351"></a><a class="code" href="kmalloc_8c.html#aa9ed6886459604cf73ccdbf6410e487">00351</a> <span class="keywordtype">void</span> <a class="code" href="kmalloc_8h.html#aa9ed6886459604cf73ccdbf6410e487">kfree</a>(<span class="keywordtype">void</span> *<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>) {
<a name="l00352"></a>00352   <span class="keyword">struct </span><a class="code" href="structmemDescriptor.html">memDescriptor</a> *tmpDesc = 0x0;
<a name="l00353"></a>00353 
<a name="l00354"></a>00354   <span class="keywordflow">if</span> (baseAddr == 0x0) <span class="keywordflow">return</span>; 
<a name="l00355"></a>00355   <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(baseAddr);
<a name="l00356"></a>00356 
<a name="l00357"></a>00357   <a class="code" href="assert_8h.html#d6d5aaa966ca7424f7cb9bd01f2c838b">assert</a>(<a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>);
<a name="l00358"></a>00358   <a class="code" href="spinlock_8h.html#2cd9a4502680fb8e7f0fe6b029e558b1">spinLock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00359"></a>00359   
<a name="l00360"></a>00360   <span class="keywordflow">for</span> (tmpDesc = <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a>;tmpDesc != 0x0;tmpDesc = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>) {
<a name="l00361"></a>00361     
<a name="l00362"></a>00362     <span class="keywordflow">if</span> (tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a> == baseAddr) {
<a name="l00363"></a>00363       <a class="code" href="lib_2string_8h.html#ce4b911463887af5e748326323e99a23">memset</a>(tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>,0xBE,tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>);
<a name="l00364"></a>00364     
<a name="l00365"></a>00365       if (<a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a> == tmpDesc)
<a name="l00366"></a>00366         <a class="code" href="kmalloc_8c.html#f60f75b69fa71f90b84c0dd58f0040a5">usedKernDesc</a> = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00367"></a>00367 
<a name="l00368"></a>00368       if (tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> != 0x0)
<a name="l00369"></a>00369         tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>;
<a name="l00370"></a>00370 
<a name="l00371"></a>00371       if (tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> != 0x0)
<a name="l00372"></a>00372         tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a>-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a>;
<a name="l00373"></a>00373 
<a name="l00374"></a>00374 
<a name="l00375"></a>00375       tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#fef7871e9eb4790c4593ddfaddcd028f">next</a> = 0x0;
<a name="l00376"></a>00376       tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#1c3d40435fbd7093299235a8684d8b66">prev</a> = 0x0;
<a name="l00377"></a>00377       
<a name="l00378"></a>00378       if (tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a> &lt;= 0x0)
<a name="l00379"></a>00379         <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"kfree tmpDesc1: [%i]\n"</span>,tmpDesc-&gt;<a class="code" href="structmemDescriptor.html#058bea66f641af082849f748d83ea065">limit</a>);
<a name="l00380"></a>00380       <span class="comment">//kprintf("{0x%X}",tmpDesc-&gt;baseAddr);</span>
<a name="l00381"></a>00381       <a class="code" href="kmalloc_8c.html#eb1c3f1ef8eb9063c2e5c4af488dd2d0">insertFreeDesc</a>(tmpDesc);
<a name="l00382"></a>00382 
<a name="l00383"></a>00383      <span class="comment">// mergeMemBlocks();</span>
<a name="l00384"></a>00384       <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00385"></a>00385       <span class="keywordflow">return</span>;
<a name="l00386"></a>00386       }
<a name="l00387"></a>00387     }
<a name="l00388"></a>00388   <a class="code" href="spinlock_8h.html#dd996cbbb3b9826dd9c8cf02b66a4c65">spinUnlock</a>(&amp;<a class="code" href="kmalloc_8c.html#6f529a6db980782464a6c1bb7eddd09c">mallocSpinLock</a>);
<a name="l00389"></a>00389   <a class="code" href="kprint_8h.html#b2761bdf0cca73ad0fb5880895210cd8">kprintf</a>(<span class="stringliteral">"Kernel: Error Freeing Descriptor! [0x%X]\n"</span>,(<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a>)<a class="code" href="structmemDescriptor.html#a1d1c6fe6d86d782b64c1ca467250cb9">baseAddr</a>);
<a name="l00390"></a>00390   <span class="keywordflow">return</span>;
<a name="l00391"></a>00391   }
<a name="l00392"></a>00392 
<a name="l00393"></a>00393 <span class="comment">/***</span>
<a name="l00394"></a>00394 <span class="comment"> $Log: kmalloc_8c-source.html,v $
<a name="l00394"></a>00394 <span class="comment"> Revision 1.7  2006/12/15 17:47:06  reddawg
<a name="l00394"></a>00394 <span class="comment"> Updates
<a name="l00394"></a>00394 <span class="comment"></span>
<a name="l00395"></a>00395 <span class="comment"> Revision 1.3  2006/12/05 14:10:21  reddawg</span>
<a name="l00396"></a>00396 <span class="comment"> Workign Distro</span>
<a name="l00397"></a>00397 <span class="comment"></span>
<a name="l00398"></a>00398 <span class="comment"> Revision 1.2  2006/10/06 15:48:01  reddawg</span>
<a name="l00399"></a>00399 <span class="comment"> Starting to make ubixos work with UFS2</span>
<a name="l00400"></a>00400 <span class="comment"></span>
<a name="l00401"></a>00401 <span class="comment"> Revision 1.1.1.1  2006/06/01 12:46:16  reddawg</span>
<a name="l00402"></a>00402 <span class="comment"> ubix2</span>
<a name="l00403"></a>00403 <span class="comment"></span>
<a name="l00404"></a>00404 <span class="comment"> Revision 1.4  2006/06/01 12:42:09  reddawg</span>
<a name="l00405"></a>00405 <span class="comment"> Getting back to the basics</span>
<a name="l00406"></a>00406 <span class="comment"></span>
<a name="l00407"></a>00407 <span class="comment"> Revision 1.3  2006/06/01 03:58:33  reddawg</span>
<a name="l00408"></a>00408 <span class="comment"> wondering about this stuff here</span>
<a name="l00409"></a>00409 <span class="comment"></span>
<a name="l00410"></a>00410 <span class="comment"> Revision 1.2  2005/10/12 00:13:37  reddawg</span>
<a name="l00411"></a>00411 <span class="comment"> Removed</span>
<a name="l00412"></a>00412 <span class="comment"></span>
<a name="l00413"></a>00413 <span class="comment"> Revision 1.1.1.1  2005/09/26 17:24:11  reddawg</span>
<a name="l00414"></a>00414 <span class="comment"> no message</span>
<a name="l00415"></a>00415 <span class="comment"></span>
<a name="l00416"></a>00416 <span class="comment"> Revision 1.35  2005/08/04 18:32:59  fsdfs</span>
<a name="l00417"></a>00417 <span class="comment"></span>
<a name="l00418"></a>00418 <span class="comment"> added error reporting</span>
<a name="l00419"></a>00419 <span class="comment"></span>
<a name="l00420"></a>00420 <span class="comment"> Revision 1.34  2005/08/04 18:23:41  reddawg</span>
<a name="l00421"></a>00421 <span class="comment"> BUG: Assert has issues that must be looked into</span>
<a name="l00422"></a>00422 <span class="comment"></span>
<a name="l00423"></a>00423 <span class="comment"> Revision 1.33  2005/08/04 17:11:11  fsdfs</span>
<a name="l00424"></a>00424 <span class="comment"></span>
<a name="l00425"></a>00425 <span class="comment"> ----------------------------------------</span>
<a name="l00426"></a>00426 <span class="comment"></span>
<a name="l00427"></a>00427 <span class="comment"> -------------------</span>
<a name="l00428"></a>00428 <span class="comment"></span>
<a name="l00429"></a>00429 <span class="comment"> Revision 1.32  2004/09/28 21:50:04  reddawg</span>
<a name="l00430"></a>00430 <span class="comment"> kmalloc: now when we kfree memory is filled with 0xBE so it is easy to debug if we continue to use free'd memory</span>
<a name="l00431"></a>00431 <span class="comment"></span>
<a name="l00432"></a>00432 <span class="comment"> Revision 1.31  2004/09/19 16:17:25  reddawg</span>
<a name="l00433"></a>00433 <span class="comment"> fixed memory leak we now lose no memory....</span>
<a name="l00434"></a>00434 <span class="comment"></span>
<a name="l00435"></a>00435 <span class="comment"> Revision 1.30  2004/09/14 21:51:24  reddawg</span>
<a name="l00436"></a>00436 <span class="comment"> Debug info</span>
<a name="l00437"></a>00437 <span class="comment"></span>
<a name="l00438"></a>00438 <span class="comment"> Revision 1.29  2004/09/11 23:39:31  reddawg</span>
<a name="l00439"></a>00439 <span class="comment"> ok time for bed</span>
<a name="l00440"></a>00440 <span class="comment"></span>
<a name="l00441"></a>00441 <span class="comment"> Revision 1.28  2004/09/11 23:21:26  reddawg</span>
<a name="l00442"></a>00442 <span class="comment"> run now do you get fegfaults with BB?</span>
<a name="l00443"></a>00443 <span class="comment"></span>
<a name="l00444"></a>00444 <span class="comment"> Revision 1.27  2004/09/11 22:49:28  reddawg</span>
<a name="l00445"></a>00445 <span class="comment"> pat look at lines 276-285  does the math seem right?</span>
<a name="l00446"></a>00446 <span class="comment"></span>
<a name="l00447"></a>00447 <span class="comment"> Revision 1.26  2004/09/11 22:33:13  reddawg</span>
<a name="l00448"></a>00448 <span class="comment"> minor changes</span>
<a name="l00449"></a>00449 <span class="comment"></span>
<a name="l00450"></a>00450 <span class="comment"> Revision 1.25  2004/09/11 12:11:11  reddawg</span>
<a name="l00451"></a>00451 <span class="comment"> Cleaning up the VFS more changes to follow...</span>
<a name="l00452"></a>00452 <span class="comment"></span>
<a name="l00453"></a>00453 <span class="comment"> Revision 1.24  2004/09/08 23:19:58  reddawg</span>
<a name="l00454"></a>00454 <span class="comment"> hmm</span>
<a name="l00455"></a>00455 <span class="comment"></span>
<a name="l00456"></a>00456 <span class="comment"> Revision 1.23  2004/09/06 15:13:25  reddawg</span>
<a name="l00457"></a>00457 <span class="comment"> Last commit before FreeBSD 6.0</span>
<a name="l00458"></a>00458 <span class="comment"></span>
<a name="l00459"></a>00459 <span class="comment"> Revision 1.22  2004/08/26 22:51:18  reddawg</span>
<a name="l00460"></a>00460 <span class="comment"> TCA touched me :( i think he likes men....</span>
<a name="l00461"></a>00461 <span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment"></span>
<a name="l00463"></a>00463 <span class="comment"> sched.h:        kTask_t added parentPid</span>
<a name="l00464"></a>00464 <span class="comment"> endtask.c:     fixed term back to parentPid</span>
<a name="l00465"></a>00465 <span class="comment"> exec.c:          cleaned warnings</span>
<a name="l00466"></a>00466 <span class="comment"> fork.c:            fixed term to childPid</span>
<a name="l00467"></a>00467 <span class="comment"> sched.c:         clean up for dead tasks</span>
<a name="l00468"></a>00468 <span class="comment"> systemtask.c: clean up dead tasks</span>
<a name="l00469"></a>00469 <span class="comment"> kmalloc.c:       cleaned up warnings</span>
<a name="l00470"></a>00470 <span class="comment"> udp.c:            cleaned up warnings</span>
<a name="l00471"></a>00471 <span class="comment"> bot.c:             cleaned up warnings</span>
<a name="l00472"></a>00472 <span class="comment"> shell.c:           cleaned up warnings</span>
<a name="l00473"></a>00473 <span class="comment"> tcpdump.c:     took a dump</span>
<a name="l00474"></a>00474 <span class="comment"> hd.c:             cleaned up warnings</span>
<a name="l00475"></a>00475 <span class="comment"> ubixfs.c:        stopped prning debug info</span>
<a name="l00476"></a>00476 <span class="comment"></span>
<a name="l00477"></a>00477 <span class="comment"> Revision 1.21  2004/07/28 15:05:43  reddawg</span>
<a name="l00478"></a>00478 <span class="comment"> Major:</span>
<a name="l00479"></a>00479 <span class="comment">   Pages now have strict security enforcement.</span>
<a name="l00480"></a>00480 <span class="comment">   Many null dereferences have been resolved.</span>
<a name="l00481"></a>00481 <span class="comment">   When apps loaded permissions set for pages rw and ro</span>
<a name="l00482"></a>00482 <span class="comment"></span>
<a name="l00483"></a>00483 <span class="comment"> Revision 1.20  2004/07/28 00:17:05  reddawg</span>
<a name="l00484"></a>00484 <span class="comment"> Major:</span>
<a name="l00485"></a>00485 <span class="comment">   Disconnected page 0x0 from the system... Unfortunately this broke many things</span>
<a name="l00486"></a>00486 <span class="comment">   all of which have been fixed. This was good because nothing deferences NULL</span>
<a name="l00487"></a>00487 <span class="comment">   any more.</span>
<a name="l00488"></a>00488 <span class="comment"></span>
<a name="l00489"></a>00489 <span class="comment"> Things affected:</span>
<a name="l00490"></a>00490 <span class="comment">   malloc,kmalloc,getfreepage,getfreevirtualpage,pagefault,fork,exec,ld,ld.so,exec,file</span>
<a name="l00491"></a>00491 <span class="comment"></span>
<a name="l00492"></a>00492 <span class="comment"> Revision 1.19  2004/07/26 19:15:49  reddawg</span>
<a name="l00493"></a>00493 <span class="comment"> test code, fixes and the like</span>
<a name="l00494"></a>00494 <span class="comment"></span>
<a name="l00495"></a>00495 <span class="comment"> Revision 1.18  2004/07/26 16:52:45  reddawg</span>
<a name="l00496"></a>00496 <span class="comment"> here we go</span>
<a name="l00497"></a>00497 <span class="comment"></span>
<a name="l00498"></a>00498 <span class="comment"> Revision 1.17  2004/07/24 23:04:44  reddawg</span>
<a name="l00499"></a>00499 <span class="comment"> Changes... mark let me know if you fault at pid 185 when you type stress</span>
<a name="l00500"></a>00500 <span class="comment"></span>
<a name="l00501"></a>00501 <span class="comment"> Revision 1.16  2004/07/21 10:02:09  reddawg</span>
<a name="l00502"></a>00502 <span class="comment"> devfs: renamed functions</span>
<a name="l00503"></a>00503 <span class="comment"> device system: renamed functions</span>
<a name="l00504"></a>00504 <span class="comment"> fdc: fixed a few potential bugs and cleaned up some unused variables</span>
<a name="l00505"></a>00505 <span class="comment"> strol: fixed definition</span>
<a name="l00506"></a>00506 <span class="comment"> endtask: made it print out freepage debug info</span>
<a name="l00507"></a>00507 <span class="comment"> kmalloc: fixed a huge memory leak we had some unhandled descriptor insertion so some descriptors were lost</span>
<a name="l00508"></a>00508 <span class="comment"> ld: fixed a pointer conversion</span>
<a name="l00509"></a>00509 <span class="comment"> file: cleaned up a few unused variables</span>
<a name="l00510"></a>00510 <span class="comment"> sched: broke task deletion</span>
<a name="l00511"></a>00511 <span class="comment"> kprintf: fixed ogPrintf definition</span>
<a name="l00512"></a>00512 <span class="comment"></span>
<a name="l00513"></a>00513 <span class="comment"> Revision 1.15  2004/07/20 23:20:50  reddawg</span>
<a name="l00514"></a>00514 <span class="comment"> kmalloc: forgot to remove an assert</span>
<a name="l00515"></a>00515 <span class="comment"></span>
<a name="l00516"></a>00516 <span class="comment"> Revision 1.14  2004/07/20 23:18:11  reddawg</span>
<a name="l00517"></a>00517 <span class="comment"> Made malloc a little more robust but we have a serious memory leak somewhere</span>
<a name="l00518"></a>00518 <span class="comment"></span>
<a name="l00519"></a>00519 <span class="comment"> Revision 1.13  2004/07/20 22:29:55  reddawg</span>
<a name="l00520"></a>00520 <span class="comment"> assert: remade assert</span>
<a name="l00521"></a>00521 <span class="comment"></span>
<a name="l00522"></a>00522 <span class="comment"> Revision 1.12  2004/07/20 18:58:24  reddawg</span>
<a name="l00523"></a>00523 <span class="comment"> Few fixes</span>
<a name="l00524"></a>00524 <span class="comment"></span>
<a name="l00525"></a>00525 <span class="comment"> Revision 1.11  2004/07/18 05:24:15  reddawg</span>
<a name="l00526"></a>00526 <span class="comment"> Fixens</span>
<a name="l00527"></a>00527 <span class="comment"></span>
<a name="l00528"></a>00528 <span class="comment"> Revision 1.10  2004/07/17 18:00:47  reddawg</span>
<a name="l00529"></a>00529 <span class="comment"> kmalloc: added assert()</span>
<a name="l00530"></a>00530 <span class="comment"></span>
<a name="l00531"></a>00531 <span class="comment"> Revision 1.9  2004/07/17 15:54:52  reddawg</span>
<a name="l00532"></a>00532 <span class="comment"> kmalloc: added assert()</span>
<a name="l00533"></a>00533 <span class="comment"> bioscall: fixed some potential problem by not making 16bit code</span>
<a name="l00534"></a>00534 <span class="comment"> paging: added assert()</span>
<a name="l00535"></a>00535 <span class="comment"></span>
<a name="l00536"></a>00536 <span class="comment"> Revision 1.8  2004/06/17 14:50:32  reddawg</span>
<a name="l00537"></a>00537 <span class="comment"> kmalloc: converted some variables to static</span>
<a name="l00538"></a>00538 <span class="comment"></span>
<a name="l00539"></a>00539 <span class="comment"> Revision 1.7  2004/06/17 02:54:54  flameshadow</span>
<a name="l00540"></a>00540 <span class="comment"> chg: fixed cast</span>
<a name="l00541"></a>00541 <span class="comment"></span>
<a name="l00542"></a>00542 <span class="comment"> Revision 1.6  2004/05/26 11:56:51  reddawg</span>
<a name="l00543"></a>00543 <span class="comment"> kmalloc: fixed memrgeMemBlocks hopefully it will prevent future segfault issues</span>
<a name="l00544"></a>00544 <span class="comment">          by not having any more overlapping blocks</span>
<a name="l00545"></a>00545 <span class="comment"></span>
<a name="l00546"></a>00546 <span class="comment"> Revision 1.5  2004/05/25 14:01:14  reddawg</span>
<a name="l00547"></a>00547 <span class="comment"> Implimented Better Spinlocking No More Issues With KMALLOC which actually</span>
<a name="l00548"></a>00548 <span class="comment"> was causing bizzare problems</span>
<a name="l00549"></a>00549 <span class="comment"></span>
<a name="l00550"></a>00550 <span class="comment"> END</span>
<a name="l00551"></a>00551 <span class="comment"> ***/</span>
<a name="l00552"></a>00552 
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Dec 15 11:18:55 2006 for UbixOS V2 by&nbsp;
<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>