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
IntelIommu Class Reference
+ Collaboration diagram for IntelIommu:

Classes

struct  Domain
 

Public Member Functions

bool attach (Device *device, bool isolated=false)
 
bool detachIsolated (Device *device, bool requesterDisabled=false)
 
bool isolatedIdle (Device *device) const
 
bool attached (const Device *device) const
 
bool isolated (const Device *device) const
 
bool mapPage (Device *device, physical_uintptr_t physical, uint32_t &dmaAddress, uint16_t &token)
 
void unmapPage (Device *device, uint16_t token)
 

Static Public Member Functions

static IntelIommu & instance ()
 

Private Member Functions

bool initialise ()
 
bool allocateTable (physical_uintptr_t &page)
 
bool makeDomain (Domain &domain)
 
void freeDomain (Domain &domain)
 
bool invalidateContext ()
 
bool invalidateIotlb ()
 
bool command (uint32_t bit, bool set)
 
bool waitForStatus (uint32_t bit, bool set)
 
void flushLines (const void *address, size_t bytes) const
 
void logFault ()
 
Domain * findDomain (const Device *device)
 
const Domain * findDomain (const Device *device) const
 

Static Private Member Functions

static uint64_t * tokenEntry (const Domain &domain, size_t slot)
 

Private Attributes

Mutex m_Lock
 
MemoryMappedIo m_Registers
 
MemoryRegion m_ReservedTokens
 
physical_uintptr_t m_Root = 0
 
physical_uintptr_t m_DefaultContext = 0
 
physical_uintptr_t m_BusContexts [256] = {}
 
Domain m_Domains [MaxDomains]
 
size_t m_IotlbOffset = 0
 
uint64_t m_MaxPhysical = 0
 
uint8_t m_Aw = 0
 
uint8_t m_PassThroughAw = 0
 
size_t m_CacheLine = 64
 
bool m_Coherent = false
 
bool m_Enabled = false
 
bool m_Failed = false
 

Static Private Attributes

static constexpr size_t MaxDomains = 8
 
static constexpr size_t TokenPages = 32
 
static constexpr size_t IsolatedTokenPages = 1024
 
static constexpr uint32_t IsolatedTokenBase = 0x10000000U
 

Detailed Description

Definition at line 12 of file IntelIommu.h.

Constructor & Destructor Documentation

◆ IntelIommu()

IntelIommu::IntelIommu ( )
private

Definition at line 73 of file IntelIommu.cc.

Member Function Documentation

◆ allocateTable()

bool IntelIommu::allocateTable ( physical_uintptr_t &  page)
private

Definition at line 90 of file IntelIommu.cc.

◆ attach()

bool IntelIommu::attach ( Device *  device,
bool  isolated = false 
)

Definition at line 384 of file IntelIommu.cc.

◆ attached()

bool IntelIommu::attached ( const Device *  device) const

Definition at line 530 of file IntelIommu.cc.

◆ command()

bool IntelIommu::command ( uint32_t  bit,
bool  set 
)
private

Definition at line 114 of file IntelIommu.cc.

◆ detachIsolated()

bool IntelIommu::detachIsolated ( Device *  device,
bool  requesterDisabled = false 
)

Definition at line 489 of file IntelIommu.cc.

◆ findDomain() [1/2]

IntelIommu::Domain * IntelIommu::findDomain ( const Device *  device)
private

Definition at line 366 of file IntelIommu.cc.

◆ findDomain() [2/2]

const IntelIommu::Domain * IntelIommu::findDomain ( const Device *  device) const
private

Definition at line 375 of file IntelIommu.cc.

◆ flushLines()

void IntelIommu::flushLines ( const void *  address,
size_t  bytes 
) const
private

Definition at line 76 of file IntelIommu.cc.

◆ freeDomain()

void IntelIommu::freeDomain ( Domain &  domain)
private

Definition at line 274 of file IntelIommu.cc.

◆ initialise()

bool IntelIommu::initialise ( )
private

Definition at line 147 of file IntelIommu.cc.

◆ instance()

IntelIommu & IntelIommu::instance ( )
static

Definition at line 68 of file IntelIommu.cc.

◆ invalidateContext()

bool IntelIommu::invalidateContext ( )
private

Definition at line 123 of file IntelIommu.cc.

