Files
DragonOS/kernel/src/driver/acpi/acpi.h
Jomo cc5feaf67b bugfix: 修复因rsdp v1 v2版本问题,导致ACPI无法正常初始化的bug (#454)
bugfix: 修复因rsdp v1 v2版本问题,导致ACPI无法正常初始化的bug
2023-11-23 21:04:32 +08:00

37 lines
784 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 解析acpi信息的模块
**/
#pragma once
#include <common/glib.h>
#include <mm/mm.h>
struct acpi_RSDP_t
{
unsigned char Signature[8];
unsigned char Checksum;
unsigned char OEMID[6];
unsigned char Revision;
// 32bit physical address of the RSDT
uint RsdtAddress;
} __attribute__((packed));
struct acpi_RSDP_2_t
{
struct acpi_RSDP_t rsdp1;
// fields below are only valid when the revision value is 2 or above
// 表的长度单位字节从offset=0开始算
uint Length;
// 64bit的XSDT的物理地址
ul XsdtAddress;
unsigned char ExtendedChecksum; // 整个表的checksum包括了之前的checksum区域
unsigned char Reserved[3];
} __attribute__((packed));
// 初始化acpi模块
void acpi_init();