2004-03-09 17:28:49 +00:00
|
|
|
/*
|
|
|
|
* VideoPort driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2009-10-27 10:34:16 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2004-03-09 17:28:49 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-10-27 10:34:16 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2004-03-09 17:28:49 +00:00
|
|
|
*
|
|
|
|
* 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
|
2009-10-27 10:34:16 +00:00
|
|
|
* Lesser General Public License for more details.
|
2004-03-09 17:28:49 +00:00
|
|
|
*
|
2009-10-27 10:34:16 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-03-09 17:28:49 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "videoprt.h"
|
|
|
|
|
2014-02-04 17:15:06 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
2004-03-09 17:28:49 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-03-09 17:28:49 +00:00
|
|
|
VideoPortCreateSpinLock(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
OUT PSPIN_LOCK *SpinLock)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortCreateSpinLock\n");
|
2004-03-09 17:28:49 +00:00
|
|
|
*SpinLock = ExAllocatePool(NonPagedPool, sizeof(KSPIN_LOCK));
|
|
|
|
if (*SpinLock == NULL)
|
2004-03-19 20:58:32 +00:00
|
|
|
return ERROR_NOT_ENOUGH_MEMORY;
|
2004-03-09 17:28:49 +00:00
|
|
|
KeInitializeSpinLock((PKSPIN_LOCK)*SpinLock);
|
2004-03-19 20:58:32 +00:00
|
|
|
return NO_ERROR;
|
2004-03-09 17:28:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-03-09 17:28:49 +00:00
|
|
|
VideoPortDeleteSpinLock(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PSPIN_LOCK SpinLock)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortDeleteSpinLock\n");
|
2004-03-09 17:28:49 +00:00
|
|
|
ExFreePool(SpinLock);
|
2004-03-19 20:58:32 +00:00
|
|
|
return NO_ERROR;
|
2004-03-09 17:28:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-03-09 17:28:49 +00:00
|
|
|
VideoPortAcquireSpinLock(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PSPIN_LOCK SpinLock,
|
|
|
|
OUT PUCHAR OldIrql)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortAcquireSpinLock\n");
|
2004-03-09 17:28:49 +00:00
|
|
|
KeAcquireSpinLock((PKSPIN_LOCK)SpinLock, OldIrql);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-03-09 17:28:49 +00:00
|
|
|
VideoPortAcquireSpinLockAtDpcLevel(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PSPIN_LOCK SpinLock)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortAcquireSpinLockAtDpcLevel\n");
|
2009-07-15 10:22:05 +00:00
|
|
|
KeAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock);
|
2004-03-09 17:28:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-03-09 17:28:49 +00:00
|
|
|
VideoPortReleaseSpinLock(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PSPIN_LOCK SpinLock,
|
|
|
|
IN UCHAR NewIrql)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortReleaseSpinLock\n");
|
2004-03-09 17:28:49 +00:00
|
|
|
KeReleaseSpinLock((PKSPIN_LOCK)SpinLock, NewIrql);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-03-09 17:28:49 +00:00
|
|
|
VideoPortReleaseSpinLockFromDpcLevel(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PSPIN_LOCK SpinLock)
|
|
|
|
{
|
2007-12-28 14:47:03 +00:00
|
|
|
TRACE_(VIDEOPRT, "VideoPortReleaseSpinLockFromDpcLevel\n");
|
2009-07-15 10:22:05 +00:00
|
|
|
KeReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock);
|
2004-03-09 17:28:49 +00:00
|
|
|
}
|