Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protos/linux_risc: add LoongArch support #439

Merged
merged 3 commits into from
Dec 22, 2024
Merged
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
9 changes: 4 additions & 5 deletions common/lib/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EFI_BOOT_SERVICES *gBS;
EFI_RUNTIME_SERVICES *gRT;
EFI_HANDLE efi_image_handle;
EFI_MEMORY_DESCRIPTOR *efi_mmap = NULL;
UINTN efi_mmap_size = 0, efi_desc_size = 0;
UINTN efi_mmap_size = 0, efi_desc_size = 0, efi_mmap_key = 0;
UINT32 efi_desc_ver = 0;
#endif

Expand Down Expand Up @@ -205,9 +205,8 @@ bool efi_exit_boot_services(void) {

EFI_MEMORY_DESCRIPTOR tmp_mmap[1];
efi_mmap_size = sizeof(tmp_mmap);
UINTN mmap_key = 0;

gBS->GetMemoryMap(&efi_mmap_size, tmp_mmap, &mmap_key, &efi_desc_size, &efi_desc_ver);
gBS->GetMemoryMap(&efi_mmap_size, tmp_mmap, &efi_mmap_key, &efi_desc_size, &efi_desc_ver);

efi_mmap_size += 4096;

Expand All @@ -232,13 +231,13 @@ bool efi_exit_boot_services(void) {
size_t retries = 0;

retry:
status = gBS->GetMemoryMap(&efi_mmap_size, efi_mmap, &mmap_key, &efi_desc_size, &efi_desc_ver);
status = gBS->GetMemoryMap(&efi_mmap_size, efi_mmap, &efi_mmap_key, &efi_desc_size, &efi_desc_ver);
if (retries == 0 && status) {
goto fail;
}

// Be gone, UEFI!
status = gBS->ExitBootServices(efi_image_handle, mmap_key);
status = gBS->ExitBootServices(efi_image_handle, efi_mmap_key);
if (status) {
if (retries == 128) {
goto fail;
Expand Down
2 changes: 1 addition & 1 deletion common/lib/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern EFI_BOOT_SERVICES *gBS;
extern EFI_RUNTIME_SERVICES *gRT;
extern EFI_HANDLE efi_image_handle;
extern EFI_MEMORY_DESCRIPTOR *efi_mmap;
extern UINTN efi_mmap_size, efi_desc_size;
extern UINTN efi_mmap_size, efi_desc_size, efi_mmap_key;
extern UINT32 efi_desc_ver;

extern bool efi_boot_services_exited;
Expand Down
5 changes: 0 additions & 5 deletions common/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,12 +1190,7 @@ noreturn void boot(char *config) {
if (!strcmp(proto, "limine")) {
limine_load(config, cmdline);
} else if (!strcmp(proto, "linux")) {
#if defined (__loongarch64)
quiet = false;
print("TODO: Linux is not available on LoongArch64.\n\n");
#else
linux_load(config, cmdline);
#endif
} else if (!strcmp(proto, "multiboot1") || !strcmp(proto, "multiboot")) {
#if defined (__x86_64__) || defined (__i386__)
multiboot1_load(config, cmdline);
Expand Down
Loading
Loading