PatchworkOS
Loading...
Searching...
No Matches
tables.c File Reference
#include <kernel/acpi/tables.h>
#include <kernel/acpi/acpi.h>
#include <kernel/fs/file.h>
#include <kernel/fs/vfs.h>
#include <kernel/log/log.h>
#include <kernel/log/panic.h>
#include <boot/boot_info.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

static uint64_t acpi_table_read (file_t *file, void *buffer, uint64_t count, uint64_t *offset)
 
static bool acpi_is_table_valid (sdt_header_t *table)
 
static bool acpi_is_xsdt_valid (xsdt_t *xsdt)
 
static bool acpi_is_rsdp_valid (rsdp_t *rsdp)
 
static uint64_t acpi_tables_push (sdt_header_t *table)
 
static uint64_t acpi_tables_load_from_xsdt (xsdt_t *xsdt)
 
static uint64_t acpi_tables_load_from_fadt (void)
 
static uint64_t acpi_tables_init_handlers (sdt_header_t *table)
 
void acpi_tables_init (rsdp_t *rsdp)
 Initialize ACPI tables and call their init handlers.
 
void acpi_tables_expose (void)
 Expose ACPI tables to sysfs.
 
sdt_header_tacpi_tables_lookup (const char *signature, uint64_t n)
 Lookup the n'th table matching the signature.
 

Variables

static uint64_t ssdtAmount = 0
 
static uint64_t tableAmount = 0
 
static acpi_cached_table_tcachedTables = NULL
 
static dentry_ttablesDir = NULL
 
const acpi_sdt_handler_t _acpiSdtHandlersStart []
 
const acpi_sdt_handler_t _acpiSdtHandlersEnd []
 
static file_ops_t tableFileOps
 

Function Documentation

◆ acpi_is_rsdp_valid()

static bool acpi_is_rsdp_valid ( rsdp_t rsdp)
static

◆ acpi_is_table_valid()

static bool acpi_is_table_valid ( sdt_header_t table)
static

◆ acpi_is_xsdt_valid()

static bool acpi_is_xsdt_valid ( xsdt_t xsdt)
static

◆ acpi_table_read()

static uint64_t acpi_table_read ( file_t file,
void *  buffer,
uint64_t  count,
uint64_t offset 
)
static

◆ acpi_tables_init_handlers()

static uint64_t acpi_tables_init_handlers ( sdt_header_t table)
static

◆ acpi_tables_load_from_fadt()

static uint64_t acpi_tables_load_from_fadt ( void  )
static

◆ acpi_tables_load_from_xsdt()

static uint64_t acpi_tables_load_from_xsdt ( xsdt_t xsdt)
static

◆ acpi_tables_push()

Variable Documentation

◆ _acpiSdtHandlersEnd

const acpi_sdt_handler_t _acpiSdtHandlersEnd[]
extern

◆ _acpiSdtHandlersStart

const acpi_sdt_handler_t _acpiSdtHandlersStart[]
extern

◆ cachedTables

acpi_cached_table_t* cachedTables = NULL
static

◆ ssdtAmount

uint64_t ssdtAmount = 0
static

Definition at line 16 of file tables.c.

Referenced by acpi_tables_expose().

◆ tableAmount

uint64_t tableAmount = 0
static

◆ tableFileOps

file_ops_t tableFileOps
static
Initial value:
= {
.read = acpi_table_read,
}
static uint64_t acpi_table_read(file_t *file, void *buffer, uint64_t count, uint64_t *offset)
Definition tables.c:26

Definition at line 44 of file tables.c.

Referenced by acpi_tables_expose().

◆ tablesDir

dentry_t* tablesDir = NULL
static

Definition at line 20 of file tables.c.

Referenced by acpi_tables_expose().