replace nob with ms' build, move disk creation to build.bat, major comment cleanup, remove old and stupid tests, overhaul interrupt management with per-CPU vector allocation, affinity migration and safe teardown, add proper IOAPIC routing and PCI MSI/MSI-X/INTx support, migrate drivers to the new interrupt API, integrate ACPICA with a proper OS services layer, move ACPI firmware events, power button handling and S5 shutdown into acpi.sys, add parallel driver startup and atomic publication, replace PnP arrays with dynamic lists, redesign service startup again to be asynchronous, add delayed startup mode for services, allow omitting keys in services.ini, fix acpi ec deferred work handling, fix kernel threads having garbage exit code.
This commit is contained in:
1 parent
d36f19509c
commit
36eef8f58d
696 files changed
+147281
-7530
No files matched your search
@@ -213,7 +213,6 @@ static void VmwSvgaWakeFifo(VMWSVGA_DEVICE* v) {
|
||||
|
||||
static KSTATUS VmwSvgaUploadCursorImage(VMWSVGA_DEVICE* v, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels);
|
||||
|
||||
// Implements the premultiply Argb For Bgra operation.
|
||||
static uint32_t VmwSvgaPremultiplyArgbForBgra(uint32_t argb) {
|
||||
uint32_t a = argb >> 24;
|
||||
if (a == 0)
|
||||
@@ -231,7 +230,6 @@ static uint32_t VmwSvgaPremultiplyArgbForBgra(uint32_t argb) {
|
||||
return (a << 24) | (r << 16) | (g << 8) | b;
|
||||
}
|
||||
|
||||
// Implements the cursor Commit operation.
|
||||
static void VmwSvgaCursorCommit(VMWSVGA_DEVICE* v) {
|
||||
if (!v || !v->HardwareCursor || !v->CursorImageDefined)
|
||||
return;
|
||||
@@ -266,7 +264,6 @@ static void VmwSvgaCursorCommit(VMWSVGA_DEVICE* v) {
|
||||
VmwSvgaWriteReg(v, SVGA_REG_CURSOR_ON, v->CursorVisible ? SVGA_CURSOR_ON_SHOW : SVGA_CURSOR_ON_HIDE);
|
||||
}
|
||||
|
||||
// Implements the cursor Set Visible operation.
|
||||
static void VmwSvgaCursorSetVisible(VMWSVGA_DEVICE* v, bool visible) {
|
||||
if (!v || !v->HardwareCursor)
|
||||
return;
|
||||
@@ -274,7 +271,6 @@ static void VmwSvgaCursorSetVisible(VMWSVGA_DEVICE* v, bool visible) {
|
||||
VmwSvgaCursorCommit(v);
|
||||
}
|
||||
|
||||
// Implements the cursor Set Position operation.
|
||||
static void VmwSvgaCursorSetPosition(VMWSVGA_DEVICE* v, int32_t x, int32_t y) {
|
||||
if (!v || !v->HardwareCursor)
|
||||
return;
|
||||
@@ -283,7 +279,6 @@ static void VmwSvgaCursorSetPosition(VMWSVGA_DEVICE* v, int32_t x, int32_t y) {
|
||||
VmwSvgaCursorCommit(v);
|
||||
}
|
||||
|
||||
// Implements the define Alpha Cursor operation.
|
||||
static KSTATUS VmwSvgaDefineAlphaCursor(VMWSVGA_DEVICE* v, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
KSTATUS st = VmwSvgaFifoWrite(v, SVGA_CMD_DEFINE_ALPHA_CURSOR);
|
||||
if (!KSUCCESS(st)) return st;
|
||||
@@ -342,7 +337,6 @@ static uint32_t VmwSvgaPackMonoCursorDword(const uint8_t* bits,
|
||||
((uint32_t)bytes[3] << 24);
|
||||
}
|
||||
|
||||
// Implements the classic Cursor Width operation.
|
||||
static int32_t VmwSvgaClassicCursorWidth(int32_t width) {
|
||||
|
||||
// QEMU's VMware SVGA implementation reads classic cursor masks as
|
||||
@@ -399,7 +393,6 @@ static void VmwSvgaBuildMonoCursorBits(const uint32_t* argbPixels,
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the define Classic Cursor operation.
|
||||
static KSTATUS VmwSvgaDefineClassicCursor(VMWSVGA_DEVICE* v, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
int32_t encodedWidth = VmwSvgaClassicCursorWidth(width);
|
||||
uint32_t dwordsPerRow = ((uint32_t)encodedWidth + 31u) / 32u;
|
||||
@@ -460,7 +453,6 @@ done:
|
||||
return st;
|
||||
}
|
||||
|
||||
// Implements the upload Cursor Image operation.
|
||||
static KSTATUS VmwSvgaUploadCursorImage(VMWSVGA_DEVICE* v, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
if (!v || !v->HardwareCursor || !argbPixels || width <= 0 || height <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -478,7 +470,6 @@ static KSTATUS VmwSvgaUploadCursorImage(VMWSVGA_DEVICE* v, int32_t width, int32_
|
||||
return st;
|
||||
}
|
||||
|
||||
// Implements the define Cursor Image operation.
|
||||
static KSTATUS VmwSvgaDefineCursorImage(VMWSVGA_DEVICE* v, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
if (!v || !v->HardwareCursor || !argbPixels || width <= 0 || height <= 0)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -509,12 +500,10 @@ static KSTATUS VmwSvgaDefineCursorImage(VMWSVGA_DEVICE* v, int32_t width, int32_
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the align Up32 operation.
|
||||
static uint32_t VmwSvgaAlignUp32(uint32_t value, uint32_t alignment) {
|
||||
return (value + alignment - 1u) & ~(alignment - 1u);
|
||||
}
|
||||
|
||||
// Implements the define Screen Object operation.
|
||||
static KSTATUS VmwSvgaDefineScreenObject(VMWSVGA_DEVICE* v) {
|
||||
if (!v || !v->FifoReady || !v->UseScreenObject)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -549,7 +538,6 @@ static KSTATUS VmwSvgaDefineScreenObject(VMWSVGA_DEVICE* v) {
|
||||
return VmwSvgaSyncDevice(v);
|
||||
}
|
||||
|
||||
// Implements the define Gmrfb operation.
|
||||
static KSTATUS VmwSvgaDefineGmrfb(VMWSVGA_DEVICE* v) {
|
||||
if (!v || !v->FifoReady || !v->UseScreenObject)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -658,7 +646,6 @@ static KSTATUS VmwSvgaInitializeScreenObject(VMWSVGA_DEVICE* v) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the legacy Update operation.
|
||||
static KSTATUS VmwSvgaLegacyUpdate(VMWSVGA_DEVICE* v, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||
DISPLAY_RECT r = { x, y, w, h };
|
||||
if (!VmwSvgaClipRect(v, &r))
|
||||
@@ -712,7 +699,6 @@ static KSTATUS VmwSvgaSyncDevice(VMWSVGA_DEVICE* v) {
|
||||
return NTLSTATUS_TIMEOUT;
|
||||
}
|
||||
|
||||
// Implements the blend Pixel operation.
|
||||
static uint32_t VmwSvgaBlendPixel(uint32_t dst, uint32_t src) {
|
||||
uint8_t a = (uint8_t)(src >> 24);
|
||||
if (a == 0) return dst;
|
||||
@@ -731,12 +717,10 @@ static uint32_t VmwSvgaBlendPixel(uint32_t dst, uint32_t src) {
|
||||
return ((uint32_t)rr << 16) | ((uint32_t)gg << 8) | bb;
|
||||
}
|
||||
|
||||
// Implements the from Display operation.
|
||||
static VMWSVGA_DEVICE* VmwSvgaFromDisplay(DISPLAY_DEVICE* device) {
|
||||
return device ? (VMWSVGA_DEVICE*)device->DriverContext : NULL;
|
||||
}
|
||||
|
||||
// Implements the display Get Mode operation.
|
||||
static KSTATUS VmwSvgaDisplayGetMode(DISPLAY_DEVICE* device, DISPLAY_MODE* outMode) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !outMode || !v->Framebuffer)
|
||||
@@ -840,7 +824,6 @@ static void VmwSvgaCopyToShadowAndFramebuffer(uint32_t* shadow,
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the display pitched blit operation.
|
||||
static KSTATUS VmwSvgaDisplayBlit(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t* pixels, uint32_t pitchBytes) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !v->Backbuffer || !pixels || w <= 0 || h <= 0 ||
|
||||
@@ -913,7 +896,6 @@ static KSTATUS VmwSvgaDisplayPresentPitched(DISPLAY_DEVICE* device,
|
||||
return VmwSvgaSyncDevice(v);
|
||||
}
|
||||
|
||||
// Implements the display Fill Rect operation.
|
||||
static KSTATUS VmwSvgaDisplayFillRect(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !v->Backbuffer || w <= 0 || h <= 0)
|
||||
@@ -934,7 +916,6 @@ static KSTATUS VmwSvgaDisplayFillRect(DISPLAY_DEVICE* device, int32_t x, int32_t
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the display Copy Rect operation.
|
||||
static KSTATUS VmwSvgaDisplayCopyRect(DISPLAY_DEVICE* device, int32_t dstX, int32_t dstY, int32_t srcX, int32_t srcY, int32_t w, int32_t h) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !v->Backbuffer || w <= 0 || h <= 0)
|
||||
@@ -971,7 +952,6 @@ static KSTATUS VmwSvgaDisplayCopyRect(DISPLAY_DEVICE* device, int32_t dstX, int3
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the display Read Rect operation.
|
||||
static KSTATUS VmwSvgaDisplayReadRect(DISPLAY_DEVICE* device, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t* outPixels, uint32_t outStride) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !v->Backbuffer || !outPixels || outStride == 0 || w <= 0 || h <= 0)
|
||||
@@ -994,7 +974,6 @@ static KSTATUS VmwSvgaDisplayReadRect(DISPLAY_DEVICE* device, int32_t x, int32_t
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the display Present operation.
|
||||
static KSTATUS VmwSvgaDisplayPresent(DISPLAY_DEVICE* device, const DISPLAY_RECT* rects, size_t rectCount) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !v->Framebuffer || !v->Backbuffer)
|
||||
@@ -1039,13 +1018,11 @@ static KSTATUS VmwSvgaDisplayPresent(DISPLAY_DEVICE* device, const DISPLAY_RECT*
|
||||
return result;
|
||||
}
|
||||
|
||||
// Implements the display Sync operation.
|
||||
static KSTATUS VmwSvgaDisplaySync(DISPLAY_DEVICE* device) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
return VmwSvgaSyncDevice(v);
|
||||
}
|
||||
|
||||
// Implements the display Set Cursor Image operation.
|
||||
static KSTATUS VmwSvgaDisplaySetCursorImage(DISPLAY_DEVICE* device, int32_t width, int32_t height, int32_t hotX, int32_t hotY, const uint32_t* argbPixels) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !v->HardwareCursor)
|
||||
@@ -1053,7 +1030,6 @@ static KSTATUS VmwSvgaDisplaySetCursorImage(DISPLAY_DEVICE* device, int32_t widt
|
||||
return VmwSvgaDefineCursorImage(v, width, height, hotX, hotY, argbPixels);
|
||||
}
|
||||
|
||||
// Implements the display Set Cursor Position operation.
|
||||
static KSTATUS VmwSvgaDisplaySetCursorPosition(DISPLAY_DEVICE* device, int32_t x, int32_t y) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v)
|
||||
@@ -1066,7 +1042,6 @@ static KSTATUS VmwSvgaDisplaySetCursorPosition(DISPLAY_DEVICE* device, int32_t x
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the restore Cursor operation.
|
||||
static void VmwSvgaRestoreCursor(VMWSVGA_DEVICE* v) {
|
||||
if (!v || !v->CursorDrawn || !v->Backbuffer || !v->Framebuffer)
|
||||
return;
|
||||
@@ -1119,7 +1094,6 @@ static void VmwSvgaDrawCursor(VMWSVGA_DEVICE* v) {
|
||||
(void)VmwSvgaUpdate(v, dirty.X, dirty.Y, dirty.W, dirty.H);
|
||||
}
|
||||
|
||||
// Implements the display Show Cursor operation.
|
||||
static KSTATUS VmwSvgaDisplayShowCursor(DISPLAY_DEVICE* device, bool show) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v)
|
||||
@@ -1154,7 +1128,6 @@ static KSTATUS VmwSvgaDisplayShowCursor(DISPLAY_DEVICE* device, bool show) {
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the display Query Stats operation.
|
||||
static KSTATUS VmwSvgaDisplayQueryStats(DISPLAY_DEVICE* device, DISPLAY_STATS* outStats) {
|
||||
VMWSVGA_DEVICE* v = VmwSvgaFromDisplay(device);
|
||||
if (!v || !outStats)
|
||||
@@ -1178,7 +1151,6 @@ static const DISPLAY_DEVICE_OPS gVmwSvgaDisplayOps = {
|
||||
.QueryStats = VmwSvgaDisplayQueryStats,
|
||||
};
|
||||
|
||||
// Implements the select Bars operation.
|
||||
static KSTATUS VmwSvgaSelectBars(VMWSVGA_DEVICE* v) {
|
||||
PCI_BAR bar;
|
||||
memset(&bar, 0, sizeof(bar));
|
||||
@@ -1564,7 +1536,6 @@ KSTATUS VmwSvgaDispatchPnp(DEVICE_OBJECT* device, IRP* irp) {
|
||||
}
|
||||
}
|
||||
|
||||
// Implements the add Device operation.
|
||||
KSTATUS VmwSvgaAddDevice(DRIVER_OBJECT* driver, DEVICE_OBJECT* physicalDeviceObject) {
|
||||
if (!driver || !physicalDeviceObject || physicalDeviceObject->Type != DeviceObjectPhysical)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -1589,14 +1560,12 @@ KSTATUS VmwSvgaAddDevice(DRIVER_OBJECT* driver, DEVICE_OBJECT* physicalDeviceObj
|
||||
return NTLSTATUS_FAILURE;
|
||||
}
|
||||
|
||||
DbgPrint("VMWSVGA: FDO attached to %v\n", physicalDeviceObject->Name);
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static KSTATUS DriverInitialize(NTL_MODULE* module) {
|
||||
(void)module;
|
||||
|
||||
DbgPrint("VMWSVGA: driver loading...\n");
|
||||
|
||||
memset(&gVmwSvgaDriver, 0, sizeof(gVmwSvgaDriver));
|
||||
IoInitializeDriverObject(&gVmwSvgaDriver, SYS_SV_LITERAL("vmwaresvga"));
|
||||
|
||||
Reference in new issue
Block a user