<?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="paging_8c" kind="file" language="C++">
    <compoundname>paging.c</compoundname>
    <includes refid="include_2sys_2types_8h" local="no">sys/types.h</includes>
    <includes refid="vmm_8h" local="no">vmm/vmm.h</includes>
    <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes>
    <includes refid="kmalloc_8h" local="no">lib/kmalloc.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="string_8h" local="no">string.h</includes>
    <includes refid="assert_8h" local="no">assert.h</includes>
    <includes refid="descrip_8h" local="no">sys/descrip.h</includes>
    <includes refid="vitals_8h" local="no">ubixos/vitals.h</includes>
    <incdepgraph>
      <node id="39">
        <label>sys/fcntl.h</label>
        <link refid="fcntl_8h"/>
      </node>
      <node id="23">
        <label>ufs/ufs.h</label>
        <link refid="ufs_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="24" relation="include">
        </childnode>
      </node>
      <node id="37">
        <label>sys/descrip.h</label>
        <link refid="descrip_8h"/>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="17" relation="include">
        </childnode>
        <childnode refid="38" relation="include">
        </childnode>
        <childnode refid="39" relation="include">
        </childnode>
      </node>
      <node id="27">
        <label>stdarg.h</label>
        <link refid="stdarg_8h"/>
      </node>
      <node id="29">
        <label>ubixos/kpanic.h</label>
        <link refid="kpanic_8h"/>
      </node>
      <node id="32">
        <label>sys/tss.h</label>
        <link refid="tss_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="50">
        <label>sys/io.h</label>
        <link refid="io_8h"/>
      </node>
      <node id="56">
        <label>net/pbuf.h</label>
        <link refid="pbuf_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="51" relation="include">
        </childnode>
      </node>
      <node id="31">
        <label>ubixos/tty.h</label>
        <link refid="tty_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="42">
        <label>net/net.h</label>
        <link refid="net_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="43" relation="include">
        </childnode>
      </node>
      <node id="35">
        <label>strings.h</label>
        <link refid="strings_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="61">
        <label>net/priv/memp_priv.h</label>
        <link refid="memp__priv_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="58" relation="include">
        </childnode>
      </node>
      <node id="15">
        <label>i386/cpu.h</label>
        <link refid="i386_2cpu_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="10">
        <label>vmm/paging.h</label>
        <link refid="paging_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="4">
        <label>sys/select.h</label>
        <link refid="select_8h"/>
        <childnode refid="5" relation="include">
        </childnode>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="8" relation="include">
        </childnode>
      </node>
      <node id="19">
        <label>vfs/inode.h</label>
        <link refid="inode_8h"/>
        <childnode refid="2" 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="33">
        <label>ubixos/spinlock.h</label>
        <link refid="spinlock_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="48">
        <label>net/arch/cc.h</label>
        <link refid="cc_8h"/>
        <childnode refid="49" relation="include">
        </childnode>
      </node>
      <node id="8">
        <label>sys/_sigset.h</label>
        <link refid="__sigset_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="9">
        <label>vmm/vmm.h</label>
        <link refid="vmm_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
      </node>
      <node id="40">
        <label>ubixos/vitals.h</label>
        <link refid="vitals_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="33" relation="include">
        </childnode>
        <childnode refid="41" relation="include">
        </childnode>
      </node>
      <node id="28">
        <label>lib/kmalloc.h</label>
        <link refid="kmalloc_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="58">
        <label>net/mem.h</label>
        <link refid="mem_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
      </node>
      <node id="57">
        <label>net/stats.h</label>
        <link refid="stats_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="58" relation="include">
        </childnode>
        <childnode refid="59" relation="include">
        </childnode>
      </node>
      <node id="1">
        <label>C:/Dev/git/UbixOS/sys/vmm/paging.c</label>
        <link refid="paging_8c"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
        <childnode refid="26" relation="include">
        </childnode>
        <childnode refid="28" relation="include">
        </childnode>
        <childnode refid="29" relation="include">
        </childnode>
        <childnode refid="30" relation="include">
        </childnode>
        <childnode refid="33" relation="include">
        </childnode>
        <childnode refid="34" relation="include">
        </childnode>
        <childnode refid="36" relation="include">
        </childnode>
        <childnode refid="37" relation="include">
        </childnode>
        <childnode refid="40" relation="include">
        </childnode>
      </node>
      <node id="41">
        <label>vfs/vfs.h</label>
        <link refid="include_2vfs_2vfs_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="17" relation="include">
        </childnode>
        <childnode refid="25" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="42" relation="include">
        </childnode>
        <childnode refid="20" relation="include">
        </childnode>
      </node>
      <node id="45">
        <label>net/lwipopts.h</label>
        <link refid="lwipopts_8h"/>
      </node>
      <node id="25">
        <label>vfs/mount.h</label>
        <link refid="mount_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="16">
        <label>sys/resource.h</label>
        <link refid="resource_8h"/>
        <childnode refid="3" 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="34">
        <label>string.h</label>
        <link refid="string_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="35" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>sys/types.h</label>
        <link refid="include_2sys_2types_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="17">
        <label>vfs/file.h</label>
        <link refid="include_2vfs_2file_8h"/>
        <childnode refid="2" 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="53">
        <label>net/def.h</label>
        <link refid="def_8h"/>
        <childnode refid="47" relation="include">
        </childnode>
        <childnode refid="44" relation="include">
        </childnode>
      </node>
      <node id="43">
        <label>net/netif.h</label>
        <link refid="netif_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="51" relation="include">
        </childnode>
        <childnode refid="52" relation="include">
        </childnode>
        <childnode refid="53" relation="include">
        </childnode>
        <childnode refid="56" relation="include">
        </childnode>
        <childnode refid="57" relation="include">
        </childnode>
      </node>
      <node id="47">
        <label>net/arch.h</label>
        <link refid="arch_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="48" relation="include">
        </childnode>
        <childnode refid="26" relation="include">
        </childnode>
        <childnode refid="29" relation="include">
        </childnode>
      </node>
      <node id="22">
        <label>fs/msdos_fs.h</label>
        <link refid="msdos__fs_8h"/>
      </node>
      <node id="36">
        <label>assert.h</label>
        <link refid="assert_8h"/>
      </node>
      <node id="12">
        <label>sys/signal.h</label>
        <link refid="sys_2signal_8h"/>
        <childnode refid="2" 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="55">
        <label>net/ip6_addr.h</label>
        <link refid="ip6__addr_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="53" relation="include">
        </childnode>
      </node>
      <node id="44">
        <label>net/opt.h</label>
        <link refid="opt_8h"/>
        <childnode refid="45" relation="include">
        </childnode>
        <childnode refid="46" relation="include">
        </childnode>
      </node>
      <node id="26">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="27" relation="include">
        </childnode>
      </node>
      <node id="46">
        <label>net/debug.h</label>
        <link refid="debug_8h"/>
        <childnode refid="47" relation="include">
        </childnode>
        <childnode refid="44" relation="include">
        </childnode>
      </node>
      <node id="54">
        <label>net/ip4_addr.h</label>
        <link refid="ip4__addr_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="53" relation="include">
        </childnode>
      </node>
      <node id="52">
        <label>net/ip_addr.h</label>
        <link refid="ip__addr_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="53" relation="include">
        </childnode>
        <childnode refid="54" relation="include">
        </childnode>
        <childnode refid="55" relation="include">
        </childnode>
      </node>
      <node id="13">
        <label>sys/thread.h</label>
        <link refid="thread_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="14" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="16" relation="include">
        </childnode>
      </node>
      <node id="60">
        <label>net/priv/memp_std.h</label>
        <link refid="memp__std_8h"/>
      </node>
      <node id="5">
        <label>sys/cdefs.h</label>
        <link refid="cdefs_8h"/>
      </node>
      <node id="49">
        <label>ubixos/time.h</label>
        <link refid="time_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="50" relation="include">
        </childnode>
      </node>
      <node id="30">
        <label>ubixos/sched.h</label>
        <link refid="sched_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="17" relation="include">
        </childnode>
        <childnode refid="31" relation="include">
        </childnode>
        <childnode refid="32" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="51">
        <label>net/err.h</label>
        <link refid="err_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="47" relation="include">
        </childnode>
      </node>
      <node id="6">
        <label>sys/_timespec.h</label>
        <link refid="__timespec_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="24">
        <label>sys/device.h</label>
        <link refid="include_2sys_2device_8h"/>
        <childnode refid="2" 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="2" relation="include">
        </childnode>
      </node>
      <node id="7">
        <label>sys/_timeval.h</label>
        <link refid="__timeval_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="38">
        <label>vfs/stat.h</label>
        <link refid="stat_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="59">
        <label>net/memp.h</label>
        <link refid="memp_8h"/>
        <childnode refid="44" relation="include">
        </childnode>
        <childnode refid="60" relation="include">
        </childnode>
        <childnode refid="61" relation="include">
        </childnode>
        <childnode refid="57" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="var">
      <memberdef kind="variable" id="paging_8c_1a21d682db5f6b9c93819b35e3075d13b9" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structspinLock" kindref="compound">spinLock</ref></type>
        <definition>struct spinLock fkpSpinLock</definition>
        <argsstring></argsstring>
        <name>fkpSpinLock</name>
        <initializer>= <ref refid="spinlock_8h_1a0fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref></initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="41" column="10" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="43" bodyend="-1"/>
      </memberdef>
      <memberdef kind="variable" id="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" prot="public" static="no" mutable="no">
        <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref> *</type>
        <definition>uint32_t* kernelPageDirectory</definition>
        <argsstring></argsstring>
        <name>kernelPageDirectory</name>
        <initializer>= 0x0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="41" column="10" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="41" bodyend="-1"/>
        <referencedby refid="i386_2bioscall_8c_1a56a172d2268fc10811a0bb180d7c3f49" compoundref="i386_2bioscall_8c" startline="40" endline="91">biosCall</referencedby>
        <referencedby refid="exec_8c_1af80d4412d42ed1b5bf9a1b9774230f33" compoundref="exec_8c" startline="153" endline="330">execFile</referencedby>
        <referencedby refid="exec_8c_1a4b86d28d8fd56197042aef174de2fd58" compoundref="exec_8c" startline="66" endline="136">execThread</referencedby>
        <referencedby refid="paging_8c_1af47a45e3f0802f5aac053808127aaaf1" compoundref="paging_8c" startline="58" endline="187">vmm_pagingInit</referencedby>
      </memberdef>
      <memberdef kind="variable" id="paging_8c_1a6e98214b436bacf0f1c7b5effdf2da7d" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structspinLock" kindref="compound">spinLock</ref></type>
        <definition>struct spinLock rmpSpinLock</definition>
        <argsstring></argsstring>
        <name>rmpSpinLock</name>
        <initializer>= <ref refid="spinlock_8h_1a0fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref></initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="41" column="10" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="45" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="paging_8c_1a6cdf3466734f2da5e258c9844d536295" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int obreak</definition>
        <argsstring>(struct thread *td, struct obreak_args *uap)</argsstring>
        <name>obreak</name>
        <param>
          <type>struct <ref refid="structthread" kindref="compound">thread</ref> *</type>
          <declname>td</declname>
        </param>
        <param>
          <type>struct <ref refid="structobreak__args" kindref="compound">obreak_args</ref> *</type>
          <declname>uap</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="546" column="5" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="546" bodyend="585"/>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1a43af6ffc41a9e9da3a15f10fb187266a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int vmm_cleanVirtualSpace</definition>
        <argsstring>(uint32_t addr)</argsstring>
        <name>vmm_cleanVirtualSpace</name>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type>
          <declname>addr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="587" column="5" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="587" bodyend="639"/>
        <referencedby refid="exec_8c_1a219681612352232186a0f568457d851d" compoundref="exec_8c" startline="340" endline="545">sysExec</referencedby>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int vmm_clearVirtualPage</definition>
        <argsstring>(uint32_t pageAddr)</argsstring>
        <name>vmm_clearVirtualPage</name>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type>
          <declname>pageAddr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="356" column="5" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="356" bodyend="370"/>
        <references refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" compoundref="paging_8h" startline="48">PD_ENTRIES</references>
        <referencedby refid="paging_8c_1a3615feeeee9f4038cd1070372ccba22e" compoundref="paging_8c" startline="291" endline="346">vmm_getFreeKernelPage</referencedby>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1a3615feeeee9f4038cd1070372ccba22e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void *</type>
        <definition>void* vmm_getFreeKernelPage</definition>
        <argsstring>(pidType pid, uint16_t count)</argsstring>
        <name>vmm_getFreeKernelPage</name>
        <param>
          <type><ref refid="include_2sys_2types_8h_1ae438ba74394b14d7b24b6df3b3b8c252" kindref="member">pidType</ref></type>
          <declname>pid</declname>
        </param>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a281b4b5562236420969a830503b0ba19" kindref="member">uint16_t</ref></type>
          <declname>count</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="291" column="6" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="291" bodyend="346"/>
        <references refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" compoundref="kpanic_8h" startline="32">K_PANIC</references>
        <references refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" compoundref="paging_8h" startline="69">KERNEL_PAGE_DEFAULT</references>
        <references refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" compoundref="armv6_2kpanic_8c" startline="41" endline="61">kpanic</references>
        <references refid="paging_8h_1a122dfc414a40e260fd35dbe9743db26f" compoundref="paging_8h" startline="55">PAGE_PRESENT</references>
        <references refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" compoundref="paging_8h" startline="37">PAGE_SIZE</references>
        <references refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" compoundref="paging_8h" startline="45">PD_BASE_ADDR</references>
        <references refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" compoundref="paging_8h" startline="48">PD_ENTRIES</references>
        <references refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" compoundref="paging_8h" startline="40">PD_INDEX</references>
        <references refid="vmm_8h_1afcaabe90527f6aec9cfeaaba78500e4c" compoundref="vmm__init_8c" startline="33">pdSpinLock</references>
        <references refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" compoundref="paging_8h" startline="46">PT_BASE_ADDR</references>
        <references refid="paging_8h_1adc9776583e54abf06ae7b99f1f3036a6" compoundref="paging_8h" startline="49">PT_ENTRIES</references>
        <references refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" compoundref="armv6_2spinlock_8c" startline="55" endline="61">spinLock</references>
        <references refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" compoundref="armv6_2spinlock_8c" startline="36" endline="45">spinUnlock</references>
        <references refid="vmm_8h_1acba8d9cc298370338bc5bea5187183b2" compoundref="vmm__allocpagetable_8c" startline="7" endline="46">vmm_allocPageTable</references>
        <references refid="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" compoundref="paging_8c" startline="356" endline="370">vmm_clearVirtualPage</references>
        <references refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" compoundref="vmm__memory_8c" startline="221" endline="252">vmm_findFreePage</references>
        <references refid="vmm_8h_1a8204faafc0c27e418f993e07c2f59f14" compoundref="vmm_8h" startline="65">VMM_KERN_END</references>
        <references refid="vmm_8h_1ad6394b4f60e68fe4e1431fc4e1998957" compoundref="vmm_8h" startline="64">VMM_KERN_START</references>
        <references refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" compoundref="paging_8c" startline="199" endline="281">vmm_remapPage</references>
        <referencedby refid="i386_2bioscall_8c_1a56a172d2268fc10811a0bb180d7c3f49" compoundref="i386_2bioscall_8c" startline="40" endline="91">biosCall</referencedby>
        <referencedby refid="exec_8h_1a82087e9a98b3a265b5a19266d0fc5970" compoundref="i386__exec_8c" startline="148" endline="227">execThread</referencedby>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1a541f0b43826a40b9e978f5479080bb0e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void *</type>
        <definition>void* vmm_getFreeMallocPage</definition>
        <argsstring>(uInt16 count)</argsstring>
        <name>vmm_getFreeMallocPage</name>
        <param>
          <type><ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref></type>
          <declname>count</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="488" column="6" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="488" bodyend="544"/>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1a6aca027c65f91943e6bc46ab9542c086" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void *</type>
        <definition>void* vmm_mapFromTask</definition>
        <argsstring>(pidType pid, void *ptr, uint32_t size)</argsstring>
        <name>vmm_mapFromTask</name>
        <param>
          <type><ref refid="include_2sys_2types_8h_1ae438ba74394b14d7b24b6df3b3b8c252" kindref="member">pidType</ref></type>
          <declname>pid</declname>
        </param>
        <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>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="372" column="6" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="372" bodyend="486"/>
        <referencedby refid="main_8cc_1aa6c38d07b193857fbaebc1656b89136e" compoundref="main_8cc" startline="51" endline="143">sdeThread</referencedby>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1af47a45e3f0802f5aac053808127aaaf1" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int vmm_pagingInit</definition>
        <argsstring>()</argsstring>
        <name>vmm_pagingInit</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="58" column="5" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="58" bodyend="187"/>
        <references refid="paging_8h_1a15b43ccb21abdb9e0a41acb82b260a99">_vmm_pageFault</references>
        <references refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" compoundref="gpt_8h" startline="37">bzero</references>
        <references refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" compoundref="kpanic_8h" startline="32">K_PANIC</references>
        <references refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" compoundref="paging_8h" startline="69">KERNEL_PAGE_DEFAULT</references>
        <references refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" compoundref="paging_8c" startline="41">kernelPageDirectory</references>
        <references refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" compoundref="kprintf_8c" startline="259" endline="276">kprintf</references>
        <references refid="vmm_8h_1a2b0091bdc36e32af3daf9cfcaa7c04e1" compoundref="vmm__memory_8c" startline="45">numPages</references>
        <references refid="paging_8h_1af0fff7a38cd2c7a32d580787423b94ea" compoundref="paging_8h" startline="68">PAGE_DEFAULT</references>
        <references refid="paging_8h_1a0d99c75e51b448fcb97266da4815c63f" compoundref="paging_8h" startline="62">PAGE_GLOBAL</references>
        <references refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" compoundref="paging_8h" startline="37">PAGE_SIZE</references>
        <references refid="paging_8h_1a1532db17068ba8d409b8ffe066414af2" compoundref="paging_8h" startline="65">PAGE_STACK</references>
        <references refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" compoundref="paging_8h" startline="45">PD_BASE_ADDR</references>
        <references refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" compoundref="paging_8h" startline="48">PD_ENTRIES</references>
        <references refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" compoundref="paging_8h" startline="40">PD_INDEX</references>
        <references refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" compoundref="paging_8h" startline="46">PT_BASE_ADDR</references>
        <references refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" compoundref="kmalloc_8h" startline="38">sysID</references>
        <references refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" compoundref="vmm__memory_8c" startline="221" endline="252">vmm_findFreePage</references>
        <references refid="vmm_8h_1a8204faafc0c27e418f993e07c2f59f14" compoundref="vmm_8h" startline="65">VMM_KERN_END</references>
        <references refid="vmm_8h_1ad6394b4f60e68fe4e1431fc4e1998957" compoundref="vmm_8h" startline="64">VMM_KERN_START</references>
        <references refid="vmm_8h_1aa015f84b2a9b7588c472ff5dc99646f6" compoundref="vmm_8h" startline="50">VMM_MMAP_ADDR_PMODE</references>
        <references refid="vmm_8h_1a1e10465731ac6cbfc253ce7d89ae34c8" compoundref="vmm_8h" startline="51">VMM_MMAP_ADDR_RMODE</references>
        <references refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" compoundref="paging_8c" startline="199" endline="281">vmm_remapPage</references>
        <references refid="vmm_8h_1a89e87741958ee81f1811075b25af058a" compoundref="vmm__memory_8c" startline="47">vmmMemoryMap</references>
        <referencedby refid="vmm__init_8c_1aac183f585641487a954ca46c0d7bde31" compoundref="vmm__init_8c" startline="43" endline="51">vmm_init</referencedby>
      </memberdef>
      <memberdef kind="function" id="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int vmm_remapPage</definition>
        <argsstring>(uint32_t source, uint32_t dest, uint16_t perms, pidType pid, int haveLock)</argsstring>
        <name>vmm_remapPage</name>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type>
          <declname>source</declname>
        </param>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type>
          <declname>dest</declname>
        </param>
        <param>
          <type><ref refid="include_2sys_2types_8h_1a281b4b5562236420969a830503b0ba19" kindref="member">uint16_t</ref></type>
          <declname>perms</declname>
        </param>
        <param>
          <type><ref refid="include_2sys_2types_8h_1ae438ba74394b14d7b24b6df3b3b8c252" kindref="member">pidType</ref></type>
          <declname>pid</declname>
        </param>
        <param>
          <type>int</type>
          <declname>haveLock</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c" line="199" column="5" bodyfile="C:/Dev/git/UbixOS/sys/vmm/paging.c" bodystart="199" bodyend="281"/>
        <references refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" compoundref="kpanic_8h" startline="32">K_PANIC</references>
        <references refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" compoundref="armv6_2kpanic_8c" startline="41" endline="61">kpanic</references>
        <references refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" compoundref="armv6_2spinlock_8c" startline="55" endline="61">spinLock</references>
        <references refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" compoundref="kmalloc_8h" startline="38">sysID</references>
        <references refid="vmm_8h_1a71bd5e4901787995ae8f9cc3e1a888f9" compoundref="vmm_8h" startline="59">VMM_USER_END</references>
        <references refid="vmm_8h_1ad43d15bd90c1980dae3db013c1a5abb0" compoundref="vmm_8h" startline="58">VMM_USER_START</references>
        <referencedby refid="kernel_2elf_8c_1aaf5f82fbbff76c71fcefe513c40730b4" compoundref="kernel_2elf_8c" startline="37" endline="137">elf_load_file</referencedby>
        <referencedby refid="exec_8c_1af80d4412d42ed1b5bf9a1b9774230f33" compoundref="exec_8c" startline="153" endline="330">execFile</referencedby>
        <referencedby refid="vmm__mmap_8c_1ac6b3ef6da47d002e7ff528f9a8e75012" compoundref="vmm__mmap_8c" startline="75" endline="153">freebsd6_mmap</referencedby>
        <referencedby refid="kmod_8c_1a92b68dbf95bf5d651555a4c02ee1a74b" compoundref="kmod_8c" startline="70" endline="207">kmod_load</referencedby>
        <referencedby refid="ld_8c_1add6ca1fb619f0bc0f4addffbfc5577a7" compoundref="ld_8c" startline="40" endline="194">ldEnable</referencedby>
        <referencedby refid="classogDisplay__UbixOS_1a63ff8d6ee36f49385885fd0cf64fba3f" compoundref="ogDisplay__UbixOS_8cc" startline="99" endline="203">ogDisplay_UbixOS::SetMode</referencedby>
        <referencedby refid="vmm__mmap_8c_1a34f95e2ffa8a4bb4ca88918a3a3af580" compoundref="vmm__mmap_8c" startline="162" endline="220">sys_mmap</referencedby>
        <referencedby refid="exec_8c_1a219681612352232186a0f568457d851d" compoundref="exec_8c" startline="340" endline="545">sysExec</referencedby>
        <referencedby refid="paging_8c_1a3615feeeee9f4038cd1070372ccba22e" compoundref="paging_8c" startline="291" endline="346">vmm_getFreeKernelPage</referencedby>
        <referencedby refid="paging_8c_1af47a45e3f0802f5aac053808127aaaf1" compoundref="paging_8c" startline="58" endline="187">vmm_pagingInit</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="include_2sys_2types_8h" kindref="compound">sys/types.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><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="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="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><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="34"><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="35"><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="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><highlight class="preprocessor">#include<sp/>&lt;<ref refid="descrip_8h" kindref="compound">sys/descrip.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="vitals_8h" kindref="compound">ubixos/vitals.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41" refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" refkind="member"><highlight class="normal"><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref><sp/>=<sp/>0x0;<sp/></highlight><highlight class="comment">//<sp/>Pointer<sp/>To<sp/>Kernel<sp/>Page<sp/>Directory</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><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="structspinLock" kindref="compound">spinLock</ref><sp/>fkpSpinLock<sp/>=<sp/><ref refid="spinlock_8h_1a0fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref>;</highlight></codeline>
