StuBS
ACPI Namespace Reference

Abstracts the ACPI standard that provides interfaces for hardware detection, device configuration, and energy management. More...

Namespaces

namespace  MADS
 

Classes

struct  Address
 ACPI address format. More...
 

Enumerations

enum class  AddressSpace : uint8_t {
  MEMORY = 0x0 ,
  IO = 0x1
}
 

Functions

static int checksum (const void *pos, unsigned len)
 
static const RSDPfindRSDP (const void *pos, unsigned len)
 
bool init ()
 Initialize the ACPI description table.
 
unsigned count ()
 Number of entries in the description table.
 
SDTHget (unsigned num)
 Get entry of description table by index.
 
SDTHget (char a, char b, char c, char d)
 Get entry of description table by four character identifier.
 
int revision ()
 Retrieve the revision from the Root System Description Pointer (RSDP)
 

Constants

static RSDPrsdp = 0
 
static RSDTrsdt = 0
 
static XSDTxsdt = 0
 
const char * RSDP_SIGNATURE = "RSD PTR "
 

Detailed Description

Abstracts the ACPI standard that provides interfaces for hardware detection, device configuration, and energy management.

ACPI is the successor to APM (Advanced Power Management), aiming to give the operating system more control over the hardware. This extended control, for instance, enables the operating system to assign a particular amount of energy to every device (e.g., by disabling a device or changing to standby mode). For this purpose, BIOS and chipset provide a set of tables that describe the system and its components and provide routines the OS can call. These tables contain details about the system, such as the number of CPU cores and the LAPIC/IOAPIC, which are determined during system boot.

Enumeration Type Documentation

◆ AddressSpace

enum class ACPI::AddressSpace : uint8_t
strong
Enumerator
MEMORY 
IO 

Function Documentation

◆ checksum()

static int ACPI::checksum ( const void *  pos,
unsigned  len 
)
static

◆ findRSDP()

static const RSDP * ACPI::findRSDP ( const void *  pos,
unsigned  len 
)
static

◆ init()

bool ACPI::init ( )

Initialize the ACPI description table.

Searches physical memory ranges o 16-byte boundaries for a valid Root System Description Pointer (RSDP) structure signature and checksum. If present, the superseding Extended System Description Table (XSDT) is used.

See also
ACPI-Specification 5.2.5 Root System Description Pointer (RSDP)
ACPI-Specification 5.2.8 Extended System Description Table (XSDT)

◆ count()

unsigned ACPI::count ( )

Number of entries in the description table.

◆ get() [1/2]

SDTH * ACPI::get ( unsigned  num)

Get entry of description table by index.

Parameters
numindex in description table
Returns
Pointer to corresponding entry or nullptr if not available

◆ get() [2/2]

SDTH * ACPI::get ( char  a,
char  b,
char  c,
char  d 
)

Get entry of description table by four character identifier.

Parameters
afirst character of identifier
bsecond character of identifier
cthird character of identifier
dforth and last character of identifier
Returns
Pointer to corresponding entry or nullptr if not available

◆ revision()

int ACPI::revision ( )

Retrieve the revision from the Root System Description Pointer (RSDP)

Constant Documentation

◆ rsdp

RSDP* ACPI::rsdp = 0
static

◆ rsdt

RSDT* ACPI::rsdt = 0
static

◆ xsdt

XSDT* ACPI::xsdt = 0
static

◆ RSDP_SIGNATURE

const char* ACPI::RSDP_SIGNATURE = "RSD PTR "