<?xml version='1.0' encoding='iso-8859-1' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.4.7">
  <compounddef id="kmalloc_8c" kind="file">
    <compoundname>kmalloc.c</compoundname>
    <includes refid="kmalloc_8h" local="no">lib/kmalloc.h</includes>
    <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes>
    <includes refid="kpanic_8h" local="no">ubixos/kpanic.h</includes>
    <includes refid="sched_8h" local="no">ubixos/sched.h</includes>
    <includes refid="spinlock_8h" local="no">ubixos/spinlock.h</includes>
    <includes refid="vmm_8h" local="no">vmm/vmm.h</includes>
    <includes refid="string_8h" local="no">string.h</includes>
    <includes refid="assert_8h" local="no">assert.h</includes>
    <incdepgraph>
      <node id="5685">
        <label>sys/thread.h</label>
        <link refid="thread_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5678">
        <label>ubixos/kpanic.h</label>
        <link refid="kpanic_8h"/>
      </node>
      <node id="5679">
        <label>ubixos/sched.h</label>
        <link refid="sched_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
        <childnode refid="5680" relation="include">
        </childnode>
        <childnode refid="5681" relation="include">
        </childnode>
        <childnode refid="5684" relation="include">
        </childnode>
        <childnode refid="5685" relation="include">
        </childnode>
      </node>
      <node id="5686">
        <label>ubixos/spinlock.h</label>
        <link refid="spinlock_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5673">
        <label>src/sys/lib/kmalloc.c</label>
        <link refid="kmalloc.c"/>
        <childnode refid="5674" relation="include">
        </childnode>
        <childnode refid="5677" relation="include">
        </childnode>
        <childnode refid="5678" relation="include">
        </childnode>
        <childnode refid="5679" relation="include">
        </childnode>
        <childnode refid="5686" relation="include">
        </childnode>
        <childnode refid="5687" relation="include">
        </childnode>
        <childnode refid="5691" relation="include">
        </childnode>
        <childnode refid="5692" relation="include">
        </childnode>
      </node>
      <node id="5675">
        <label>ubixos/types.h</label>
        <link refid="types_8h"/>
        <childnode refid="5676" relation="include">
        </childnode>
      </node>
      <node id="5676">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="5688">
        <label>vmm/paging.h</label>
        <link refid="paging_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
        <childnode refid="5689" relation="include">
        </childnode>
        <childnode refid="5685" relation="include">
        </childnode>
      </node>
      <node id="5691">
        <label>string.h</label>
        <link refid="string_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5681">
        <label>vfs/file.h</label>
        <link refid="file_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
        <childnode refid="5682" relation="include">
        </childnode>
        <childnode refid="5683" relation="include">
        </childnode>
      </node>
      <node id="5684">
        <label>sys/tss.h</label>
        <link refid="tss_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5674">
        <label>lib/kmalloc.h</label>
        <link refid="kmalloc_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5687">
        <label>vmm/vmm.h</label>
        <link refid="vmm_8h"/>
        <childnode refid="5688" relation="include">
        </childnode>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5683">
        <label>vfs/mount.h</label>
        <link refid="mount_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5677">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5692">
        <label>assert.h</label>
        <link refid="assert_8h"/>
      </node>
      <node id="5682">
        <label>ubixfs/dirCache.h</label>
        <link refid="dirCache_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5689">
        <label>sys/sysproto.h</label>
        <link refid="sysproto_8h"/>
        <childnode refid="5690" relation="include">
        </childnode>
        <childnode refid="5685" relation="include">
        </childnode>
      </node>
      <node id="5690">
        <label>sys/signal.h</label>
        <link refid="signal_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
      <node id="5680">
        <label>ubixos/tty.h</label>
        <link refid="tty_8h"/>
        <childnode refid="5675" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void *</type>
        <definition>static void* getEmptyDesc</definition>
        <argsstring>()</argsstring>
        <name>getEmptyDesc</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="67" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="67" bodyend="110"/>
        <references refid="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" compoundref="kmalloc_8c" startline="55">emptyDescSpinLock</references>
        <references refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" compoundref="kmalloc_8c" startline="49">emptyKernDesc</references>
        <references refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" compoundref="kpanic_8c" startline="42" endline="60">kpanic</references>
        <references refid="lib_2string_8h_1ce4b911463887af5e748326323e99a23" compoundref="memset_8c" startline="37" endline="80">memset</references>
        <references refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" compoundref="kmalloc_8h" startline="45">memDescriptor::next</references>
        <references refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" compoundref="kmalloc_8h" startline="44">memDescriptor::prev</references>
        <references refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" compoundref="spinlock_8c" startline="56" endline="62">spinLock</references>
        <references refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" compoundref="spinlock_8c" startline="37" endline="46">spinUnlock</references>
        <references refid="paging_8h_1541f0b43826a40b9e978f5479080bb0e" compoundref="paging_8c" startline="401" endline="451">vmm_getFreeMallocPage</references>
        <references refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" compoundref="ap-boot_8S" startline="6">x1</references>
        <referencedby refid="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</referencedby>
      </memberdef>
      <memberdef kind="function" id="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int insertFreeDesc</definition>
        <argsstring>(struct memDescriptor *freeDesc)</argsstring>
        <name>insertFreeDesc</name>
        <param>
          <type>struct <ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref> *</type>
          <declname>freeDesc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="124" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="124" bodyend="173"/>
        <references refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" compoundref="assert_8h" startline="64">assert</references>
        <references refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" compoundref="kmalloc_8c" startline="48">freeKernDesc</references>
        <references refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" compoundref="kpanic_8c" startline="42" endline="60">kpanic</references>
        <references refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" compoundref="kmalloc_8h" startline="47">memDescriptor::limit</references>
        <references refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" compoundref="kmalloc_8h" startline="45">memDescriptor::next</references>
        <references refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" compoundref="kmalloc_8h" startline="44">memDescriptor::prev</references>
        <referencedby refid="kmalloc_8c_1aa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="351" endline="391">kfree</referencedby>
        <referencedby refid="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</referencedby>
      </memberdef>
      <memberdef kind="function" id="kmalloc_8c_1aa9ed6886459604cf73ccdbf6410e487" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void kfree</definition>
        <argsstring>(void *baseAddr)</argsstring>
        <name>kfree</name>
        <param>
          <type>void *</type>
          <declname>baseAddr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="351" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="351" bodyend="391"/>
        <references refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" compoundref="assert_8h" startline="64">assert</references>
        <references refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" compoundref="kmalloc_8h" startline="46">memDescriptor::baseAddr</references>
        <references refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" compoundref="kmalloc_8c" startline="124" endline="173">insertFreeDesc</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" compoundref="kmalloc_8h" startline="47">memDescriptor::limit</references>
        <references refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" compoundref="kmalloc_8c" startline="54">mallocSpinLock</references>
        <references refid="lib_2string_8h_1ce4b911463887af5e748326323e99a23" compoundref="memset_8c" startline="37" endline="80">memset</references>
        <references refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" compoundref="kmalloc_8h" startline="45">memDescriptor::next</references>
        <references refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" compoundref="kmalloc_8h" startline="44">memDescriptor::prev</references>
        <references refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" compoundref="spinlock_8c" startline="56" endline="62">spinLock</references>
        <references refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" compoundref="spinlock_8c" startline="37" endline="46">spinUnlock</references>
        <references refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" compoundref="kmalloc_8c" startline="47">usedKernDesc</references>
        <referencedby refid="kern__descrip_8c_1ec14600d2aa9db1288f00704ba3a55d7" compoundref="kern__descrip_8c" startline="90" endline="98">close</referencedby>
        <referencedby refid="device_8c_1b6cc746d95021f087eb5aef767050e71" compoundref="device_8c" startline="110" endline="145">device_remove</referencedby>
        <referencedby refid="elf_8c_1f11ec9e50bcff723428b0c911a177fd0" compoundref="elf_8c" startline="111" endline="185">elf_loadfile</referencedby>
        <referencedby refid="exec_8c_1f80d4412d42ed1b5bf9a1b9774230f33" compoundref="exec_8c" startline="143" endline="323">execFile</referencedby>
        <referencedby refid="file_8c_1789959682f4ac8df2d89ea6450efda8b" compoundref="file_8c" startline="398" endline="425">fclose</referencedby>
        <referencedby refid="file_8c_13c11b2679cf37c72b05eaab50c282e72" compoundref="file_8c" startline="274" endline="389">fopen</referencedby>
        <referencedby refid="kmod_8c_192b68dbf95bf5d651555a4c02ee1a74b" compoundref="kmod_8c" startline="75" endline="211">kmod_load</referencedby>
        <referencedby refid="ld_8c_1b0622e93915d1824df770950e425875f" compoundref="ld_8c" startline="42" endline="176">ldEnable</referencedby>
        <referencedby refid="system_8c_1bde5afef3a059fc7e8f355486f80a4cd" compoundref="system_8c" startline="234" endline="255">mpi_destroyMbox</referencedby>
        <referencedby refid="system_8c_176ba344daaa7e476f1d23c4f23f31615" compoundref="system_8c" startline="189" endline="223">mpi_fetchMessage</referencedby>
        <referencedby refid="ne2k_8c_1deb7b37e43d9b5203408374d8d8ce586" compoundref="ne2k_8c" startline="353" endline="357">ne2kFreeBuffer</referencedby>
        <referencedby refid="libcpp_8cc_13d97a7e2a0208075b4b37328c96ed390" compoundref="libcpp_8cc" startline="64" endline="68">operator delete</referencedby>
        <referencedby refid="libcpp_8cc_11d8b2d6f17242ae0d182b0f7a98ba54f" compoundref="libcpp_8cc" startline="51" endline="56">operator delete[]</referencedby>
        <referencedby refid="exec_8c_1094c23346b6d226a03866a54b755ed64" compoundref="exec_8c" startline="552" endline="716">sys_exec</referencedby>
        <referencedby refid="gen__calls_8c_114173c973cb6d92a0e2ff34ee072f4d3" compoundref="gen__calls_8c" startline="67" endline="98">sys_write</referencedby>
        <referencedby refid="exec_8c_1219681612352232186a0f568457d851d" compoundref="exec_8c" startline="334" endline="546">sysExec</referencedby>
        <referencedby refid="systemtask_8c_1c7cc6a806237f8657fcdce169319fd7f" compoundref="systemtask_8c" startline="48" endline="118">systemTask</referencedby>
        <referencedby refid="dirCache_8c_1472e166c2202b92faa451f2ae9906882" compoundref="dirCache_8c" startline="202" endline="228">ubixfs_cacheDelete</referencedby>
        <referencedby refid="directory_8c_119ed96e270f8c904857e2fe1651ea325" compoundref="directory_8c" startline="94" endline="127">ubixFSmkDir</referencedby>
        <referencedby refid="ubthread_8c_1e914fae69538736dc5e494c15ce93a17" compoundref="ubthread_8c" startline="64" endline="68">ubthread_cond_destroy</referencedby>
        <referencedby refid="ubthread_8c_1278f5d5b1e11b6668b75da6a285442e4" compoundref="ubthread_8c" startline="70" endline="74">ubthread_mutex_destroy</referencedby>
        <referencedby refid="mount_8c_18379310fce9e1a500f602059516e25f0" compoundref="mount_8c" startline="47" endline="94">vfs_mount</referencedby>
        <referencedby refid="ubixfs_8c_1ba0435c266346dd10ac3cbc68655b20c" compoundref="ubixfs_8c" startline="232" endline="307">writeUbixFS</referencedby>
      </memberdef>
      <memberdef kind="function" id="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void *</type>
        <definition>void* kmalloc</definition>
        <argsstring>(uInt32 len)</argsstring>
        <name>kmalloc</name>
        <param>
          <type><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref></type>
          <declname>len</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="247" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="247" bodyend="339"/>
        <references refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" compoundref="assert_8h" startline="64">assert</references>
        <references refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" compoundref="kmalloc_8h" startline="46">memDescriptor::baseAddr</references>
        <references refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" compoundref="kmalloc_8c" startline="48">freeKernDesc</references>
        <references refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" compoundref="kmalloc_8c" startline="67" endline="110">getEmptyDesc</references>
        <references refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" compoundref="kmalloc_8c" startline="124" endline="173">insertFreeDesc</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" compoundref="kmalloc_8h" startline="47">memDescriptor::limit</references>
        <references refid="kmalloc_8h_1f0fa0ac2c51032ef234e92b127e59a74" compoundref="kmalloc_8h" startline="41">MALLOC_ALIGN</references>
        <references refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" compoundref="kmalloc_8c" startline="54">mallocSpinLock</references>
        <references refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" compoundref="kmalloc_8h" startline="45">memDescriptor::next</references>
        <references refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" compoundref="kmalloc_8h" startline="44">memDescriptor::prev</references>
        <references refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" compoundref="spinlock_8c" startline="56" endline="62">spinLock</references>
        <references refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" compoundref="spinlock_8c" startline="37" endline="46">spinUnlock</references>
        <references refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" compoundref="kmalloc_8c" startline="47">usedKernDesc</references>
        <referencedby refid="directory_8c_1756e1f497c4d9fed64ac0a2256f9fa46" compoundref="directory_8c" startline="66" endline="91">addDirEntry</referencedby>
        <referencedby refid="bioscall_8c_156a172d2268fc10811a0bb180d7c3f49" compoundref="bioscall_8c" startline="50" endline="97">biosCall</referencedby>
        <referencedby refid="devfs_8c_17b312bcbbf9c2386ec31ccc73f1c3c63" compoundref="devfs_8c" startline="50" endline="62">devfs_initialize</referencedby>
        <referencedby refid="devfs_8h_1d568bae84bef3691539f1b1d0f6a54b4" compoundref="devfs_8c" startline="178" endline="213">devfs_makeNode</referencedby>
        <referencedby refid="device_8c_124bac04b529afec40daa960bd7e7b8ee" compoundref="device_8c" startline="51" endline="73">device_add</referencedby>
        <referencedby refid="elf_8c_1f11ec9e50bcff723428b0c911a177fd0" compoundref="elf_8c" startline="111" endline="185">elf_loadfile</referencedby>
        <referencedby refid="exec_8c_1f80d4412d42ed1b5bf9a1b9774230f33" compoundref="exec_8c" startline="143" endline="323">execFile</referencedby>
        <referencedby refid="kern__descrip_8c_19c93ac280b559128027746bda7c5d6d4" compoundref="kern__descrip_8c" startline="67" endline="88">falloc</referencedby>
        <referencedby refid="fdc_8c_12fad92b12d9ff56bf300b7e53875c75d" compoundref="fdc_8c" startline="63" endline="77">fdc_init</referencedby>
        <referencedby refid="file_8c_13c11b2679cf37c72b05eaab50c282e72" compoundref="file_8c" startline="274" endline="389">fopen</referencedby>
        <referencedby refid="hd_8c_1a6ffe735243161c69ce0930999e02f88" compoundref="hd_8c" startline="39" endline="123">initHardDisk</referencedby>
        <referencedby refid="lnc_8c_10b7fb4f8833ed743dc1f3c4c90c28731" compoundref="lnc_8c" startline="104" endline="152">initLNC</referencedby>
        <referencedby refid="main_8c_1a099bb67b4698f94150184a0ee8ccffb" compoundref="main_8c" startline="97" endline="152">kmain</referencedby>
        <referencedby refid="kmod_8c_1f2a085a786b2cf77d53da7f364948cd4" compoundref="kmod_8c" startline="46" endline="73">kmod_add</referencedby>
        <referencedby refid="kmod_8c_192b68dbf95bf5d651555a4c02ee1a74b" compoundref="kmod_8c" startline="75" endline="211">kmod_load</referencedby>
        <referencedby refid="ld_8c_1b0622e93915d1824df770950e425875f" compoundref="ld_8c" startline="42" endline="176">ldEnable</referencedby>
        <referencedby refid="lnc_8c_186e977fd8113976b87da564f2b53a2d7" compoundref="lnc_8c" startline="246" endline="308">lncAttach</referencedby>
        <referencedby refid="system_8c_17fe5c18f6d5c29d15a74277234d18739" compoundref="system_8c" startline="69" endline="97">mpi_createMbox</referencedby>
        <referencedby refid="system_8c_127f6a180049b096910c4ffd8b152fbb8" compoundref="system_8c" startline="143" endline="178">mpi_postMessage</referencedby>
        <referencedby refid="system_8c_1806e9deddf18f8be353745a16e8f5e85" compoundref="system_8c" startline="108" endline="132">mpi_spam</referencedby>
        <referencedby refid="ne2k_8c_1033e069050ace667acb10ed9ffc8ac6c" compoundref="ne2k_8c" startline="70" endline="113">ne2k_init</referencedby>
        <referencedby refid="ne2k_8c_1dae239918a8091c31abf996cee262c92" compoundref="ne2k_8c" startline="313" endline="339">ne2kAllocBuffer</referencedby>
        <referencedby refid="ubixfs_8c_10ab17f87a44bc7bb7ee3c76262f80e94" compoundref="ubixfs_8c" startline="46" endline="116">openFileUbixFS</referencedby>
        <referencedby refid="libcpp_8cc_19bccb23e08907b6033c45f524578239a" compoundref="libcpp_8cc" startline="58" endline="62">operator new</referencedby>
        <referencedby refid="libcpp_8cc_1e55853bd31de5afc92b2093f2567c007" compoundref="libcpp_8cc" startline="46" endline="49">operator new[]</referencedby>
        <referencedby refid="sched_8c_1cc9c0d52122a455dbd018fabfc11ab59" compoundref="sched_8c" startline="69" endline="81">sched_init</referencedby>
        <referencedby refid="sched_8c_192458df2063761371869cdfe0c9b4ee3" compoundref="sched_8c" startline="143" endline="172">schedNewTask</referencedby>
        <referencedby refid="exec_8c_1094c23346b6d226a03866a54b755ed64" compoundref="exec_8c" startline="552" endline="716">sys_exec</referencedby>
        <referencedby refid="gen__calls_8c_114173c973cb6d92a0e2ff34ee072f4d3" compoundref="gen__calls_8c" startline="67" endline="98">sys_write</referencedby>
        <referencedby refid="kern__sysctl_8c_12a55d33778f8774747841f23f4ff9f1f" compoundref="kern__sysctl_8c" startline="205" endline="248">sysctl_add</referencedby>
        <referencedby refid="kern__sysctl_8c_16d1146ba67c212252bb9699a7dc77cbf" compoundref="kern__sysctl_8c" startline="65" endline="151">sysctl_init</referencedby>
        <referencedby refid="exec_8c_1219681612352232186a0f568457d851d" compoundref="exec_8c" startline="334" endline="546">sysExec</referencedby>
        <referencedby refid="tty_8c_1ab365abb615be7027fa0bdb2c09569cb" compoundref="tty_8c" startline="42" endline="79">tty_init</referencedby>
        <referencedby refid="dirCache_8c_1169a7d814e5ab80f123e5193a81b70b2" compoundref="dirCache_8c" startline="185" endline="199">ubixfs_cacheNew</referencedby>
        <referencedby refid="ubixfs_8c_132762e2563015d124909f3317c2a7423" compoundref="ubixfs_8c" startline="376" endline="442">ubixfs_initialize</referencedby>
        <referencedby refid="directory_8c_17cac3d485d20bce5cf642f767769dfcf" compoundref="directory_8c" startline="41" endline="63">ubixFSLoadDir</referencedby>
        <referencedby refid="directory_8c_119ed96e270f8c904857e2fe1651ea325" compoundref="directory_8c" startline="94" endline="127">ubixFSmkDir</referencedby>
        <referencedby refid="ubixfs_8c_1dfbafb62e063e24f4df09029862ba9d0" compoundref="ubixfs_8c" startline="309" endline="326">ubixFSUnlink</referencedby>
        <referencedby refid="ubthread_8c_1cbb7170a68758468ab5b02512a320112" compoundref="ubthread_8c" startline="48" endline="54">ubthread_cond_init</referencedby>
        <referencedby refid="ubthread_8c_1a0af177ef44888f3c93883294207328e" compoundref="ubthread_8c" startline="76" endline="79">ubthread_create</referencedby>
        <referencedby refid="ubthread_8c_1b6bfc2169b55532821582f24b68dc855" compoundref="ubthread_8c" startline="56" endline="62">ubthread_mutex_init</referencedby>
        <referencedby refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" compoundref="ufs_8c" startline="272" endline="289">ufs_openFile</referencedby>
        <referencedby refid="mount_8c_18379310fce9e1a500f602059516e25f0" compoundref="mount_8c" startline="47" endline="94">vfs_mount</referencedby>
        <referencedby refid="vfs_8c_1d8cb9693ae7b6b9fc419efc975778338" compoundref="vfs_8c" startline="81" endline="138">vfsRegisterFS</referencedby>
        <referencedby refid="vitals_8c_134d7f48e003fe73f05d594c6c1f00d49" compoundref="vitals_8c" startline="48" endline="69">vitals_init</referencedby>
        <referencedby refid="ubixfs_8c_1ba0435c266346dd10ac3cbc68655b20c" compoundref="ubixfs_8c" startline="232" endline="307">writeUbixFS</referencedby>
      </memberdef>
      <memberdef kind="function" id="kmalloc_8c_1e86fd9a9efa965202367d84e53bc7c85" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void mergeMemBlocks</definition>
        <argsstring>()</argsstring>
        <name>mergeMemBlocks</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="185" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="185" bodyend="234"/>
        <references refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" compoundref="kmalloc_8h" startline="46">memDescriptor::baseAddr</references>
        <references refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" compoundref="kmalloc_8c" startline="49">emptyKernDesc</references>
        <references refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" compoundref="kmalloc_8c" startline="48">freeKernDesc</references>
        <references refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" compoundref="kmalloc_8h" startline="47">memDescriptor::limit</references>
        <references refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" compoundref="kmalloc_8h" startline="45">memDescriptor::next</references>
        <references refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" compoundref="kmalloc_8h" startline="44">memDescriptor::prev</references>
      </memberdef>
      </sectiondef>
      <sectiondef kind="var">
      <memberdef kind="variable" id="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" prot="public" static="yes" mutable="no">
        <type><ref refid="spinlock_8h_1a240e9404b4ede1e0d714610080d1176" kindref="member">spinLock_t</ref></type>
        <definition>spinLock_t emptyDescSpinLock</definition>
        <argsstring></argsstring>
        <name>emptyDescSpinLock</name>
        <initializer> SPIN_LOCK_INITIALIZER</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="55" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="55" bodyend="-1"/>
        <referencedby refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" compoundref="kmalloc_8c" startline="67" endline="110">getEmptyDesc</referencedby>
      </memberdef>
      <memberdef kind="variable" id="kmalloc_8c_133325db110e0782930deda9b52e7224b" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref> *</type>
        <definition>struct memDescriptor* emptyKernDesc</definition>
        <argsstring></argsstring>
        <name>emptyKernDesc</name>
        <initializer> 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="49" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="49" bodyend="-1"/>
        <referencedby refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" compoundref="kmalloc_8c" startline="67" endline="110">getEmptyDesc</referencedby>
        <referencedby refid="kmalloc_8c_1e86fd9a9efa965202367d84e53bc7c85" compoundref="kmalloc_8c" startline="185" endline="234">mergeMemBlocks</referencedby>
      </memberdef>
      <memberdef kind="variable" id="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref> *</type>
        <definition>struct memDescriptor* freeKernDesc</definition>
        <argsstring></argsstring>
        <name>freeKernDesc</name>
        <initializer> 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="48" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="48" bodyend="-1"/>
        <referencedby refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" compoundref="kmalloc_8c" startline="124" endline="173">insertFreeDesc</referencedby>
        <referencedby refid="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</referencedby>
        <referencedby refid="kmalloc_8c_1e86fd9a9efa965202367d84e53bc7c85" compoundref="kmalloc_8c" startline="185" endline="234">mergeMemBlocks</referencedby>
      </memberdef>
      <memberdef kind="variable" id="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" prot="public" static="yes" mutable="no">
        <type><ref refid="spinlock_8h_1a240e9404b4ede1e0d714610080d1176" kindref="member">spinLock_t</ref></type>
        <definition>spinLock_t mallocSpinLock</definition>
        <argsstring></argsstring>
        <name>mallocSpinLock</name>
        <initializer> SPIN_LOCK_INITIALIZER</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="54" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="54" bodyend="-1"/>
        <referencedby refid="kmalloc_8c_1aa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="351" endline="391">kfree</referencedby>
        <referencedby refid="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</referencedby>
      </memberdef>
      <memberdef kind="variable" id="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref> *</type>
        <definition>struct memDescriptor* usedKernDesc</definition>
        <argsstring></argsstring>
        <name>usedKernDesc</name>
        <initializer> 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" line="47" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c" bodystart="47" bodyend="-1"/>
        <referencedby refid="kmalloc_8c_1aa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="351" endline="391">kfree</referencedby>
        <referencedby refid="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</referencedby>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*****************************************************************************************</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>Copyright<sp/>(c)<sp/>2002-2004<sp/>The<sp/>UbixOS<sp/>Project</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>All<sp/>rights<sp/>reserved.</highlight></codeline>
