- Fixed the offset in ReadPciConfigUshort/WritePciConfigUshort.

svn path=/trunk/; revision=4585
This commit is contained in:
Hartmut Birr 2003-04-26 07:06:55 +00:00
parent 63e4fdcdc6
commit 40b6b22911
2 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
/* $Id: pci.c,v 1.2 2002/05/05 14:57:45 chorns Exp $
/* $Id: pci.c,v 1.3 2003/04/26 07:06:55 hbirr Exp $
*
* PROJECT: ReactOS PCI Bus driver
* FILE: pci.c
@ -68,7 +68,7 @@ PciReadConfigUshort(UCHAR Bus,
{
case pbtType1:
WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(Bus, Slot, Offset));
*Value = READ_PORT_USHORT((PUSHORT)0xCFC + (Offset & 1));
*Value = READ_PORT_USHORT((PUSHORT)0xCFC + (Offset & 2));
return STATUS_SUCCESS;
case pbtType2:
@ -150,7 +150,7 @@ PciWriteConfigUshort(UCHAR Bus,
{
case pbtType1:
WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(Bus, Slot, Offset));
WRITE_PORT_USHORT((PUSHORT)0xCFC + (Offset & 1), Value);
WRITE_PORT_USHORT((PUSHORT)0xCFC + (Offset & 2), Value);
return STATUS_SUCCESS;
case pbtType2:

View file

@ -1,4 +1,4 @@
/* $Id: pci.c,v 1.8 2003/04/06 10:45:15 chorns Exp $
/* $Id: pci.c,v 1.9 2003/04/26 07:06:54 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -115,7 +115,7 @@ ReadPciConfigUshort(UCHAR Bus,
case 1:
KeAcquireSpinLock(&PciLock, &oldIrql);
WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(Bus, Slot, Offset));
*Value = READ_PORT_USHORT((PUSHORT)0xCFC + (Offset & 1));
*Value = READ_PORT_USHORT((PUSHORT)0xCFC + (Offset & 2));
KeReleaseSpinLock(&PciLock, oldIrql);
return STATUS_SUCCESS;
@ -215,7 +215,7 @@ WritePciConfigUshort(UCHAR Bus,
case 1:
KeAcquireSpinLock(&PciLock, &oldIrql);
WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(Bus, Slot, Offset));
WRITE_PORT_USHORT((PUSHORT)0xCFC + (Offset & 1), Value);
WRITE_PORT_USHORT((PUSHORT)0xCFC + (Offset & 2), Value);
KeReleaseSpinLock(&PciLock, oldIrql);
return STATUS_SUCCESS;