Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
acpi.cpp File Reference
#include "precompiled.h"
#include "lib/sysdep/os/win/acpi.h"
#include "lib/byte_order.h"
#include "lib/module_init.h"
#include "lib/sysdep/os/win/wfirmware.h"
#include <atomic>
Include dependency graph for acpi.cpp:

Typedefs

typedef const volatile u8PCV_u8
 
typedef const volatile AcpiTablePCV_AcpiTable
 

Functions

static AcpiTableAllocateTable (size_t size)
 
template<typename T >
static void DeallocateTable (const T *table)
 
static u8 ComputeChecksum (PCV_u8 buf, size_t numBytes)
 
static bool ValidateTable (const AcpiTable *table, const char *signature=0)
 
static void AllocateAndCopyTables (std::atomic< const AcpiTable ** > &tables, size_t &numTables)
 
void acpi_Shutdown ()
 invalidates all pointers returned by acpi_GetTable. More...
 
const AcpiTableacpi_GetTable (const char *signature)
 

Variables

static std::atomic< const AcpiTable ** > tables { nullptr }
 
static const AcpiTableinvalidTables
 
static size_t numTables
 

Typedef Documentation

◆ PCV_AcpiTable

typedef const volatile AcpiTable* PCV_AcpiTable

◆ PCV_u8

typedef const volatile u8* PCV_u8

Function Documentation

◆ acpi_GetTable()

const AcpiTable * acpi_GetTable ( const char *  signature)
Parameters
signaturee.g. "RSDT"
Returns
pointer to internal storage (valid until acpi_Shutdown())

note: the first call may be slow, e.g. if a kernel-mode driver is loaded. subsequent requests will be faster since tables are cached.

◆ acpi_Shutdown()

void acpi_Shutdown ( )

invalidates all pointers returned by acpi_GetTable.

◆ AllocateAndCopyTables()

static void AllocateAndCopyTables ( std::atomic< const AcpiTable ** > &  tables,
size_t &  numTables 
)
static

◆ AllocateTable()

static AcpiTable * AllocateTable ( size_t  size)
static

◆ ComputeChecksum()

static u8 ComputeChecksum ( PCV_u8  buf,
size_t  numBytes 
)
static

◆ DeallocateTable()

template<typename T >
static void DeallocateTable ( const T table)
static

◆ ValidateTable()

static bool ValidateTable ( const AcpiTable table,
const char *  signature = 0 
)
static

Variable Documentation

◆ invalidTables

const AcpiTable* invalidTables
static

◆ numTables

size_t numTables
static

◆ tables

std::atomic<const AcpiTable**> tables { nullptr }
static