Xyris  0.5
Memory.i686.hpp File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
+ Include dependency graph for Memory.i686.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Frame
 
struct  Page
 
struct  TableEntry
 
struct  Table
 
struct  DirectoryEntry
 
struct  Directory
 

Macros

#define ARCH_PAGE_DIR_ENTRIES   1024
 
#define ARCH_PAGE_TABLE_ENTRIES   1024
 
#define ARCH_PAGE_SIZE   4096
 
#define ARCH_PAGE_ALIGN   0xFFFFF000
 
#define ARCH_PAGE_DIR_ENTRY_SHIFT   22
 
#define ARCH_PAGE_TABLE_ENTRY_SHIFT   12
 
#define ARCH_PAGE_TABLE_ENTRY_MASK   0x3ff
 

Functions

 __attribute__ ((always_inline)) static inline void setPageDirectory(uintptr_t pageDirPtr)
 

Detailed Description

i686 memory structures and definitions. C & C++ compatible header.

Author
Keeton Feavel (keeto.nosp@m.n@xy.nosp@m.r.is)
Version
0.1
Date
2021-10-26

Definition in file Memory.i686.hpp.

Macro Definition Documentation

◆ ARCH_PAGE_ALIGN

#define ARCH_PAGE_ALIGN   0xFFFFF000

Definition at line 22 of file Memory.i686.hpp.

◆ ARCH_PAGE_DIR_ENTRIES

#define ARCH_PAGE_DIR_ENTRIES   1024

Definition at line 19 of file Memory.i686.hpp.

◆ ARCH_PAGE_DIR_ENTRY_SHIFT

#define ARCH_PAGE_DIR_ENTRY_SHIFT   22

Definition at line 23 of file Memory.i686.hpp.

◆ ARCH_PAGE_SIZE

#define ARCH_PAGE_SIZE   4096

Definition at line 21 of file Memory.i686.hpp.

◆ ARCH_PAGE_TABLE_ENTRIES

#define ARCH_PAGE_TABLE_ENTRIES   1024

Definition at line 20 of file Memory.i686.hpp.

◆ ARCH_PAGE_TABLE_ENTRY_MASK

#define ARCH_PAGE_TABLE_ENTRY_MASK   0x3ff

Definition at line 25 of file Memory.i686.hpp.

◆ ARCH_PAGE_TABLE_ENTRY_SHIFT

#define ARCH_PAGE_TABLE_ENTRY_SHIFT   12

Definition at line 24 of file Memory.i686.hpp.

Function Documentation

◆ __attribute__()

__attribute__ ( (always_inline)  )

Writes the address of the page directory to CR3. Does not enable paging.

Parameters
pageDirPtrAddress of page directory structure to be used

Definition at line 213 of file Memory.i686.hpp.

215 {
216  asm volatile(
217  "mov %0, %%cr3"
218  :
219  : "b" (pageDirPtr)
220  : "memory"
221  );
222 }