<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
  <compounddef id="unmappage_8c" kind="file" language="C++">
    <compoundname>unmappage.c</compoundname>
    <includes refid="vmm_8h" local="no">vmm/vmm.h</includes>
    <incdepgraph>
      <node id="23">
        <label>ufs/ufs.h</label>
        <link refid="ufs_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="24" relation="include">
        </childnode>
      </node>
      <node id="15">
        <label>i386/cpu.h</label>
        <link refid="i386_2cpu_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="10">
        <label>vmm/paging.h</label>
        <link refid="paging_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="5">
        <label>sys/select.h</label>
        <link refid="select_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="8" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
      </node>
      <node id="19">
        <label>vfs/inode.h</label>
        <link refid="inode_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="20" relation="include">
        </childnode>
        <childnode refid="21" relation="include">
        </childnode>
        <childnode refid="22" relation="include">
        </childnode>
        <childnode refid="23" relation="include">
        </childnode>
      </node>
      <node id="1">
        <label>C:/Dev/git/UbixOS/sys/vmm/unmappage.c</label>
        <link refid="unmappage_8c"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="9">
        <label>sys/_sigset.h</label>
        <link refid="__sigset_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>vmm/vmm.h</label>
        <link refid="vmm_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
      </node>
      <node id="25">
        <label>vfs/mount.h</label>
        <link refid="mount_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="16">
        <label>sys/resource.h</label>
        <link refid="resource_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="14">
        <label>sys/trap.h</label>
        <link refid="trap_8h"/>
        <childnode refid="15" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>sys/types.h</label>
        <link refid="include_2sys_2types_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
      </node>
      <node id="17">
        <label>vfs/file.h</label>
        <link refid="include_2vfs_2file_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="18" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="19" relation="include">
        </childnode>
        <childnode refid="25" relation="include">
        </childnode>
        <childnode refid="23" relation="include">
        </childnode>
      </node>
      <node id="22">
        <label>fs/msdos_fs.h</label>
        <link refid="msdos__fs_8h"/>
      </node>
      <node id="12">
        <label>sys/signal.h</label>
        <link refid="sys_2signal_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="21">
        <label>fs/pipe_fs.h</label>
        <link refid="pipe__fs_8h"/>
      </node>
      <node id="20">
        <label>ubixos/wait.h</label>
        <link refid="wait_8h"/>
      </node>
      <node id="13">
        <label>sys/thread.h</label>
        <link refid="thread_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="14" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="16" relation="include">
        </childnode>
      </node>
      <node id="6">
        <label>sys/cdefs.h</label>
        <link refid="cdefs_8h"/>
      </node>
      <node id="4">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="7">
        <label>sys/_timespec.h</label>
        <link refid="__timespec_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="24">
        <label>sys/device.h</label>
        <link refid="include_2sys_2device_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="11">
        <label>sys/sysproto_posix.h</label>
        <link refid="sysproto__posix_8h"/>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="17" relation="include">
        </childnode>
      </node>
      <node id="18">
        <label>ubixfs/dirCache.h</label>
        <link refid="dirCache_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="8">
        <label>sys/_timeval.h</label>
        <link refid="__timeval_8h"/>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="func">
      <memberdef kind="function" id="unmappage_8c_1a58fb96856e9c4c2e85b31a779afb097d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void vmm_unmapPage</definition>
        <argsstring>(uint32_t pageAddr, unmapFlags_t flags)</argsstring>
        <name>vmm_unmapPage</name>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type>
          <declname>pageAddr</declname>
        </param>
        <param>
          <type><ref refid="vmm_8h_1aabceab91796188f211167ff9ca38fad7" kindref="member">unmapFlags_t</ref></type>
          <declname>flags</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/unmappage.c" line="47" column="6" bodyfile="C:/Dev/git/UbixOS/sys/vmm/unmappage.c" bodystart="47" bodyend="81"/>
        <references refid="vmm_8h_1a38c3fe6ce5f3bf8af4a0631d4c41b0ba" compoundref="vmm__memory_8c" startline="262" endline="290">freePage</references>
        <references refid="paging_8h_1a122dfc414a40e260fd35dbe9743db26f" compoundref="paging_8h" startline="55">PAGE_PRESENT</references>
        <references refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" compoundref="paging_8h" startline="45">PD_BASE_ADDR</references>
        <references refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" compoundref="paging_8h" startline="46">PT_BASE_ADDR</references>
        <referencedby refid="vmm__mmap_8c_1a34f95e2ffa8a4bb4ca88918a3a3af580" compoundref="vmm__mmap_8c" startline="162" endline="220">sys_mmap</referencedby>
        <referencedby refid="createvirtualspace_8c_1ab7ce06bf4237638127c7f052e8872f8a" compoundref="createvirtualspace_8c" startline="53" endline="191">vmm_createVirtualSpace</referencedby>
      </memberdef>
      <memberdef kind="function" id="unmappage_8c_1aaaaea0ea425598e5742a2e296a6f69d2" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void vmm_unmapPages</definition>
        <argsstring>(void *ptr, uint32_t size, unmapFlags_t flags)</argsstring>
        <name>vmm_unmapPages</name>
        <param>
          <type>void *</type>
          <declname>ptr</declname>
        </param>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type>
          <declname>size</declname>
        </param>
        <param>
          <type><ref refid="vmm_8h_1aabceab91796188f211167ff9ca38fad7" kindref="member">unmapFlags_t</ref></type>
          <declname>flags</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/unmappage.c" line="99" column="6" bodyfile="C:/Dev/git/UbixOS/sys/vmm/unmappage.c" bodystart="99" bodyend="112"/>
        <references refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" compoundref="paging_8h" startline="46">PT_BASE_ADDR</references>
        <referencedby refid="main_8cc_1aa6c38d07b193857fbaebc1656b89136e" compoundref="main_8cc" startline="51" endline="143">sdeThread</referencedby>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*-</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>*<sp/>Copyright<sp/>(c)<sp/>2002-2018<sp/>The<sp/>UbixOS<sp/>Project.</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>*<sp/>All<sp/>rights<sp/>reserved.</highlight></codeline>
