summaryrefslogtreecommitdiff
path: root/Kernel/ACPI
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-13 21:16:18 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-22 22:14:30 +0100
commit5356aae3cc32392870582895a1136bc4871976d6 (patch)
tree14462ea2fdfbea6e13d5168d167266b43360bb27 /Kernel/ACPI
parent663a6141d8b3f9a25f8774c0cf3751a7da1235c9 (diff)
downloadserenity-5356aae3cc32392870582895a1136bc4871976d6.zip
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
Diffstat (limited to 'Kernel/ACPI')
-rw-r--r--Kernel/ACPI/MultiProcessorParser.cpp5
-rw-r--r--Kernel/ACPI/Parser.cpp38
2 files changed, 13 insertions, 30 deletions
diff --git a/Kernel/ACPI/MultiProcessorParser.cpp b/Kernel/ACPI/MultiProcessorParser.cpp
index 5b27d14eeb..295c945ddb 100644
--- a/Kernel/ACPI/MultiProcessorParser.cpp
+++ b/Kernel/ACPI/MultiProcessorParser.cpp
@@ -25,6 +25,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <AK/Debug.h>
#include <AK/StringView.h>
#include <Kernel/ACPI/MultiProcessorParser.h>
#include <Kernel/Arch/PC/BIOS.h>
@@ -68,9 +69,7 @@ void MultiProcessorParser::parse_configuration_table()
size_t entry_count = config_table->entry_count;
auto* entry = config_table->entries;
while (entry_count > 0) {
-#ifdef MULTIPROCESSOR_DEBUG
- dbg() << "MultiProcessor: Entry Type " << entry->entry_type << " detected.";
-#endif
+ dbgln<debug_multiprocessor>("MultiProcessor: Entry Type {} detected.", entry->entry_type);
switch (entry->entry_type) {
case ((u8)MultiProcessor::ConfigurationTableEntryType::Processor):
entry = (MultiProcessor::EntryHeader*)(FlatPtr)entry + sizeof(MultiProcessor::ProcessorEntry);
diff --git a/Kernel/ACPI/Parser.cpp b/Kernel/ACPI/Parser.cpp
index 6a4c9884e4..dcb66ba332 100644
--- a/Kernel/ACPI/Parser.cpp
+++ b/Kernel/ACPI/Parser.cpp
@@ -25,6 +25,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <AK/Debug.h>
#include <AK/StringView.h>
#include <Kernel/ACPI/Parser.h>
#include <Kernel/Arch/PC/BIOS.h>
@@ -65,18 +66,12 @@ void Parser::locate_static_data()
PhysicalAddress Parser::find_table(const StringView& signature)
{
-#ifdef ACPI_DEBUG
- dbgln("ACPI: Calling Find Table method!");
-#endif
+ dbgln<debug_acpi>("ACPI: Calling Find Table method!");
for (auto p_sdt : m_sdt_pointers) {
auto sdt = map_typed<Structures::SDTHeader>(p_sdt);
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: Examining Table @ P " << p_sdt;
-#endif
+ dbgln<debug_acpi>("ACPI: Examining Table @ {}", p_sdt);
if (!strncmp(sdt->sig, signature.characters_without_null_termination(), 4)) {
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: Found Table @ P " << p_sdt;
-#endif
+ dbgln<debug_acpi>("ACPI: Found Table @ {}", p_sdt);
return p_sdt;
}
}
@@ -98,9 +93,8 @@ void Parser::init_fadt()
auto sdt = map_typed<Structures::FADT>(m_fadt);
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: FADT @ V " << &sdt << ", P " << (void*)m_fadt.as_ptr();
-#endif
+ dbgln<debug_acpi>("ACPI: FADT @ V{}, {}", &sdt, m_fadt);
+
klog() << "ACPI: Fixed ACPI data, Revision " << sdt->h.revision << ", Length " << sdt->h.length << " bytes";
klog() << "ACPI: DSDT " << PhysicalAddress(sdt->dsdt_ptr);
m_x86_specific_flags.cmos_rtc_not_present = (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::CMOS_RTC_Not_Present);
@@ -225,9 +219,7 @@ void Parser::try_acpi_reboot()
klog() << "ACPI: Reboot, Not supported!";
return;
}
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: Rebooting, Probing FADT (" << m_fadt << ")";
-#endif
+ dbgln<debug_acpi>("ACPI: Rebooting, Probing FADT ({})", m_fadt);
auto fadt = map_typed<Structures::FADT>(m_fadt);
ASSERT(validate_reset_register());
@@ -275,26 +267,18 @@ void Parser::initialize_main_system_description_table()
auto& xsdt = (const Structures::XSDT&)*sdt;
klog() << "ACPI: Using XSDT, Enumerating tables @ " << m_main_system_description_table;
klog() << "ACPI: XSDT Revision " << revision << ", Total length - " << length;
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: XSDT pointer @ V " << &xsdt;
-#endif
+ dbgln<debug_acpi>("ACPI: XSDT pointer @ V{}", &xsdt);
for (u32 i = 0; i < ((length - sizeof(Structures::SDTHeader)) / sizeof(u64)); i++) {
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: Found new table [" << i << "], @ V " << String::format("%p", &xsdt.table_ptrs[i]) << " - P 0x" << String::format("%llx", xsdt.table_ptrs[i]);
-#endif
+ dbgln<debug_acpi>("ACPI: Found new table [{0}], @ V{1:p} - P{1:p}", i, &xsdt.table_ptrs[i]);
m_sdt_pointers.append(PhysicalAddress(xsdt.table_ptrs[i]));
}
} else {
auto& rsdt = (const Structures::RSDT&)*sdt;
klog() << "ACPI: Using RSDT, Enumerating tables @ " << m_main_system_description_table;
klog() << "ACPI: RSDT Revision " << revision << ", Total length - " << length;
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: RSDT pointer @ V " << &rsdt;
-#endif
+ dbgln<debug_acpi>("ACPI: RSDT pointer @ V{}", &rsdt);
for (u32 i = 0; i < ((length - sizeof(Structures::SDTHeader)) / sizeof(u32)); i++) {
-#ifdef ACPI_DEBUG
- dbg() << "ACPI: Found new table [" << i << "], @ V " << String::format("%p", &rsdt.table_ptrs[i]) << " - P 0x" << String::format("%x", rsdt.table_ptrs[i]);
-#endif
+ dbgln<debug_acpi>("ACPI: Found new table [{0}], @ V{1:p} - P{1:p}", i, &rsdt.table_ptrs[i]);
m_sdt_pointers.append(PhysicalAddress(rsdt.table_ptrs[i]));
}
}