◆ invalidateIotlb()

bool IntelIommu::invalidateIotlb ( )
private

Definition at line 135 of file IntelIommu.cc.

◆ isolated()

bool IntelIommu::isolated ( const Device *  device) const

Definition at line 535 of file IntelIommu.cc.

◆ isolatedIdle()

bool IntelIommu::isolatedIdle ( Device *  device) const

Definition at line 471 of file IntelIommu.cc.

◆ logFault()

void IntelIommu::logFault ( )
private

Definition at line 614 of file IntelIommu.cc.

◆ makeDomain()

bool IntelIommu::makeDomain ( Domain &  domain)
private

Definition at line 281 of file IntelIommu.cc.

◆ mapPage()

bool IntelIommu::mapPage ( Device *  device,
physical_uintptr_t  physical,
uint32_t &  dmaAddress,
uint16_t &  token 
)

Definition at line 541 of file IntelIommu.cc.

◆ tokenEntry()

uint64_t * IntelIommu::tokenEntry ( const Domain &  domain,
size_t  slot 
)
staticprivate

Definition at line 355 of file IntelIommu.cc.

◆ unmapPage()

void IntelIommu::unmapPage ( Device *  device,
uint16_t  token 
)

Definition at line 589 of file IntelIommu.cc.

◆ waitForStatus()

bool IntelIommu::waitForStatus ( uint32_t  bit,
bool  set 
)
private

Definition at line 104 of file IntelIommu.cc.

Member Data Documentation

◆ IsolatedTokenBase

constexpr uint32_t IntelIommu::IsolatedTokenBase = 0x10000000U
staticconstexprprivate

Definition at line 29 of file IntelIommu.h.

◆ IsolatedTokenPages

constexpr size_t IntelIommu::IsolatedTokenPages = 1024
staticconstexprprivate

Definition at line 28 of file IntelIommu.h.

◆ m_Aw

uint8_t IntelIommu::m_Aw = 0
private

Definition at line 69 of file IntelIommu.h.

◆ m_BusContexts

physical_uintptr_t IntelIommu::m_BusContexts[256] = {}
private

Definition at line 65 of file IntelIommu.h.

◆ m_CacheLine

size_t IntelIommu::m_CacheLine = 64
private

Definition at line 71 of file IntelIommu.h.

◆ m_Coherent

bool IntelIommu::m_Coherent = false
private

Definition at line 72 of file IntelIommu.h.

◆ m_DefaultContext

physical_uintptr_t IntelIommu::m_DefaultContext = 0
private

Definition at line 64 of file IntelIommu.h.

◆ m_Domains

Domain IntelIommu::m_Domains[MaxDomains]
private

Definition at line 66 of file IntelIommu.h.

◆ m_Enabled

bool IntelIommu::m_Enabled = false
private

Definition at line 73 of file IntelIommu.h.

◆ m_Failed

bool IntelIommu::m_Failed = false
private

Definition at line 74 of file IntelIommu.h.

◆ m_IotlbOffset

size_t IntelIommu::m_IotlbOffset = 0
private

Definition at line 67 of file IntelIommu.h.

◆ m_Lock

Mutex IntelIommu::m_Lock
mutableprivate

Definition at line 60 of file IntelIommu.h.

◆ m_MaxPhysical

uint64_t IntelIommu::m_MaxPhysical = 0
private

Definition at line 68 of file IntelIommu.h.

◆ m_PassThroughAw

uint8_t IntelIommu::m_PassThroughAw = 0
private

Definition at line 70 of file IntelIommu.h.

◆ m_Registers

MemoryMappedIo IntelIommu::m_Registers
private

Definition at line 61 of file IntelIommu.h.

◆ m_ReservedTokens

MemoryRegion IntelIommu::m_ReservedTokens
private

Definition at line 62 of file IntelIommu.h.

◆ m_Root

physical_uintptr_t IntelIommu::m_Root = 0
private

Definition at line 63 of file IntelIommu.h.

◆ MaxDomains

constexpr size_t IntelIommu::MaxDomains = 8
staticconstexprprivate

Definition at line 25 of file IntelIommu.h.

◆ TokenPages

constexpr size_t IntelIommu::TokenPages = 32
staticconstexprprivate

Definition at line 27 of file IntelIommu.h.


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