<codeline lineno="4"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>*<sp/>This<sp/>was<sp/>developed<sp/>by<sp/>Christopher<sp/>W.<sp/>Olsen<sp/>for<sp/>the<sp/>UbixOS<sp/>Project.</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="7"><highlight class="comment"><sp/>*<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<sp/>permitted</highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>*<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/>1)<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="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>*<sp/>2)<sp/>Redistributions<sp/>in<sp/>binary<sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>other<sp/>materials<sp/>provided<sp/>with<sp/>the<sp/>distribution.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"><sp/>*<sp/>3)<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its<sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to</highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software<sp/>without<sp/>specific<sp/>prior<sp/>written</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>permission.</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>*<sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>AUTHOR<sp/>AND<sp/>CONTRIBUTORS<sp/>&quot;AS<sp/>IS&quot;<sp/>AND<sp/>ANY<sp/>EXPRESS<sp/>OR<sp/>IMPLIED</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>*<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF<sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL<sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>*<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,<sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES</highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>*<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT<sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>*<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)<sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN</highlight></codeline>
<codeline lineno="25"><highlight class="comment"><sp/>*<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR<sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT</highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>*<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS<sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="27"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><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="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="32"><highlight class="comment"></highlight></codeline>
<codeline lineno="33"><highlight class="comment"><sp/>Function:<sp/>void<sp/>vmm_unmapPage(uInt32<sp/>pageAddr,int<sp/>flags);</highlight></codeline>
<codeline lineno="34"><highlight class="comment"><sp/>Description:<sp/>This<sp/>Function<sp/>Will<sp/>Unmap<sp/>A<sp/>Page<sp/>From<sp/>The<sp/>Kernel<sp/>VM<sp/>Space</highlight></codeline>
<codeline lineno="35"><highlight class="comment"><sp/>The<sp/>Flags<sp/>Variable<sp/>Decides<sp/>If<sp/>Its<sp/>To<sp/>Free<sp/>The<sp/>Page<sp/>Or<sp/>Not</highlight></codeline>
<codeline lineno="36"><highlight class="comment"><sp/>A<sp/>Flag<sp/>Of<sp/>0<sp/>Will<sp/>Free<sp/>It<sp/>And<sp/>A<sp/>Flag<sp/>Of<sp/>1<sp/>Will<sp/>Keep<sp/>It</highlight></codeline>
<codeline lineno="37"><highlight class="comment"><sp/>Notes:</highlight></codeline>
<codeline lineno="38"><highlight class="comment"></highlight></codeline>
<codeline lineno="39"><highlight class="comment"><sp/>07/30/02<sp/>-<sp/>I<sp/>Have<sp/>Decided<sp/>That<sp/>This<sp/>Should<sp/>Free<sp/>The<sp/>Physical<sp/>Page<sp/>There</highlight></codeline>
<codeline lineno="40"><highlight class="comment"><sp/>Is<sp/>No<sp/>Reason<sp/>To<sp/>Keep<sp/>It<sp/>Marked<sp/>As<sp/>Not<sp/>Available</highlight></codeline>
<codeline lineno="41"><highlight class="comment"></highlight></codeline>
<codeline lineno="42"><highlight class="comment"><sp/>07/30/02<sp/>-<sp/>Ok<sp/>A<sp/>Found<sp/>A<sp/>Reason<sp/>To<sp/>Keep<sp/>It<sp/>Marked<sp/>As<sp/>Available<sp/>I<sp/>Admit</highlight></codeline>
<codeline lineno="43"><highlight class="comment"><sp/>Even<sp/>I<sp/>Am<sp/>Not<sp/>Perfect<sp/>Ok<sp/>The<sp/>Case<sp/>Where<sp/>You<sp/>Wouldn&apos;t<sp/>Want<sp/>To</highlight></codeline>
<codeline lineno="44"><highlight class="comment"><sp/>Free<sp/>It<sp/>Would<sp/>Be<sp/>On<sp/>Something<sp/>Like<sp/>Where<sp/>I<sp/>Allocated<sp/>A<sp/>Page</highlight></codeline>
<codeline lineno="45"><highlight class="comment"><sp/>To<sp/>Create<sp/>A<sp/>New<sp/>Virtual<sp/>Space<sp/>So<sp/>Now<sp/>It<sp/>Has<sp/>A<sp/>Flag</highlight></codeline>
<codeline lineno="46"><highlight class="comment"></highlight></codeline>
<codeline lineno="47" refid="unmappage_8c_1a58fb96856e9c4c2e85b31a779afb097d" refkind="member"><highlight class="comment"><sp/>************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="unmappage_8c_1a58fb96856e9c4c2e85b31a779afb097d" kindref="member">vmm_unmapPage</ref>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>pageAddr,<sp/><ref refid="vmm_8h_1aabceab91796188f211167ff9ca38fad7" kindref="member">unmapFlags_t</ref><sp/>flags)<sp/>{</highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>pageDirectoryIndex<sp/>=<sp/>0,<sp/>pageTableIndex<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageTable<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageDirectory<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/>pageDirectory<sp/>=<sp/><ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>;</highlight></codeline>
<codeline lineno="54"><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Get<sp/>The<sp/>Index<sp/>To<sp/>The<sp/>Page<sp/>Directory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/>pageDirectoryIndex<sp/>=<sp/>(pageAddr<sp/>&gt;&gt;<sp/>22);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageDirectory[pageDirectoryIndex]<sp/>&amp;<sp/><ref refid="paging_8h_1a122dfc414a40e260fd35dbe9743db26f" kindref="member">PAGE_PRESENT</ref>)<sp/>!=<sp/><ref refid="paging_8h_1a122dfc414a40e260fd35dbe9743db26f" kindref="member">PAGE_PRESENT</ref>)</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="60"><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//Calculate<sp/>The<sp/>Page<sp/>Table<sp/>Index</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/>pageTableIndex<sp/>=<sp/>((pageAddr<sp/>&gt;&gt;<sp/>12)<sp/>&amp;<sp/>0x3FF);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>pageTable<sp/>To<sp/>The<sp/>Virtual<sp/>Address<sp/>Of<sp/>Table<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/>pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/>(<ref refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" kindref="member">PT_BASE_ADDR</ref><sp/>+<sp/>(0x1000<sp/>*<sp/>pageDirectoryIndex));</highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Free<sp/>The<sp/>Physical<sp/>Page<sp/>If<sp/>Flags<sp/>Is<sp/>0<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(flags<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1a38c3fe6ce5f3bf8af4a0631d4c41b0ba" kindref="member">freePage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable[pageTableIndex]<sp/>&amp;<sp/>0xFFFFF000));</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Unmap<sp/>The<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/>pageTable[pageTableIndex]<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Rehash<sp/>The<sp/>Page<sp/>Directory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">asm</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">volatile</highlight><highlight class="normal">(</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%cr3,%eax\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%eax,%cr3\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/>);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="82"><highlight class="normal">}</highlight></codeline>
<codeline lineno="83"><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="85"><highlight class="comment"></highlight></codeline>
<codeline lineno="86"><highlight class="comment"><sp/>Function:<sp/>void<sp/>vmm_unmapPages(uInt32<sp/>pageAddr,int<sp/>flags);</highlight></codeline>
<codeline lineno="87"><highlight class="comment"><sp/>Description:<sp/>This<sp/>Function<sp/>Will<sp/>Unmap<sp/>A<sp/>Page<sp/>From<sp/>The<sp/>Kernel<sp/>VM<sp/>Space</highlight></codeline>
<codeline lineno="88"><highlight class="comment"><sp/>The<sp/>Flags<sp/>Variable<sp/>Decides<sp/>If<sp/>Its<sp/>To<sp/>Free<sp/>The<sp/>Page<sp/>Or<sp/>Not</highlight></codeline>
<codeline lineno="89"><highlight class="comment"><sp/>A<sp/>Flag<sp/>Of<sp/>0<sp/>Will<sp/>Free<sp/>It<sp/>And<sp/>A<sp/>Flag<sp/>Of<sp/>1<sp/>Will<sp/>Keep<sp/>It</highlight></codeline>
<codeline lineno="90"><highlight class="comment"><sp/>Notes:</highlight></codeline>
<codeline lineno="91"><highlight class="comment"></highlight></codeline>
<codeline lineno="92"><highlight class="comment"><sp/>07/30/02<sp/>-<sp/>I<sp/>Have<sp/>Decided<sp/>That<sp/>This<sp/>Should<sp/>Free<sp/>The<sp/>Physical<sp/>Page<sp/>There</highlight></codeline>
<codeline lineno="93"><highlight class="comment"><sp/>Is<sp/>No<sp/>Reason<sp/>To<sp/>Keep<sp/>It<sp/>Marked<sp/>As<sp/>Not<sp/>Available</highlight></codeline>
<codeline lineno="94"><highlight class="comment"></highlight></codeline>
<codeline lineno="95"><highlight class="comment"><sp/>07/30/02<sp/>-<sp/>Ok<sp/>A<sp/>Found<sp/>A<sp/>Reason<sp/>To<sp/>Keep<sp/>It<sp/>Marked<sp/>As<sp/>Available<sp/>I<sp/>Admit</highlight></codeline>
<codeline lineno="96"><highlight class="comment"><sp/>Even<sp/>I<sp/>Am<sp/>Not<sp/>Perfect<sp/>Ok<sp/>The<sp/>Case<sp/>Where<sp/>You<sp/>Wouldn&apos;t<sp/>Want<sp/>To</highlight></codeline>
<codeline lineno="97"><highlight class="comment"><sp/>Free<sp/>It<sp/>Would<sp/>Be<sp/>On<sp/>Something<sp/>Like<sp/>Where<sp/>I<sp/>Allocated<sp/>A<sp/>Page</highlight></codeline>
<codeline lineno="98"><highlight class="comment"><sp/>To<sp/>Create<sp/>A<sp/>New<sp/>Virtual<sp/>Space<sp/>So<sp/>Now<sp/>It<sp/>Has<sp/>A<sp/>Flag</highlight></codeline>
<codeline lineno="99" refid="unmappage_8c_1aaaaea0ea425598e5742a2e296a6f69d2" refkind="member"><highlight class="comment"></highlight></codeline>
<codeline lineno="100"><highlight class="comment"><sp/>************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="101"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="unmappage_8c_1aaaaea0ea425598e5742a2e296a6f69d2" kindref="member">vmm_unmapPages</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*ptr,<sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>size,<sp/><ref refid="vmm_8h_1aabceab91796188f211167ff9ca38fad7" kindref="member">unmapFlags_t</ref><sp/>flags)<sp/>{</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref><sp/>baseAddr<sp/>=<sp/>(<ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref>)<sp/>ptr<sp/>&amp;<sp/>0xFFFFF000;</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref><sp/>dI<sp/>=<sp/>0x0,<sp/>tI<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref><sp/>y<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref><sp/>*pageTable<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/>dI<sp/>=<sp/>(baseAddr<sp/>/<sp/>(1024<sp/>*<sp/>4096));</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/>tI<sp/>=<sp/>((baseAddr<sp/>-<sp/>(dI<sp/>*<sp/>(1024<sp/>*<sp/>4096)))<sp/>/<sp/>4096);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/>pageTable<sp/>=<sp/>(<ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref><sp/>*)<sp/>(<ref refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" kindref="member">PT_BASE_ADDR</ref><sp/>+<sp/>(4096<sp/>*<sp/>dI));</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(y<sp/>=<sp/>tI;<sp/>y<sp/>&lt;<sp/>(tI<sp/>+<sp/>((size<sp/>+<sp/>4095)<sp/>/<sp/>4096));<sp/>y++)<sp/>{</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/>pageTable[y]<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="114"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/vmm/unmappage.c"/>
  </compounddef>
</doxygen>
