Skip to content

Commit 9045330

Browse files
committed
Import Acpi Headers
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1 parent dfb0bdc commit 9045330

File tree

17 files changed

+25381
-19
lines changed

17 files changed

+25381
-19
lines changed

src/acpi.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,6 @@
22
#include <printf.h>
33
#include "csmwrap.h"
44

5-
struct RSDPDescriptor {
6-
char Signature[8];
7-
uint8_t Checksum;
8-
char OEMID[6];
9-
uint8_t Revision;
10-
uint32_t RsdtAddress;
11-
} __attribute__ ((packed));
12-
13-
struct RSDPDescriptor20 {
14-
struct RSDPDescriptor firstPart;
15-
16-
uint32_t Length;
17-
uint64_t XsdtAddress;
18-
uint8_t ExtendedChecksum;
19-
uint8_t reserved[3];
20-
} __attribute__ ((packed));
21-
225
int copy_rsdt(struct csmwrap_priv *priv)
236
{
247
UINTN i;
@@ -33,13 +16,13 @@ int copy_rsdt(struct csmwrap_priv *priv)
3316

3417
if (!efi_guidcmp(table->VendorGuid, acpi2Guid)) {
3518
printf("Found ACPI 2.0 RSDT at %x, copied to %x\n", (uintptr_t)table->VendorTable, (uintptr_t)table_target);
36-
memcpy(table_target, table->VendorTable, sizeof(struct RSDPDescriptor20));
19+
memcpy(table_target, table->VendorTable, sizeof(EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER));
3720
return 0;
3821
}
3922

4023
if (!efi_guidcmp(table->VendorGuid, acpiGuid)) {
4124
printf("Found ACPI 1.0 RSDT at %x, copied to %x\n", (uintptr_t)table->VendorTable, (uintptr_t)table_target);
42-
memcpy(table_target, table->VendorTable, sizeof(struct RSDPDescriptor));
25+
memcpy(table_target, table->VendorTable, sizeof(EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER));
4326
return 0;
4427
}
4528

src/csmwrap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _CSM_WRAP_H
33

44
#include <efi.h>
5+
#include <edk2/Acpi.h>
56
#include <edk2/LegacyBios.h>
67
#include <edk2/Coreboot.h>
78
#include <edk2/E820.h>

src/edk2/Acpi.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** @file
2+
This file contains the latest ACPI definitions that are
3+
consumed by drivers that do not care about ACPI versions.
4+
5+
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
6+
Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.<BR>
7+
Copyright (c) 2023, Loongson Technology Corporation Limited. All rights reserved.<BR>
8+
SPDX-License-Identifier: BSD-2-Clause-Patent
9+
10+
**/
11+
12+
#ifndef _ACPI_H_
13+
#define _ACPI_H_
14+
15+
#include "Acpi65.h"
16+
17+
#endif

0 commit comments

Comments
 (0)