1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

Everywhere: Hook up remaining debug macros to Debug.h.

This commit is contained in:
asynts 2021-01-24 15:28:26 +01:00 committed by Andreas Kling
parent da69de1f1b
commit eea72b9b5c
63 changed files with 458 additions and 287 deletions

View file

@ -26,6 +26,7 @@
#include <AK/Assertions.h>
#include <AK/ByteBuffer.h>
#include <AK/Debug.h>
#include <AK/Singleton.h>
#include <AK/StringView.h>
#include <AK/Types.h>
@ -293,7 +294,7 @@ void KeyboardDevice::irq_handle_byte_read(u8 byte)
return;
}
#ifdef KEYBOARD_DEBUG
#if KEYBOARD_DEBUG
dbgln("Keyboard::irq_handle_byte_read: {:#02x} {}", ch, (pressed ? "down" : "up"));
#endif
switch (ch) {

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/Debug.h>
#include <AK/Memory.h>
#include <AK/Singleton.h>
#include <AK/StringView.h>
@ -241,7 +242,7 @@ KResultOr<size_t> SB16::write(FileDescription&, size_t, const UserOrKernelBuffer
return ENOMEM;
}
#ifdef SB16_DEBUG
#if SB16_DEBUG
klog() << "SB16: Writing buffer of " << length << " bytes";
#endif
ASSERT(length <= PAGE_SIZE);

View file

@ -25,6 +25,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/Debug.h>
#include <Kernel/Devices/USB/UHCIController.h>
#include <Kernel/Process.h>
#include <Kernel/StdLib.h>
@ -194,7 +195,7 @@ void UHCIController::create_structures()
transfer_descriptor->set_isochronous();
transfer_descriptor->link_queue_head(m_interrupt_transfer_queue->paddr());
#ifdef UHCI_VERBOSE_DEBUG
#if UHCI_VERBOSE_DEBUG
transfer_descriptor->print();
#endif
}
@ -212,13 +213,13 @@ void UHCIController::create_structures()
// access the raw descriptor (that we later send to the controller)
m_free_td_pool.at(i) = new (placement_addr) Kernel::USB::TransferDescriptor(paddr);
#ifdef UHCI_VERBOSE_DEBUG
#if UHCI_VERBOSE_DEBUG
auto transfer_descriptor = m_free_td_pool.at(i);
transfer_descriptor->print();
#endif
}
#ifdef UHCI_DEBUG
#if UHCI_DEBUG
klog() << "UHCI: Pool information:";
klog() << "\tqh_pool: " << PhysicalAddress(m_qh_pool->physical_page(0)->paddr()) << ", length: " << m_qh_pool->range().size();
klog() << "\ttd_pool: " << PhysicalAddress(m_td_pool->physical_page(0)->paddr()) << ", length: " << m_td_pool->range().size();
@ -290,7 +291,7 @@ QueueHead* UHCIController::allocate_queue_head() const
for (QueueHead* queue_head : m_free_qh_pool) {
if (!queue_head->in_use()) {
queue_head->set_in_use(true);
#ifdef UHCI_DEBUG
#if UHCI_DEBUG
klog() << "UHCI: Allocated a new Queue Head! Located @ " << VirtualAddress(queue_head) << "(" << PhysicalAddress(queue_head->paddr()) << ")";
#endif
return queue_head;
@ -306,7 +307,7 @@ TransferDescriptor* UHCIController::allocate_transfer_descriptor() const
for (TransferDescriptor* transfer_descriptor : m_free_td_pool) {
if (!transfer_descriptor->in_use()) {
transfer_descriptor->set_in_use(true);
#ifdef UHCI_DEBUG
#if UHCI_DEBUG
klog() << "UHCI: Allocated a new Transfer Descriptor! Located @ " << VirtualAddress(transfer_descriptor) << "(" << PhysicalAddress(transfer_descriptor->paddr()) << ")";
#endif
return transfer_descriptor;
@ -460,7 +461,7 @@ void UHCIController::handle_irq(const RegisterState&)
if (!read_usbsts())
return;
#ifdef UHCI_DEBUG
#if UHCI_DEBUG
klog() << "UHCI: Interrupt happened!";
klog() << "Value of USBSTS: " << read_usbsts();
#endif