Xyris  0.5
Memory::Section Class Reference

#include <MemorySection.hpp>

Public Member Functions

 Section ()
 
 Section (const uintptr_t base, const uintptr_t end)
 
 Section (const uintptr_t base, const uintptr_t end, const Type type)
 
bool initialized ()
 
uintptr_t base ()
 
uintptr_t end ()
 
uintptr_t size ()
 
uintptr_t pages ()
 
enum Type type ()
 
const char * typeString ()
 
void setType (enum Type type)
 
bool empty ()
 
bool contains (uintptr_t addr)
 

Private Attributes

uintptr_t m_base
 
uintptr_t m_end
 
enum Type m_type
 

Detailed Description

Definition at line 29 of file MemorySection.hpp.

Constructor & Destructor Documentation

◆ Section() [1/3]

Memory::Section::Section ( )
inline

Definition at line 31 of file MemorySection.hpp.

32  : m_base(0)
33  , m_end(0)
34  , m_type(Unknown)
35  {
36  }

◆ Section() [2/3]

Memory::Section::Section ( const uintptr_t  base,
const uintptr_t  end 
)
inline

Definition at line 38 of file MemorySection.hpp.

39  : m_base(base)
40  , m_end(end)
41  , m_type(Unknown)
42  {
43  }

◆ Section() [3/3]

Memory::Section::Section ( const uintptr_t  base,
const uintptr_t  end,
const Type  type 
)
inline

Definition at line 45 of file MemorySection.hpp.

46  : m_base(base)
47  , m_end(end)
48  , m_type(type)
49  {
50  }

Member Function Documentation

◆ base()

uintptr_t Memory::Section::base ( )
inline

Definition at line 57 of file MemorySection.hpp.

58  {
59  return m_base;
60  }
+ Here is the caller graph for this function:

◆ contains()

bool Memory::Section::contains ( uintptr_t  addr)
inline

Definition at line 116 of file MemorySection.hpp.

117  {
118  return end() >= addr && addr <= base();
119  }
+ Here is the call graph for this function:

◆ empty()

bool Memory::Section::empty ( )
inline

Definition at line 111 of file MemorySection.hpp.

112  {
113  return size() == 0;
114  }
+ Here is the call graph for this function:

◆ end()

uintptr_t Memory::Section::end ( )
inline

Definition at line 62 of file MemorySection.hpp.

63  {
64  return m_end;
65  }
+ Here is the caller graph for this function:

◆ initialized()

bool Memory::Section::initialized ( )
inline

Definition at line 52 of file MemorySection.hpp.

53  {
54  return m_base && size();
55  }
+ Here is the call graph for this function:

◆ pages()

uintptr_t Memory::Section::pages ( )
inline

Definition at line 72 of file MemorySection.hpp.

73  {
74  return size() / ARCH_PAGE_SIZE;
75  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setType()

void Memory::Section::setType ( enum Type  type)
inline

Definition at line 106 of file MemorySection.hpp.

107  {
108  m_type = type;
109  }
+ Here is the call graph for this function:

◆ size()

uintptr_t Memory::Section::size ( )
inline

Definition at line 67 of file MemorySection.hpp.

68  {
69  return m_end - m_base;
70  }
+ Here is the caller graph for this function:

◆ type()

enum Type Memory::Section::type ( )
inline

Definition at line 77 of file MemorySection.hpp.

78  {
79  return m_type;
80  }
+ Here is the caller graph for this function:

◆ typeString()

const char* Memory::Section::typeString ( )
inline

Definition at line 82 of file MemorySection.hpp.

83  {
84  switch (type()) {
85  case Available:
86  return "Available";
87  case Reserved:
88  return "Reserved";
89  case ACPI:
90  return "ACPI";
91  case NVS:
92  return "NVS";
93  case Bad:
94  return "Bad";
95  case Bootloader:
96  return "Bootloader";
97  case Kernel:
98  return "Kernel";
99  case Unknown:
100  return "Unknown";
101  default:
102  return "Invalid!";
103  }
104  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ m_base

uintptr_t Memory::Section::m_base
private

Definition at line 122 of file MemorySection.hpp.

◆ m_end

uintptr_t Memory::Section::m_end
private

Definition at line 123 of file MemorySection.hpp.

◆ m_type

enum Type Memory::Section::m_type
private

Definition at line 124 of file MemorySection.hpp.


The documentation for this class was generated from the following file:
Memory::ACPI
@ ACPI
Definition: MemorySection.hpp:21
Memory::Section::m_base
uintptr_t m_base
Definition: MemorySection.hpp:122
Memory::Section::type
enum Type type()
Definition: MemorySection.hpp:77
Memory::Section::size
uintptr_t size()
Definition: MemorySection.hpp:67
Memory::NVS
@ NVS
Definition: MemorySection.hpp:22
Memory::Bad
@ Bad
Definition: MemorySection.hpp:23
Memory::Reserved
@ Reserved
Definition: MemorySection.hpp:20
Memory::Section::m_end
uintptr_t m_end
Definition: MemorySection.hpp:123
Memory::Section::m_type
enum Type m_type
Definition: MemorySection.hpp:124
Memory::Section::base
uintptr_t base()
Definition: MemorySection.hpp:57
Memory::Section::end
uintptr_t end()
Definition: MemorySection.hpp:62
ARCH_PAGE_SIZE
#define ARCH_PAGE_SIZE
Definition: Memory.i686.hpp:21
Memory::Kernel
@ Kernel
Definition: MemorySection.hpp:25
Memory::Available
@ Available
Definition: MemorySection.hpp:19
Memory::Unknown
@ Unknown
Definition: MemorySection.hpp:26
Memory::Bootloader
@ Bootloader
Definition: MemorySection.hpp:24