:github_url: https://github.com/nyx-org/gaia


.. _program_listing_file_vm_vm_kernel.hpp:

Program Listing for File vm_kernel.hpp
======================================

|exhale_lsh| :ref:`Return to documentation for file <file_vm_vm_kernel.hpp>` (``vm/vm_kernel.hpp``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. code-block:: cpp

   /* SPDX-License-Identifier: BSD-2-Clause */
   #pragma once
   #include <lib/base.hpp>
   #include <vm/phys.hpp>
   #include <vm/vm.hpp>
   
   namespace Gaia::Vm {
   
   #define KERNEL_HEAP_BASE 0xffff810000000000
   #define KERNEL_HEAP_SIZE GIB(4)
   
   void vm_kernel_init();
   extern "C" void *vm_kernel_alloc(int npages, bool bootstrap = false);
   extern "C" void vm_kernel_free(void *ptr, int npages);
   
   void *vm_kernel_alloc_at_phys(size_t npages, uintptr_t phys);
   
   extern Space *kernel_space;
   
   } // namespace Gaia::Vm