mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
Moved videoprt driver to a new location and implemented few functions.
svn path=/trunk/; revision=7768
This commit is contained in:
parent
ebbc9105dd
commit
6e45aaa48b
12 changed files with 548 additions and 524 deletions
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.205 2004/01/16 04:35:07 mtempel Exp $
|
# $Id: Makefile,v 1.206 2004/01/19 15:56:53 navaraf Exp $
|
||||||
#
|
#
|
||||||
# Global makefile
|
# Global makefile
|
||||||
#
|
#
|
||||||
|
@ -65,8 +65,8 @@ DRIVERS_LIB = bzip2
|
||||||
|
|
||||||
# Kernel mode device drivers
|
# Kernel mode device drivers
|
||||||
# Obsolete: ide
|
# Obsolete: ide
|
||||||
# beep blue floppy null parallel ramdrv serenum serial videoprt
|
# beep blue floppy null parallel ramdrv serenum serial
|
||||||
DEVICE_DRIVERS = beep blue debugout floppy null serial videoprt bootvid
|
DEVICE_DRIVERS = beep blue debugout floppy null serial bootvid
|
||||||
|
|
||||||
# Kernel mode input drivers
|
# Kernel mode input drivers
|
||||||
INPUT_DRIVERS = keyboard mouclass psaux sermouse
|
INPUT_DRIVERS = keyboard mouclass psaux sermouse
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
; $Id: videoprt.edf,v 1.2 2003/06/19 16:04:05 gvg Exp $
|
|
||||||
;
|
|
||||||
; vidport.def - export definition file for ReactOS
|
|
||||||
;
|
|
||||||
EXPORTS
|
|
||||||
ReturnCsrssAddress
|
|
||||||
VideoPortCompareMemory=NTOSKRNL.RtlCompareMemory
|
|
||||||
VideoPortDebugPrint
|
|
||||||
VideoPortDisableInterrupt=VideoPortDisableInterrupt@4
|
|
||||||
VideoPortEnableInterrupt=VideoPortEnableInterrupt@4
|
|
||||||
VideoPortFreeDeviceBase=VideoPortFreeDeviceBase@8
|
|
||||||
VideoPortGetBusData=VideoPortGetBusData@24
|
|
||||||
VideoPortGetCurrentIrql=VideoPortGetCurrentIrql@0
|
|
||||||
VideoPortGetDeviceBase=VideoPortGetDeviceBase@20
|
|
||||||
VideoPortGetDeviceData=VideoPortGetDeviceData@16
|
|
||||||
VideoPortGetAccessRanges=VideoPortGetAccessRanges@32
|
|
||||||
VideoPortGetRegistryParameters=VideoPortGetRegistryParameters@20
|
|
||||||
VideoPortInitialize=VideoPortInitialize@16
|
|
||||||
VideoPortInt10=VideoPortInt10@8
|
|
||||||
VideoPortLogError=VideoPortLogError@16
|
|
||||||
VideoPortMapBankedMemory=VideoPortMapBankedMemory@40
|
|
||||||
VideoPortMapMemory=VideoPortMapMemory@24
|
|
||||||
VideoPortMoveMemory=NTOSKRNL.RtlMoveMemory
|
|
||||||
VideoPortReadPortUchar=VideoPortReadPortUchar@4
|
|
||||||
VideoPortReadPortUshort=VideoPortReadPortUshort@4
|
|
||||||
VideoPortReadPortUlong=VideoPortReadPortUlong@4
|
|
||||||
VideoPortReadPortBufferUchar=VideoPortReadPortBufferUchar@12
|
|
||||||
VideoPortReadPortBufferUshort=VideoPortReadPortBufferUshort@12
|
|
||||||
VideoPortReadPortBufferUlong=VideoPortReadPortBufferUlong@12
|
|
||||||
VideoPortReadRegisterUchar=VideoPortReadRegisterUchar@4
|
|
||||||
VideoPortReadRegisterUshort=VideoPortReadRegisterUshort@4
|
|
||||||
VideoPortReadRegisterUlong=VideoPortReadRegisterUlong@4
|
|
||||||
VideoPortReadRegisterBufferUchar=VideoPortReadRegisterBufferUchar@12
|
|
||||||
VideoPortReadRegisterBufferUshort=VideoPortReadRegisterBufferUshort@12
|
|
||||||
VideoPortReadRegisterBufferUlong=VideoPortReadRegisterBufferUlong@12
|
|
||||||
VideoPortScanRom=VideoPortScanRom@16
|
|
||||||
VideoPortSetBusData=VideoPortSetBusData@24
|
|
||||||
VideoPortSetRegistryParameters=VideoPortSetRegistryParameters@16
|
|
||||||
VideoPortSetTrappedEmulatorPorts=VideoPortSetTrappedEmulatorPorts@12
|
|
||||||
VideoPortStallExecution=HAL.KeStallExecutionProcessor
|
|
||||||
;VideoPortStallExecution=NTOSKRNL.KeStallExecutionProcessor
|
|
||||||
VideoPortStartTimer=VideoPortStartTimer@4
|
|
||||||
VideoPortStopTimer=VideoPortStopTimer@4
|
|
||||||
VideoPortSynchronizeExecution=VideoPortSynchronizeExecution@16
|
|
||||||
VideoPortUnmapMemory=VideoPortUnmapMemory@12
|
|
||||||
VideoPortVerifyAccessRanges=VideoPortVerifyAccessRanges@12
|
|
||||||
VideoPortWritePortUchar=VideoPortWritePortUchar@8
|
|
||||||
VideoPortWritePortUshort=VideoPortWritePortUshort@8
|
|
||||||
VideoPortWritePortUlong=VideoPortWritePortUlong@8
|
|
||||||
VideoPortWritePortBufferUchar=VideoPortWritePortBufferUchar@12
|
|
||||||
VideoPortWritePortBufferUshort=VideoPortWritePortBufferUshort@12
|
|
||||||
VideoPortWritePortBufferUlong=VideoPortWritePortBufferUlong@12
|
|
||||||
VideoPortWriteRegisterUchar=VideoPortWriteRegisterUchar@8
|
|
||||||
VideoPortWriteRegisterUshort=VideoPortWriteRegisterUshort@8
|
|
||||||
VideoPortWriteRegisterUlong=VideoPortWriteRegisterUlong@8
|
|
||||||
VideoPortWriteRegisterBufferUchar=VideoPortWriteRegisterBufferUchar@12
|
|
||||||
VideoPortWriteRegisterBufferUshort=VideoPortWriteRegisterBufferUshort@12
|
|
||||||
VideoPortWriteRegisterBufferUlong=VideoPortWriteRegisterBufferUlong@12
|
|
||||||
VideoPortZeroMemory=NTOSKRNL.RtlZeroMemory
|
|
||||||
VideoPortZeroDeviceMemory=VideoPortZeroDeviceMemory@8
|
|
||||||
|
|
|
@ -2,14 +2,19 @@ DISPLAY_DRIVERS = vga framebuf
|
||||||
MINIPORT_DRIVERS = vga vbe
|
MINIPORT_DRIVERS = vga vbe
|
||||||
|
|
||||||
all: $(DISPLAY_DRIVERS:%=DD%) $(MINIPORT_DRIVERS:%=MP%)
|
all: $(DISPLAY_DRIVERS:%=DD%) $(MINIPORT_DRIVERS:%=MP%)
|
||||||
|
$(MAKE) -C videoprt all
|
||||||
|
|
||||||
implib: $(DISPLAY_DRIVERS:%=DD%_implib) $(MINIPORT_DRIVERS:%=MP%_implib)
|
implib: $(DISPLAY_DRIVERS:%=DD%_implib) $(MINIPORT_DRIVERS:%=MP%_implib)
|
||||||
|
$(MAKE) -C videoprt implib
|
||||||
|
|
||||||
clean: $(DISPLAY_DRIVERS:%=DD%_clean) $(MINIPORT_DRIVERS:%=MP%_clean)
|
clean: $(DISPLAY_DRIVERS:%=DD%_clean) $(MINIPORT_DRIVERS:%=MP%_clean)
|
||||||
|
$(MAKE) -C videoprt clean
|
||||||
|
|
||||||
install: $(DISPLAY_DRIVERS:%=DD%_install) $(MINIPORT_DRIVERS:%=MP%_install)
|
install: $(DISPLAY_DRIVERS:%=DD%_install) $(MINIPORT_DRIVERS:%=MP%_install)
|
||||||
|
$(MAKE) -C videoprt install
|
||||||
|
|
||||||
bootcd: $(DISPLAY_DRIVERS:%=DD%_bootcd) $(MINIPORT_DRIVERS:%=MP%_bootcd)
|
bootcd: $(DISPLAY_DRIVERS:%=DD%_bootcd) $(MINIPORT_DRIVERS:%=MP%_bootcd)
|
||||||
|
$(MAKE) -C videoprt bootcd
|
||||||
|
|
||||||
#
|
#
|
||||||
# Video display driver rules
|
# Video display driver rules
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: Makefile,v 1.3 2003/11/30 19:15:21 gvg Exp $
|
# $Id: Makefile,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
|
|
||||||
PATH_TO_TOP = ../../..
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ TARGET_TYPE = export_driver
|
||||||
|
|
||||||
TARGET_NAME = videoprt
|
TARGET_NAME = videoprt
|
||||||
|
|
||||||
TARGET_CFLAGS += -Wall -Werror -I$(PATH_TO_TOP)/ntoskrnl/include
|
TARGET_CFLAGS += -Wall -Werror -D__USE_W32API -I$(PATH_TO_TOP)/ntoskrnl/include
|
||||||
|
|
||||||
TARGET_OBJECTS = videoprt.o
|
TARGET_OBJECTS = videoprt.o int10.o services.o
|
||||||
|
|
||||||
include $(PATH_TO_TOP)/rules.mak
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
208
reactos/drivers/video/videoprt/int10.c
Normal file
208
reactos/drivers/video/videoprt/int10.c
Normal file
|
@ -0,0 +1,208 @@
|
||||||
|
/*
|
||||||
|
* VideoPort driver
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; see the file COPYING.LIB.
|
||||||
|
* If not, write to the Free Software Foundation,
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id: int10.c,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "videoprt.h"
|
||||||
|
#include "internal/v86m.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
VideoPortInt10(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
|
||||||
|
{
|
||||||
|
KV86M_REGISTERS Regs;
|
||||||
|
NTSTATUS Status;
|
||||||
|
PEPROCESS CallingProcess;
|
||||||
|
PEPROCESS PrevAttachedProcess;
|
||||||
|
|
||||||
|
DPRINT("VideoPortInt10\n");
|
||||||
|
|
||||||
|
CallingProcess = PsGetCurrentProcess();
|
||||||
|
if (CallingProcess != Csrss)
|
||||||
|
{
|
||||||
|
if (NULL != PsGetCurrentThread()->OldProcess)
|
||||||
|
{
|
||||||
|
PrevAttachedProcess = CallingProcess;
|
||||||
|
KeDetachProcess();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrevAttachedProcess = NULL;
|
||||||
|
}
|
||||||
|
KeAttachProcess(Csrss);
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&Regs, 0, sizeof(Regs));
|
||||||
|
Regs.Eax = BiosArguments->Eax;
|
||||||
|
Regs.Ebx = BiosArguments->Ebx;
|
||||||
|
Regs.Ecx = BiosArguments->Ecx;
|
||||||
|
Regs.Edx = BiosArguments->Edx;
|
||||||
|
Regs.Esi = BiosArguments->Esi;
|
||||||
|
Regs.Edi = BiosArguments->Edi;
|
||||||
|
Regs.Ebp = BiosArguments->Ebp;
|
||||||
|
Status = Ke386CallBios(0x10, &Regs);
|
||||||
|
|
||||||
|
if (CallingProcess != Csrss)
|
||||||
|
{
|
||||||
|
KeDetachProcess();
|
||||||
|
if (NULL != PrevAttachedProcess)
|
||||||
|
{
|
||||||
|
KeAttachProcess(PrevAttachedProcess);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10AllocateBuffer(
|
||||||
|
IN PVOID Context,
|
||||||
|
OUT PUSHORT Seg,
|
||||||
|
OUT PUSHORT Off,
|
||||||
|
IN OUT PULONG Length)
|
||||||
|
{
|
||||||
|
PVOID MemoryAddress;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
DPRINT("IntInt10AllocateBuffer\n");
|
||||||
|
|
||||||
|
MemoryAddress = (PVOID)0x20000;
|
||||||
|
Status = ZwAllocateVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0,
|
||||||
|
Length, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
}
|
||||||
|
if (MemoryAddress > (PVOID)(0x100000 - *Length))
|
||||||
|
{
|
||||||
|
ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, Length,
|
||||||
|
MEM_RELEASE);
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
*Seg = (ULONG)MemoryAddress >> 4;
|
||||||
|
*Off = (ULONG)MemoryAddress & 0xFF;
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10FreeBuffer(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN USHORT Seg,
|
||||||
|
IN USHORT Off)
|
||||||
|
{
|
||||||
|
PVOID MemoryAddress = (PVOID)((Seg << 4) + Off);
|
||||||
|
DPRINT("IntInt10FreeBuffer\n");
|
||||||
|
return ZwFreeVirtualMemory(NtCurrentProcess(), &MemoryAddress, 0,
|
||||||
|
MEM_RELEASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10ReadMemory(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN USHORT Seg,
|
||||||
|
IN USHORT Off,
|
||||||
|
OUT PVOID Buffer,
|
||||||
|
IN ULONG Length)
|
||||||
|
{
|
||||||
|
DPRINT("IntInt10ReadMemory\n");
|
||||||
|
RtlCopyMemory(Buffer, (PVOID)((Seg << 4) + Off), Length);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10WriteMemory(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN USHORT Seg,
|
||||||
|
IN USHORT Off,
|
||||||
|
IN PVOID Buffer,
|
||||||
|
IN ULONG Length)
|
||||||
|
{
|
||||||
|
DPRINT("IntInt10WriteMemory\n");
|
||||||
|
RtlCopyMemory((PVOID)((Seg << 4) + Off), Buffer, Length);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10CallBios(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
|
||||||
|
{
|
||||||
|
KV86M_REGISTERS Regs;
|
||||||
|
NTSTATUS Status;
|
||||||
|
PEPROCESS CallingProcess;
|
||||||
|
PEPROCESS PrevAttachedProcess;
|
||||||
|
|
||||||
|
DPRINT("IntInt10CallBios\n");
|
||||||
|
|
||||||
|
CallingProcess = PsGetCurrentProcess();
|
||||||
|
if (CallingProcess != Csrss)
|
||||||
|
{
|
||||||
|
if (NULL != PsGetCurrentThread()->OldProcess)
|
||||||
|
{
|
||||||
|
PrevAttachedProcess = CallingProcess;
|
||||||
|
KeDetachProcess();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrevAttachedProcess = NULL;
|
||||||
|
}
|
||||||
|
KeAttachProcess(Csrss);
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&Regs, 0, sizeof(Regs));
|
||||||
|
Regs.Eax = BiosArguments->Eax;
|
||||||
|
Regs.Ebx = BiosArguments->Ebx;
|
||||||
|
Regs.Ecx = BiosArguments->Ecx;
|
||||||
|
Regs.Edx = BiosArguments->Edx;
|
||||||
|
Regs.Esi = BiosArguments->Esi;
|
||||||
|
Regs.Edi = BiosArguments->Edi;
|
||||||
|
Regs.Ebp = BiosArguments->Ebp;
|
||||||
|
Regs.Ds = BiosArguments->SegDs;
|
||||||
|
Regs.Es = BiosArguments->SegEs;
|
||||||
|
Status = Ke386CallBios(0x10, &Regs);
|
||||||
|
BiosArguments->Eax = Regs.Eax;
|
||||||
|
BiosArguments->Ebx = Regs.Ebx;
|
||||||
|
BiosArguments->Ecx = Regs.Ecx;
|
||||||
|
BiosArguments->Edx = Regs.Edx;
|
||||||
|
BiosArguments->Esi = Regs.Esi;
|
||||||
|
BiosArguments->Edi = Regs.Edi;
|
||||||
|
BiosArguments->Ebp = Regs.Ebp;
|
||||||
|
BiosArguments->SegDs = Regs.Ds;
|
||||||
|
BiosArguments->SegEs = Regs.Es;
|
||||||
|
|
||||||
|
if (CallingProcess != Csrss)
|
||||||
|
{
|
||||||
|
KeDetachProcess();
|
||||||
|
if (NULL != PrevAttachedProcess)
|
||||||
|
{
|
||||||
|
KeAttachProcess(PrevAttachedProcess);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
75
reactos/drivers/video/videoprt/services.c
Normal file
75
reactos/drivers/video/videoprt/services.c
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
/*
|
||||||
|
* VideoPort driver
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; see the file COPYING.LIB.
|
||||||
|
* If not, write to the Free Software Foundation,
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id: services.c,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "videoprt.h"
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
IntInterfaceReference(PVOID Context)
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
IntInterfaceDereference(PVOID Context)
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
}
|
||||||
|
|
||||||
|
VP_STATUS
|
||||||
|
STDCALL
|
||||||
|
VideoPortQueryServices(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN VIDEO_PORT_SERVICES ServicesType,
|
||||||
|
IN OUT PINTERFACE Interface)
|
||||||
|
{
|
||||||
|
switch (ServicesType)
|
||||||
|
{
|
||||||
|
case VideoPortServicesInt10:
|
||||||
|
if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 ||
|
||||||
|
Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE))
|
||||||
|
{
|
||||||
|
VIDEO_PORT_INT10_INTERFACE *Int10Interface =
|
||||||
|
(VIDEO_PORT_INT10_INTERFACE *)Interface;
|
||||||
|
|
||||||
|
Interface->InterfaceReference = IntInterfaceReference;
|
||||||
|
Interface->InterfaceDereference = IntInterfaceDereference;
|
||||||
|
Int10Interface->Int10AllocateBuffer = IntInt10AllocateBuffer;
|
||||||
|
Int10Interface->Int10FreeBuffer = IntInt10FreeBuffer;
|
||||||
|
Int10Interface->Int10ReadMemory = IntInt10ReadMemory;
|
||||||
|
Int10Interface->Int10WriteMemory = IntInt10WriteMemory;
|
||||||
|
Int10Interface->Int10CallBios = IntInt10CallBios;
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VideoPortServicesAGP:
|
||||||
|
case VideoPortServicesI2C:
|
||||||
|
case VideoPortServicesHeadless:
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
|
@ -1,74 +1,31 @@
|
||||||
/* $Id: videoprt.c,v 1.15 2003/12/03 18:58:41 navaraf Exp $
|
/*
|
||||||
*
|
|
||||||
* VideoPort driver
|
* VideoPort driver
|
||||||
* Written by Rex Jolliff
|
|
||||||
*
|
*
|
||||||
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; see the file COPYING.LIB.
|
||||||
|
* If not, write to the Free Software Foundation,
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id: videoprt.c,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errors.h>
|
#include "videoprt.h"
|
||||||
#include <roskrnl.h>
|
|
||||||
#include <ddk/ntddvid.h>
|
|
||||||
|
|
||||||
#include "internal/v86m.h"
|
BOOLEAN CsrssInitialized = FALSE;
|
||||||
#include "internal/ps.h"
|
PEPROCESS Csrss = NULL;
|
||||||
|
PVIDEO_PORT_DEVICE_EXTENSION ResetDisplayParametersDeviceExtension = NULL;
|
||||||
#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
#define VERSION "0.0.0"
|
|
||||||
|
|
||||||
#define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P')
|
|
||||||
|
|
||||||
typedef struct _VIDEO_PORT_ADDRESS_MAPPING
|
|
||||||
{
|
|
||||||
LIST_ENTRY List;
|
|
||||||
|
|
||||||
PVOID MappedAddress;
|
|
||||||
ULONG NumberOfUchars;
|
|
||||||
PHYSICAL_ADDRESS IoAddress;
|
|
||||||
ULONG SystemIoBusNumber;
|
|
||||||
UINT MappingCount;
|
|
||||||
} VIDEO_PORT_ADDRESS_MAPPING, *PVIDEO_PORT_ADDRESS_MAPPING;
|
|
||||||
|
|
||||||
typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
|
|
||||||
{
|
|
||||||
PDEVICE_OBJECT DeviceObject;
|
|
||||||
PKINTERRUPT InterruptObject;
|
|
||||||
KSPIN_LOCK InterruptSpinLock;
|
|
||||||
ULONG InterruptVector;
|
|
||||||
ULONG InterruptLevel;
|
|
||||||
PVIDEO_HW_INITIALIZE HwInitialize;
|
|
||||||
PVIDEO_HW_RESET_HW HwResetHw;
|
|
||||||
PVIDEO_HW_TIMER HwTimer;
|
|
||||||
PVIDEO_HW_INTERRUPT HwInterrupt;
|
|
||||||
LIST_ENTRY AddressMappingListHead;
|
|
||||||
INTERFACE_TYPE AdapterInterfaceType;
|
|
||||||
ULONG SystemIoBusNumber;
|
|
||||||
UNICODE_STRING RegistryPath;
|
|
||||||
|
|
||||||
UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */
|
|
||||||
} VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;
|
|
||||||
|
|
||||||
|
|
||||||
static NTSTATUS STDCALL VidDispatchOpen(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
|
|
||||||
static NTSTATUS STDCALL VidDispatchClose(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
|
|
||||||
static NTSTATUS STDCALL VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
|
|
||||||
static PVOID STDCALL InternalMapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
|
||||||
IN PHYSICAL_ADDRESS IoAddress,
|
|
||||||
IN ULONG NumberOfUchars,
|
|
||||||
IN UCHAR InIoSpace);
|
|
||||||
static VOID STDCALL InternalUnmapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
|
||||||
IN PVOID MappedAddress);
|
|
||||||
|
|
||||||
static BOOLEAN CsrssInitialized = FALSE;
|
|
||||||
static PEPROCESS Csrss = NULL;
|
|
||||||
static PVIDEO_PORT_DEVICE_EXTENSION ResetDisplayParametersDeviceExtension = NULL;
|
|
||||||
|
|
||||||
PBYTE ReturnCsrssAddress(void)
|
|
||||||
{
|
|
||||||
DPRINT("ReturnCsrssAddress()\n");
|
|
||||||
return (PBYTE)Csrss;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------- Public Interface
|
// ------------------------------------------------------- Public Interface
|
||||||
|
|
||||||
|
@ -89,7 +46,7 @@ PBYTE ReturnCsrssAddress(void)
|
||||||
// RETURNS:
|
// RETURNS:
|
||||||
// NTSTATUS
|
// NTSTATUS
|
||||||
|
|
||||||
STDCALL NTSTATUS
|
NTSTATUS STDCALL
|
||||||
DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||||
IN PUNICODE_STRING RegistryPath)
|
IN PUNICODE_STRING RegistryPath)
|
||||||
{
|
{
|
||||||
|
@ -101,7 +58,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
VideoPortDebugPrint(IN ULONG DebugPrintLevel,
|
VideoPortDebugPrint(IN VIDEO_DEBUG_LEVEL DebugPrintLevel,
|
||||||
IN PCHAR DebugMessage, ...)
|
IN PCHAR DebugMessage, ...)
|
||||||
{
|
{
|
||||||
char Buffer[256];
|
char Buffer[256];
|
||||||
|
@ -694,59 +651,6 @@ VideoPortInitialize(IN PVOID Context1,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dummy;
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VP_STATUS STDCALL
|
|
||||||
VideoPortInt10(IN PVOID HwDeviceExtension,
|
|
||||||
IN PVIDEO_X86_BIOS_ARGUMENTS BiosArguments)
|
|
||||||
{
|
|
||||||
KV86M_REGISTERS Regs;
|
|
||||||
NTSTATUS Status;
|
|
||||||
PEPROCESS CallingProcess;
|
|
||||||
PEPROCESS PrevAttachedProcess;
|
|
||||||
|
|
||||||
DPRINT("VideoPortInt10\n");
|
|
||||||
|
|
||||||
CallingProcess = PsGetCurrentProcess();
|
|
||||||
if (CallingProcess != Csrss)
|
|
||||||
{
|
|
||||||
if (NULL != PsGetCurrentThread()->OldProcess)
|
|
||||||
{
|
|
||||||
PrevAttachedProcess = CallingProcess;
|
|
||||||
KeDetachProcess();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PrevAttachedProcess = NULL;
|
|
||||||
}
|
|
||||||
KeAttachProcess(Csrss);
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&Regs, 0, sizeof(Regs));
|
|
||||||
Regs.Eax = BiosArguments->Eax;
|
|
||||||
Regs.Ebx = BiosArguments->Ebx;
|
|
||||||
Regs.Ecx = BiosArguments->Ecx;
|
|
||||||
Regs.Edx = BiosArguments->Edx;
|
|
||||||
Regs.Esi = BiosArguments->Esi;
|
|
||||||
Regs.Edi = BiosArguments->Edi;
|
|
||||||
Regs.Ebp = BiosArguments->Ebp;
|
|
||||||
Status = Ke386CallBios(0x10, &Regs);
|
|
||||||
|
|
||||||
if (CallingProcess != Csrss)
|
|
||||||
{
|
|
||||||
KeDetachProcess();
|
|
||||||
if (NULL != PrevAttachedProcess)
|
|
||||||
{
|
|
||||||
KeAttachProcess(PrevAttachedProcess);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return(Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -812,162 +716,6 @@ VideoPortMapMemory(IN PVOID HwDeviceExtension,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
UCHAR
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadPortUchar(IN PUCHAR Port)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortUchar\n");
|
|
||||||
return READ_PORT_UCHAR(Port);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
USHORT
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadPortUshort(IN PUSHORT Port)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortUshort\n");
|
|
||||||
return READ_PORT_USHORT(Port);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
ULONG
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadPortUlong(IN PULONG Port)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortUlong\n");
|
|
||||||
return READ_PORT_ULONG(Port);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadPortBufferUchar(IN PUCHAR Port,
|
|
||||||
OUT PUCHAR Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortBufferUchar\n");
|
|
||||||
READ_PORT_BUFFER_UCHAR(Port, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadPortBufferUshort(IN PUSHORT Port,
|
|
||||||
OUT PUSHORT Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortBufferUshort\n");
|
|
||||||
READ_PORT_BUFFER_USHORT(Port, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadPortBufferUlong(IN PULONG Port,
|
|
||||||
OUT PULONG Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortBufferUlong\n");
|
|
||||||
READ_PORT_BUFFER_ULONG(Port, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
UCHAR
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadRegisterUchar(IN PUCHAR Register)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortRegisterUchar\n");
|
|
||||||
return READ_REGISTER_UCHAR(Register);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
USHORT
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadRegisterUshort(IN PUSHORT Register)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortRegisterUshort\n");
|
|
||||||
return READ_REGISTER_USHORT(Register);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
ULONG
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadRegisterUlong(IN PULONG Register)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortRegisterUlong\n");
|
|
||||||
return READ_REGISTER_ULONG(Register);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadRegisterBufferUchar(IN PUCHAR Register,
|
|
||||||
OUT PUCHAR Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortRegisterBufferUchar\n");
|
|
||||||
READ_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadRegisterBufferUshort(IN PUSHORT Register,
|
|
||||||
OUT PUSHORT Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortRegisterBufferUshort\n");
|
|
||||||
READ_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortReadRegisterBufferUlong(IN PULONG Register,
|
|
||||||
OUT PULONG Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortReadPortRegisterBufferUlong\n");
|
|
||||||
READ_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -1196,177 +944,6 @@ VideoPortVerifyAccessRanges(IN PVOID HwDeviceExtension,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWritePortUchar(IN PUCHAR Port,
|
|
||||||
IN UCHAR Value)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWritePortUchar\n");
|
|
||||||
WRITE_PORT_UCHAR(Port, Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWritePortUshort(IN PUSHORT Port,
|
|
||||||
IN USHORT Value)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWritePortUshort\n");
|
|
||||||
WRITE_PORT_USHORT(Port, Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWritePortUlong(IN PULONG Port,
|
|
||||||
IN ULONG Value)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWritePortUlong\n");
|
|
||||||
WRITE_PORT_ULONG(Port, Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWritePortBufferUchar(IN PUCHAR Port,
|
|
||||||
IN PUCHAR Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWritePortBufferUchar\n");
|
|
||||||
WRITE_PORT_BUFFER_UCHAR(Port, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWritePortBufferUshort(IN PUSHORT Port,
|
|
||||||
IN PUSHORT Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWritePortBufferUshort\n");
|
|
||||||
WRITE_PORT_BUFFER_USHORT(Port, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWritePortBufferUlong(IN PULONG Port,
|
|
||||||
IN PULONG Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWritePortBufferUlong\n");
|
|
||||||
WRITE_PORT_BUFFER_ULONG(Port, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWriteRegisterUchar(IN PUCHAR Register,
|
|
||||||
IN UCHAR Value)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWriteRegisterUchar\n");
|
|
||||||
WRITE_REGISTER_UCHAR(Register, Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWriteRegisterUshort(IN PUSHORT Register,
|
|
||||||
IN USHORT Value)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWriteRegisterUshort\n");
|
|
||||||
WRITE_REGISTER_USHORT(Register, Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWriteRegisterUlong(IN PULONG Register,
|
|
||||||
IN ULONG Value)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWriteRegisterUlong\n");
|
|
||||||
WRITE_REGISTER_ULONG(Register, Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
VideoPortWriteRegisterBufferUchar(IN PUCHAR Register,
|
|
||||||
IN PUCHAR Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWriteRegisterBufferUchar\n");
|
|
||||||
WRITE_REGISTER_BUFFER_UCHAR(Register, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID STDCALL
|
|
||||||
VideoPortWriteRegisterBufferUshort(IN PUSHORT Register,
|
|
||||||
IN PUSHORT Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWriteRegisterBufferUshort\n");
|
|
||||||
WRITE_REGISTER_BUFFER_USHORT(Register, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID STDCALL
|
|
||||||
VideoPortWriteRegisterBufferUlong(IN PULONG Register,
|
|
||||||
IN PULONG Buffer,
|
|
||||||
IN ULONG Count)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortWriteRegisterBufferUlong\n");
|
|
||||||
WRITE_REGISTER_BUFFER_ULONG(Register, Buffer, Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID STDCALL
|
|
||||||
VideoPortZeroDeviceMemory(OUT PVOID Destination,
|
|
||||||
IN ULONG Length)
|
|
||||||
{
|
|
||||||
DPRINT("VideoPortZeroDeviceMemory\n");
|
|
||||||
RtlZeroMemory(Destination, Length);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset display to blue screen
|
* Reset display to blue screen
|
||||||
*/
|
*/
|
||||||
|
@ -1392,6 +969,33 @@ VideoPortResetDisplayParameters(Columns, Rows)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
STDCALL
|
||||||
|
VideoPortAllocatePool(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN VP_POOL_TYPE PoolType,
|
||||||
|
IN SIZE_T NumberOfBytes,
|
||||||
|
IN ULONG Tag)
|
||||||
|
{
|
||||||
|
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
STDCALL
|
||||||
|
VideoPortFreePool(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN PVOID Ptr)
|
||||||
|
{
|
||||||
|
ExFreePool(Ptr);
|
||||||
|
}
|
||||||
|
|
||||||
// VidDispatchOpen
|
// VidDispatchOpen
|
||||||
//
|
//
|
||||||
|
@ -1408,7 +1012,7 @@ VideoPortResetDisplayParameters(Columns, Rows)
|
||||||
// NTSTATUS
|
// NTSTATUS
|
||||||
//
|
//
|
||||||
|
|
||||||
static NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
VidDispatchOpen(IN PDEVICE_OBJECT pDO,
|
VidDispatchOpen(IN PDEVICE_OBJECT pDO,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
|
@ -1467,7 +1071,7 @@ VidDispatchOpen(IN PDEVICE_OBJECT pDO,
|
||||||
// NTSTATUS
|
// NTSTATUS
|
||||||
//
|
//
|
||||||
|
|
||||||
static NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
VidDispatchClose(IN PDEVICE_OBJECT pDO,
|
VidDispatchClose(IN PDEVICE_OBJECT pDO,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
|
@ -1507,7 +1111,7 @@ VidDispatchClose(IN PDEVICE_OBJECT pDO,
|
||||||
// NTSTATUS
|
// NTSTATUS
|
||||||
//
|
//
|
||||||
|
|
||||||
static NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject,
|
VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
|
@ -1535,7 +1139,7 @@ VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject,
|
||||||
vrp->OutputBufferLength = IrpStack->Parameters.DeviceIoControl.OutputBufferLength;
|
vrp->OutputBufferLength = IrpStack->Parameters.DeviceIoControl.OutputBufferLength;
|
||||||
|
|
||||||
/* Call the Miniport Driver with the VRP */
|
/* Call the Miniport Driver with the VRP */
|
||||||
DeviceObject->DriverObject->DriverStartIo((PVOID) &DeviceExtension->MiniPortDeviceExtension, (PIRP)vrp);
|
((PDRIVER_STARTIO)DeviceObject->DriverObject->DriverStartIo)((PVOID) &DeviceExtension->MiniPortDeviceExtension, (PIRP)vrp);
|
||||||
|
|
||||||
/* Free the VRP */
|
/* Free the VRP */
|
||||||
ExFreePool(vrp);
|
ExFreePool(vrp);
|
||||||
|
@ -1545,7 +1149,7 @@ VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PVOID STDCALL
|
PVOID STDCALL
|
||||||
InternalMapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
InternalMapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
IN PHYSICAL_ADDRESS IoAddress,
|
IN PHYSICAL_ADDRESS IoAddress,
|
||||||
IN ULONG NumberOfUchars,
|
IN ULONG NumberOfUchars,
|
||||||
|
@ -1617,7 +1221,7 @@ InternalMapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
return MappedAddress;
|
return MappedAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID STDCALL
|
VOID STDCALL
|
||||||
InternalUnmapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
InternalUnmapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
IN PVOID MappedAddress)
|
IN PVOID MappedAddress)
|
||||||
{
|
{
|
|
@ -1,4 +1,4 @@
|
||||||
; $Id: videoprt.def,v 1.1 2003/02/15 19:16:32 gvg Exp $
|
; $Id: videoprt.def,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
;
|
;
|
||||||
; vidport.def - export definition file for ReactOS
|
; vidport.def - export definition file for ReactOS
|
||||||
;
|
;
|
||||||
|
@ -57,4 +57,3 @@ VideoPortWriteRegisterBufferUshort@12
|
||||||
VideoPortWriteRegisterBufferUlong@12
|
VideoPortWriteRegisterBufferUlong@12
|
||||||
VideoPortZeroMemory@8
|
VideoPortZeroMemory@8
|
||||||
VideoPortZeroDeviceMemory@8
|
VideoPortZeroDeviceMemory@8
|
||||||
|
|
62
reactos/drivers/video/videoprt/videoprt.edf
Normal file
62
reactos/drivers/video/videoprt/videoprt.edf
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
; $Id: videoprt.edf,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
|
;
|
||||||
|
; vidport.def - export definition file for ReactOS
|
||||||
|
;
|
||||||
|
EXPORTS
|
||||||
|
VideoPortCompareMemory=NTOSKRNL.RtlCompareMemory
|
||||||
|
VideoPortAllocatePool=VideoPortAllocatePool@16
|
||||||
|
VideoPortDebugPrint
|
||||||
|
VideoPortDisableInterrupt=VideoPortDisableInterrupt@4
|
||||||
|
VideoPortEnableInterrupt=VideoPortEnableInterrupt@4
|
||||||
|
VideoPortFreeDeviceBase=VideoPortFreeDeviceBase@8
|
||||||
|
VideoPortFreePool=VideoPortFreePool@8
|
||||||
|
VideoPortGetBusData=VideoPortGetBusData@24
|
||||||
|
VideoPortGetCurrentIrql=VideoPortGetCurrentIrql@0
|
||||||
|
VideoPortGetDeviceBase=VideoPortGetDeviceBase@20
|
||||||
|
VideoPortGetDeviceData=VideoPortGetDeviceData@16
|
||||||
|
VideoPortGetAccessRanges=VideoPortGetAccessRanges@32
|
||||||
|
VideoPortGetRegistryParameters=VideoPortGetRegistryParameters@20
|
||||||
|
VideoPortInitialize=VideoPortInitialize@16
|
||||||
|
VideoPortInt10=VideoPortInt10@8
|
||||||
|
VideoPortLogError=VideoPortLogError@16
|
||||||
|
VideoPortMapBankedMemory=VideoPortMapBankedMemory@40
|
||||||
|
VideoPortMapMemory=VideoPortMapMemory@24
|
||||||
|
VideoPortMoveMemory=NTOSKRNL.RtlMoveMemory
|
||||||
|
VideoPortQueryServices=VideoPortQueryServices@12
|
||||||
|
VideoPortQuerySystemTime=NTOSKRNL.KeQuerySystemTime
|
||||||
|
VideoPortReadPortUchar=HAL.READ_PORT_UCHAR
|
||||||
|
VideoPortReadPortUshort=HAL.READ_PORT_USHORT
|
||||||
|
VideoPortReadPortUlong=HAL.READ_PORT_ULONG
|
||||||
|
VideoPortReadPortBufferUchar=HAL.READ_PORT_BUFFER_UCHAR
|
||||||
|
VideoPortReadPortBufferUshort=HAL.READ_PORT_BUFFER_USHORT
|
||||||
|
VideoPortReadPortBufferUlong=HAL.READ_PORT_BUFFER_ULONG
|
||||||
|
VideoPortReadRegisterUchar=NTOSKRNL.READ_REGISTER_UCHAR
|
||||||
|
VideoPortReadRegisterUshort=NTOSKRNL.READ_REGISTER_USHORT
|
||||||
|
VideoPortReadRegisterUlong=NTOSKRNL.READ_REGISTER_ULONG
|
||||||
|
VideoPortReadRegisterBufferUchar=NTOSKRNL.READ_REGISTER_BUFFER_UCHAR
|
||||||
|
VideoPortReadRegisterBufferUshort=NTOSKRNL.READ_REGISTER_BUFFER_USHORT
|
||||||
|
VideoPortReadRegisterBufferUlong=NTOSKRNL.READ_REGISTER_BUFFER_ULONG
|
||||||
|
VideoPortScanRom=VideoPortScanRom@16
|
||||||
|
VideoPortSetBusData=VideoPortSetBusData@24
|
||||||
|
VideoPortSetRegistryParameters=VideoPortSetRegistryParameters@16
|
||||||
|
VideoPortSetTrappedEmulatorPorts=VideoPortSetTrappedEmulatorPorts@12
|
||||||
|
VideoPortStallExecution=HAL.KeStallExecutionProcessor
|
||||||
|
VideoPortStartTimer=VideoPortStartTimer@4
|
||||||
|
VideoPortStopTimer=VideoPortStopTimer@4
|
||||||
|
VideoPortSynchronizeExecution=VideoPortSynchronizeExecution@16
|
||||||
|
VideoPortUnmapMemory=VideoPortUnmapMemory@12
|
||||||
|
VideoPortVerifyAccessRanges=VideoPortVerifyAccessRanges@12
|
||||||
|
VideoPortWritePortUchar=HAL.WRITE_PORT_UCHAR
|
||||||
|
VideoPortWritePortUshort=HAL.WRITE_PORT_USHORT
|
||||||
|
VideoPortWritePortUlong=HAL.WRITE_PORT_ULONG
|
||||||
|
VideoPortWritePortBufferUchar=HAL.WRITE_PORT_BUFFER_UCHAR
|
||||||
|
VideoPortWritePortBufferUshort=HAL.WRITE_PORT_BUFFER_USHORT
|
||||||
|
VideoPortWritePortBufferUlong=HAL.WRITE_PORT_BUFFER_ULONG
|
||||||
|
VideoPortWriteRegisterUchar=NTOSKRNL.WRITE_REGISTER_UCHAR
|
||||||
|
VideoPortWriteRegisterUshort=NTOSKRNL.WRITE_REGISTER_USHORT
|
||||||
|
VideoPortWriteRegisterUlong=NTOSKRNL.WRITE_REGISTER_ULONG
|
||||||
|
VideoPortWriteRegisterBufferUchar=NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR
|
||||||
|
VideoPortWriteRegisterBufferUshort=NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT
|
||||||
|
VideoPortWriteRegisterBufferUlong=NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG
|
||||||
|
VideoPortZeroMemory=NTOSKRNL.RtlZeroMemory
|
||||||
|
VideoPortZeroDeviceMemory=NTOSKRNL.RtlZeroMemory
|
132
reactos/drivers/video/videoprt/videoprt.h
Normal file
132
reactos/drivers/video/videoprt/videoprt.h
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
/*
|
||||||
|
* VideoPort driver
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; see the file COPYING.LIB.
|
||||||
|
* If not, write to the Free Software Foundation,
|
||||||
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* $Id: videoprt.h,v 1.1 2004/01/19 15:56:53 navaraf Exp $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef VIDEOPRT_H
|
||||||
|
#define VIDEOPRT_H
|
||||||
|
|
||||||
|
#include <ddk/miniport.h>
|
||||||
|
#include <ddk/video.h>
|
||||||
|
#include <ddk/ntddvdeo.h>
|
||||||
|
#include "internal/ps.h"
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FIXME: Definition missing from w32api!
|
||||||
|
*/
|
||||||
|
#ifndef SYNCH_LEVEL
|
||||||
|
#define SYNCH_LEVEL (IPI_LEVEL - 2)
|
||||||
|
#endif
|
||||||
|
VOID FASTCALL KfLowerIrql(IN KIRQL NewIrql);
|
||||||
|
#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
|
||||||
|
KIRQL FASTCALL KfRaiseIrql(IN KIRQL NewIrql);
|
||||||
|
NTKERNELAPI VOID HalAcquireDisplayOwnership(IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
|
||||||
|
|
||||||
|
#define TAG_VIDEO_PORT TAG('V', 'I', 'D', 'P')
|
||||||
|
|
||||||
|
extern PEPROCESS Csrss;
|
||||||
|
|
||||||
|
typedef struct _VIDEO_PORT_ADDRESS_MAPPING
|
||||||
|
{
|
||||||
|
LIST_ENTRY List;
|
||||||
|
PVOID MappedAddress;
|
||||||
|
ULONG NumberOfUchars;
|
||||||
|
PHYSICAL_ADDRESS IoAddress;
|
||||||
|
ULONG SystemIoBusNumber;
|
||||||
|
UINT MappingCount;
|
||||||
|
} VIDEO_PORT_ADDRESS_MAPPING, *PVIDEO_PORT_ADDRESS_MAPPING;
|
||||||
|
|
||||||
|
typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
|
||||||
|
{
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
PKINTERRUPT InterruptObject;
|
||||||
|
KSPIN_LOCK InterruptSpinLock;
|
||||||
|
ULONG InterruptVector;
|
||||||
|
ULONG InterruptLevel;
|
||||||
|
PVIDEO_HW_INITIALIZE HwInitialize;
|
||||||
|
PVIDEO_HW_RESET_HW HwResetHw;
|
||||||
|
PVIDEO_HW_TIMER HwTimer;
|
||||||
|
PVIDEO_HW_INTERRUPT HwInterrupt;
|
||||||
|
LIST_ENTRY AddressMappingListHead;
|
||||||
|
INTERFACE_TYPE AdapterInterfaceType;
|
||||||
|
ULONG SystemIoBusNumber;
|
||||||
|
UNICODE_STRING RegistryPath;
|
||||||
|
UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */
|
||||||
|
} VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;
|
||||||
|
|
||||||
|
NTSTATUS STDCALL
|
||||||
|
VidDispatchOpen(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
|
||||||
|
|
||||||
|
NTSTATUS STDCALL
|
||||||
|
VidDispatchClose(IN PDEVICE_OBJECT pDO, IN PIRP Irp);
|
||||||
|
|
||||||
|
NTSTATUS STDCALL
|
||||||
|
VidDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
|
||||||
|
|
||||||
|
PVOID STDCALL
|
||||||
|
InternalMapMemory(
|
||||||
|
IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
|
IN PHYSICAL_ADDRESS IoAddress,
|
||||||
|
IN ULONG NumberOfUchars,
|
||||||
|
IN UCHAR InIoSpace);
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
|
InternalUnmapMemory(
|
||||||
|
IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
|
IN PVOID MappedAddress);
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10AllocateBuffer(
|
||||||
|
IN PVOID Context,
|
||||||
|
OUT PUSHORT Seg,
|
||||||
|
OUT PUSHORT Off,
|
||||||
|
IN OUT PULONG Length);
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10FreeBuffer(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN USHORT Seg,
|
||||||
|
IN USHORT Off);
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10ReadMemory(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN USHORT Seg,
|
||||||
|
IN USHORT Off,
|
||||||
|
OUT PVOID Buffer,
|
||||||
|
IN ULONG Length);
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10WriteMemory(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN USHORT Seg,
|
||||||
|
IN USHORT Off,
|
||||||
|
IN PVOID Buffer,
|
||||||
|
IN ULONG Length);
|
||||||
|
|
||||||
|
VP_STATUS STDCALL
|
||||||
|
IntInt10CallBios(
|
||||||
|
IN PVOID Context,
|
||||||
|
IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
|
||||||
|
|
||||||
|
#endif /* VIDEOPRT_H */
|
|
@ -22,7 +22,7 @@ BEGIN
|
||||||
BLOCK "040904b0"
|
BLOCK "040904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
||||||
VALUE "FileDescription", "Videort Driver\0"
|
VALUE "FileDescription", "Videoport Driver\0"
|
||||||
VALUE "FileVersion", "0.0.0\0"
|
VALUE "FileVersion", "0.0.0\0"
|
||||||
VALUE "InternalName", "vidport\0"
|
VALUE "InternalName", "vidport\0"
|
||||||
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
|
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
|
Loading…
Add table
Add a link
Reference in a new issue