PatchworkOS  a7b3d61
A non-POSIX operating system.
Loading...
Searching...
No Matches
Tables

System Description Tables. More...

Collaboration diagram for Tables:

Detailed Description

System Description Tables.

This module defines the ACPI tables found in the ACPI specification, tables defined outside of the specification, for example, MCFG is defined in their own files.

Data Structures

struct  fadt_gas_t
 FADT generic Address. More...
 
struct  fadt_t
 Fixed ACPI Description Table. More...
 
struct  interrupt_controller_header_t
 
struct  processor_local_apic_t
 Processor Local APIC. More...
 
struct  ioapic_t
 IO APIC. More...
 
struct  madt_t
 Multiple APIC Description Table. More...
 
struct  dsdt_t
 Differentiated System Description Table. More...
 
struct  ssdt_t
 Secondary System Description Table. More...
 
struct  acpi_cached_table_t
 Cached ACPI table. More...
 
struct  madt_interrupt_controller_header_t
 MADT Interrupt Controller Header. More...
 

Macros

#define FADT_SIGNATURE   "FACP"
 FADT table signature.
 
#define MADT_FLAG_PCAT_COMPAT   ((madt_flags_t)(1 << 0))
 
#define INTERRUPT_CONTROLLER_PROCESSOR_LOCAL_APIC   ((interrupt_controller_type_t)0)
 
#define INTERRUPT_CONTROLLER_IO_APIC   ((interrupt_controller_type_t)1)
 
#define PROCESSOR_LOCAL_APIC_ENABLED   (1 << 0)
 
#define PROCESSOR_LOCAL_APIC_ONLINE_CAPABLE   (1 << 1)
 
#define MADT_FOR_EACH(madt, ic)
 Iterate over all MADT interrupt controllers.
 
#define MADT_SIGNATURE   "APIC"
 MADT table signature.
 
#define DSDT_SIGNATURE   "DSDT"
 DSDT table signature.
 
#define SSDT_SIGNATURE   "SSDT"
 SSDT table signature.
 

Typedefs

typedef uint32_t madt_flags_t
 Multiple APIC Description Table flags.
 
typedef uint8_t interrupt_controller_type_t
 MADT Interrupt Controller Types.
 
typedef uint32_t processor_local_apic_flags_t
 MADT Processor Local APIC flags.
 

Enumerations

enum  fadt_boot_arch_flags_t { FADT_BOOT_ARCH_PS2_EXISTS = (1 << 1) }
 Enum for the fadt_t::bootArchFlags field. More...
 

Functions

uint64_t acpi_tables_init (rsdp_t *rsdp)
 Initialize ACPI tables and call their init handlers.
 
uint64_t acpi_tables_expose (void)
 Expose ACPI tables to sysfs.
 
sdt_header_tacpi_tables_lookup (const char *signature, uint64_t minSize, uint64_t n)
 Lookup the n'th table matching the signature.
 

Macro Definition Documentation

◆ FADT_SIGNATURE

#define FADT_SIGNATURE   "FACP"

FADT table signature.

Definition at line 103 of file tables.h.

◆ MADT_FLAG_PCAT_COMPAT

#define MADT_FLAG_PCAT_COMPAT   ((madt_flags_t)(1 << 0))

Definition at line 112 of file tables.h.

◆ INTERRUPT_CONTROLLER_PROCESSOR_LOCAL_APIC

#define INTERRUPT_CONTROLLER_PROCESSOR_LOCAL_APIC   ((interrupt_controller_type_t)0)

Definition at line 121 of file tables.h.

◆ INTERRUPT_CONTROLLER_IO_APIC

#define INTERRUPT_CONTROLLER_IO_APIC   ((interrupt_controller_type_t)1)

Definition at line 122 of file tables.h.

◆ PROCESSOR_LOCAL_APIC_ENABLED

#define PROCESSOR_LOCAL_APIC_ENABLED   (1 << 0)

Definition at line 141 of file tables.h.

◆ PROCESSOR_LOCAL_APIC_ONLINE_CAPABLE

#define PROCESSOR_LOCAL_APIC_ONLINE_CAPABLE   (1 << 1)

Definition at line 142 of file tables.h.

◆ MADT_FOR_EACH

#define MADT_FOR_EACH (   madt,
  ic 
)
Value:
for (ic = (typeof(ic))madt->interruptControllers; (uint8_t*)ic < (uint8_t*)madt + madt->header.length && \
(uint8_t*)ic + sizeof(interrupt_controller_header_t) <= (uint8_t*)madt + madt->header.length && \
(uint8_t*)ic + ic->header.length <= (uint8_t*)madt + madt->header.length; \
ic = (typeof(ic))((uint8_t*)ic + ic->header.length))
__UINT8_TYPE__ uint8_t
Definition stdint.h:11

Iterate over all MADT interrupt controllers.

Parameters
madtThe MADT table to iterate over.
icA pointer to a madt_interrupt_controller_header_t* that will be set to the current interrupt controller.

Definition at line 193 of file tables.h.

◆ MADT_SIGNATURE

#define MADT_SIGNATURE   "APIC"

MADT table signature.

Definition at line 202 of file tables.h.

◆ DSDT_SIGNATURE

#define DSDT_SIGNATURE   "DSDT"

DSDT table signature.

Definition at line 219 of file tables.h.

◆ SSDT_SIGNATURE

#define SSDT_SIGNATURE   "SSDT"

SSDT table signature.

Note that there might be multiple SSDT tables.

Definition at line 238 of file tables.h.

Typedef Documentation

◆ madt_flags_t

Multiple APIC Description Table flags.

See also
Section 5.2.12 table 5.20 of the ACPI specification for more details.

Definition at line 110 of file tables.h.

◆ interrupt_controller_type_t

MADT Interrupt Controller Types.

See also
Section 5.2.12 table 5.21 of the ACPI specification for more details.

Definition at line 119 of file tables.h.

◆ processor_local_apic_flags_t

MADT Processor Local APIC flags.

See also
Section 5.2.12.2 table 5.23 of the ACPI specification for more details.

Definition at line 139 of file tables.h.

Enumeration Type Documentation

◆ fadt_boot_arch_flags_t

Enum for the fadt_t::bootArchFlags field.

Enumerator
FADT_BOOT_ARCH_PS2_EXISTS 

Definition at line 19 of file tables.h.

Function Documentation

◆ acpi_tables_init()

uint64_t acpi_tables_init ( rsdp_t rsdp)

Initialize ACPI tables and call their init handlers.

Parameters
rsdpPointer to the RSDP structure.
Returns
On success, 0. On failure, ERR.

Definition at line 195 of file tables.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ acpi_tables_expose()

uint64_t acpi_tables_expose ( void  )

Expose ACPI tables to sysfs.

Returns
On success, 0. On failure, ERR.

Definition at line 221 of file tables.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ acpi_tables_lookup()

sdt_header_t * acpi_tables_lookup ( const char *  signature,
uint64_t  minSize,
uint64_t  n 
)

Lookup the n'th table matching the signature.

Parameters
signatureThe signature of the table to look up.
minSizeThe minimum size of the table to look up, should usually be sizeof() of the table struct.
nThe index of the table to look up (0 indexed).
Returns
On success, a pointer to the table. On error, NULL and errno is set to:
  • EINVAL: Invalid parameters.
  • ENOENT: No table matching the signature was found.
  • ERANGE: A table was found, but not enough matching tables to satisfy n.
  • EILSEQ: The table found was smaller than minSize.

Definition at line 260 of file tables.c.

Here is the call graph for this function:
Here is the caller graph for this function: