The Pedigree Project  0.1
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
X64GdtManager Class Reference

#include <gdt.h>

+ Collaboration diagram for X64GdtManager:

Classes

struct  segment_descriptor
 
struct  tss_descriptor
 

Public Member Functions

void initialise (size_t processorCount) INITIALISATION_ONLY
 

Static Public Member Functions

static X64GdtManagerinstance ()
 
static void initialiseProcessor () INITIALISATION_ONLY
 

Private Member Functions

 X64GdtManager () INITIALISATION_ONLY
 
 X64GdtManager (const X64GdtManager &)
 
X64GdtManageroperator= (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_descriptorm_Gdt
 
size_t m_DescriptorCount
 

Static Private Attributes

static X64GdtManager m_Instance
 

Detailed Description

The GDT manager on x64 processors

Definition at line 32 of file x64/gdt.h.

Constructor & Destructor Documentation

X64GdtManager::X64GdtManager ( )
private

The constructor

Definition at line 102 of file x64/gdt.cc.

Referenced by instance().

+ Here is the caller graph for this function:

X64GdtManager::X64GdtManager ( const X64GdtManager )
private

Copy constructor

Note
NOT implemented
X64GdtManager::~X64GdtManager ( )
private

The destructor

Definition at line 105 of file x64/gdt.cc.

Referenced by instance().

+ Here is the caller graph for this function:

Member Function Documentation

void X64GdtManager::initialise ( size_t  processorCount)

Initialise the GDT

Parameters
[in]processorCountthe number of processors
Note
This should only be called from initialiseProcessor2()

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().

+ Here is the caller graph for this function:

void X64GdtManager::initialiseProcessor ( )
static

Initialises this processors GDTR

Note
This should only be called from initialiseProcessor2()
Todo:
and some smp/acpi function

Definition at line 85 of file x64/gdt.cc.

References Processor::information(), loadSegmentRegisters(), m_DescriptorCount, m_Gdt, and m_Instance.

Referenced by instance().

+ Here is the caller graph for this function:

void X64GdtManager::initialiseTss ( X64TaskStateSegment pTss)
private

Readies a TSS for use.

Parameters
[in]pTssthe TSS to ready.
Todo:
this should change

Definition at line 127 of file x64/gdt.cc.

Referenced by initialise(), and instance().

+ Here is the caller graph for this function:

static X64GdtManager& X64GdtManager::instance ( )
inlinestatic

Get the gdt manager instance

Returns
instance of the gdt manager

Definition at line 37 of file x64/gdt.h.

References INITIALISATION_ONLY, initialise(), initialiseProcessor(), initialiseTss(), loadSegmentRegisters(), m_Instance, operator=(), setSegmentDescriptor(), setTssDescriptor(), X64GdtManager(), and ~X64GdtManager().

static void X64GdtManager::loadSegmentRegisters ( )
staticprivate

Load the new segment registers

Note
This function is implemented in asm/gdt.s

Referenced by initialiseProcessor(), and instance().

+ Here is the caller graph for this function:

X64GdtManager& X64GdtManager::operator= ( const X64GdtManager )
private

Assignment operator

Note
NOT implemented

Referenced by instance().

+ Here is the caller graph for this function:

void X64GdtManager::setSegmentDescriptor ( size_t  index,
uint64_t  base,
uint32_t  limit,
uint8_t  flags,
uint8_t  flags2 
)
private

Set up a segment descriptor

Parameters
[in]indexthe descriptor index
[in]basethe base address
[in]limitthe size of the segment (either in bytes or in 4kb units)
[in]flagsthe flags
[in]flags2additional 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().

+ Here is the caller graph for this function:

void X64GdtManager::setTssDescriptor ( size_t  index,
uint64_t  base 
)
private

Set up a task-state-segment descriptor

Parameters
[in]indexthe descriptor index
[in]basethe 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().

+ Here is the caller graph for this function:

Member Data Documentation

size_t X64GdtManager::m_DescriptorCount
private

The number of descriptors in the Gdt

Definition at line 116 of file x64/gdt.h.

Referenced by initialise(), and initialiseProcessor().

segment_descriptor* X64GdtManager::m_Gdt
private

The Gdt

Definition at line 114 of file x64/gdt.h.

Referenced by initialise(), initialiseProcessor(), setSegmentDescriptor(), and setTssDescriptor().

X64GdtManager X64GdtManager::m_Instance
staticprivate

The instance of the gdt manager

Definition at line 119 of file x64/gdt.h.

Referenced by initialiseProcessor(), and instance().


The documentation for this class was generated from the following files: