The Pedigree Project
0.1
|
#include <gdt.h>
Classes | |
struct | segment_descriptor |
struct | tss_descriptor |
Public Member Functions | |
void | initialise (size_t processorCount) INITIALISATION_ONLY |
Static Public Member Functions | |
static X64GdtManager & | instance () |
static void | initialiseProcessor () INITIALISATION_ONLY |
Private Member Functions | |
X64GdtManager () INITIALISATION_ONLY | |
X64GdtManager (const X64GdtManager &) | |
X64GdtManager & | operator= (const X64GdtManager &) |
~X64GdtManager () | |
void | setSegmentDescriptor (size_t index, uint64_t base, uint32_t limit, uint8_t flags, uint8_t flags2) |
void | setTssDescriptor (size_t index, uint64_t base) INITIALISATION_ONLY |
void | initialiseTss (X64TaskStateSegment *pTss) INITIALISATION_ONLY |
void | initialiseDoubleFaultTss (X64TaskStateSegment *pTss) INITIALISATION_ONLY |
Static Private Member Functions | |
static void | loadSegmentRegisters () |
Private Attributes | |
struct X64GdtManager::segment_descriptor | PACKED |
segment_descriptor * | m_Gdt |
size_t | m_DescriptorCount |
Static Private Attributes | |
static X64GdtManager | m_Instance |
|
private |
The constructor
Definition at line 102 of file x64/gdt.cc.
Referenced by instance().
|
private |
Copy constructor
|
private |
The destructor
Definition at line 105 of file x64/gdt.cc.
Referenced by instance().
void X64GdtManager::initialise | ( | size_t | processorCount | ) |
Initialise the GDT
[in] | processorCount | the number of processors |
Definition at line 35 of file x64/gdt.cc.
References Dec, Hex, Processor::information(), initialiseTss(), m_DescriptorCount, m_Gdt, Processor::m_ProcessorInformation, NOTICE, setSegmentDescriptor(), and setTssDescriptor().
Referenced by instance().
|
static |
Initialises this processors GDTR
Definition at line 85 of file x64/gdt.cc.
References Processor::information(), loadSegmentRegisters(), m_DescriptorCount, m_Gdt, and m_Instance.
Referenced by instance().
|
private |
Readies a TSS for use.
[in] | pTss | the TSS to ready. |
Definition at line 127 of file x64/gdt.cc.
Referenced by initialise(), and instance().
|
inlinestatic |
Get the gdt manager instance
Definition at line 37 of file x64/gdt.h.
References INITIALISATION_ONLY, initialise(), initialiseProcessor(), initialiseTss(), loadSegmentRegisters(), m_Instance, operator=(), setSegmentDescriptor(), setTssDescriptor(), X64GdtManager(), and ~X64GdtManager().
|
staticprivate |
Load the new segment registers
Referenced by initialiseProcessor(), and instance().
|
private |
Assignment operator
Referenced by instance().
|
private |
Set up a segment descriptor
[in] | index | the descriptor index |
[in] | base | the base address |
[in] | limit | the size of the segment (either in bytes or in 4kb units) |
[in] | flags | the flags |
[in] | flags2 | additional flags |
Definition at line 109 of file x64/gdt.cc.
References X64GdtManager::segment_descriptor::base0, X64GdtManager::segment_descriptor::base1, X64GdtManager::segment_descriptor::base2, X64GdtManager::segment_descriptor::flags, X64GdtManager::segment_descriptor::flags_limit1, X64GdtManager::segment_descriptor::limit0, and m_Gdt.
Referenced by initialise(), instance(), and setTssDescriptor().
|
private |
Set up a task-state-segment descriptor
[in] | index | the descriptor index |
[in] | base | the base address |
Definition at line 119 of file x64/gdt.cc.
References X64GdtManager::tss_descriptor::base3, m_Gdt, X64GdtManager::tss_descriptor::res, and setSegmentDescriptor().
Referenced by initialise(), and instance().
|
private |
The number of descriptors in the Gdt
Definition at line 116 of file x64/gdt.h.
Referenced by initialise(), and initialiseProcessor().
|
private |
The Gdt
Definition at line 114 of file x64/gdt.h.
Referenced by initialise(), initialiseProcessor(), setSegmentDescriptor(), and setTssDescriptor().
|
staticprivate |
The instance of the gdt manager
Definition at line 119 of file x64/gdt.h.
Referenced by initialiseProcessor(), and instance().