mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 02:34:53 +00:00
Added Adapter-Object used for PCI-Bus-Master-DMA.
svn path=/trunk/; revision=6045
This commit is contained in:
parent
89d5a30486
commit
892557fccc
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: dma.c,v 1.6 2003/09/04 06:45:38 vizzini Exp $
|
/* $Id: dma.c,v 1.7 2003/09/11 11:45:28 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -16,11 +16,14 @@
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
|
|
||||||
ADAPTER_OBJECT AdapterObjects[] = {
|
ADAPTER_OBJECT IsaSlaveAdapterObjects[] = {
|
||||||
{ 0, (PVOID)0x87, (PVOID)0x1, (PVOID)0x0, 0, NULL },
|
{ Isa, FALSE, 0, (PVOID)0x87, (PVOID)0x1, (PVOID)0x0, 0, NULL },
|
||||||
{ 1, (PVOID)0x83, (PVOID)0x3, (PVOID)0x2, 0, NULL },
|
{ Isa, FALSE, 1, (PVOID)0x83, (PVOID)0x3, (PVOID)0x2, 0, NULL },
|
||||||
{ 2, (PVOID)0x81, (PVOID)0x5, (PVOID)0x4, 0, NULL },
|
{ Isa, FALSE, 2, (PVOID)0x81, (PVOID)0x5, (PVOID)0x4, 0, NULL },
|
||||||
{ 3, (PVOID)0x82, (PVOID)0x7, (PVOID)0x6, 0, NULL } };
|
{ Isa, FALSE, 3, (PVOID)0x82, (PVOID)0x7, (PVOID)0x6, 0, NULL } };
|
||||||
|
|
||||||
|
ADAPTER_OBJECT PciBusMasterAdapterObjects[] = {
|
||||||
|
{ PCIBus, TRUE, 0, (PVOID)0, (PVOID)0, (PVOID)0x0, 0, NULL } };
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
@ -48,9 +51,17 @@ HalAllocateCommonBuffer (PADAPTER_OBJECT AdapterObject,
|
||||||
{
|
{
|
||||||
PHYSICAL_ADDRESS HighestAddress;
|
PHYSICAL_ADDRESS HighestAddress;
|
||||||
PVOID BaseAddress;
|
PVOID BaseAddress;
|
||||||
|
|
||||||
HighestAddress.u.HighPart = 0;
|
HighestAddress.u.HighPart = 0;
|
||||||
HighestAddress.u.LowPart = -1;
|
if (AdapterObject->InterfaceType == Isa ||
|
||||||
|
(AdapterObject->InterfaceType == MicroChannel && AdapterObject->Master == FALSE))
|
||||||
|
{
|
||||||
|
HighestAddress.u.LowPart = 0x00FFFFFF; /* 24Bit: 16MB address range */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HighestAddress.u.LowPart = 0xFFFFFFFF; /* 32Bit: 4GB address range */
|
||||||
|
}
|
||||||
|
|
||||||
BaseAddress = MmAllocateContiguousMemory(Length, HighestAddress);
|
BaseAddress = MmAllocateContiguousMemory(Length, HighestAddress);
|
||||||
if (!BaseAddress)
|
if (!BaseAddress)
|
||||||
|
@ -58,8 +69,6 @@ HalAllocateCommonBuffer (PADAPTER_OBJECT AdapterObject,
|
||||||
|
|
||||||
*LogicalAddress = MmGetPhysicalAddress(BaseAddress);
|
*LogicalAddress = MmGetPhysicalAddress(BaseAddress);
|
||||||
|
|
||||||
/* is this supposed to be tracked in the adapter object? */
|
|
||||||
|
|
||||||
return BaseAddress;
|
return BaseAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +116,15 @@ HalGetAdapter (PDEVICE_DESCRIPTION DeviceDescription,
|
||||||
the adapter object for the requested dma channel */
|
the adapter object for the requested dma channel */
|
||||||
if( DeviceDescription->Version != DEVICE_DESCRIPTION_VERSION )
|
if( DeviceDescription->Version != DEVICE_DESCRIPTION_VERSION )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (DeviceDescription->InterfaceType == PCIBus)
|
||||||
|
{
|
||||||
|
if (DeviceDescription->Master == FALSE)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return &PciBusMasterAdapterObjects[0];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if( DeviceDescription->Master )
|
if( DeviceDescription->Master )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -122,8 +140,8 @@ HalGetAdapter (PDEVICE_DESCRIPTION DeviceDescription,
|
||||||
/* if( DeviceDescription->DmaWidth != Width8Bits )
|
/* if( DeviceDescription->DmaWidth != Width8Bits )
|
||||||
return NULL;*/
|
return NULL;*/
|
||||||
*NumberOfMapRegisters = 0x10;
|
*NumberOfMapRegisters = 0x10;
|
||||||
AdapterObjects[DeviceDescription->DmaChannel].Buffer = 0;
|
IsaSlaveAdapterObjects[DeviceDescription->DmaChannel].Buffer = 0;
|
||||||
return &AdapterObjects[DeviceDescription->DmaChannel];
|
return &IsaSlaveAdapterObjects[DeviceDescription->DmaChannel];
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG STDCALL
|
ULONG STDCALL
|
||||||
|
|
|
@ -34,6 +34,8 @@ VOID HalpInitPciBus (VOID);
|
||||||
VOID HalpStartEnumerator (VOID);
|
VOID HalpStartEnumerator (VOID);
|
||||||
|
|
||||||
struct _ADAPTER_OBJECT {
|
struct _ADAPTER_OBJECT {
|
||||||
|
INTERFACE_TYPE InterfaceType;
|
||||||
|
BOOLEAN Master;
|
||||||
int Channel;
|
int Channel;
|
||||||
PVOID PagePort;
|
PVOID PagePort;
|
||||||
PVOID CountPort;
|
PVOID CountPort;
|
||||||
|
|
Loading…
Reference in a new issue