mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Register interrupts with hal.
svn path=/trunk/; revision=3852
This commit is contained in:
parent
a7ee619591
commit
39a9c0a865
3 changed files with 36 additions and 23 deletions
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
FLOPPY_CONTROLLER_PARAMETERS ControllerParameters[FLOPPY_MAX_CONTROLLERS] =
|
FLOPPY_CONTROLLER_PARAMETERS ControllerParameters[FLOPPY_MAX_CONTROLLERS] =
|
||||||
{
|
{
|
||||||
{0x03f0, 6, 6, 2, 6, LevelSensitive, 0xffff}
|
{0x03f0, 6, 2, Latched}
|
||||||
// {0x0370, 6, 6, 6, LevelSensitive, 0xffff},
|
// {0x0370, 6, 6, Latched}
|
||||||
};
|
};
|
||||||
|
|
||||||
const FLOPPY_MEDIA_TYPE MediaTypes[] = {
|
const FLOPPY_MEDIA_TYPE MediaTypes[] = {
|
||||||
|
@ -50,8 +50,17 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
|
||||||
PCONFIGURATION_INFORMATION Config;
|
PCONFIGURATION_INFORMATION Config;
|
||||||
DEVICE_DESCRIPTION DeviceDescription;
|
DEVICE_DESCRIPTION DeviceDescription;
|
||||||
ULONG MaxMapRegs;
|
ULONG MaxMapRegs;
|
||||||
|
ULONG MappedIrq;
|
||||||
|
KIRQL Dirql;
|
||||||
|
KAFFINITY Affinity;
|
||||||
|
|
||||||
/* FIXME: Register port ranges and interrupts with HAL */
|
/* FIXME: Register port ranges with HAL */
|
||||||
|
MappedIrq = HalGetInterruptVector(Isa,
|
||||||
|
0,
|
||||||
|
ControllerParameters->Vector,
|
||||||
|
ControllerParameters->Vector,
|
||||||
|
&Dirql,
|
||||||
|
&Affinity);
|
||||||
|
|
||||||
/* Create controller object for FDC */
|
/* Create controller object for FDC */
|
||||||
ControllerObject = IoCreateController(sizeof(FLOPPY_CONTROLLER_EXTENSION));
|
ControllerObject = IoCreateController(sizeof(FLOPPY_CONTROLLER_EXTENSION));
|
||||||
|
@ -67,7 +76,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
|
||||||
ControllerObject->ControllerExtension;
|
ControllerObject->ControllerExtension;
|
||||||
ControllerExtension->Number = Index;
|
ControllerExtension->Number = Index;
|
||||||
ControllerExtension->PortBase = ControllerParameters->PortBase;
|
ControllerExtension->PortBase = ControllerParameters->PortBase;
|
||||||
ControllerExtension->Vector = ControllerParameters->Vector;
|
ControllerExtension->Vector = MappedIrq;
|
||||||
KeInitializeEvent( &ControllerExtension->Event, SynchronizationEvent, FALSE );
|
KeInitializeEvent( &ControllerExtension->Event, SynchronizationEvent, FALSE );
|
||||||
ControllerExtension->Device = 0; // no active device
|
ControllerExtension->Device = 0; // no active device
|
||||||
ControllerExtension->Irp = 0; // no active IRP
|
ControllerExtension->Irp = 0; // no active IRP
|
||||||
|
@ -81,12 +90,12 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
|
||||||
FloppyIsr,
|
FloppyIsr,
|
||||||
ControllerObject,
|
ControllerObject,
|
||||||
&ControllerExtension->SpinLock,
|
&ControllerExtension->SpinLock,
|
||||||
ControllerExtension->Vector,
|
MappedIrq,
|
||||||
ControllerParameters->IrqL,
|
Dirql,
|
||||||
ControllerParameters->SynchronizeIrqL,
|
Dirql,
|
||||||
ControllerParameters->InterruptMode,
|
ControllerParameters->InterruptMode,
|
||||||
FALSE,
|
FALSE,
|
||||||
ControllerParameters->Affinity,
|
Affinity,
|
||||||
FALSE);
|
FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,11 +171,8 @@ typedef struct _FLOPPY_CONTROLLER_PARAMETERS
|
||||||
{
|
{
|
||||||
ULONG PortBase;
|
ULONG PortBase;
|
||||||
ULONG Vector;
|
ULONG Vector;
|
||||||
ULONG IrqL;
|
|
||||||
ULONG DmaChannel;
|
ULONG DmaChannel;
|
||||||
ULONG SynchronizeIrqL;
|
|
||||||
KINTERRUPT_MODE InterruptMode;
|
KINTERRUPT_MODE InterruptMode;
|
||||||
KAFFINITY Affinity;
|
|
||||||
} FLOPPY_CONTROLLER_PARAMETERS, *PFLOPPY_CONTROLLER_PARAMETERS;
|
} FLOPPY_CONTROLLER_PARAMETERS, *PFLOPPY_CONTROLLER_PARAMETERS;
|
||||||
|
|
||||||
#define FLOPPY_MAX_CONTROLLERS 1
|
#define FLOPPY_MAX_CONTROLLERS 1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: ide.c,v 1.56 2002/09/08 10:22:04 chorns Exp $
|
/* $Id: ide.c,v 1.57 2002/12/09 19:57:56 hbirr Exp $
|
||||||
*
|
*
|
||||||
* IDE.C - IDE Disk driver
|
* IDE.C - IDE Disk driver
|
||||||
* written by Rex Jolliff
|
* written by Rex Jolliff
|
||||||
|
@ -90,10 +90,7 @@ typedef struct _IDE_CONTROLLER_PARAMETERS
|
||||||
int ControlPortBase;
|
int ControlPortBase;
|
||||||
int ControlPortSpan;
|
int ControlPortSpan;
|
||||||
int Vector;
|
int Vector;
|
||||||
int IrqL;
|
|
||||||
int SynchronizeIrqL;
|
|
||||||
KINTERRUPT_MODE InterruptMode;
|
KINTERRUPT_MODE InterruptMode;
|
||||||
KAFFINITY Affinity;
|
|
||||||
} IDE_CONTROLLER_PARAMETERS, *PIDE_CONTROLLER_PARAMETERS;
|
} IDE_CONTROLLER_PARAMETERS, *PIDE_CONTROLLER_PARAMETERS;
|
||||||
|
|
||||||
// NOTE: Do not increase max drives above 2
|
// NOTE: Do not increase max drives above 2
|
||||||
|
@ -103,10 +100,10 @@ typedef struct _IDE_CONTROLLER_PARAMETERS
|
||||||
#define IDE_MAX_CONTROLLERS 2
|
#define IDE_MAX_CONTROLLERS 2
|
||||||
IDE_CONTROLLER_PARAMETERS Controllers[IDE_MAX_CONTROLLERS] =
|
IDE_CONTROLLER_PARAMETERS Controllers[IDE_MAX_CONTROLLERS] =
|
||||||
{
|
{
|
||||||
{0x01f0, 8, 0x03f6, 1, 14, 14, 15, LevelSensitive, 0xffff},
|
{0x01f0, 8, 0x03f6, 1, 14, Latched},
|
||||||
{0x0170, 8, 0x0376, 1, 15, 15, 15, LevelSensitive, 0xffff}
|
{0x0170, 8, 0x0376, 1, 15, Latched}
|
||||||
/* {0x01E8, 8, 0x03ee, 1, 11, 11, 15, LevelSensitive, 0xffff},
|
/* {0x01E8, 8, 0x03ee, 1, 11, LevelSensitive},
|
||||||
{0x0168, 8, 0x036e, 1, 10, 10, 15, LevelSensitive, 0xffff}*/
|
{0x0168, 8, 0x036e, 1, 10, LevelSensitive}*/
|
||||||
};
|
};
|
||||||
|
|
||||||
static BOOLEAN IDEInitialized = FALSE;
|
static BOOLEAN IDEInitialized = FALSE;
|
||||||
|
@ -487,6 +484,9 @@ IdeCreateController(IN PDRIVER_OBJECT DriverObject,
|
||||||
NTSTATUS RC;
|
NTSTATUS RC;
|
||||||
PCONTROLLER_OBJECT ControllerObject;
|
PCONTROLLER_OBJECT ControllerObject;
|
||||||
PIDE_CONTROLLER_EXTENSION ControllerExtension;
|
PIDE_CONTROLLER_EXTENSION ControllerExtension;
|
||||||
|
ULONG MappedIrq;
|
||||||
|
KIRQL Dirql;
|
||||||
|
KAFFINITY Affinity;
|
||||||
|
|
||||||
ControllerObject = IoCreateController(sizeof(IDE_CONTROLLER_EXTENSION));
|
ControllerObject = IoCreateController(sizeof(IDE_CONTROLLER_EXTENSION));
|
||||||
if (ControllerObject == NULL)
|
if (ControllerObject == NULL)
|
||||||
|
@ -496,13 +496,20 @@ IdeCreateController(IN PDRIVER_OBJECT DriverObject,
|
||||||
return STATUS_NO_SUCH_DEVICE;
|
return STATUS_NO_SUCH_DEVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MappedIrq = HalGetInterruptVector(Isa,
|
||||||
|
0,
|
||||||
|
ControllerParams->Vector,
|
||||||
|
ControllerParams->Vector,
|
||||||
|
&Dirql,
|
||||||
|
&Affinity);
|
||||||
|
|
||||||
// Fill out Controller extension data
|
// Fill out Controller extension data
|
||||||
ControllerExtension = (PIDE_CONTROLLER_EXTENSION)
|
ControllerExtension = (PIDE_CONTROLLER_EXTENSION)
|
||||||
ControllerObject->ControllerExtension;
|
ControllerObject->ControllerExtension;
|
||||||
ControllerExtension->Number = ControllerIdx;
|
ControllerExtension->Number = ControllerIdx;
|
||||||
ControllerExtension->CommandPortBase = ControllerParams->CommandPortBase;
|
ControllerExtension->CommandPortBase = ControllerParams->CommandPortBase;
|
||||||
ControllerExtension->ControlPortBase = ControllerParams->ControlPortBase;
|
ControllerExtension->ControlPortBase = ControllerParams->ControlPortBase;
|
||||||
ControllerExtension->Vector = ControllerParams->Vector;
|
ControllerExtension->Vector = MappedIrq;
|
||||||
ControllerExtension->DMASupported = FALSE;
|
ControllerExtension->DMASupported = FALSE;
|
||||||
ControllerExtension->ControllerInterruptBug = FALSE;
|
ControllerExtension->ControllerInterruptBug = FALSE;
|
||||||
ControllerExtension->OperationInProgress = FALSE;
|
ControllerExtension->OperationInProgress = FALSE;
|
||||||
|
@ -516,11 +523,11 @@ IdeCreateController(IN PDRIVER_OBJECT DriverObject,
|
||||||
ControllerExtension,
|
ControllerExtension,
|
||||||
&ControllerExtension->SpinLock,
|
&ControllerExtension->SpinLock,
|
||||||
ControllerExtension->Vector,
|
ControllerExtension->Vector,
|
||||||
ControllerParams->IrqL,
|
Dirql,
|
||||||
ControllerParams->SynchronizeIrqL,
|
Dirql,
|
||||||
ControllerParams->InterruptMode,
|
ControllerParams->InterruptMode,
|
||||||
FALSE,
|
FALSE,
|
||||||
ControllerParams->Affinity,
|
Affinity,
|
||||||
FALSE);
|
FALSE);
|
||||||
if (!NT_SUCCESS(RC))
|
if (!NT_SUCCESS(RC))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue