X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FLibraries%2FVirtIO%2Fvirtio.c;h=4631b72c14eb78d05a8072ae2dc178ea6c1d9f15;hb=85362e8a4c919b58cd261345d29f26bae4ad75e2;hp=65f4cc9fd7aabe77c53ed404a21e4775b034e583;hpb=230138900684786053e5d1a1efb566db9edc5021;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Libraries/VirtIO/virtio.c b/KernelLand/Modules/Libraries/VirtIO/virtio.c index 65f4cc9f..4631b72c 100644 --- a/KernelLand/Modules/Libraries/VirtIO/virtio.c +++ b/KernelLand/Modules/Libraries/VirtIO/virtio.c @@ -5,7 +5,7 @@ * virtio.c * - Core */ -#define DEBUG 1 +#define DEBUG 0 #define VERSION 0x100 #include #include @@ -154,8 +154,7 @@ tVirtIO_Dev *VirtIO_InitDev(Uint16 IOBase, Uint IRQ, Uint32 Features, int MaxQue // Register IRQ Handler IRQ_AddHandler(IRQ, VirtIO_IRQHandler, ret); - Uint8 isr = inb(IOBase + VIRTIO_REG_ISRSTS); - LOG("isr = %x", isr); + LOG("isr = %x", inb(IOBase + VIRTIO_REG_ISRSTS)); // Start outb(IOBase + VIRTIO_REG_DEVSTS, VIRTIO_DEVSTS_DRIVER_OK); @@ -391,7 +390,8 @@ void VirtIO_ReleaseBuffer(tVirtIO_Buf *Buffer) do { has_next = !!(queue->Entries[idx].Flags & VRING_DESC_F_NEXT); int next_idx = queue->Entries[idx].Next; - ASSERTC(!has_next || next_idx,!=,idx); + if( has_next ) + ASSERTC(next_idx,!=,idx); VirtIO_int_ReleaseQDesc(queue, idx); @@ -410,6 +410,7 @@ void VirtIO_int_ProcessUsedList(tVirtIO_Dev *Dev, tVirtIO_Queue *Queue, int Used if( !Queue->NoAutoRel ) { + LOG("Releasing"); // Return the buffer to the avaliable pool VirtIO_ReleaseBuffer(&Queue->Buffers[qent]); if(Queue->NextUsedPop == UsedIdx) @@ -440,6 +441,7 @@ void VirtIO_IRQHandler(int IRQ, void *Ptr) queue->LastSeenUsed ++; VirtIO_int_ProcessUsedList(Dev, queue, idx); } + LOG("- Done"); } }