[SDK][VIRTIO][NETKVM] Make VirtIO a separate library (#6280)

* [SDK][VIRTIO][NETKVM] Make VirtIO a separate library

This is to avoid code duplication when more VirtIO drivers are brought in. This will also be used on development of a VirtIO XDDM GPU Driver.

* [VIRTIO] Sync with upstream
This commit is contained in:
Adam Słaboń 2024-01-17 02:55:35 +01:00 committed by GitHub
parent 96d5b6281d
commit 823fdb19d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 35 additions and 8 deletions

View file

@ -0,0 +1,11 @@
#pragma once
extern int virtioDebugLevel;
extern int bDebugPrint;
typedef void (*tDebugPrintFunc)(const char *format, ...);
extern tDebugPrintFunc VirtioDebugPrintProc;
#define DPrintf(Level, MSG, ...) if ((!bDebugPrint) || Level > virtioDebugLevel) {} else VirtioDebugPrintProc(MSG, __VA_ARGS__)
#define DEBUG_ENTRY(level) DPrintf(level, "[%s]=>\n", __FUNCTION__)
#define DEBUG_EXIT_STATUS(level, status) DPrintf((status == NDIS_STATUS_SUCCESS ? level : 0), "[%s]<=0x%X\n", __FUNCTION__, (status))