diff --git a/.gitmodules b/.gitmodules index 4154386..cfb0fdc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,6 +13,3 @@ [submodule "seabios"] path = seabios url = https://github.com/FlyGoat/seabios-csmwrap.git -[submodule "uACPI"] - path = uACPI - url = https://github.com/uACPI/uACPI.git diff --git a/GNUmakefile b/GNUmakefile index d918a1f..0b4b541 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -74,8 +74,6 @@ override CFLAGS += \ override CPPFLAGS := \ -I src \ -I nyu-efi/inc \ - -I uACPI/include \ - -DUACPI_OVERRIDE_CONFIG \ -DBUILD_VERSION=\"$(BUILD_VERSION)\" \ -isystem freestnd-c-hdrs \ $(CPPFLAGS) \ @@ -134,7 +132,7 @@ override LDFLAGS += \ # Use "find" to glob all *.c, *.S, and *.asm{32,64} files in the tree and obtain the # object and header dependency file names. -override SRCFILES := $(shell find -L src cc-runtime/src nyu-efi/$(ARCH) uACPI/source uACPI/include -type f | LC_ALL=C sort) +override SRCFILES := $(shell find -L src cc-runtime/src nyu-efi/$(ARCH) -type f | LC_ALL=C sort) override CFILES := $(filter %.c,$(SRCFILES)) override ASFILES := $(filter %.S,$(SRCFILES)) ifeq ($(ARCH),ia32) diff --git a/README.md b/README.md index 41d5db9..18375f0 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,5 @@ Please read the [Contributing](https://github.com/FlyGoat/CSMWrap/wiki/Contribut * The **[SeaBIOS project](https://www.seabios.org/)** for their CSM and VBIOS code. * **[Nyu-EFI](https://codeberg.org/osdev/nyu-efi)** for the EFI C runtime, build system, and headers. * **[EDK2 (TianoCore)](https://github.com/tianocore/edk2)** for UEFI specifications and some code snippets. -* **[uACPI](https://github.com/uACPI/uACPI)** for ACPI table handling. * **@CanonKong** for test feedback and general knowledge. * All contributors and testers from the community! diff --git a/src/acpi.c b/src/acpi.c index 6715ca3..3ba4178 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -2,50 +2,8 @@ #include #include "csmwrap.h" -#include -#include -#include - uintptr_t g_rsdp = 0; -static inline const char *uacpi_log_level_to_string(uacpi_log_level lvl) { - switch (lvl) { - case UACPI_LOG_DEBUG: - return "DEBUG"; - case UACPI_LOG_TRACE: - return "TRACE"; - case UACPI_LOG_INFO: - return "INFO"; - case UACPI_LOG_WARN: - return "WARN"; - case UACPI_LOG_ERROR: - default: - return "ERROR"; - } -} - -void uacpi_kernel_log(enum uacpi_log_level lvl, const char *text) { - printf("[uACPI][%s] %s", uacpi_log_level_to_string(lvl), text); -} - -void *uacpi_kernel_map(uacpi_phys_addr addr, EFI_UNUSED uacpi_size len) { - return (void*)((uintptr_t)addr); -} - -void uacpi_kernel_unmap(EFI_UNUSED void *ptr, EFI_UNUSED uacpi_size len) { -} - -uacpi_status uacpi_kernel_get_rsdp(uacpi_phys_addr *rsdp) { - if (!g_rsdp) { - return UACPI_STATUS_NOT_FOUND; - } - - *rsdp = g_rsdp; - return UACPI_STATUS_OK; -} - -static void *early_table_buffer; - bool acpi_init(struct csmwrap_priv *priv) { UINTN i; EFI_GUID acpiGuid = ACPI_TABLE_GUID; @@ -79,29 +37,9 @@ bool acpi_init(struct csmwrap_priv *priv) { } if (g_rsdp) { - const size_t table_buffer_size = 4096; - - if (gBS->AllocatePool(EfiLoaderData, table_buffer_size, &early_table_buffer) != EFI_SUCCESS) { - return false; - } - - enum uacpi_status uacpi_status; - uacpi_status = uacpi_setup_early_table_access(early_table_buffer, table_buffer_size); - if (uacpi_status != UACPI_STATUS_OK) { - printf("uACPI early table setup failed: %s\n", uacpi_status_to_string(uacpi_status)); - return false; - } - return true; } printf("No ACPI RSDT found\n"); return false; } - -void acpi_prepare_exitbs(void) { - if (early_table_buffer != NULL) { - gBS->FreePool(early_table_buffer); - early_table_buffer = NULL; - } -} diff --git a/src/csmwrap.c b/src/csmwrap.c index 0ade623..d7fffa5 100644 --- a/src/csmwrap.c +++ b/src/csmwrap.c @@ -161,7 +161,6 @@ EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) /* WARNING: No EFI Video afterwards */ csmwrap_video_prepare_exitbs(&priv); - acpi_prepare_exitbs(); /* WARNING: No EFI runtime service afterwards */ UINTN efi_mmap_size = 0, efi_desc_size = 0, efi_mmap_key = 0; diff --git a/src/csmwrap.h b/src/csmwrap.h index 828272a..0afff3f 100644 --- a/src/csmwrap.h +++ b/src/csmwrap.h @@ -40,7 +40,6 @@ struct csmwrap_priv { extern int unlock_bios_region(); extern int build_coreboot_table(struct csmwrap_priv *priv); bool acpi_init(struct csmwrap_priv *priv); -void acpi_prepare_exitbs(void); int build_e820_map(struct csmwrap_priv *priv, EFI_MEMORY_DESCRIPTOR *memory_map, UINTN memory_map_size, UINTN descriptor_size); int apply_intel_platform_workarounds(void); diff --git a/src/uacpi_config.h b/src/uacpi_config.h deleted file mode 100644 index b90e968..0000000 --- a/src/uacpi_config.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include -#include - - -#define UACPI_DEFAULT_LOG_LEVEL UACPI_LOG_INFO -#define UACPI_DEFAULT_LOOP_TIMEOUT_SECONDS 30 -#define UACPI_DEFAULT_MAX_CALL_STACK_DEPTH 256 - -#define UACPI_USE_BUILTIN_STRING -#ifndef __LP64__ -#define UACPI_PHYS_ADDR_IS_32BITS -#endif -#define UACPI_BAREBONES_MODE -#define UACPI_PLAIN_LOG_BUFFER_SIZE 128 -#define UACPI_STATIC_TABLE_ARRAY_LEN 128 diff --git a/uACPI b/uACPI deleted file mode 160000 index 229faec..0000000 --- a/uACPI +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 229faec5cb55550f4da189cf029f2274e63b9679