mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 00:36:30 +00:00
- Export the InitSafeBootMode variable as per KB83764.
- Remove KeRescheduleThread (it's not present neither on WinNT4 nor on WinXP SP2). - Fix IoOpenDeviceRegistryKey for PLUGPLAY_REGKEY_DRIVER case. (Oops) - Move IoConnectInterrupt and IoDisconnectInterrupt outside from Ke. svn path=/trunk/; revision=11588
This commit is contained in:
parent
da8cb9fe17
commit
5879eeb98a
8 changed files with 143 additions and 143 deletions
|
@ -185,6 +185,7 @@ OBJECTS_IO = \
|
|||
io/iomgr.o \
|
||||
io/iowork.o \
|
||||
io/irp.o \
|
||||
io/irq.o \
|
||||
io/lock.o \
|
||||
io/mailslot.o \
|
||||
io/mdl.o \
|
||||
|
|
|
@ -45,9 +45,6 @@ struct _KPCR;
|
|||
VOID STDCALL
|
||||
DbgBreakPointNoBugCheck(VOID);
|
||||
|
||||
VOID STDCALL KeRescheduleThread();
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
KeProfileInterrupt(
|
||||
|
|
125
reactos/ntoskrnl/io/irq.c
Normal file
125
reactos/ntoskrnl/io/irq.c
Normal file
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/io/irq.c
|
||||
* PURPOSE: IRQ handling
|
||||
* PROGRAMMER: David Welch (welch@mcmail.com)
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ntoskrnl.h>
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* GLOBALS *****************************************************************/
|
||||
|
||||
#define TAG_KINTERRUPT TAG('K', 'I', 'S', 'R')
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS STDCALL
|
||||
IoConnectInterrupt(PKINTERRUPT* InterruptObject,
|
||||
PKSERVICE_ROUTINE ServiceRoutine,
|
||||
PVOID ServiceContext,
|
||||
PKSPIN_LOCK SpinLock,
|
||||
ULONG Vector,
|
||||
KIRQL Irql,
|
||||
KIRQL SynchronizeIrql,
|
||||
KINTERRUPT_MODE InterruptMode,
|
||||
BOOLEAN ShareVector,
|
||||
KAFFINITY ProcessorEnableMask,
|
||||
BOOLEAN FloatingSave)
|
||||
/*
|
||||
* FUNCTION: Registers a driver's isr to be called when its device interrupts
|
||||
* ARGUMENTS:
|
||||
* InterruptObject (OUT) = Points to the interrupt object created on
|
||||
* return
|
||||
* ServiceRoutine = Routine to be called when the device interrupts
|
||||
* ServiceContext = Parameter to be passed to ServiceRoutine
|
||||
* SpinLock = Initalized spinlock that will be used to synchronize
|
||||
* access between the isr and other driver routines. This is
|
||||
* required if the isr handles more than one vector or the
|
||||
* driver has more than one isr
|
||||
* Vector = Interrupt vector to allocate
|
||||
* (returned from HalGetInterruptVector)
|
||||
* Irql = DIRQL returned from HalGetInterruptVector
|
||||
* SynchronizeIrql = DIRQL at which the isr will execute. This must
|
||||
* be the highest of all the DIRQLs returned from
|
||||
* HalGetInterruptVector if the driver has multiple
|
||||
* isrs
|
||||
* InterruptMode = Specifies if the interrupt is LevelSensitive or
|
||||
* Latched
|
||||
* ShareVector = Specifies if the vector can be shared
|
||||
* ProcessorEnableMask = Processors on the isr can run
|
||||
* FloatingSave = TRUE if the floating point stack should be saved when
|
||||
* the isr runs. Must be false for x86 drivers
|
||||
* RETURNS: Status
|
||||
* IRQL: PASSIVE_LEVEL
|
||||
*/
|
||||
{
|
||||
PKINTERRUPT Interrupt;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
ASSERT_IRQL(PASSIVE_LEVEL);
|
||||
|
||||
DPRINT("IoConnectInterrupt(Vector %x)\n",Vector);
|
||||
|
||||
/*
|
||||
* Initialize interrupt object
|
||||
*/
|
||||
Interrupt=ExAllocatePoolWithTag(NonPagedPool,sizeof(KINTERRUPT),
|
||||
TAG_KINTERRUPT);
|
||||
if (Interrupt==NULL)
|
||||
{
|
||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
|
||||
Status = KeInitializeInterrupt(Interrupt,
|
||||
ServiceRoutine,
|
||||
ServiceContext,
|
||||
SpinLock,
|
||||
Vector,
|
||||
Irql,
|
||||
SynchronizeIrql,
|
||||
InterruptMode,
|
||||
ShareVector,
|
||||
ProcessorEnableMask,
|
||||
FloatingSave);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ExFreePool(Interrupt);
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (!KeConnectInterrupt(Interrupt))
|
||||
{
|
||||
ExFreePool(Interrupt);
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*InterruptObject = Interrupt;
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VOID STDCALL
|
||||
IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
|
||||
/*
|
||||
* FUNCTION: Releases a drivers isr
|
||||
* ARGUMENTS:
|
||||
* InterruptObject = isr to release
|
||||
*/
|
||||
{
|
||||
KeDisconnectInterrupt(InterruptObject);
|
||||
ExFreePool(InterruptObject);
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: pnpmgr.c,v 1.48 2004/11/07 21:18:33 navaraf Exp $
|
||||
/* $Id: pnpmgr.c,v 1.49 2004/11/07 22:55:38 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -378,6 +378,7 @@ IoOpenDeviceRegistryKey(
|
|||
ExFreePool(KeyNameBuffer);
|
||||
return Status;
|
||||
}
|
||||
KeyName.Length += DriverKeyLength - sizeof(UNICODE_NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: irq.c,v 1.53 2004/11/01 19:01:25 hbirr Exp $
|
||||
/* $Id: irq.c,v 1.54 2004/11/07 22:55:38 navaraf Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/i386/irq.c
|
||||
|
@ -187,7 +187,6 @@ static PKSPIN_LOCK isr_lock[NR_IRQS] = {NULL,};
|
|||
static KSPIN_LOCK isr_table_lock = {0,};
|
||||
|
||||
#define TAG_ISR_LOCK TAG('I', 'S', 'R', 'L')
|
||||
#define TAG_KINTERRUPT TAG('K', 'I', 'S', 'R')
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
|
@ -399,7 +398,7 @@ KeDumpIrqList(VOID)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS STDCALL
|
||||
BOOLEAN STDCALL
|
||||
KeConnectInterrupt(PKINTERRUPT InterruptObject)
|
||||
{
|
||||
KIRQL oldlvl;
|
||||
|
@ -412,9 +411,8 @@ KeConnectInterrupt(PKINTERRUPT InterruptObject)
|
|||
Vector = InterruptObject->Vector;
|
||||
|
||||
if (Vector < IRQ_BASE && Vector >= IRQ_BASE + NR_IRQS)
|
||||
{
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
Vector -= IRQ_BASE;
|
||||
|
||||
/*
|
||||
|
@ -430,7 +428,7 @@ KeConnectInterrupt(PKINTERRUPT InterruptObject)
|
|||
(InterruptObject->Shareable == FALSE || ListHead->Shareable==FALSE))
|
||||
{
|
||||
KeReleaseSpinLock(&isr_table_lock,oldlvl);
|
||||
return(STATUS_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -462,7 +460,7 @@ KeConnectInterrupt(PKINTERRUPT InterruptObject)
|
|||
|
||||
KeDumpIrqList();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -514,127 +512,9 @@ KeInitializeInterrupt(PKINTERRUPT InterruptObject,
|
|||
InterruptObject->ProcessorEnableMask = ProcessorEnableMask;
|
||||
InterruptObject->SynchLevel = SynchronizeIrql;
|
||||
InterruptObject->Shareable = ShareVector;
|
||||
InterruptObject->FloatingSave = FALSE;
|
||||
InterruptObject->FloatingSave = FloatingSave;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS STDCALL
|
||||
IoConnectInterrupt(PKINTERRUPT* InterruptObject,
|
||||
PKSERVICE_ROUTINE ServiceRoutine,
|
||||
PVOID ServiceContext,
|
||||
PKSPIN_LOCK SpinLock,
|
||||
ULONG Vector,
|
||||
KIRQL Irql,
|
||||
KIRQL SynchronizeIrql,
|
||||
KINTERRUPT_MODE InterruptMode,
|
||||
BOOLEAN ShareVector,
|
||||
KAFFINITY ProcessorEnableMask,
|
||||
BOOLEAN FloatingSave)
|
||||
/*
|
||||
* FUNCTION: Registers a driver's isr to be called when its device interrupts
|
||||
* ARGUMENTS:
|
||||
* InterruptObject (OUT) = Points to the interrupt object created on
|
||||
* return
|
||||
* ServiceRoutine = Routine to be called when the device interrupts
|
||||
* ServiceContext = Parameter to be passed to ServiceRoutine
|
||||
* SpinLock = Initalized spinlock that will be used to synchronize
|
||||
* access between the isr and other driver routines. This is
|
||||
* required if the isr handles more than one vector or the
|
||||
* driver has more than one isr
|
||||
* Vector = Interrupt vector to allocate
|
||||
* (returned from HalGetInterruptVector)
|
||||
* Irql = DIRQL returned from HalGetInterruptVector
|
||||
* SynchronizeIrql = DIRQL at which the isr will execute. This must
|
||||
* be the highest of all the DIRQLs returned from
|
||||
* HalGetInterruptVector if the driver has multiple
|
||||
* isrs
|
||||
* InterruptMode = Specifies if the interrupt is LevelSensitive or
|
||||
* Latched
|
||||
* ShareVector = Specifies if the vector can be shared
|
||||
* ProcessorEnableMask = Processors on the isr can run
|
||||
* FloatingSave = TRUE if the floating point stack should be saved when
|
||||
* the isr runs. Must be false for x86 drivers
|
||||
* RETURNS: Status
|
||||
* IRQL: PASSIVE_LEVEL
|
||||
*/
|
||||
{
|
||||
PKINTERRUPT Interrupt;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
ASSERT_IRQL(PASSIVE_LEVEL);
|
||||
|
||||
DPRINT("IoConnectInterrupt(Vector %x)\n",Vector);
|
||||
|
||||
/*
|
||||
* Check the parameters
|
||||
*/
|
||||
if (Vector < IRQ_BASE || Vector >= NR_IRQS + IRQ_BASE)
|
||||
{
|
||||
return(STATUS_INVALID_PARAMETER);
|
||||
}
|
||||
if (FloatingSave == TRUE)
|
||||
{
|
||||
return(STATUS_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize interrupt object
|
||||
*/
|
||||
Interrupt=ExAllocatePoolWithTag(NonPagedPool,sizeof(KINTERRUPT),
|
||||
TAG_KINTERRUPT);
|
||||
if (Interrupt==NULL)
|
||||
{
|
||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
|
||||
Status = KeInitializeInterrupt(Interrupt,
|
||||
ServiceRoutine,
|
||||
ServiceContext,
|
||||
SpinLock,
|
||||
Vector,
|
||||
Irql,
|
||||
SynchronizeIrql,
|
||||
InterruptMode,
|
||||
ShareVector,
|
||||
ProcessorEnableMask,
|
||||
FloatingSave);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ExFreePool(Interrupt);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = KeConnectInterrupt(Interrupt);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ExFreePool(Interrupt);
|
||||
return Status;
|
||||
}
|
||||
|
||||
*InterruptObject = Interrupt;
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VOID STDCALL
|
||||
IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
|
||||
/*
|
||||
* FUNCTION: Releases a drivers isr
|
||||
* ARGUMENTS:
|
||||
* InterruptObject = isr to release
|
||||
*/
|
||||
{
|
||||
KeDisconnectInterrupt(InterruptObject);
|
||||
ExFreePool(InterruptObject);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: kthread.c,v 1.56 2004/10/30 23:48:56 navaraf Exp $
|
||||
/* $Id: kthread.c,v 1.57 2004/11/07 22:55:38 navaraf Exp $
|
||||
*
|
||||
* FILE: ntoskrnl/ke/kthread.c
|
||||
* PURPOSE: Microkernel thread support
|
||||
|
@ -326,12 +326,6 @@ crashes. I'm disabling it again, until we fix the APC implementation...
|
|||
*/
|
||||
}
|
||||
|
||||
VOID STDCALL
|
||||
KeRescheduleThread(VOID)
|
||||
{
|
||||
PsDispatchThread(THREAD_STATE_READY);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: main.c,v 1.203 2004/11/05 17:41:34 ekohl Exp $
|
||||
/* $Id: main.c,v 1.204 2004/11/07 22:55:38 navaraf Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/main.c
|
||||
|
@ -58,6 +58,7 @@ LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock;
|
|||
ULONG EXPORTED KeDcacheFlushCount = 0;
|
||||
ULONG EXPORTED KeIcacheFlushCount = 0;
|
||||
ULONG EXPORTED KiDmaIoCoherency = 0; /* RISC Architectures only */
|
||||
ULONG EXPORTED InitSafeBootMode = 0; /* KB83764 */
|
||||
#else
|
||||
/* Microsoft-style declarations */
|
||||
EXPORTED ULONG NtBuildNumber = KERNEL_VERSION_BUILD;
|
||||
|
@ -68,6 +69,7 @@ EXPORTED LOADER_PARAMETER_BLOCK KeLoaderBlock;
|
|||
EXPORTED ULONG KeDcacheFlushCount = 0;
|
||||
EXPORTED ULONG KeIcacheFlushCount = 0;
|
||||
EXPORTED ULONG KiDmaIoCoherency = 0; /* RISC Architectures only */
|
||||
EXPORTED ULONG InitSafeBootMode = 0; /* KB83764 */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
static LOADER_MODULE KeLoaderModules[64];
|
||||
|
@ -1002,8 +1004,8 @@ _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock)
|
|||
*/
|
||||
LdrSafePEProcessModule((PVOID)KERNEL_BASE, (PVOID)KERNEL_BASE, (PVOID)DriverBase, &DriverSize);
|
||||
|
||||
/* Now our imports from HAL is fixed. This is the first */
|
||||
/* time in the boot process that we can use HAL */
|
||||
/* Now our imports from HAL are fixed. This is the first */
|
||||
/* time in the boot process that we can use HAL */
|
||||
|
||||
FirstKrnlPhysAddr = KeLoaderModules[0].ModStart - KERNEL_BASE + 0x200000;
|
||||
LastKrnlPhysAddr = LastKernelAddress - KERNEL_BASE + 0x200000;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.def,v 1.198 2004/11/07 18:45:52 hyperion Exp $
|
||||
; $Id: ntoskrnl.def,v 1.199 2004/11/07 22:55:37 navaraf Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -303,6 +303,7 @@ InbvResetDisplay@0
|
|||
InbvSetScrollRegion@16
|
||||
InbvSetTextColor@4
|
||||
InbvSolidColorFill@20
|
||||
InitSafeBootMode DATA
|
||||
@InterlockedCompareExchange@12
|
||||
@InterlockedDecrement@4
|
||||
@InterlockedExchange@8
|
||||
|
@ -592,7 +593,6 @@ KeQuerySystemTime@4
|
|||
KeQueryTickCount@4
|
||||
KeQueryTimeIncrement@0
|
||||
KeRaiseUserException@4
|
||||
KeRescheduleThread@0
|
||||
KeReadStateEvent@4
|
||||
KeReadStateMutant@4
|
||||
KeReadStateMutex@4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue