Skip to content

Commit

Permalink
protos/limine: Make some pointers physical for base rev 3
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Oct 28, 2024
1 parent e6d7352 commit a82e67d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ struct limine_rsdp_response {
};
```
* `address` - Address of the RSDP table.
* `address` - Address of the RSDP table. Physical for base revision >= 3.
### SMBIOS Feature
Expand All @@ -1156,8 +1156,8 @@ struct limine_smbios_response {
};
```
* `entry_32` - Address of the 32-bit SMBIOS entry point. NULL if not present.
* `entry_64` - Address of the 64-bit SMBIOS entry point. NULL if not present.
* `entry_32` - Address of the 32-bit SMBIOS entry point. NULL if not present. Physical for base revision >= 3.
* `entry_64` - Address of the 64-bit SMBIOS entry point. NULL if not present. Physical for base revision >= 3.
### EFI System Table Feature
Expand All @@ -1183,7 +1183,7 @@ struct limine_efi_system_table_response {
};
```
* `address` - Address of EFI system table.
* `address` - Address of EFI system table. Physical for base revision >= 3.
### EFI Memory Map Feature
Expand Down Expand Up @@ -1212,7 +1212,7 @@ struct limine_efi_memmap_response {
};
```
* `memmap` - Address (HHDM) of the EFI memory map.
* `memmap` - Address (HHDM for base revision <= 2, else physical) of the EFI memory map.
* `memmap_size` - Size in bytes of the EFI memory map.
* `desc_size` - EFI memory map descriptor size in bytes.
* `desc_version` - Version of EFI memory map descriptors.
Expand Down
10 changes: 5 additions & 5 deletions common/protos/limine.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ FEAT_START
struct limine_rsdp_response *rsdp_response =
ext_mem_alloc(sizeof(struct limine_rsdp_response));

rsdp_response->address = reported_addr(rsdp);
rsdp_response->address = base_revision <= 2 ? reported_addr(rsdp) : (uintptr_t)rsdp;

rsdp_request->response = reported_addr(rsdp_response);
FEAT_END
Expand All @@ -959,10 +959,10 @@ FEAT_START
ext_mem_alloc(sizeof(struct limine_smbios_response));

if (smbios_entry_32) {
smbios_response->entry_32 = reported_addr(smbios_entry_32);
smbios_response->entry_32 = base_revision <= 2 ? reported_addr(smbios_entry_32) : (uintptr_t)smbios_entry_32;
}
if (smbios_entry_64) {
smbios_response->entry_64 = reported_addr(smbios_entry_64);
smbios_response->entry_64 = base_revision <= 2 ? reported_addr(smbios_entry_64) : (uintptr_t)smbios_entry_64;
}

smbios_request->response = reported_addr(smbios_response);
Expand All @@ -979,7 +979,7 @@ FEAT_START
struct limine_efi_system_table_response *est_response =
ext_mem_alloc(sizeof(struct limine_efi_system_table_response));

est_response->address = reported_addr(gST);
est_response->address = base_revision <= 2 ? reported_addr(gST) : (uintptr_t)gST;

est_request->response = reported_addr(est_response);
FEAT_END
Expand Down Expand Up @@ -1368,7 +1368,7 @@ FEAT_START
struct limine_efi_memmap_response *efi_memmap_response =
ext_mem_alloc(sizeof(struct limine_efi_memmap_response));

efi_memmap_response->memmap = reported_addr(efi_mmap);
efi_memmap_response->memmap = base_revision <= 2 ? reported_addr(efi_mmap) : (uintptr_t)efi_mmap;
efi_memmap_response->memmap_size = efi_mmap_size;
efi_memmap_response->desc_size = efi_desc_size;
efi_memmap_response->desc_version = efi_desc_ver;
Expand Down

0 comments on commit a82e67d

Please sign in to comment.