Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
62 changes: 0 additions & 62 deletions src/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,8 @@
#include <printf.h>
#include "csmwrap.h"

#include <uacpi/kernel_api.h>
#include <uacpi/tables.h>
#include <uacpi/uacpi.h>

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;
Expand Down Expand Up @@ -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;
}
}
1 change: 0 additions & 1 deletion src/csmwrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/csmwrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
17 changes: 0 additions & 17 deletions src/uacpi_config.h

This file was deleted.

1 change: 0 additions & 1 deletion uACPI
Submodule uACPI deleted from 229fae