<codeline lineno="44"><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><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="structspinLock" kindref="compound">spinLock</ref><sp/>rmpSpinLock<sp/>=<sp/><ref refid="spinlock_8h_1a0fe85a4f3642683148b25916d6c5eafd" kindref="member">SPIN_LOCK_INITIALIZER</ref>;</highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight><highlight class="comment">/*****************************************************************************************</highlight></codeline>
<codeline lineno="48"><highlight class="comment"><sp/>Function:<sp/>int<sp/>vmm_pagingInit();</highlight></codeline>
<codeline lineno="49"><highlight class="comment"></highlight></codeline>
<codeline lineno="50"><highlight class="comment"><sp/>Description:<sp/>This<sp/>Function<sp/>Will<sp/>Initialize<sp/>The<sp/>Operating<sp/>Systems<sp/>Paging</highlight></codeline>
<codeline lineno="51"><highlight class="comment"><sp/>Abilities.</highlight></codeline>
<codeline lineno="52"><highlight class="comment"></highlight></codeline>
<codeline lineno="53"><highlight class="comment"><sp/>Notes:</highlight></codeline>
<codeline lineno="54"><highlight class="comment"><sp/>02/20/2004<sp/>-<sp/>Looked<sp/>Over<sp/>Code<sp/>And<sp/>Have<sp/>Approved<sp/>Its<sp/>Quality</highlight></codeline>
<codeline lineno="55"><highlight class="comment"><sp/>07/28/3004<sp/>-<sp/>All<sp/>pages<sp/>are<sp/>set<sp/>for<sp/>ring-0<sp/>only<sp/>no<sp/>more<sp/>user<sp/>accessable</highlight></codeline>
<codeline lineno="56"><highlight class="comment"></highlight></codeline>
<codeline lineno="57"><highlight class="comment"><sp/>*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58" refid="paging_8c_1af47a45e3f0802f5aac053808127aaaf1" refkind="member"><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="paging_8c_1af47a45e3f0802f5aac053808127aaaf1" kindref="member">vmm_pagingInit</ref>()<sp/>{</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="61"><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="62"><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Allocate<sp/>A<sp/>Page<sp/>Of<sp/>Memory<sp/>For<sp/>Kernels<sp/>Page<sp/>Directory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref><sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>);</highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref><sp/>==<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="comment">/*<sp/>end<sp/>if<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Clear<sp/>The<sp/>Memory<sp/>To<sp/>Ensure<sp/>There<sp/>Is<sp/>No<sp/>Garbage<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><ref refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" kindref="member">bzero</ref>(<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>,<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>);</highlight></codeline>
<codeline lineno="72"><highlight class="normal"></highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Allocate<sp/>a<sp/>page<sp/>for<sp/>the<sp/>first<sp/>4MB<sp/>of<sp/>memory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Make<sp/>Sure<sp/>The<sp/>Page<sp/>Table<sp/>Is<sp/>Clean<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><ref refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" kindref="member">bzero</ref>(pageTable,<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[0]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable)<sp/>|<sp/><ref refid="paging_8h_1af0fff7a38cd2c7a32d580787423b94ea" kindref="member">PAGE_DEFAULT</ref>);</highlight></codeline>
<codeline lineno="81"><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="83"><highlight class="comment"><sp/><sp/><sp/>*<sp/>Map<sp/>the<sp/>first<sp/>1MB<sp/>of<sp/>Memory<sp/>to<sp/>the<sp/>kernel<sp/>MM<sp/>space<sp/>because<sp/>our<sp/>kernel<sp/>starts</highlight></codeline>
<codeline lineno="84"><highlight class="comment"><sp/><sp/><sp/>*<sp/>at<sp/>0x30000</highlight></codeline>
<codeline lineno="85"><highlight class="comment"><sp/><sp/><sp/>*<sp/>Do<sp/>not<sp/>map<sp/>page<sp/>at<sp/>address<sp/>0x0<sp/>this<sp/>is<sp/>reserved<sp/>for<sp/>null...</highlight></codeline>
<codeline lineno="86"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>MrOlsen<sp/>(2016-01-15)<sp/>NOTE:<sp/>I&apos;m<sp/>Mapping<sp/>It<sp/>For<sp/>Now<sp/>Until<sp/>I<sp/>Can<sp/>Figure<sp/>Out<sp/>Why<sp/>FS:0x0<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0x0;<sp/>i<sp/>&lt;<sp/>(<ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref><sp/>/<sp/>0x4);<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/>pageTable[i]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((i<sp/>*<sp/>0x1000)<sp/>|<sp/><ref refid="paging_8h_1af0fff7a38cd2c7a32d580787423b94ea" kindref="member">PAGE_DEFAULT</ref>);<sp/></highlight><highlight class="comment">//FIXME:<sp/>This<sp/>is<sp/>temp<sp/>becauseo<sp/>f<sp/>bios<sp/>callKERNEL_PAGE_DEFAULT);<sp/><sp/>//MrOlsen<sp/>2018-01-14<sp/>PAGE_DEFAULT</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="comment">/*<sp/>end<sp/>for<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"></highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Allocate<sp/>a<sp/>page<sp/>for<sp/>the<sp/>second<sp/>4MB<sp/>of<sp/>memory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="96"><highlight class="normal"></highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Make<sp/>Sure<sp/>The<sp/>Page<sp/>Table<sp/>Is<sp/>Clean<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><ref refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" kindref="member">bzero</ref>(pageTable,<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>);</highlight></codeline>
<codeline lineno="99"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[1]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable)<sp/>|<sp/><ref refid="paging_8h_1af0fff7a38cd2c7a32d580787423b94ea" kindref="member">PAGE_DEFAULT</ref>);</highlight></codeline>
<codeline lineno="101"><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="103"><highlight class="comment"><sp/><sp/><sp/>*<sp/>Create<sp/>page<sp/>tables<sp/>for<sp/>the<sp/>top<sp/>1GB<sp/>of<sp/>VM<sp/>space.<sp/>This<sp/>space<sp/>is<sp/>set<sp/>aside</highlight></codeline>
<codeline lineno="104"><highlight class="comment"><sp/><sp/><sp/>*<sp/>for<sp/>kernel<sp/>space<sp/>and<sp/>will<sp/>be<sp/>shared<sp/>with<sp/>each<sp/>process</highlight></codeline>
<codeline lineno="105"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1ad6394b4f60e68fe4e1431fc4e1998957" kindref="member">VMM_KERN_START</ref>);<sp/>i<sp/>&lt;=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1a8204faafc0c27e418f993e07c2f59f14" kindref="member">VMM_KERN_END</ref>);<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"></highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Make<sp/>Sure<sp/>The<sp/>Page<sp/>Table<sp/>Is<sp/>Clean<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" kindref="member">bzero</ref>(pageTable,<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>);</highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Map<sp/>In<sp/>The<sp/>Page<sp/>Directory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[i]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref><sp/>|<sp/><ref refid="paging_8h_1a0d99c75e51b448fcb97266da4815c63f" kindref="member">PAGE_GLOBAL</ref>);</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="comment">/*<sp/>end<sp/>for<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"></highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[1023]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>);</highlight></codeline>
<codeline lineno="119"><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_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[1023]<sp/>&amp;<sp/>0xFFFFF000);</highlight></codeline>
<codeline lineno="120"><highlight class="normal"></highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/>pageTable[1023]<sp/>=<sp/>(<ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref><sp/>|<sp/><ref refid="paging_8h_1a1532db17068ba8d409b8ffe066414af2" kindref="member">PAGE_STACK</ref>);</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/>pageTable[1022]<sp/>=<sp/>(<ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref><sp/>|<sp/><ref refid="paging_8h_1a1532db17068ba8d409b8ffe066414af2" kindref="member">PAGE_STACK</ref>);</highlight></codeline>
<codeline lineno="123"><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="125"><highlight class="comment"><sp/><sp/><sp/>*<sp/>Map<sp/>Page<sp/>Tables<sp/>Into<sp/>VM<sp/>Space</highlight></codeline>
<codeline lineno="126"><highlight class="comment"><sp/><sp/><sp/>*<sp/>The<sp/>First<sp/>Page<sp/>Table<sp/>(4MB)<sp/>Maps<sp/>To<sp/>All<sp/>Page<sp/>Directories</highlight></codeline>
<codeline lineno="127"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[<ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" kindref="member">PT_BASE_ADDR</ref>)]<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" kindref="member">bzero</ref>(pageTable,<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"></highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[<ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" kindref="member">PT_BASE_ADDR</ref>)]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>);</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="136"><highlight class="normal"></highlight></codeline>
<codeline lineno="137"><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_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[<ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="paging_8h_1a8d42a9a09d9dea53cab3044f51482acc" kindref="member">PT_BASE_ADDR</ref>)]<sp/>&amp;<sp/>0xFFFFF000);</highlight></codeline>
<codeline lineno="138"><highlight class="normal"></highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/>pageTable[i]<sp/>=<sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[i];</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="comment">/*<sp/>end<sp/>for<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="normal"></highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="144"><highlight class="comment"><sp/><sp/><sp/>*<sp/>Map<sp/>Page<sp/>Directory<sp/>Into<sp/>VM<sp/>Space</highlight></codeline>
<codeline lineno="145"><highlight class="comment"><sp/><sp/><sp/>*<sp/>First<sp/>Page<sp/>After<sp/>Page<sp/>Tables</highlight></codeline>
<codeline lineno="146"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[<ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>)]<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Error:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="gpt_8h_1a310ac455ac45de9713bd7dcb0b5500ad" kindref="member">bzero</ref>(pageTable,<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>);</highlight></codeline>
<codeline lineno="152"><highlight class="normal"></highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[<ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>)]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(pageTable)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>);</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="155"><highlight class="normal"></highlight></codeline>
<codeline lineno="156"><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_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>[<ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>)]<sp/>&amp;<sp/>0xFFFFF000);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/>pageTable[0]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>)<sp/>|<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>);</highlight></codeline>
<codeline lineno="158"><highlight class="normal"></highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Allocate<sp/>New<sp/>Stack<sp/>Space<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;ERROR:<sp/>vmm_findFreePage<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="162"><highlight class="normal"></highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Now<sp/>Lets<sp/>Turn<sp/>On<sp/>Paging<sp/>With<sp/>This<sp/>Initial<sp/>Page<sp/>Table<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="164"><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="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%0,%%eax<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%%eax,%%cr3<sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%%cr0,%%eax<sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;orl<sp/><sp/>$0x80010000,%%eax<sp/>\n&quot;</highlight><highlight class="normal"><sp/></highlight><highlight class="comment">/*<sp/>Turn<sp/>on<sp/>memory<sp/>protection<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%%eax,%%cr0<sp/><sp/><sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>:</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>:<sp/></highlight><highlight class="stringliteral">&quot;d&quot;</highlight><highlight class="normal">((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/>(<ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>))</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/>);</highlight></codeline>
<codeline lineno="173"><highlight class="normal"></highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Remap<sp/>The<sp/>Memory<sp/>List<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/><ref refid="vmm_8h_1a1e10465731ac6cbfc253ce7d89ae34c8" kindref="member">VMM_MMAP_ADDR_RMODE</ref>;<sp/>i<sp/>&lt;=<sp/>(0x101000<sp/>+<sp/>(<ref refid="vmm_8h_1a2b0091bdc36e32af3daf9cfcaa7c04e1" kindref="member">numPages</ref><sp/>*<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="structmMap" kindref="compound">mMap</ref>)));<sp/>i<sp/>+=<sp/>0x1000)<sp/>{</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(i,<sp/>(<ref refid="vmm_8h_1aa015f84b2a9b7588c472ff5dc99646f6" kindref="member">VMM_MMAP_ADDR_PMODE</ref><sp/>+<sp/>(i<sp/>-<sp/>0x101000)),<sp/><ref refid="paging_8h_1af0fff7a38cd2c7a32d580787423b94ea" kindref="member">PAGE_DEFAULT</ref>,<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>,<sp/>0))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;vmmRemapPage<sp/>failed\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="179"><highlight class="normal"></highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>New<sp/>Address<sp/>For<sp/>Memory<sp/>Map<sp/>Since<sp/>Its<sp/>Relocation<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><ref refid="vmm_8h_1a89e87741958ee81f1811075b25af058a" kindref="member">vmmMemoryMap</ref><sp/>=<sp/>(<ref refid="structmMap" kindref="compound">mMap</ref><sp/>*)<sp/><ref refid="vmm_8h_1aa015f84b2a9b7588c472ff5dc99646f6" kindref="member">VMM_MMAP_ADDR_PMODE</ref>;</highlight></codeline>
<codeline lineno="182"><highlight class="normal"></highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Print<sp/>information<sp/>on<sp/>paging<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;paging0<sp/>-<sp/>Address:<sp/>[0x%X],<sp/>PagingISR<sp/>Address:<sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,<sp/><ref refid="paging_8c_1a7c58070dedac2ee9e1c73d8c8206b923" kindref="member">kernelPageDirectory</ref>,<sp/>&amp;<ref refid="paging_8h_1a15b43ccb21abdb9e0a41acb82b260a99" kindref="member">_vmm_pageFault</ref>);</highlight></codeline>
<codeline lineno="185"><highlight class="normal"></highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>so<sp/>we<sp/>know<sp/>everything<sp/>went<sp/>well<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="188"><highlight class="normal">}<sp/></highlight><highlight class="comment">/*<sp/>END<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="normal"></highlight></codeline>
<codeline lineno="190"><highlight class="normal"></highlight><highlight class="comment">/*****************************************************************************************</highlight></codeline>
<codeline lineno="191"><highlight class="comment"><sp/>Function:<sp/>int<sp/>vmmRemapPage(Physical<sp/>Source,Virtual<sp/>Destination)</highlight></codeline>
<codeline lineno="192"><highlight class="comment"></highlight></codeline>
<codeline lineno="193"><highlight class="comment"><sp/>Description:<sp/>This<sp/>Function<sp/>Will<sp/>Remap<sp/>A<sp/>Physical<sp/>Page<sp/>Into<sp/>Virtual<sp/>Space</highlight></codeline>
<codeline lineno="194"><highlight class="comment"></highlight></codeline>
<codeline lineno="195"><highlight class="comment"><sp/>Notes:</highlight></codeline>
<codeline lineno="196"><highlight class="comment"><sp/>07/29/02<sp/>-<sp/>Rewrote<sp/>This<sp/>To<sp/>Work<sp/>With<sp/>Our<sp/>New<sp/>Paging<sp/>System</highlight></codeline>
<codeline lineno="197"><highlight class="comment"><sp/>07/30/02<sp/>-<sp/>Changed<sp/>Address<sp/>Of<sp/>Page<sp/>Tables<sp/>And<sp/>Page<sp/>Directory</highlight></codeline>
<codeline lineno="198"><highlight class="comment"><sp/>07/28/04<sp/>-<sp/>If<sp/>perms<sp/>==<sp/>0x0<sp/>set<sp/>to<sp/>PAGE_DEFAULT</highlight></codeline>
<codeline lineno="199" refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" refkind="member"><highlight class="comment"></highlight></codeline>
<codeline lineno="200"><highlight class="comment"><sp/>*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="201"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>source,<sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>dest,<sp/><ref refid="include_2sys_2types_8h_1a281b4b5562236420969a830503b0ba19" kindref="member">uint16_t</ref><sp/>perms,<sp/><ref refid="include_2sys_2types_8h_1ae438ba74394b14d7b24b6df3b3b8c252" kindref="member">pidType</ref><sp/>pid,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>haveLock)<sp/>{</highlight></codeline>
<codeline lineno="202"><highlight class="normal"></highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a281b4b5562236420969a830503b0ba19" kindref="member">uint16_t</ref><sp/>destPageDirectoryIndex<sp/>=<sp/>0x0,<sp/>destPageTableIndex<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageDir<sp/>=<sp/>0x0,<sp/>*pageTable<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"></highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="207"><highlight class="normal"></highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(pid<sp/>&lt;<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>)</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Invalid<sp/>PID<sp/>%i&quot;</highlight><highlight class="normal">,<sp/>pid);</highlight></codeline>
<codeline lineno="210"><highlight class="normal"></highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(source<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;source<sp/>==<sp/>0x0&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(dest<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;dest<sp/>==<sp/>0x0&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="216"><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(haveLock<sp/>==<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(dest<sp/>&gt;=<sp/><ref refid="vmm_8h_1ad43d15bd90c1980dae3db013c1a5abb0" kindref="member">VMM_USER_START</ref><sp/>&amp;&amp;<sp/>dest<sp/>&lt;=<sp/><ref refid="vmm_8h_1a71bd5e4901787995ae8f9cc3e1a888f9" kindref="member">VMM_USER_END</ref>)</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" kindref="member">spinLock</ref>(&amp;rmpSpinLock);</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" kindref="member">spinLock</ref>(&amp;<ref refid="vmm_8h_1afcaabe90527f6aec9cfeaaba78500e4c" kindref="member">pdSpinLock</ref>);</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="223"><highlight class="normal"></highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(perms<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/>perms<sp/>=<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>;</highlight></codeline>
<codeline lineno="226"><highlight class="normal"></highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>Pointer<sp/>pageDirectory<sp/>To<sp/>Point<sp/>To<sp/>The<sp/>Virtual<sp/>Mapping<sp/>Of<sp/>The<sp/>Page<sp/>Directory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/>pageDir<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"></highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Get<sp/>Index<sp/>Into<sp/>The<sp/>Page<sp/>Directory<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/>destPageDirectoryIndex<sp/>=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(dest);</highlight></codeline>
<codeline lineno="232"><highlight class="normal"></highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageDir[destPageDirectoryIndex]<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>)<sp/>{</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;[NpdI:0x%X]&quot;,<sp/>destPageDirectoryIndex);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1acba8d9cc298370338bc5bea5187183b2" kindref="member">vmm_allocPageTable</ref>(destPageDirectoryIndex,<sp/>pid);</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="237"><highlight class="normal"></highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>Address<sp/>To<sp/>Page<sp/>Table<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="239"><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/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/>destPageDirectoryIndex));</highlight></codeline>
<codeline lineno="240"><highlight class="normal"></highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Get<sp/>The<sp/>Index<sp/>To<sp/>The<sp/>Page<sp/>Table<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/>destPageTableIndex<sp/>=<sp/><ref refid="paging_8h_1a2c6e29890bb0209384b6d012db48e2f7" kindref="member">PT_INDEX</ref>(dest);</highlight></codeline>
<codeline lineno="243"><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>If<sp/>The<sp/>Page<sp/>Is<sp/>Mapped<sp/>In<sp/>Free<sp/>It<sp/>Before<sp/>We<sp/>Remap<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable[destPageTableIndex]<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>)<sp/>{</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;A<sp/>Page<sp/>Is<sp/>Already<sp/>Mapped<sp/>Here:<sp/>0x%X:0x%X&quot;</highlight><highlight class="normal">,<sp/>dest,<sp/>destPageTableIndex);</highlight></codeline>
<codeline lineno="247"><highlight class="normal"></highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable[destPageTableIndex]<sp/>&amp;<sp/><ref refid="paging_8h_1a1532db17068ba8d409b8ffe066414af2" kindref="member">PAGE_STACK</ref>)<sp/>==<sp/><ref refid="paging_8h_1a1532db17068ba8d409b8ffe066414af2" kindref="member">PAGE_STACK</ref>)</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Stack<sp/>Page:<sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,<sp/>dest);</highlight></codeline>
<codeline lineno="250"><highlight class="normal"></highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable[destPageTableIndex]<sp/>&amp;<sp/><ref refid="paging_8h_1a57d743cb60fe478f6720c42315e7e813" kindref="member">PAGE_COW</ref>)<sp/>!=<sp/><ref refid="paging_8h_1a57d743cb60fe478f6720c42315e7e813" kindref="member">PAGE_COW</ref>)<sp/>{</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Page<sp/>NOT<sp/>COW\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Page<sp/>Present:<sp/>[0x%X][0x%X]&quot;</highlight><highlight class="normal">,<sp/>dest,<sp/>pageTable[destPageTableIndex]);</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>source<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">goto</highlight><highlight class="normal"><sp/>rmDone;</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="257"><highlight class="normal"></highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Clear<sp/>The<sp/>Page<sp/>First<sp/>For<sp/>Security<sp/>Reasons<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><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[destPageTableIndex]<sp/>&amp;<sp/>0xFFFFF000));</highlight></codeline>
<codeline lineno="260"><highlight class="normal"></highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="262"><highlight class="normal"></highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>The<sp/>Source<sp/>Address<sp/>In<sp/>The<sp/>Destination<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/>pageTable[destPageTableIndex]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(source<sp/>|<sp/>perms);</highlight></codeline>
<codeline lineno="265"><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Reload<sp/>The<sp/>Page<sp/>Table;<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/>rmDone:<sp/></highlight><highlight class="keyword">asm</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">volatile</highlight><highlight class="normal">(</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;push<sp/>%eax<sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%cr3,%eax\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%eax,%cr3\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;pop<sp/><sp/>%eax<sp/><sp/><sp/><sp/><sp/>\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/>);</highlight></codeline>
<codeline lineno="273"><highlight class="normal"></highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(haveLock<sp/>==<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(dest<sp/>&gt;=<sp/><ref refid="vmm_8h_1ad43d15bd90c1980dae3db013c1a5abb0" kindref="member">VMM_USER_START</ref><sp/>&amp;&amp;<sp/>dest<sp/>&lt;=<sp/><ref refid="vmm_8h_1a71bd5e4901787995ae8f9cc3e1a888f9" kindref="member">VMM_USER_END</ref>)</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;rmpSpinLock);</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;<ref refid="vmm_8h_1afcaabe90527f6aec9cfeaaba78500e4c" kindref="member">pdSpinLock</ref>);</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="281"><highlight class="normal"></highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(source);</highlight></codeline>
<codeline lineno="283"><highlight class="normal">}</highlight></codeline>
<codeline lineno="284"><highlight class="normal"></highlight></codeline>
<codeline lineno="285"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="286"><highlight class="comment"></highlight></codeline>
<codeline lineno="287"><highlight class="comment"><sp/>Function:<sp/>void<sp/>*vmm_getFreeKernelPage(pidType<sp/>pid,<sp/>uint16_t<sp/>count);</highlight></codeline>
<codeline lineno="288"><highlight class="comment"><sp/>Description:<sp/>Returns<sp/>A<sp/>Free<sp/>Page<sp/>Mapped<sp/>To<sp/>The<sp/>VM<sp/>Space</highlight></codeline>
<codeline lineno="289"><highlight class="comment"><sp/>Notes:</highlight></codeline>
<codeline lineno="290"><highlight class="comment"></highlight></codeline>
<codeline lineno="291" refid="paging_8c_1a3615feeeee9f4038cd1070372ccba22e" refkind="member"><highlight class="comment"><sp/>07/30/02<sp/>-<sp/>This<sp/>Returns<sp/>A<sp/>Free<sp/>Page<sp/>In<sp/>The<sp/>Kernel<sp/>Space</highlight></codeline>
<codeline lineno="292"><highlight class="comment"></highlight></codeline>
<codeline lineno="293"><highlight class="comment"><sp/>***********************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="294"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="paging_8c_1a3615feeeee9f4038cd1070372ccba22e" kindref="member">vmm_getFreeKernelPage</ref>(<ref refid="include_2sys_2types_8h_1ae438ba74394b14d7b24b6df3b3b8c252" kindref="member">pidType</ref><sp/>pid,<sp/><ref refid="include_2sys_2types_8h_1a281b4b5562236420969a830503b0ba19" kindref="member">uint16_t</ref><sp/>count)<sp/>{</highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>pdI<sp/>=<sp/>0x0,<sp/>ptI<sp/>=<sp/>0x0,<sp/>c<sp/>=<sp/>0,<sp/>lc<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="296"><highlight class="normal"></highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageDirectory<sp/>=<sp/><ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>;</highlight></codeline>
<codeline lineno="298"><highlight class="normal"></highlight></codeline>
<codeline lineno="299"><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="300"><highlight class="normal"></highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>startAddress<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="302"><highlight class="normal"></highlight></codeline>
<codeline lineno="303"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Lock<sp/>The<sp/>Page<sp/>Dir<sp/>&amp;<sp/>Tables<sp/>For<sp/>All<sp/>Since<sp/>Kernel<sp/>Space<sp/>Is<sp/>Shared<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="304"><highlight class="normal"><sp/><sp/><ref refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" kindref="member">spinLock</ref>(&amp;<ref refid="vmm_8h_1afcaabe90527f6aec9cfeaaba78500e4c" kindref="member">pdSpinLock</ref>);</highlight></codeline>
<codeline lineno="305"><highlight class="normal"></highlight></codeline>
<codeline lineno="306"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Lets<sp/>Search<sp/>For<sp/>A<sp/>Free<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(pdI<sp/>=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1ad6394b4f60e68fe4e1431fc4e1998957" kindref="member">VMM_KERN_START</ref>);<sp/>pdI<sp/>&lt;=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1a8204faafc0c27e418f993e07c2f59f14" kindref="member">VMM_KERN_END</ref>);<sp/>pdI++)<sp/>{</highlight></codeline>
<codeline lineno="308"><highlight class="normal"></highlight></codeline>
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageDirectory[pdI]<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="310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="vmm_8h_1acba8d9cc298370338bc5bea5187183b2" kindref="member">vmm_allocPageTable</ref>(pdI,<sp/>pid)<sp/>==<sp/>-1)</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Failed<sp/>To<sp/>Allocate<sp/>Page<sp/>Dir:<sp/>0x%X&quot;</highlight><highlight class="normal">,<sp/>pdI);</highlight></codeline>
<codeline lineno="312"><highlight class="normal"></highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>Page<sp/>Table<sp/>Address<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><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/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/>pdI));</highlight></codeline>
<codeline lineno="315"><highlight class="normal"></highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Loop<sp/>Through<sp/>The<sp/>Page<sp/>Table<sp/>For<sp/>A<sp/>Free<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(ptI<sp/>=<sp/>0;<sp/>ptI<sp/>&lt;<sp/><ref refid="paging_8h_1adc9776583e54abf06ae7b99f1f3036a6" kindref="member">PT_ENTRIES</ref>;<sp/>ptI++)<sp/>{</highlight></codeline>
<codeline lineno="318"><highlight class="normal"></highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Check<sp/>For<sp/>Unalocated<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTable[ptI]<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>)<sp/>{</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(startAddress<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>startAddress<sp/>=<sp/>((pdI<sp/>*<sp/>(<ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref><sp/>*<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>))<sp/>+<sp/>(ptI<sp/>*<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>));</highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>c++;</highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>startAddress<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>c<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="328"><highlight class="normal"></highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(c<sp/>==<sp/>count)</highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">goto</highlight><highlight class="normal"><sp/>gotPages;</highlight></codeline>
<codeline lineno="331"><highlight class="normal"></highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="334"><highlight class="normal"></highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/>startAddress<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">goto</highlight><highlight class="normal"><sp/>noPagesAvail;</highlight></codeline>
<codeline lineno="337"><highlight class="normal"></highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/>gotPages:<sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(c<sp/>=<sp/>0;<sp/>c<sp/>&lt;<sp/>count;<sp/>c++)<sp/>{</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(pid),<sp/>(startAddress<sp/>+<sp/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/>c)),<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/>pid,<sp/>1))<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="340"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;vmmRemapPage<sp/>failed:<sp/>gfkp-1\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="341"><highlight class="normal"></highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" kindref="member">vmm_clearVirtualPage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>(startAddress<sp/>+<sp/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/>c)));</highlight></codeline>
<codeline lineno="343"><highlight class="normal"></highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="345"><highlight class="normal"></highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/>noPagesAvail:<sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;<ref refid="vmm_8h_1afcaabe90527f6aec9cfeaaba78500e4c" kindref="member">pdSpinLock</ref>);</highlight></codeline>
<codeline lineno="347"><highlight class="normal"></highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(startAddress);</highlight></codeline>
<codeline lineno="349"><highlight class="normal">}</highlight></codeline>
<codeline lineno="350"><highlight class="normal"></highlight></codeline>
<codeline lineno="351"><highlight class="normal"></highlight><highlight class="comment">/************************************************************************</highlight></codeline>
<codeline lineno="352"><highlight class="comment"></highlight></codeline>
<codeline lineno="353"><highlight class="comment"><sp/>Function:<sp/>void<sp/>vmm_clearVirtualPage(uint32_t<sp/>pageAddr);</highlight></codeline>
<codeline lineno="354"><highlight class="comment"></highlight></codeline>
<codeline lineno="355"><highlight class="comment"><sp/>Description:<sp/>This<sp/>Will<sp/>Null<sp/>Out<sp/>A<sp/>Page<sp/>Of<sp/>Memory</highlight></codeline>
<codeline lineno="356" refid="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" refkind="member"><highlight class="comment"></highlight></codeline>
<codeline lineno="357"><highlight class="comment"><sp/>Notes:</highlight></codeline>
<codeline lineno="358"><highlight class="comment"></highlight></codeline>
<codeline lineno="359"><highlight class="comment"><sp/>************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="360"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" kindref="member">vmm_clearVirtualPage</ref>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>pageAddr)<sp/>{</highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*src<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>counter<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="363"><highlight class="normal"></highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Set<sp/>Source<sp/>Pointer<sp/>To<sp/>Virtual<sp/>Page<sp/>Address<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/>src<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/>pageAddr;</highlight></codeline>
<codeline lineno="366"><highlight class="normal"></highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Clear<sp/>Out<sp/>The<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="368"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(counter<sp/>=<sp/>0x0;<sp/>counter<sp/>&lt;<sp/><ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref>;<sp/>counter++)<sp/>{</highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/>src[counter]<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>0x0;</highlight></codeline>
<codeline lineno="370"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="371"><highlight class="normal"></highlight></codeline>
<codeline lineno="372" refid="paging_8c_1a6aca027c65f91943e6bc46ab9542c086" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="373"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="374"><highlight class="normal">}</highlight></codeline>
<codeline lineno="375"><highlight class="normal"></highlight></codeline>
<codeline lineno="376"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="paging_8c_1a6aca027c65f91943e6bc46ab9542c086" kindref="member">vmm_mapFromTask</ref>(<ref refid="include_2sys_2types_8h_1ae438ba74394b14d7b24b6df3b3b8c252" kindref="member">pidType</ref><sp/>pid,<sp/></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/>{</highlight></codeline>
<codeline lineno="377"><highlight class="normal"><sp/><sp/><ref refid="structtaskStruct" kindref="compound">kTask_t</ref><sp/>*child<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="378"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>i<sp/>=<sp/>0x0,<sp/>x<sp/>=<sp/>0x0,<sp/>y<sp/>=<sp/>0x0,<sp/>count<sp/>=<sp/>((size<sp/>+<sp/>4095)<sp/>/<sp/>0x1000),<sp/>c<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="379"><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="380"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>baseAddr<sp/>=<sp/>0x0,<sp/>offset<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="381"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*childPageDir<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/>0x5A00000;</highlight></codeline>
<codeline lineno="382"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*childPageTable<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageTableSrc<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/>offset<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>ptr<sp/>&amp;<sp/>0xFFF;</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/>baseAddr<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>ptr<sp/>&amp;<sp/>0xFFFFF000;</highlight></codeline>
<codeline lineno="386"><highlight class="normal"><sp/><sp/>child<sp/>=<sp/><ref refid="armv6_2sched_8c_1a9cf37ade4c1f6184b33014ac2015e8ed" kindref="member">schedFindTask</ref>(pid);</highlight></codeline>
<codeline lineno="387"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//Calculate<sp/>The<sp/>Page<sp/>Table<sp/>Index<sp/>And<sp/>Page<sp/>Directory<sp/>Index</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="388"><highlight class="normal"><sp/><sp/>dI<sp/>=<sp/>(baseAddr<sp/>/<sp/>(1024<sp/>*<sp/>4096));</highlight></codeline>
<codeline lineno="389"><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="390"><highlight class="normal"></highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;cr3:<sp/>0x%X\n&quot;</highlight><highlight class="normal">,<sp/>child-&gt;<ref refid="structtaskStruct_1a4c8accd7c0d5bb5ce426dc982bfc8519" kindref="member">tss</ref>.<ref refid="structtssStruct_1a8d312ed3dd0ea7a0f801c08a8cc4afd0" kindref="member">cr3</ref>);</highlight></codeline>
<codeline lineno="392"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(child-&gt;<ref refid="structtaskStruct_1a4c8accd7c0d5bb5ce426dc982bfc8519" kindref="member">tss</ref>.<ref refid="structtssStruct_1a8d312ed3dd0ea7a0f801c08a8cc4afd0" kindref="member">cr3</ref>,<sp/>0x5A00000,<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-&gt;<ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;vmm_remapPage:<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="394"><highlight class="normal"></highlight></codeline>
<codeline lineno="395"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref>;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="396"><highlight class="normal"></highlight></codeline>
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((childPageDir[i]<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>)<sp/>{</highlight></codeline>
<codeline lineno="398"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;mapping:<sp/>0x%X\n&quot;,<sp/>i);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="399"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(childPageDir[i],<sp/>0x5A01000<sp/>+<sp/>(i<sp/>*<sp/>0x1000),<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-&gt;<ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Returned<sp/>NULL&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="401"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="402"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="403"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;mapping<sp/>completed\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="404"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">//for<sp/>(x<sp/>=<sp/>(_current-&gt;oInfo.vmStart<sp/>/<sp/>(1024<sp/>*<sp/>4096));<sp/>x<sp/>&lt;<sp/>1024;<sp/>x++)<sp/>{</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="405"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(x<sp/>=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1ad6394b4f60e68fe4e1431fc4e1998957" kindref="member">VMM_KERN_START</ref>);<sp/>x<sp/>&lt;<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1a8204faafc0c27e418f993e07c2f59f14" kindref="member">VMM_KERN_END</ref>);<sp/>x++)<sp/>{</highlight></codeline>
<codeline lineno="406"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kpanic(&quot;v_mFT&quot;);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/>pageTableSrc<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/>(4096<sp/>*<sp/>x));</highlight></codeline>
<codeline lineno="408"><highlight class="normal"></highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(y<sp/>=<sp/>0;<sp/>y<sp/>&lt;<sp/>1024;<sp/>y++)<sp/>{</highlight></codeline>
<codeline lineno="410"><highlight class="normal"></highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Loop<sp/>Through<sp/>The<sp/>Page<sp/>Table<sp/>Find<sp/>An<sp/>UnAllocated<sp/>Page</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>pageTableSrc[y]<sp/>==<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="413"><highlight class="normal"></highlight></codeline>
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(count<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="415"><highlight class="normal"></highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(c<sp/>=<sp/>0;<sp/>((c<sp/>&lt;<sp/>count)<sp/>&amp;&amp;<sp/>(y<sp/>+<sp/>c<sp/>&lt;<sp/>1024));<sp/>c++)<sp/>{</highlight></codeline>
<codeline lineno="417"><highlight class="normal"></highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>pageTableSrc[y<sp/>+<sp/>c]<sp/>!=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="419"><highlight class="normal"></highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>c<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="422"><highlight class="normal"></highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="424"><highlight class="normal"></highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="426"><highlight class="normal"></highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(c<sp/>!=<sp/>-1)<sp/>{</highlight></codeline>
<codeline lineno="428"><highlight class="normal"></highlight></codeline>
<codeline lineno="429"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(c<sp/>=<sp/>0;<sp/>c<sp/>&lt;<sp/>count;<sp/>c++)<sp/>{</highlight></codeline>
<codeline lineno="430"><highlight class="normal"></highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((tI<sp/>+<sp/>c)<sp/>&gt;=<sp/>0x1000)<sp/>{</highlight></codeline>
<codeline lineno="432"><highlight class="normal"></highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dI++;</highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tI<sp/>=<sp/>0<sp/>-<sp/>c;</highlight></codeline>
<codeline lineno="435"><highlight class="normal"></highlight></codeline>
<codeline lineno="436"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="437"><highlight class="normal"></highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((childPageDir[dI]<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>)<sp/>{</highlight></codeline>
<codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;dI:<sp/>0x%X\n&quot;,<sp/>dI);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>childPageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/>(0x5A01000<sp/>+<sp/>(0x1000<sp/>*<sp/>dI));</highlight></codeline>
<codeline lineno="441"><highlight class="normal"></highlight></codeline>
<codeline lineno="442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((childPageTable[tI<sp/>+<sp/>c]<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>)<sp/>{</highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(childPageTable[tI<sp/>+<sp/>c],<sp/>((x<sp/>*<sp/>(1024<sp/>*<sp/>4096))<sp/>+<sp/>((y<sp/>+<sp/>c)<sp/>*<sp/>4096)),<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-&gt;<ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="444"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;remap<sp/>==<sp/>NULL&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="445"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="446"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="447"><highlight class="normal"></highlight></codeline>
<codeline lineno="448"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="449"><highlight class="normal"></highlight></codeline>
<codeline lineno="450"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1a457446966aafafd939af6603f68516b1" kindref="member">vmm_unmapPage</ref>(0x5A00000,<sp/>1);</highlight></codeline>
<codeline lineno="451"><highlight class="normal"></highlight></codeline>
<codeline lineno="452"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>0x1000;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="453"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1a457446966aafafd939af6603f68516b1" kindref="member">vmm_unmapPage</ref>((0x5A01000<sp/>+<sp/>(i<sp/>*<sp/>0x1000)),<sp/>1);</highlight></codeline>
<codeline lineno="454"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="455"><highlight class="normal"></highlight></codeline>
<codeline lineno="456"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>((</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<sp/>((x<sp/>*<sp/>(1024<sp/>*<sp/>4096))<sp/>+<sp/>(y<sp/>*<sp/>4096)<sp/>+<sp/>offset));</highlight></codeline>
<codeline lineno="457"><highlight class="normal"></highlight></codeline>
<codeline lineno="458"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="459"><highlight class="normal"></highlight></codeline>
<codeline lineno="460"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="461"><highlight class="normal"></highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Map<sp/>A<sp/>Physical<sp/>Page<sp/>To<sp/>The<sp/>Virtual<sp/>Page</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>childPageTable<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/>(0x5A01000<sp/>+<sp/>(0x1000<sp/>*<sp/>dI));</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((childPageDir[dI]<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>)<sp/>{</highlight></codeline>
<codeline lineno="465"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;eDI:<sp/>0x%X&quot;,<sp/>dI);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((childPageTable[tI]<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>)<sp/>{</highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(childPageTable[tI],<sp/>((x<sp/>*<sp/>(1024<sp/>*<sp/>4096))<sp/>+<sp/>(y<sp/>*<sp/>4096)),<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-&gt;<ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="468"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;remap<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="469"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="470"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="471"><highlight class="normal"></highlight></codeline>
<codeline lineno="472"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Return<sp/>The<sp/>Address<sp/>Of<sp/>The<sp/>Mapped<sp/>In<sp/>Memory</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="473"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1a457446966aafafd939af6603f68516b1" kindref="member">vmm_unmapPage</ref>(0x5A00000,<sp/>1);</highlight></codeline>
<codeline lineno="474"><highlight class="normal"></highlight></codeline>
<codeline lineno="475"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>0x1000;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="476"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1a457446966aafafd939af6603f68516b1" kindref="member">vmm_unmapPage</ref>((0x5A01000<sp/>+<sp/>(i<sp/>*<sp/>0x1000)),<sp/>1);</highlight></codeline>
<codeline lineno="477"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="478"><highlight class="normal"></highlight></codeline>
<codeline lineno="479"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>((</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<sp/>((x<sp/>*<sp/>(1024<sp/>*<sp/>4096))<sp/>+<sp/>(y<sp/>*<sp/>4096)<sp/>+<sp/>offset));</highlight></codeline>
<codeline lineno="480"><highlight class="normal"></highlight></codeline>
<codeline lineno="481"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="482"><highlight class="normal"></highlight></codeline>
<codeline lineno="483"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="484"><highlight class="normal"></highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="486"><highlight class="normal"></highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="488" refid="paging_8c_1a541f0b43826a40b9e978f5479080bb0e" refkind="member"><highlight class="normal"></highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="490"><highlight class="normal">}</highlight></codeline>
<codeline lineno="491"><highlight class="normal"></highlight></codeline>
<codeline lineno="492"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="paging_8c_1a541f0b43826a40b9e978f5479080bb0e" kindref="member">vmm_getFreeMallocPage</ref>(<ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref><sp/>count)<sp/>{</highlight></codeline>
<codeline lineno="493"><highlight class="normal"><sp/><sp/><ref refid="objgfx30_8h_1a81f3b46fa4ddd984830104840a08da82" kindref="member">uInt16</ref><sp/>x<sp/>=<sp/>0x0,<sp/>y<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="494"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageTableSrc<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="496"><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="497"><highlight class="normal"></highlight></codeline>
<codeline lineno="498"><highlight class="normal"><sp/><sp/>pageDirectory<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>;</highlight></codeline>
<codeline lineno="499"><highlight class="normal"></highlight></codeline>
<codeline lineno="500"><highlight class="normal"><sp/><sp/><ref refid="armv6_2spinlock_8c_1a71f03d2ba55111c715b6068254847a53" kindref="member">spinLock</ref>(&amp;fkpSpinLock);</highlight></codeline>
<codeline lineno="501"><highlight class="normal"></highlight></codeline>
<codeline lineno="502"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Lets<sp/>Search<sp/>For<sp/>A<sp/>Free<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="503"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(x<sp/>=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1ad6394b4f60e68fe4e1431fc4e1998957" kindref="member">VMM_KERN_START</ref>);<sp/>x<sp/>&lt;=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1a8204faafc0c27e418f993e07c2f59f14" kindref="member">VMM_KERN_END</ref>);<sp/>x++)<sp/>{</highlight></codeline>
<codeline lineno="504"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageDirectory[x]<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>)<sp/></highlight><highlight class="comment">/*<sp/>If<sp/>Page<sp/>Directory<sp/>Is<sp/>Not<sp/>Yet<sp/>Allocated<sp/>Allocate<sp/>It<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="505"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1acba8d9cc298370338bc5bea5187183b2" kindref="member">vmm_allocPageTable</ref>(x,<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>);</highlight></codeline>
<codeline lineno="506"><highlight class="normal"></highlight></codeline>
<codeline lineno="507"><highlight class="normal"><sp/><sp/><sp/><sp/>pageTableSrc<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/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/>x));</highlight></codeline>
<codeline lineno="508"><highlight class="normal"></highlight></codeline>
<codeline lineno="509"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(y<sp/>=<sp/>0;<sp/>y<sp/>&lt;<sp/>1024;<sp/>y++)<sp/>{</highlight></codeline>
<codeline lineno="510"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Loop<sp/>Through<sp/>The<sp/>Page<sp/>Table<sp/>Find<sp/>An<sp/>UnAllocated<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="511"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>pageTableSrc[y]<sp/>==<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="512"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(count<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="513"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(c<sp/>=<sp/>0;<sp/>c<sp/>&lt;<sp/>count;<sp/>c++)<sp/>{</highlight></codeline>
<codeline lineno="514"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y<sp/>+<sp/>c<sp/>&lt;<sp/>1024)<sp/>{</highlight></codeline>
<codeline lineno="515"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>pageTableSrc[y<sp/>+<sp/>c]<sp/>!=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="516"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>c<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="517"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="518"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="519"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="520"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="521"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(c<sp/>!=<sp/>-1)<sp/>{</highlight></codeline>
<codeline lineno="522"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(c<sp/>=<sp/>0;<sp/>c<sp/>&lt;<sp/>count;<sp/>c++)<sp/>{</highlight></codeline>
<codeline lineno="523"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>),<sp/>((x<sp/>*<sp/>0x400000)<sp/>+<sp/>((y<sp/>+<sp/>c)<sp/>*<sp/>0x1000)),<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="524"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;remap<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="525"><highlight class="normal"></highlight></codeline>
<codeline lineno="526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" kindref="member">vmm_clearVirtualPage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((x<sp/>*<sp/>0x400000)<sp/>+<sp/>((y<sp/>+<sp/>c)<sp/>*<sp/>0x1000)));</highlight></codeline>
<codeline lineno="527"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="528"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;fkpSpinLock);</highlight></codeline>
<codeline lineno="529"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>((</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<sp/>((x<sp/>*<sp/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/><ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref>))<sp/>+<sp/>(y<sp/>*<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>)));</highlight></codeline>
<codeline lineno="530"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="531"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="532"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Map<sp/>A<sp/>Physical<sp/>Page<sp/>To<sp/>The<sp/>Virtual<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="533"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/><ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>),<sp/>((x<sp/>*<sp/>0x400000)<sp/>+<sp/>(y<sp/>*<sp/>0x1000)),<sp/><ref refid="paging_8h_1a8b838cda4f0bc79ab8d07eb19dd35420" kindref="member">KERNEL_PAGE_DEFAULT</ref>,<sp/><ref refid="kmalloc_8h_1a81d09bc848b49133401b3efeeb65f1af" kindref="member">sysID</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="534"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="535"><highlight class="normal"></highlight></codeline>
<codeline lineno="536"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Clear<sp/>This<sp/>Page<sp/>So<sp/>No<sp/>Garbage<sp/>Is<sp/>There<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="537"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="paging_8c_1a8350aa43ff69829ba667ca34d9bcaa7a" kindref="member">vmm_clearVirtualPage</ref>((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>((x<sp/>*<sp/>0x400000)<sp/>+<sp/>(y<sp/>*<sp/>0x1000)));</highlight></codeline>
<codeline lineno="538"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>The<sp/>Address<sp/>Of<sp/>The<sp/>Newly<sp/>Allocate<sp/>Page<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="539"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;fkpSpinLock);</highlight></codeline>
<codeline lineno="540"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>((</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<sp/>((x<sp/>*<sp/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/><ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref>))<sp/>+<sp/>(y<sp/>*<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>)));</highlight></codeline>
<codeline lineno="541"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="542"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="543"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="544"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="545"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>If<sp/>No<sp/>Free<sp/>Page<sp/>Was<sp/>Found<sp/>Return<sp/>NULL<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="546" refid="paging_8c_1a6cdf3466734f2da5e258c9844d536295" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="armv6_2spinlock_8c_1ae29ab191c93f9ead066cb462dd2e7247" kindref="member">spinUnlock</ref>(&amp;fkpSpinLock);</highlight></codeline>
<codeline lineno="547"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="548"><highlight class="normal">}</highlight></codeline>
<codeline lineno="549"><highlight class="normal"></highlight></codeline>
<codeline lineno="550"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="paging_8c_1a6cdf3466734f2da5e258c9844d536295" kindref="member">obreak</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structthread" kindref="compound">thread</ref><sp/>*td,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structobreak__args" kindref="compound">obreak_args</ref><sp/>*uap)<sp/>{</highlight></codeline>
<codeline lineno="551"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>i<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="552"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1ad6f327965d9e330cd225ca2153ac0453" kindref="member">vm_offset_t</ref><sp/>old<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="553"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1ad6f327965d9e330cd225ca2153ac0453" kindref="member">vm_offset_t</ref><sp/>base<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="554"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1ad6f327965d9e330cd225ca2153ac0453" kindref="member">vm_offset_t</ref><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="555"><highlight class="normal"></highlight></codeline>
<codeline lineno="556"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="557"><highlight class="comment"><sp/><sp/><sp/>#ifdef<sp/>_VMM_DEBUG</highlight></codeline>
<codeline lineno="558"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="559"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;vm_offset_t:<sp/>[%i]\n&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(<ref refid="include_2sys_2types_8h_1ad6f327965d9e330cd225ca2153ac0453" kindref="member">vm_offset_t</ref>));</highlight></codeline>
<codeline lineno="560"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;nsize:<sp/><sp/><sp/><sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,<sp/>uap-&gt;<ref refid="structobreak__args_1ab30a3d3c9186553a40d1b6e7c5714fb4" kindref="member">nsize</ref>);</highlight></codeline>
<codeline lineno="561"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;vm_daddr:<sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,<sp/>td-&gt;<ref refid="structthread_1ae4165d082b98f27dab6bfeeefb76e060" kindref="member">vm_daddr</ref>);</highlight></codeline>
<codeline lineno="562"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;vm_dsize:<sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,<sp/>td-&gt;<ref refid="structthread_1ac5ce95b5be4422e5f5a61f081547d425" kindref="member">vm_dsize</ref>);</highlight></codeline>
<codeline lineno="563"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;total:<sp/><sp/><sp/><sp/>[0x%X]\n&quot;</highlight><highlight class="normal">,<sp/>td-&gt;<ref refid="structthread_1ae4165d082b98f27dab6bfeeefb76e060" kindref="member">vm_daddr</ref><sp/>+<sp/>td-&gt;<ref refid="structthread_1ac5ce95b5be4422e5f5a61f081547d425" kindref="member">vm_dsize</ref>);</highlight></codeline>
<codeline lineno="564"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="565"><highlight class="comment"><sp/><sp/><sp/>#endif</highlight></codeline>
<codeline lineno="566"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="567"><highlight class="normal"></highlight></codeline>
<codeline lineno="568"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>=<sp/><ref refid="paging_8h_1a2702263fcf2b3b026cb26c6d895cb0ee" kindref="member">round_page</ref>((<ref refid="include_2sys_2types_8h_1ad6f327965d9e330cd225ca2153ac0453" kindref="member">vm_offset_t</ref><sp/>)uap-&gt;<ref refid="structobreak__args_1ab30a3d3c9186553a40d1b6e7c5714fb4" kindref="member">nsize</ref>);</highlight></codeline>
<codeline lineno="569"><highlight class="normal"></highlight></codeline>
<codeline lineno="570"><highlight class="normal"><sp/><sp/>base<sp/>=<sp/><ref refid="paging_8h_1a2702263fcf2b3b026cb26c6d895cb0ee" kindref="member">round_page</ref>((<ref refid="include_2sys_2types_8h_1ad6f327965d9e330cd225ca2153ac0453" kindref="member">vm_offset_t</ref><sp/>)<sp/>td-&gt;<ref refid="structthread_1ae4165d082b98f27dab6bfeeefb76e060" kindref="member">vm_daddr</ref>);</highlight></codeline>
<codeline lineno="571"><highlight class="normal"></highlight></codeline>
<codeline lineno="572"><highlight class="normal"><sp/><sp/>old<sp/>=<sp/>base<sp/>+<sp/><ref refid="paging_8h_1a071caea8a82a06e754daca63317d3c07" kindref="member">ctob</ref>(td-&gt;<ref refid="structthread_1ac5ce95b5be4422e5f5a61f081547d425" kindref="member">vm_dsize</ref>);</highlight></codeline>
<codeline lineno="573"><highlight class="normal"></highlight></codeline>
<codeline lineno="574"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>&lt;<sp/>base)</highlight></codeline>
<codeline lineno="575"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;EINVAL&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="576"><highlight class="normal"></highlight></codeline>
<codeline lineno="577"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>&gt;<sp/>old)<sp/>{</highlight></codeline>
<codeline lineno="578"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>old;<sp/>i<sp/>&lt;<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal">;<sp/>i<sp/>+=<sp/>0x1000)<sp/>{</highlight></codeline>
<codeline lineno="579"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="paging_8c_1ad6c3897473d837504f3d1415fb8ab796" kindref="member">vmm_remapPage</ref>(<ref refid="vmm_8h_1ab8e4e189a7b1df2a03072ce5b75c89fe" kindref="member">vmm_findFreePage</ref>(<ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-&gt;<ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>),<sp/>i,<sp/><ref refid="paging_8h_1af0fff7a38cd2c7a32d580787423b94ea" kindref="member">PAGE_DEFAULT</ref>,<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-&gt;<ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>,<sp/>0)<sp/>==<sp/>0x0)</highlight></codeline>
<codeline lineno="580"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;remap<sp/>Failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="581"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="582"><highlight class="normal"><sp/><sp/><sp/><sp/>td-&gt;<ref refid="structthread_1ac5ce95b5be4422e5f5a61f081547d425" kindref="member">vm_dsize</ref><sp/>+=<sp/><ref refid="paging_8h_1a0851ee42f36c8a00e9eafe739c8ffaaa" kindref="member">btoc</ref>(</highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>-<sp/>old);</highlight></codeline>
<codeline lineno="583"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>&lt;<sp/>old)<sp/>{</highlight></codeline>
<codeline lineno="584"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1aa5193288597f00c4f8e3b2939aa6c0ce" kindref="member">K_PANIC</ref>(</highlight><highlight class="stringliteral">&quot;new<sp/>&lt;<sp/>old&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="585"><highlight class="normal"><sp/><sp/><sp/><sp/>td-&gt;<ref refid="structthread_1ac5ce95b5be4422e5f5a61f081547d425" kindref="member">vm_dsize</ref><sp/>-=<sp/><ref refid="paging_8h_1a0851ee42f36c8a00e9eafe739c8ffaaa" kindref="member">btoc</ref>(old<sp/>-<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="586"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="587" refid="paging_8c_1a43af6ffc41a9e9da3a15f10fb187266a" refkind="member"><highlight class="normal"></highlight></codeline>
<codeline lineno="588"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="589"><highlight class="normal">}</highlight></codeline>
<codeline lineno="590"><highlight class="normal"></highlight></codeline>
<codeline lineno="591"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="paging_8c_1a43af6ffc41a9e9da3a15f10fb187266a" kindref="member">vmm_cleanVirtualSpace</ref>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>addr)<sp/>{</highlight></codeline>
<codeline lineno="592"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>x<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="593"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>y<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="594"><highlight class="normal"></highlight></codeline>
<codeline lineno="595"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageTableSrc<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="596"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*pageDir<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="597"><highlight class="normal"></highlight></codeline>
<codeline lineno="598"><highlight class="normal"><sp/><sp/>pageDir<sp/>=<sp/>(<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>*)<sp/><ref refid="paging_8h_1a1b0f37794d3da1a86f1df77e503ed98f" kindref="member">PD_BASE_ADDR</ref>;</highlight></codeline>
<codeline lineno="599"><highlight class="normal"></highlight></codeline>
<codeline lineno="600"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(x<sp/>=<sp/>(addr<sp/>/<sp/>(<ref refid="paging_8h_1a91bd4c1c49996222f571b2f53ca00dc4" kindref="member">PD_ENTRIES</ref><sp/>*<sp/><ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref>));<sp/>x<sp/>&lt;=<sp/><ref refid="paging_8h_1ac96f9536624cb5d2e7634f37fa919c4c" kindref="member">PD_INDEX</ref>(<ref refid="vmm_8h_1a71bd5e4901787995ae8f9cc3e1a888f9" kindref="member">VMM_USER_END</ref>);<sp/>x++)<sp/>{</highlight></codeline>
<codeline lineno="601"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageDir[x]<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>)<sp/>{</highlight></codeline>
<codeline lineno="602"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pageTableSrc<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/>(<ref refid="paging_8h_1a7d467c1d283fdfa1f2081ba1e0d01b6e" kindref="member">PAGE_SIZE</ref><sp/>*<sp/>x));</highlight></codeline>
<codeline lineno="603"><highlight class="normal"></highlight></codeline>
<codeline lineno="604"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(y<sp/>=<sp/>0;<sp/>y<sp/>&lt;<sp/><ref refid="paging_8h_1adc9776583e54abf06ae7b99f1f3036a6" kindref="member">PT_ENTRIES</ref>;<sp/>y++)<sp/>{</highlight></codeline>
<codeline lineno="605"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTableSrc[y]<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>)<sp/>{</highlight></codeline>
<codeline lineno="606"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((pageTableSrc[y]<sp/>&amp;<sp/><ref refid="paging_8h_1a57d743cb60fe478f6720c42315e7e813" kindref="member">PAGE_COW</ref>)<sp/>==<sp/><ref refid="paging_8h_1a57d743cb60fe478f6720c42315e7e813" kindref="member">PAGE_COW</ref>)<sp/>{</highlight></codeline>
<codeline lineno="607"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="vmm_8h_1aafef303dc8f2c6ed7bcf171819579166" kindref="member">adjustCowCounter</ref>(((<ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref>)<sp/>pageTableSrc[y]<sp/>&amp;<sp/>0xFFFFF000),<sp/>-1);</highlight></codeline>
<codeline lineno="608"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pageTableSrc[y]<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="609"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="610"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="611"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>else<sp/>if<sp/>((pageTableSrc[y]<sp/>&amp;<sp/>PAGE_STACK)<sp/>==<sp/>PAGE_STACK)<sp/>{</highlight></codeline>
<codeline lineno="612"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>//TODO:<sp/>We<sp/>need<sp/>to<sp/>fix<sp/>this<sp/>so<sp/>we<sp/>can<sp/>clean<sp/>the<sp/>stack!</highlight></codeline>
<codeline lineno="613"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>//kprintf(&quot;Page<sp/>Stack!:<sp/>0x%X&quot;,<sp/>(x<sp/>*<sp/>0x400000)<sp/>+<sp/>(y<sp/>*<sp/>0x1000));</highlight></codeline>
<codeline lineno="614"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>//<sp/>pageTableSrc[y]<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="615"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>//MrOlsen<sp/>(2016-01-18)<sp/>NOTE:<sp/>WHat<sp/>should<sp/>I<sp/>Do<sp/>Here?<sp/>kprintf(<sp/>&quot;STACK:<sp/>(%i:%i)&quot;,<sp/>x,<sp/>y<sp/>);</highlight></codeline>
<codeline lineno="616"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="617"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="618"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="619"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="620"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>int<sp/>vmmMemoryMapIndex<sp/>=<sp/>((pageTableSrc[y]<sp/>&amp;<sp/>0xFFFFF000)<sp/>/<sp/>4096);</highlight></codeline>
<codeline lineno="621"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vmmMemoryMap[vmmMemoryMapIndex].cowCounter<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="622"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vmmMemoryMap[vmmMemoryMapIndex].pid<sp/>=<sp/>vmmID;</highlight></codeline>
<codeline lineno="623"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vmmMemoryMap[vmmMemoryMapIndex].status<sp/>=<sp/>memAvail;</highlight></codeline>
<codeline lineno="624"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>systemVitals-&gt;freePages++;</highlight></codeline>
<codeline lineno="625"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="626"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pageTableSrc[y]<sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="627"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="628"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="629"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="630"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="631"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="632"><highlight class="normal"></highlight></codeline>
<codeline lineno="633"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">asm</highlight><highlight class="normal">(</highlight></codeline>
<codeline lineno="634"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%cr3,%eax\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="635"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;movl<sp/>%eax,%cr3\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="636"><highlight class="normal"><sp/><sp/>);</highlight></codeline>
<codeline lineno="637"><highlight class="normal"></highlight></codeline>
<codeline lineno="638"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/>#ifdef<sp/>VMM_DEBUG</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="639"><highlight class="normal"><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Here!?&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="640"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/>#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="641"><highlight class="normal"></highlight></codeline>
<codeline lineno="642"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline>
<codeline lineno="643"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/vmm/paging.c"/>
  </compounddef>
</doxygen>
