diff options
author | asynts <asynts@gmail.com> | 2021-01-14 00:10:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-22 22:14:30 +0100 |
commit | 67583bc4242a8063574702a5351fc321025b0218 (patch) | |
tree | 0b815a7f7c448be89f27b37fe419e79756f6e168 /Kernel/Interrupts/IOAPIC.cpp | |
parent | 78b2be5a2a9e7dffa60f4600116412be824fb397 (diff) | |
download | serenity-67583bc4242a8063574702a5351fc321025b0218.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/Interrupts/IOAPIC.cpp')
-rw-r--r-- | Kernel/Interrupts/IOAPIC.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Kernel/Interrupts/IOAPIC.cpp b/Kernel/Interrupts/IOAPIC.cpp index ed3a1620d0..ca46c09984 100644 --- a/Kernel/Interrupts/IOAPIC.cpp +++ b/Kernel/Interrupts/IOAPIC.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <AK/Debug.h> #include <AK/Optional.h> #include <AK/StringView.h> #include <Kernel/ACPI/MultiProcessorParser.h> @@ -201,13 +202,14 @@ void IOAPIC::configure_redirection_entry(int index, u8 interrupt_vector, u8 deli u32 redirection_entry1 = interrupt_vector | (delivery_mode & 0b111) << 8 | logical_destination << 11 | active_low << 13 | trigger_level_mode << 15 | masked << 16; u32 redirection_entry2 = destination << 24; write_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET, redirection_entry1); -#ifdef IOAPIC_DEBUG - dbg() << "IOAPIC Value: 0x" << String::format("%x", read_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET)); -#endif + + if constexpr (debug_ioapic) + dbgln("IOAPIC Value: {:#x}", read_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET)); + write_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET + 1, redirection_entry2); -#ifdef IOAPIC_DEBUG - dbg() << "IOAPIC Value: 0x" << String::format("%x", read_register((index << 1) + 0x11)); -#endif + + if constexpr (debug_ioapic) + dbgln("IOAPIC Value: {:#x}", read_register((index << 1) + 0x11)); } void IOAPIC::mask_all_redirection_entries() const @@ -319,17 +321,15 @@ void IOAPIC::write_register(u32 index, u32 value) const InterruptDisabler disabler; m_regs->select = index; m_regs->window = value; -#ifdef IOAPIC_DEBUG - dbg() << "IOAPIC Writing, Value 0x" << String::format("%x", m_regs->window) << " @ offset 0x" << String::format("%x", m_regs->select); -#endif + + dbgln<debug_ioapic>("IOAPIC Writing, Value {:#x} @ offset {:#x}", (u32)m_regs->window, (u32)m_regs->select); } u32 IOAPIC::read_register(u32 index) const { InterruptDisabler disabler; m_regs->select = index; -#ifdef IOAPIC_DEBUG - dbg() << "IOAPIC Reading, Value 0x" << String::format("%x", m_regs->window) << " @ offset 0x" << String::format("%x", m_regs->select); -#endif + dbgln<debug_ioapic>("IOAPIC Reading, Value {:#x} @ offset {:#x}", (u32)m_regs->window, (u32)m_regs->select); return m_regs->window; } + } |