XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
paging.cpp File Reference
#include "physm.h"
#include "paging.h"
#include "lowlevel.h"
#include "xnldr.h"
#include "xnout.h"
Include dependency graph for paging.cpp:

Classes

struct  mapping_table
 

Macros

#define PAGING_PRESENT   0x1
 
#define PAGING_WRITABLE   0x2
 
#define PAGING_NOCACHE   0x10
 
#define PAGING_XENEVA_NOSWAP   0x200
 
#define PAGING_SIZEBIT   0x80
 
#define PAGING_NXE   0x8000000000000000
 
#define PAGE_ADDR_MASK   0x000ffffffffff000
 
#define PAGING_USER   (1<<2)
 

Typedefs

typedef size_t PD_ENTRY
 
typedef size_t PTAB_ENTRY
 
typedef size_t PDPT_ENTRY
 
typedef size_t PML4_ENTRY
 
typedef size_t *(* get_tab_ptr) (void *)
 
typedef size_t(* get_tab_index) (void *)
 

Functions

void identity_map_4kb (uint64_t logical)
 
void XEInitialisePaging ()
 
bool XEPagingMap_ (void *vaddr, paddr_t paddr, size_t attributes)
 
bool check_free (int level, void *start_addr, void *end_addr)
 
bool XEPagingMap (void *vaddr, paddr_t paddr, size_t length, size_t attributes)
 
void set_paging_attributes (void *vaddr, size_t length, size_t attrset, size_t attrclear)
 
size_t arch_get_recursive_slot ()
 
void * arch_get_pml4ptr ()
 
void fill_arch_paging_info (void *info)
 
bool check_free (void *vaddr, size_t length)
 

Variables

void * pdptr
 
void * pml4ptr
 
size_t recursive_slot
 
uint64_t pml4e [512]
 

Macro Definition Documentation

◆ PAGE_ADDR_MASK

#define PAGE_ADDR_MASK   0x000ffffffffff000

◆ PAGING_NOCACHE

#define PAGING_NOCACHE   0x10

◆ PAGING_NXE

#define PAGING_NXE   0x8000000000000000

◆ PAGING_PRESENT

#define PAGING_PRESENT   0x1

◆ PAGING_SIZEBIT

#define PAGING_SIZEBIT   0x80

◆ PAGING_USER

#define PAGING_USER   (1<<2)

◆ PAGING_WRITABLE

#define PAGING_WRITABLE   0x2

◆ PAGING_XENEVA_NOSWAP

#define PAGING_XENEVA_NOSWAP   0x200

Typedef Documentation

◆ get_tab_index

typedef size_t(* get_tab_index) (void *)

◆ get_tab_ptr

typedef size_t *(* get_tab_ptr) (void *)

◆ PD_ENTRY

typedef size_t PD_ENTRY

◆ PDPT_ENTRY

typedef size_t PDPT_ENTRY

◆ PML4_ENTRY

typedef size_t PML4_ENTRY

◆ PTAB_ENTRY

typedef size_t PTAB_ENTRY

Function Documentation

◆ arch_get_pml4ptr()

void * arch_get_pml4ptr ( )

◆ arch_get_recursive_slot()

size_t arch_get_recursive_slot ( )

◆ check_free() [1/2]

bool check_free ( int  level,
void *  start_addr,
void *  end_addr 
)

◆ check_free() [2/2]

bool check_free ( void *  vaddr,
size_t  length 
)

◆ fill_arch_paging_info()

void fill_arch_paging_info ( void *  info)

◆ identity_map_4kb()

void identity_map_4kb ( uint64_t  logical)

◆ set_paging_attributes()

void set_paging_attributes ( void *  vaddr,
size_t  length,
size_t  attrset,
size_t  attrclear 
)

◆ XEInitialisePaging()

void XEInitialisePaging ( )

◆ XEPagingMap()

bool XEPagingMap ( void *  vaddr,
paddr_t  paddr,
size_t  length,
size_t  attributes 
)

◆ XEPagingMap_()

bool XEPagingMap_ ( void *  vaddr,
paddr_t  paddr,
size_t  attributes 
)

Variable Documentation

◆ pdptr

void* pdptr

BSD 2-Clause License

Copyright (c) 2023-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ pml4e

uint64_t pml4e[512]

◆ pml4ptr

void* pml4ptr

◆ recursive_slot

size_t recursive_slot