<codeline lineno="4"><highlight class="comment"></highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/>modification,<sp/>are</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>permitted<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline>
<codeline lineno="7"><highlight class="comment"></highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.<sp/><sp/>Redistributions<sp/>in<sp/>binary</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of<sp/>conditions,<sp/>the<sp/>following</highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or<sp/>other<sp/>materials<sp/>provided</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>with<sp/>the<sp/>distribution.<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to<sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>without<sp/>specific<sp/>prior<sp/>written<sp/>permission.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"></highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>COPYRIGHT<sp/>HOLDERS<sp/>AND<sp/>CONTRIBUTORS<sp/>&quot;AS<sp/>IS&quot;<sp/>AND<sp/>ANY</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>EXPRESS<sp/>OR<sp/>IMPLIED<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR</highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="25"><highlight class="comment"></highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>$Id: kmalloc_8c.xml 88 2016-01-12 00:11:29Z reddawg $</highlight></codeline>
<codeline lineno="27"><highlight class="comment"></highlight></codeline>
<codeline lineno="28"><highlight class="comment">*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kpanic_8h" kindref="compound">ubixos/kpanic.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="sched_8h" kindref="compound">ubixos/sched.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="spinlock_8h" kindref="compound">ubixos/spinlock.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="vmm_8h" kindref="compound">vmm/vmm.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="string_8h" kindref="compound">string.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="assert_8h" kindref="compound">assert.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="40"><highlight class="comment"><sp/>Set<sp/>up<sp/>three<sp/>descriptor<sp/>tables:</highlight></codeline>
<codeline lineno="41"><highlight class="comment"><sp/></highlight></codeline>
<codeline lineno="42"><highlight class="comment"><sp/>kernDesc<sp/><sp/><sp/><sp/><sp/><sp/>-<sp/>The<sp/>inuse<sp/>descriptor<sp/>table<sp/></highlight></codeline>
<codeline lineno="43"><highlight class="comment"><sp/>freeKernDesc<sp/><sp/>-<sp/>The<sp/>free<sp/>descriptor<sp/>table<sp/>(descriptors<sp/>with<sp/>memory<sp/>backing<sp/>just<sp/>not<sp/>in<sp/>use)</highlight></codeline>
<codeline lineno="44"><highlight class="comment"><sp/>emptyKernDesc<sp/>-<sp/>The<sp/>empty<sp/>descriptor<sp/>table<sp/>(descriptors<sp/>with<sp/>out<sp/>a<sp/>memory<sp/>backing)</highlight></codeline>
<codeline lineno="45"><highlight class="comment"><sp/></highlight></codeline>
<codeline lineno="46"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="47" refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*<ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="48" refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*<ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="49" refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="52"><highlight class="comment"><sp/>Set<sp/>up<sp/>our<sp/>spinlocks<sp/>so<sp/>we<sp/>do<sp/>not<sp/>corrupt<sp/>linked<sp/>lists<sp/>if<sp/>we<sp/>have<sp/>re-entrancy</highlight></codeline>
<codeline lineno="53"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54" refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="spinlock_8h_1a240e9404b4ede1e0d714610080d1176" kindref="member">spinLock_t</ref><sp/><ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref><sp/><sp/><sp/><sp/>=<sp/><ref refid="spinlock_8h_10fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref>;</highlight></codeline>
<codeline lineno="55" refid="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="spinlock_8h_1a240e9404b4ede1e0d714610080d1176" kindref="member">spinLock_t</ref><sp/><ref refid="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" kindref="member">emptyDescSpinLock</ref><sp/>=<sp/><ref refid="spinlock_8h_10fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref>;</highlight></codeline>
<codeline lineno="56"><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="58"><highlight class="comment"></highlight></codeline>
<codeline lineno="59"><highlight class="comment">Function:<sp/>void<sp/>*getEmptyDesc()</highlight></codeline>
<codeline lineno="60"><highlight class="comment">Description:<sp/>Find<sp/>An<sp/>Empty<sp/>Descriptor</highlight></codeline>
<codeline lineno="61"><highlight class="comment"></highlight></codeline>
<codeline lineno="62"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="63"><highlight class="comment"></highlight></codeline>
<codeline lineno="64"><highlight class="comment">02/17/03<sp/>-<sp/>Is<sp/>This<sp/>Efficient?</highlight></codeline>
<codeline lineno="65"><highlight class="comment"></highlight></codeline>
<codeline lineno="66"><highlight class="comment">************************************************************************/</highlight><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="67" refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" kindref="member">getEmptyDesc</ref>()<sp/>{</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" kindref="member">spinLock</ref>(&amp;<ref refid="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" kindref="member">emptyDescSpinLock</ref>);</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/>tmpDesc<sp/>=<sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc<sp/>!=<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref><sp/>!=<sp/>0x0)<sp/></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" kindref="member">emptyDescSpinLock</ref>);</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(tmpDesc);</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref><sp/>=<sp/>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*)<ref refid="paging_8h_1541f0b43826a40b9e978f5479080bb0e" kindref="member">vmm_getFreeMallocPage</ref>(4))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmmGetFreeKernelPage<sp/>returned<sp/>NULL\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>zero<sp/>out<sp/>the<sp/>memory<sp/>so<sp/>we<sp/>know<sp/>there<sp/>is<sp/>no<sp/>garbage<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><ref refid="lib_2string_8h_1ce4b911463887af5e748326323e99a23" kindref="member">memset</ref>(<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>,0x0,0x4000);</highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[0].<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>&amp;<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[1];</highlight></codeline>
<codeline lineno="93"><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0<ref refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" kindref="member">x1</ref>;i<sp/>&lt;<sp/>((0x4000/</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">memDescriptor)));i++)<sp/>{</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(i+1<sp/>&lt;<sp/>(0x4000/</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/>memDescriptor)))</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[i].<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>&amp;<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[i+1];</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[i].<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[i].<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>&amp;<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[i-1];</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="101"><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/>tmpDesc<sp/>=<sp/>&amp;<ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>[0];</highlight></codeline>
<codeline lineno="103"><highlight class="normal"></highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_12d89e65292e7be33cb2424224396ee2d" kindref="member">emptyDescSpinLock</ref>);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(tmpDesc);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="111"><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="113"><highlight class="comment"></highlight></codeline>
<codeline lineno="114"><highlight class="comment">Function:<sp/>void<sp/>insertFreeDesc(struct<sp/>memDescriptor<sp/>*freeDesc)</highlight></codeline>
<codeline lineno="115"><highlight class="comment">Description:<sp/>This<sp/>Function<sp/>Inserts<sp/>A<sp/>Free<sp/>Descriptor<sp/>On<sp/>The<sp/>List<sp/>Which<sp/>Is</highlight></codeline>
<codeline lineno="116"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Kept<sp/>In<sp/>Size<sp/>Order</highlight></codeline>
<codeline lineno="117"><highlight class="comment"></highlight></codeline>
<codeline lineno="118"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="119"><highlight class="comment"></highlight></codeline>
<codeline lineno="120"><highlight class="comment">02/17/03<sp/>-<sp/>This<sp/>Was<sp/>Inspired<sp/>By<sp/>TCA&apos;s<sp/>Great<sp/>Wisdom<sp/>-</highlight></codeline>
<codeline lineno="121"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&quot;[20:20:59]<sp/>&lt;TCA&gt;<sp/>You<sp/>should<sp/>just<sp/>insert<sp/>it<sp/>in<sp/>order&quot;</highlight></codeline>
<codeline lineno="122"><highlight class="comment"></highlight></codeline>
<codeline lineno="123"><highlight class="comment">************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="124" refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" kindref="member">insertFreeDesc</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*freeDesc)<sp/>{</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(freeDesc);</highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(freeDesc-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>&lt;=<sp/>0x0)</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Inserting<sp/>Descriptor<sp/>with<sp/>no<sp/>limit\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref><sp/>!=<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/></highlight></codeline>
<codeline lineno="133"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/>#if<sp/>0</highlight></codeline>
<codeline lineno="134"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/>freeDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>;</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/>freeDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/>#endif<sp/></highlight></codeline>
<codeline lineno="139"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(tmpDesc<sp/>=<sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>;tmpDesc<sp/>!=<sp/>0x0;tmpDesc<sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(freeDesc-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>&lt;=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref>)<sp/>{</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>freeDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>;</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="146"><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>freeDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>tmpDesc;</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc<sp/>==<sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>)</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>==<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>freeDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc;</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>freeDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;didnt<sp/>Insert\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/>freeDesc-&gt;prev<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/>freeDesc-&gt;next<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref><sp/>=<sp/>freeDesc;</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0<ref refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" kindref="member">x1</ref>);</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="174"><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="176"><highlight class="comment"></highlight></codeline>
<codeline lineno="177"><highlight class="comment">Function:<sp/>void<sp/>mergeMemBlocks()</highlight></codeline>
<codeline lineno="178"><highlight class="comment">Description:<sp/>This<sp/>Function<sp/>Will<sp/>Merge<sp/>Free<sp/>Blocks<sp/>And<sp/>Free<sp/>Pages</highlight></codeline>
<codeline lineno="179"><highlight class="comment"></highlight></codeline>
<codeline lineno="180"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="181"><highlight class="comment"></highlight></codeline>
<codeline lineno="182"><highlight class="comment">03/05/03<sp/>-<sp/>We<sp/>Have<sp/>A<sp/>Problem<sp/>It<sp/>Seems<sp/>The<sp/>First<sp/>Block<sp/>Is<sp/>Limit<sp/>0x0</highlight></codeline>
<codeline lineno="183"><highlight class="comment"></highlight></codeline>
<codeline lineno="184"><highlight class="comment">************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="185" refid="kmalloc_8c_1e86fd9a9efa965202367d84e53bc7c85" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="kmalloc_8c_1e86fd9a9efa965202367d84e53bc7c85" kindref="member">mergeMemBlocks</ref>()<sp/>{</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc1<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc2<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="189"><highlight class="normal"></highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"></highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//Loop<sp/>The<sp/>Free<sp/>Descriptors<sp/>See<sp/>If<sp/>We<sp/>Can<sp/>Merge<sp/>Them</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/>mergeStart:</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(tmpDesc1=<ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>;tmpDesc1<sp/>!=<sp/>0x0;tmpDesc1=tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="196"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>Compare<sp/>The<sp/>Base<sp/>Addr<sp/>With<sp/>The<sp/>Other<sp/>Descriptors<sp/>If<sp/>You<sp/>Find<sp/>The<sp/>One</highlight></codeline>
<codeline lineno="197"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>That<sp/>You<sp/>Are<sp/>Looking<sp/>For<sp/>Lets<sp/>Merge<sp/>Them</highlight></codeline>
<codeline lineno="198"><highlight class="comment"><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>!=<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>baseAddr<sp/>=<sp/>(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)tmpDesc1-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/>+<sp/>(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref>;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>for<sp/>(tmpDesc2=<ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>;tmpDesc2;tmpDesc2=tmpDesc2-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)tmpDesc2-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/>==<sp/>baseAddr)<sp/>{</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>+=<sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref>;</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc2-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>)<sp/>{</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc2-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>;</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>;</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc2;</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_133325db110e0782930deda9b52e7224b" kindref="member">emptyKernDesc</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>tmpDesc2;</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>)<sp/>{</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc1-&gt;next)<sp/>{</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;mergememBlocks:<sp/>[%i]\n&quot;</highlight><highlight class="normal">,tmpDesc1-&gt;limit);</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" kindref="member">insertFreeDesc</ref>(tmpDesc1);</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//tmpDesc1<sp/>=<sp/>freeKernDesc;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">goto</highlight><highlight class="normal"><sp/>mergeStart;</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="235"><highlight class="normal"></highlight></codeline>
<codeline lineno="236"><highlight class="normal"></highlight></codeline>
<codeline lineno="237"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="238"><highlight class="comment"></highlight></codeline>
<codeline lineno="239"><highlight class="comment">Function:<sp/>void<sp/>*kmalloc(uInt32<sp/>len)</highlight></codeline>
<codeline lineno="240"><highlight class="comment">Description:<sp/>Allocate<sp/>Kernel<sp/>Memory</highlight></codeline>
<codeline lineno="241"><highlight class="comment"></highlight></codeline>
<codeline lineno="242"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="243"><highlight class="comment"></highlight></codeline>
<codeline lineno="244"><highlight class="comment">02/17/03<sp/>-<sp/>Do<sp/>I<sp/>Still<sp/>Need<sp/>To<sp/>Pass<sp/>In<sp/>The<sp/>Pid?</highlight></codeline>
<codeline lineno="245"><highlight class="comment"></highlight></codeline>
<codeline lineno="246"><highlight class="comment">************************************************************************/</highlight><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="247" refid="kmalloc_8c_1150eab2ac4ce4553e21ca10e7f441762" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc1<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc2<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*<ref refid="structbuf" kindref="compound">buf</ref><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pages<sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="253"><highlight class="normal"></highlight></codeline>
<codeline lineno="254"><highlight class="normal"></highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" kindref="member">spinLock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/>len<sp/>=<sp/><ref refid="kmalloc_8h_1f0fa0ac2c51032ef234e92b127e59a74" kindref="member">MALLOC_ALIGN</ref>(len);</highlight></codeline>
<codeline lineno="258"><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(len<sp/>==<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;kmalloc:<sp/>len<sp/>=<sp/>0!\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(tmpDesc1<sp/>=<sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>;tmpDesc1<sp/>!=<sp/>0x0;tmpDesc1=tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(tmpDesc1);</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>&gt;=<sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"></highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc1<sp/>==<sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref>)</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1a0c5be194ccb3f36a4ea8e666fbd2dac" kindref="member">freeKernDesc</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"></highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref>;</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(<ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc1;</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/>=<sp/>tmpDesc1;<sp/></highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>&gt;<sp/>len)<sp/>{</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2<sp/>=<sp/><ref refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" kindref="member">getEmptyDesc</ref>();</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(tmpDesc2);</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>-<sp/>len;</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>=<sp/>len;</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/>=<sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/>+<sp/>len;</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" kindref="member">insertFreeDesc</ref>(tmpDesc2);</highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>buf<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)tmpDesc1-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref>;</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>for<sp/>(i=0;i&lt;tmpDesc1-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref>;i++)<sp/>{</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">)buf[i]<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">)0x0;</highlight></codeline>
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;m1[%i:%i:0x%X]&quot;,tmpDesc1-&gt;limit,len,tmpDesc1-&gt;baseAddr);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(tmpDesc1-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref>);</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(tmpDesc1-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref>);</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/>tmpDesc1<sp/>=<sp/><ref refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" kindref="member">getEmptyDesc</ref>();</highlight></codeline>
<codeline lineno="302"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;no<sp/>empty<sp/>desc\n&quot;);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc1<sp/>!=<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/>pages<sp/>=<sp/>((len<sp/>+<sp/>4095)/4096);</highlight></codeline>
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpDesc1-&gt;baseAddr<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*)<ref refid="paging_8h_1541f0b43826a40b9e978f5479080bb0e" kindref="member">vmm_getFreeMallocPage</ref>(pages);</highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpDesc1-&gt;limit<sp/><sp/><sp/><sp/>=<sp/>len;</highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpDesc1-&gt;next<sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref>;</highlight></codeline>
<codeline lineno="308"><highlight class="normal"><sp/><sp/><sp/><sp/>tmpDesc1-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>tmpDesc1;</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>tmpDesc1;</highlight></codeline>
<codeline lineno="312"><highlight class="normal"></highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(((pages<sp/>*<sp/>4096)-len)<sp/>&gt;<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="kmalloc_8c_1f6c4ea5cb961c72548d92ff65d7e33a4" kindref="member">getEmptyDesc</ref>();</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(tmpDesc2);</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;baseAddr<sp/>=<sp/>tmpDesc1-&gt;baseAddr<sp/>+<sp/>tmpDesc1-&gt;limit;</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;limit<sp/><sp/><sp/><sp/>=<sp/>((pages<sp/>*<sp/>4096)-len);</highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;prev<sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc2-&gt;next<sp/><sp/><sp/><sp/><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc2-&gt;limit<sp/>&lt;=<sp/>0x0)</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;kmalloc-2<sp/>tmpDesc2:<sp/>[%i]\n&quot;</highlight><highlight class="normal">,tmpDesc2-&gt;limit);</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" kindref="member">insertFreeDesc</ref>(tmpDesc2);</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="324"><highlight class="normal"></highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="structbuf" kindref="compound">buf</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)tmpDesc1-&gt;baseAddr;</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>for<sp/>(i=0;i&lt;tmpDesc1-&gt;limit;i++)<sp/>{</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">)<ref refid="structbuf" kindref="compound">buf</ref>[i]<sp/>=<sp/>(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">)0x0;</highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;baseAddr2[0x%X:0x%X]&quot;,tmpDesc1,tmpDesc1-&gt;baseAddr);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;m2[%i:%i:0x%X]&quot;,tmpDesc1-&gt;limit,len,tmpDesc1-&gt;baseAddr);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(tmpDesc1-&gt;baseAddr);</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(tmpDesc1-&gt;baseAddr);</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//Return<sp/>Null<sp/>If<sp/>Unable<sp/>To<sp/>Malloc</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;baseAddr3[0x0]&quot;);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="341"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="342"><highlight class="comment"></highlight></codeline>
<codeline lineno="343"><highlight class="comment">Function:<sp/>void<sp/>kfree(void<sp/>*baseAddr)</highlight></codeline>
<codeline lineno="344"><highlight class="comment">Description:<sp/>This<sp/>Will<sp/>Find<sp/>The<sp/>Descriptor<sp/>And<sp/>Free<sp/>It</highlight></codeline>
<codeline lineno="345"><highlight class="comment"></highlight></codeline>
<codeline lineno="346"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="347"><highlight class="comment"></highlight></codeline>
<codeline lineno="348"><highlight class="comment">02/17/03<sp/>-<sp/>I<sp/>need<sp/>To<sp/>Make<sp/>It<sp/>Join<sp/>Descriptors</highlight></codeline>
<codeline lineno="349"><highlight class="comment"></highlight></codeline>
<codeline lineno="350"><highlight class="comment">************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="351" refid="kmalloc_8c_1aa9ed6886459604cf73ccdbf6410e487" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="kmalloc_8h_1aa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref>)<sp/>{</highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structmemDescriptor" kindref="compound">memDescriptor</ref><sp/>*tmpDesc<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="353"><highlight class="normal"></highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baseAddr<sp/>==<sp/>0x0)<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;<sp/></highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(baseAddr);</highlight></codeline>
<codeline lineno="356"><highlight class="normal"></highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/><ref refid="assert_8h_1d6d5aaa966ca7424f7cb9bd01f2c838b" kindref="member">assert</ref>(<ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref>);</highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_12cd9a4502680fb8e7f0fe6b029e558b1" kindref="member">spinLock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(tmpDesc<sp/>=<sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref>;tmpDesc<sp/>!=<sp/>0x0;tmpDesc<sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmpDesc-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref><sp/>==<sp/>baseAddr)<sp/>{</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="lib_2string_8h_1ce4b911463887af5e748326323e99a23" kindref="member">memset</ref>(tmpDesc-&gt;<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref>,0xBE,tmpDesc-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref>);</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(<ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/>==<sp/>tmpDesc)</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1f60f75b69fa71f90b84c0dd58f0040a5" kindref="member">usedKernDesc</ref><sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="367"><highlight class="normal"></highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="370"><highlight class="normal"></highlight></codeline>
<codeline lineno="371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>!=<sp/>0x0)</highlight></codeline>
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref>-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref>;</highlight></codeline>
<codeline lineno="373"><highlight class="normal"></highlight></codeline>
<codeline lineno="374"><highlight class="normal"></highlight></codeline>
<codeline lineno="375"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_1fef7871e9eb4790c4593ddfaddcd028f" kindref="member">next</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmpDesc-&gt;<ref refid="structmemDescriptor_11c3d40435fbd7093299235a8684d8b66" kindref="member">prev</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(tmpDesc-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref><sp/>&lt;=<sp/>0x0)</highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;kfree<sp/>tmpDesc1:<sp/>[%i]\n&quot;</highlight><highlight class="normal">,tmpDesc-&gt;<ref refid="structmemDescriptor_1058bea66f641af082849f748d83ea065" kindref="member">limit</ref>);</highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;{0x%X}&quot;,tmpDesc-&gt;baseAddr);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kmalloc_8c_1eb1c3f1ef8eb9063c2e5c4af488dd2d0" kindref="member">insertFreeDesc</ref>(tmpDesc);</highlight></codeline>
<codeline lineno="382"><highlight class="normal"></highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>mergeMemBlocks();</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="388"><highlight class="normal"><sp/><sp/><ref refid="spinlock_8h_1dd996cbbb3b9826dd9c8cf02b66a4c65" kindref="member">spinUnlock</ref>(&amp;<ref refid="kmalloc_8c_16f529a6db980782464a6c1bb7eddd09c" kindref="member">mallocSpinLock</ref>);</highlight></codeline>
<codeline lineno="389"><highlight class="normal"><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Kernel:<sp/>Error<sp/>Freeing<sp/>Descriptor!<sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,(<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref>)<ref refid="structmemDescriptor_1a1d1c6fe6d86d782b64c1ca467250cb9" kindref="member">baseAddr</ref>);</highlight></codeline>
<codeline lineno="390"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="392"><highlight class="normal"></highlight></codeline>
<codeline lineno="393"><highlight class="normal"></highlight><highlight class="comment">/***</highlight></codeline>
<codeline lineno="394"><highlight class="comment"><sp/>$Log: kmalloc_8c.xml,v $
<codeline lineno="394"><highlight class="comment"><sp/>Revision 1.6  2006/12/19 14:12:51  reddawg
<codeline lineno="394"><highlight class="comment"><sp/>rtld-elf almost workign
<codeline lineno="394"><highlight class="comment"><sp/></highlight></codeline>
<codeline lineno="395"><highlight class="comment"><sp/>Revision<sp/>1.3<sp/><sp/>2006/12/05<sp/>14:10:21<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="396"><highlight class="comment"><sp/>Workign<sp/>Distro</highlight></codeline>
<codeline lineno="397"><highlight class="comment"></highlight></codeline>
<codeline lineno="398"><highlight class="comment"><sp/>Revision<sp/>1.2<sp/><sp/>2006/10/06<sp/>15:48:01<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="399"><highlight class="comment"><sp/>Starting<sp/>to<sp/>make<sp/>ubixos<sp/>work<sp/>with<sp/>UFS2</highlight></codeline>
<codeline lineno="400"><highlight class="comment"></highlight></codeline>
<codeline lineno="401"><highlight class="comment"><sp/>Revision<sp/>1.1.1.1<sp/><sp/>2006/06/01<sp/>12:46:16<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="402"><highlight class="comment"><sp/>ubix2</highlight></codeline>
<codeline lineno="403"><highlight class="comment"></highlight></codeline>
<codeline lineno="404"><highlight class="comment"><sp/>Revision<sp/>1.4<sp/><sp/>2006/06/01<sp/>12:42:09<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="405"><highlight class="comment"><sp/>Getting<sp/>back<sp/>to<sp/>the<sp/>basics</highlight></codeline>
<codeline lineno="406"><highlight class="comment"></highlight></codeline>
<codeline lineno="407"><highlight class="comment"><sp/>Revision<sp/>1.3<sp/><sp/>2006/06/01<sp/>03:58:33<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="408"><highlight class="comment"><sp/>wondering<sp/>about<sp/>this<sp/>stuff<sp/>here</highlight></codeline>
<codeline lineno="409"><highlight class="comment"></highlight></codeline>
<codeline lineno="410"><highlight class="comment"><sp/>Revision<sp/>1.2<sp/><sp/>2005/10/12<sp/>00:13:37<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="411"><highlight class="comment"><sp/>Removed</highlight></codeline>
<codeline lineno="412"><highlight class="comment"></highlight></codeline>
<codeline lineno="413"><highlight class="comment"><sp/>Revision<sp/>1.1.1.1<sp/><sp/>2005/09/26<sp/>17:24:11<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="414"><highlight class="comment"><sp/>no<sp/>message</highlight></codeline>
<codeline lineno="415"><highlight class="comment"></highlight></codeline>
<codeline lineno="416"><highlight class="comment"><sp/>Revision<sp/>1.35<sp/><sp/>2005/08/04<sp/>18:32:59<sp/><sp/>fsdfs</highlight></codeline>
<codeline lineno="417"><highlight class="comment"></highlight></codeline>
<codeline lineno="418"><highlight class="comment"><sp/>added<sp/>error<sp/>reporting</highlight></codeline>
<codeline lineno="419"><highlight class="comment"></highlight></codeline>
<codeline lineno="420"><highlight class="comment"><sp/>Revision<sp/>1.34<sp/><sp/>2005/08/04<sp/>18:23:41<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="421"><highlight class="comment"><sp/>BUG:<sp/>Assert<sp/>has<sp/>issues<sp/>that<sp/>must<sp/>be<sp/>looked<sp/>into</highlight></codeline>
<codeline lineno="422"><highlight class="comment"></highlight></codeline>
<codeline lineno="423"><highlight class="comment"><sp/>Revision<sp/>1.33<sp/><sp/>2005/08/04<sp/>17:11:11<sp/><sp/>fsdfs</highlight></codeline>
<codeline lineno="424"><highlight class="comment"></highlight></codeline>
<codeline lineno="425"><highlight class="comment"><sp/>----------------------------------------</highlight></codeline>
<codeline lineno="426"><highlight class="comment"></highlight></codeline>
<codeline lineno="427"><highlight class="comment"><sp/>-------------------</highlight></codeline>
<codeline lineno="428"><highlight class="comment"></highlight></codeline>
<codeline lineno="429"><highlight class="comment"><sp/>Revision<sp/>1.32<sp/><sp/>2004/09/28<sp/>21:50:04<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="430"><highlight class="comment"><sp/>kmalloc:<sp/>now<sp/>when<sp/>we<sp/>kfree<sp/>memory<sp/>is<sp/>filled<sp/>with<sp/>0xBE<sp/>so<sp/>it<sp/>is<sp/>easy<sp/>to<sp/>debug<sp/>if<sp/>we<sp/>continue<sp/>to<sp/>use<sp/>free&apos;d<sp/>memory</highlight></codeline>
<codeline lineno="431"><highlight class="comment"></highlight></codeline>
<codeline lineno="432"><highlight class="comment"><sp/>Revision<sp/>1.31<sp/><sp/>2004/09/19<sp/>16:17:25<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="433"><highlight class="comment"><sp/>fixed<sp/>memory<sp/>leak<sp/>we<sp/>now<sp/>lose<sp/>no<sp/>memory....</highlight></codeline>
<codeline lineno="434"><highlight class="comment"></highlight></codeline>
<codeline lineno="435"><highlight class="comment"><sp/>Revision<sp/>1.30<sp/><sp/>2004/09/14<sp/>21:51:24<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="436"><highlight class="comment"><sp/>Debug<sp/>info</highlight></codeline>
<codeline lineno="437"><highlight class="comment"></highlight></codeline>
<codeline lineno="438"><highlight class="comment"><sp/>Revision<sp/>1.29<sp/><sp/>2004/09/11<sp/>23:39:31<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="439"><highlight class="comment"><sp/>ok<sp/>time<sp/>for<sp/>bed</highlight></codeline>
<codeline lineno="440"><highlight class="comment"></highlight></codeline>
<codeline lineno="441"><highlight class="comment"><sp/>Revision<sp/>1.28<sp/><sp/>2004/09/11<sp/>23:21:26<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="442"><highlight class="comment"><sp/>run<sp/>now<sp/>do<sp/>you<sp/>get<sp/>fegfaults<sp/>with<sp/>BB?</highlight></codeline>
<codeline lineno="443"><highlight class="comment"></highlight></codeline>
<codeline lineno="444"><highlight class="comment"><sp/>Revision<sp/>1.27<sp/><sp/>2004/09/11<sp/>22:49:28<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="445"><highlight class="comment"><sp/>pat<sp/>look<sp/>at<sp/>lines<sp/>276-285<sp/><sp/>does<sp/>the<sp/>math<sp/>seem<sp/>right?</highlight></codeline>
<codeline lineno="446"><highlight class="comment"></highlight></codeline>
<codeline lineno="447"><highlight class="comment"><sp/>Revision<sp/>1.26<sp/><sp/>2004/09/11<sp/>22:33:13<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="448"><highlight class="comment"><sp/>minor<sp/>changes</highlight></codeline>
<codeline lineno="449"><highlight class="comment"></highlight></codeline>
<codeline lineno="450"><highlight class="comment"><sp/>Revision<sp/>1.25<sp/><sp/>2004/09/11<sp/>12:11:11<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="451"><highlight class="comment"><sp/>Cleaning<sp/>up<sp/>the<sp/>VFS<sp/>more<sp/>changes<sp/>to<sp/>follow...</highlight></codeline>
<codeline lineno="452"><highlight class="comment"></highlight></codeline>
<codeline lineno="453"><highlight class="comment"><sp/>Revision<sp/>1.24<sp/><sp/>2004/09/08<sp/>23:19:58<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="454"><highlight class="comment"><sp/>hmm</highlight></codeline>
<codeline lineno="455"><highlight class="comment"></highlight></codeline>
<codeline lineno="456"><highlight class="comment"><sp/>Revision<sp/>1.23<sp/><sp/>2004/09/06<sp/>15:13:25<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="457"><highlight class="comment"><sp/>Last<sp/>commit<sp/>before<sp/>FreeBSD<sp/>6.0</highlight></codeline>
<codeline lineno="458"><highlight class="comment"></highlight></codeline>
<codeline lineno="459"><highlight class="comment"><sp/>Revision<sp/>1.22<sp/><sp/>2004/08/26<sp/>22:51:18<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="460"><highlight class="comment"><sp/>TCA<sp/>touched<sp/>me<sp/>:(<sp/>i<sp/>think<sp/>he<sp/>likes<sp/>men....</highlight></codeline>
<codeline lineno="461"><highlight class="comment"></highlight></codeline>
<codeline lineno="462"><highlight class="comment"></highlight></codeline>
<codeline lineno="463"><highlight class="comment"><sp/>sched.h:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>kTask_t<sp/>added<sp/>parentPid</highlight></codeline>
<codeline lineno="464"><highlight class="comment"><sp/>endtask.c:<sp/><sp/><sp/><sp/><sp/>fixed<sp/>term<sp/>back<sp/>to<sp/>parentPid</highlight></codeline>
<codeline lineno="465"><highlight class="comment"><sp/>exec.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cleaned<sp/>warnings</highlight></codeline>
<codeline lineno="466"><highlight class="comment"><sp/>fork.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fixed<sp/>term<sp/>to<sp/>childPid</highlight></codeline>
<codeline lineno="467"><highlight class="comment"><sp/>sched.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>clean<sp/>up<sp/>for<sp/>dead<sp/>tasks</highlight></codeline>
<codeline lineno="468"><highlight class="comment"><sp/>systemtask.c:<sp/>clean<sp/>up<sp/>dead<sp/>tasks</highlight></codeline>
<codeline lineno="469"><highlight class="comment"><sp/>kmalloc.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/>cleaned<sp/>up<sp/>warnings</highlight></codeline>
<codeline lineno="470"><highlight class="comment"><sp/>udp.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cleaned<sp/>up<sp/>warnings</highlight></codeline>
<codeline lineno="471"><highlight class="comment"><sp/>bot.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cleaned<sp/>up<sp/>warnings</highlight></codeline>
<codeline lineno="472"><highlight class="comment"><sp/>shell.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cleaned<sp/>up<sp/>warnings</highlight></codeline>
<codeline lineno="473"><highlight class="comment"><sp/>tcpdump.c:<sp/><sp/><sp/><sp/><sp/>took<sp/>a<sp/>dump</highlight></codeline>
<codeline lineno="474"><highlight class="comment"><sp/>hd.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cleaned<sp/>up<sp/>warnings</highlight></codeline>
<codeline lineno="475"><highlight class="comment"><sp/>ubixfs.c:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>stopped<sp/>prning<sp/>debug<sp/>info</highlight></codeline>
<codeline lineno="476"><highlight class="comment"></highlight></codeline>
<codeline lineno="477"><highlight class="comment"><sp/>Revision<sp/>1.21<sp/><sp/>2004/07/28<sp/>15:05:43<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="478"><highlight class="comment"><sp/>Major:</highlight></codeline>
<codeline lineno="479"><highlight class="comment"><sp/><sp/><sp/>Pages<sp/>now<sp/>have<sp/>strict<sp/>security<sp/>enforcement.</highlight></codeline>
<codeline lineno="480"><highlight class="comment"><sp/><sp/><sp/>Many<sp/>null<sp/>dereferences<sp/>have<sp/>been<sp/>resolved.</highlight></codeline>
<codeline lineno="481"><highlight class="comment"><sp/><sp/><sp/>When<sp/>apps<sp/>loaded<sp/>permissions<sp/>set<sp/>for<sp/>pages<sp/>rw<sp/>and<sp/>ro</highlight></codeline>
<codeline lineno="482"><highlight class="comment"></highlight></codeline>
<codeline lineno="483"><highlight class="comment"><sp/>Revision<sp/>1.20<sp/><sp/>2004/07/28<sp/>00:17:05<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="484"><highlight class="comment"><sp/>Major:</highlight></codeline>
<codeline lineno="485"><highlight class="comment"><sp/><sp/><sp/>Disconnected<sp/>page<sp/>0x0<sp/>from<sp/>the<sp/>system...<sp/>Unfortunately<sp/>this<sp/>broke<sp/>many<sp/>things</highlight></codeline>
<codeline lineno="486"><highlight class="comment"><sp/><sp/><sp/>all<sp/>of<sp/>which<sp/>have<sp/>been<sp/>fixed.<sp/>This<sp/>was<sp/>good<sp/>because<sp/>nothing<sp/>deferences<sp/>NULL</highlight></codeline>
<codeline lineno="487"><highlight class="comment"><sp/><sp/><sp/>any<sp/>more.</highlight></codeline>
<codeline lineno="488"><highlight class="comment"></highlight></codeline>
<codeline lineno="489"><highlight class="comment"><sp/>Things<sp/>affected:</highlight></codeline>
<codeline lineno="490"><highlight class="comment"><sp/><sp/><sp/>malloc,kmalloc,getfreepage,getfreevirtualpage,pagefault,fork,exec,ld,ld.so,exec,file</highlight></codeline>
<codeline lineno="491"><highlight class="comment"></highlight></codeline>
<codeline lineno="492"><highlight class="comment"><sp/>Revision<sp/>1.19<sp/><sp/>2004/07/26<sp/>19:15:49<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="493"><highlight class="comment"><sp/>test<sp/>code,<sp/>fixes<sp/>and<sp/>the<sp/>like</highlight></codeline>
<codeline lineno="494"><highlight class="comment"></highlight></codeline>
<codeline lineno="495"><highlight class="comment"><sp/>Revision<sp/>1.18<sp/><sp/>2004/07/26<sp/>16:52:45<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="496"><highlight class="comment"><sp/>here<sp/>we<sp/>go</highlight></codeline>
<codeline lineno="497"><highlight class="comment"></highlight></codeline>
<codeline lineno="498"><highlight class="comment"><sp/>Revision<sp/>1.17<sp/><sp/>2004/07/24<sp/>23:04:44<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="499"><highlight class="comment"><sp/>Changes...<sp/>mark<sp/>let<sp/>me<sp/>know<sp/>if<sp/>you<sp/>fault<sp/>at<sp/>pid<sp/>185<sp/>when<sp/>you<sp/>type<sp/>stress</highlight></codeline>
<codeline lineno="500"><highlight class="comment"></highlight></codeline>
<codeline lineno="501"><highlight class="comment"><sp/>Revision<sp/>1.16<sp/><sp/>2004/07/21<sp/>10:02:09<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="502"><highlight class="comment"><sp/>devfs:<sp/>renamed<sp/>functions</highlight></codeline>
<codeline lineno="503"><highlight class="comment"><sp/>device<sp/>system:<sp/>renamed<sp/>functions</highlight></codeline>
<codeline lineno="504"><highlight class="comment"><sp/>fdc:<sp/>fixed<sp/>a<sp/>few<sp/>potential<sp/>bugs<sp/>and<sp/>cleaned<sp/>up<sp/>some<sp/>unused<sp/>variables</highlight></codeline>
<codeline lineno="505"><highlight class="comment"><sp/>strol:<sp/>fixed<sp/>definition</highlight></codeline>
<codeline lineno="506"><highlight class="comment"><sp/>endtask:<sp/>made<sp/>it<sp/>print<sp/>out<sp/>freepage<sp/>debug<sp/>info</highlight></codeline>
<codeline lineno="507"><highlight class="comment"><sp/>kmalloc:<sp/>fixed<sp/>a<sp/>huge<sp/>memory<sp/>leak<sp/>we<sp/>had<sp/>some<sp/>unhandled<sp/>descriptor<sp/>insertion<sp/>so<sp/>some<sp/>descriptors<sp/>were<sp/>lost</highlight></codeline>
<codeline lineno="508"><highlight class="comment"><sp/>ld:<sp/>fixed<sp/>a<sp/>pointer<sp/>conversion</highlight></codeline>
<codeline lineno="509"><highlight class="comment"><sp/>file:<sp/>cleaned<sp/>up<sp/>a<sp/>few<sp/>unused<sp/>variables</highlight></codeline>
<codeline lineno="510"><highlight class="comment"><sp/>sched:<sp/>broke<sp/>task<sp/>deletion</highlight></codeline>
<codeline lineno="511"><highlight class="comment"><sp/>kprintf:<sp/>fixed<sp/>ogPrintf<sp/>definition</highlight></codeline>
<codeline lineno="512"><highlight class="comment"></highlight></codeline>
<codeline lineno="513"><highlight class="comment"><sp/>Revision<sp/>1.15<sp/><sp/>2004/07/20<sp/>23:20:50<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="514"><highlight class="comment"><sp/>kmalloc:<sp/>forgot<sp/>to<sp/>remove<sp/>an<sp/>assert</highlight></codeline>
<codeline lineno="515"><highlight class="comment"></highlight></codeline>
<codeline lineno="516"><highlight class="comment"><sp/>Revision<sp/>1.14<sp/><sp/>2004/07/20<sp/>23:18:11<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="517"><highlight class="comment"><sp/>Made<sp/>malloc<sp/>a<sp/>little<sp/>more<sp/>robust<sp/>but<sp/>we<sp/>have<sp/>a<sp/>serious<sp/>memory<sp/>leak<sp/>somewhere</highlight></codeline>
<codeline lineno="518"><highlight class="comment"></highlight></codeline>
<codeline lineno="519"><highlight class="comment"><sp/>Revision<sp/>1.13<sp/><sp/>2004/07/20<sp/>22:29:55<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="520"><highlight class="comment"><sp/>assert:<sp/>remade<sp/>assert</highlight></codeline>
<codeline lineno="521"><highlight class="comment"></highlight></codeline>
<codeline lineno="522"><highlight class="comment"><sp/>Revision<sp/>1.12<sp/><sp/>2004/07/20<sp/>18:58:24<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="523"><highlight class="comment"><sp/>Few<sp/>fixes</highlight></codeline>
<codeline lineno="524"><highlight class="comment"></highlight></codeline>
<codeline lineno="525"><highlight class="comment"><sp/>Revision<sp/>1.11<sp/><sp/>2004/07/18<sp/>05:24:15<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="526"><highlight class="comment"><sp/>Fixens</highlight></codeline>
<codeline lineno="527"><highlight class="comment"></highlight></codeline>
<codeline lineno="528"><highlight class="comment"><sp/>Revision<sp/>1.10<sp/><sp/>2004/07/17<sp/>18:00:47<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="529"><highlight class="comment"><sp/>kmalloc:<sp/>added<sp/>assert()</highlight></codeline>
<codeline lineno="530"><highlight class="comment"></highlight></codeline>
<codeline lineno="531"><highlight class="comment"><sp/>Revision<sp/>1.9<sp/><sp/>2004/07/17<sp/>15:54:52<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="532"><highlight class="comment"><sp/>kmalloc:<sp/>added<sp/>assert()</highlight></codeline>
<codeline lineno="533"><highlight class="comment"><sp/>bioscall:<sp/>fixed<sp/>some<sp/>potential<sp/>problem<sp/>by<sp/>not<sp/>making<sp/>16bit<sp/>code</highlight></codeline>
<codeline lineno="534"><highlight class="comment"><sp/>paging:<sp/>added<sp/>assert()</highlight></codeline>
<codeline lineno="535"><highlight class="comment"></highlight></codeline>
<codeline lineno="536"><highlight class="comment"><sp/>Revision<sp/>1.8<sp/><sp/>2004/06/17<sp/>14:50:32<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="537"><highlight class="comment"><sp/>kmalloc:<sp/>converted<sp/>some<sp/>variables<sp/>to<sp/>static</highlight></codeline>
<codeline lineno="538"><highlight class="comment"></highlight></codeline>
<codeline lineno="539"><highlight class="comment"><sp/>Revision<sp/>1.7<sp/><sp/>2004/06/17<sp/>02:54:54<sp/><sp/>flameshadow</highlight></codeline>
<codeline lineno="540"><highlight class="comment"><sp/>chg:<sp/>fixed<sp/>cast</highlight></codeline>
<codeline lineno="541"><highlight class="comment"></highlight></codeline>
<codeline lineno="542"><highlight class="comment"><sp/>Revision<sp/>1.6<sp/><sp/>2004/05/26<sp/>11:56:51<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="543"><highlight class="comment"><sp/>kmalloc:<sp/>fixed<sp/>memrgeMemBlocks<sp/>hopefully<sp/>it<sp/>will<sp/>prevent<sp/>future<sp/>segfault<sp/>issues</highlight></codeline>
<codeline lineno="544"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>by<sp/>not<sp/>having<sp/>any<sp/>more<sp/>overlapping<sp/>blocks</highlight></codeline>
<codeline lineno="545"><highlight class="comment"></highlight></codeline>
<codeline lineno="546"><highlight class="comment"><sp/>Revision<sp/>1.5<sp/><sp/>2004/05/25<sp/>14:01:14<sp/><sp/>reddawg</highlight></codeline>
<codeline lineno="547"><highlight class="comment"><sp/>Implimented<sp/>Better<sp/>Spinlocking<sp/>No<sp/>More<sp/>Issues<sp/>With<sp/>KMALLOC<sp/>which<sp/>actually</highlight></codeline>
<codeline lineno="548"><highlight class="comment"><sp/>was<sp/>causing<sp/>bizzare<sp/>problems</highlight></codeline>
<codeline lineno="549"><highlight class="comment"></highlight></codeline>
<codeline lineno="550"><highlight class="comment"><sp/>END</highlight></codeline>
<codeline lineno="551"><highlight class="comment"><sp/>***/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="552"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/usr/home/reddawg/source/ubix2/src/sys/lib/kmalloc.c"/>
  </compounddef>
</doxygen>
