From d89e0df163f047ad73fc89642f7bb2557d5cb8a2 Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Wed, 26 May 1999 00:39:11 +0000 Subject: [PATCH] changes to support VGA miniport driver svn path=/trunk/; revision=517 --- reactos/drivers/dd/vidport/vidport.c | 38 +++++++++++++++++++++++----- reactos/include/ddk/ntddvid.h | 7 +++++ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/dd/vidport/vidport.c b/reactos/drivers/dd/vidport/vidport.c index f9883ca76e5..27bef2d8352 100644 --- a/reactos/drivers/dd/vidport/vidport.c +++ b/reactos/drivers/dd/vidport/vidport.c @@ -106,7 +106,7 @@ VideoPortGetBusData(IN PVOID HwDeviceExtension, UCHAR VideoPortGetCurrentIrql(VOID) { - return KeGetCurrentIrql; + return KeGetCurrentIrql(); } PVOID @@ -115,7 +115,15 @@ VideoPortGetDeviceBase(IN PVOID HwDeviceExtension, IN ULONG NumberOfUchars, IN UCHAR InIoSpace) { - UNIMPLEMENTED; + if (InIoSpace) + { + return MmMapIoSpace(IoAddress, NumberOfUChars, FALSE); + } + else + { + UNIMPLEMENTED; + return NULL; + } } VP_STATUS @@ -217,7 +225,9 @@ VideoPortInitialize(IN PVOID Context1, /* FIXME: Allocate hardware resources for device */ /* Allocate interrupt for device */ - if (HwInitializationData->HwInterrupt != NULL) + if (HwInitializationData->HwInterrupt != NULL && + !(ConfigInfo.BusInterruptLevel == 0 && + ConfigInfo.BusInterruptVector == 0)) { ExtensionData->IRQL = ConfigInfo.BusInterruptLevel; ExtensionData->Interrupt = @@ -311,7 +321,18 @@ VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PULONG InIoSpace, OUT PVOID *VirtualAddress) { - UNIMPLEMENTED; + if (*InIoSpace) + { + *VirtualAddress = MmMapIoSpace(PhyiscalAddress, Length, FALSE); + + return *VirtualAddress != NULL ? STATUS_SUCCESS : STATUS_INSUFFICFIENT_RESOURCES; + } + else + { + UNIMPLEMENTED; + } + + return STATUS_SUCCESS; } VOID @@ -319,7 +340,7 @@ VideoPortMoveMemory(OUT PVOID Destination, IN PVOID Source, IN ULONG Length) { - UNIMPLEMENTED; + RtlMoveMemory(Destination, Source, Length); } UCHAR @@ -423,7 +444,12 @@ VideoPortSetBusData(IN PVOID HwDeviceExtension, IN ULONG Offset, IN ULONG Length) { - UNIMPLEMENTED; + return HalSetBusDataByOffset(BusDataType, + 0, + SlotNumber, + Buffer, + Offset, + Length); } VP_STATUS diff --git a/reactos/include/ddk/ntddvid.h b/reactos/include/ddk/ntddvid.h index f6be51204ce..79251b14224 100644 --- a/reactos/include/ddk/ntddvid.h +++ b/reactos/include/ddk/ntddvid.h @@ -27,6 +27,13 @@ * interrupts are handled the same as KM drivers. */ +typedef enum _VP_STATUS +{ + NO_ERROR, + ERROR_DEV_NOT_EXIST, + ERROR_INVALID_PARAMETER +} VP_STATUS, *PVP_STATUS; + #define VIDEO_MEMORY_SPACE_MEMORY 0x00 #define VIDEO_MEMORY_SPACE_IO 0x01 #define VIDEO_MEMORY_SPACE_USER_MODE 0x02