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
Refactor the ACPI
code and change its location.
#911
Conversation
Redefine ACPI structures so that they comply with the coding style and fix Local SAPIC's wrong definition, as the UID string has at least 1 byte. Furthermore, redefine `MADTTypeEntry` as a general System Descriptor sub-Table, since it is used by almost all of them. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Since all structures calculate their checksum in the same manner, use only one general checksum verification function for all of them. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
be802a3
to
54373a4
Compare
Since `MADT` is a System Descriptor Table itself, move it to `sdt.h` and keep in `madt.h` only the `MADT` specific definitions. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Write the code in such a manner that the same set of functions can accommodate any version of ACPI. Thus, remove `acpi10_*` functions and define an ACPI table generic fetching function `acpi_get_table`. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Allow quick access to the `UEFI` System Tables through a field in the `bootinfo` structure. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
First check for the presence of `RSDP` in the `UEFI` System Table's Configuration Tables. If it does not exist, fallback on the legacy BIOS ROM Area. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Add the definition for `FADT` and its related structures. Implement a getter for it and add its signature in the list of `ACPI` fetched tables. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Since `ACPI` is a platform and architecture agnostic specification, move it to a place where reality reflects that. Furthermore, add a corresponding configuration option and dependency on it for x86 SMP builds. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
54373a4
to
e925cbc
Compare
Beep boop! I ran Unikraft's
Truncated logs starting from first warning 3b72ca1:
View complete logs | Learn more about Unikraft's coding style and contribution guidelines. |
I currently can't compile this without also enabling PIE:
The defconfig:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Marco Schlumpp marco@unikraft.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
Since all structures calculate their checksum in the same manner, use only one general checksum verification function for all of them. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
Since `MADT` is a System Descriptor Table itself, move it to `sdt.h` and keep in `madt.h` only the `MADT` specific definitions. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
Write the code in such a manner that the same set of functions can accommodate any version of ACPI. Thus, remove `acpi10_*` functions and define an ACPI table generic fetching function `acpi_get_table`. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
Allow quick access to the `UEFI` System Tables through a field in the `bootinfo` structure. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
First check for the presence of `RSDP` in the `UEFI` System Table's Configuration Tables. If it does not exist, fallback on the legacy BIOS ROM Area. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
Add the definition for `FADT` and its related structures. Implement a getter for it and add its signature in the list of `ACPI` fetched tables. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
Since `ACPI` is a platform and architecture agnostic specification, move it to a place where reality reflects that. Furthermore, add a corresponding configuration option and dependency on it for x86 SMP builds. Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com> Reviewed-by: Dragos Petre <dragos.petre27@gmail.com> Reviewed-by: Marco Schlumpp <marco@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #911
Prerequisite checklist
checkpatch.pl
on your commit series before opening this PR;Base target
x86_64
kvm
Additional configuration
Description of changes
Re-write the
ACPI
structures definitions and, sinceACPI
is platform and architecture agnostic, move it to a location where it reflects that.This PR depends on #772 #848 #908 #909 and #910, therefore it includes them.
NOTE
This is part of a larger set of Pull Requests. To make things easier and to ensure that things build as expected, it is recommended that testing is done based on #912, which includes everything. The splitting has been done to ease the review process.