Writing PCI memory space

Hi all,

I try to write some data in the PCI memory space claimed by my device. My device is a PCI board
with MPC8240 processor on it.

I do the following:

  1. claim resources

BusAddress.HighPart = 0;
BusAddress.LowPart = ConfigInfo->u.type0.BaseAddresses[1] ;

Descriptor->Type = CmResourceTypeMemory;
Descriptor->ShareDisposition = CmResourceShareShared;
Descriptor->Flags = CM_RESOURCE_MEMORY_READ_WRITE;
Descriptor->u.Memory.Start.LowPart = BusAddress.LowPart;
Descriptor->u.Memory.Length = BaseLength;

IoReportResourceUsage( NULL,
DriverObj,
NULL,
0L,
devObj,
resources,
(PUCHAR)Descriptor - (PUCHAR)resources,
FALSE,
&bConflictDetected );

  1. map I/O memory space

PHYSICAL_ADDRESS Start; // 8-byte physical addresses.
ULONG Length;

Start = prd->u.Memory.Start;
Length = prd->u.Memory.Length;

addressSpace = 0x00;

HalTranslateBusAddress(PCIBus,
devExt->BusNumber,
Start,
&addressSpace,
&address);

devExt->BaseRegisterAddress = MmMapIoSpace(address, Length, MmNonCached);

  1. write to the device
    WRITE_REGISTER_BUFFER_UCHAR((PUCHAR)devExt->BaseRegisterAddress+0x1000, (PUCHAR)Buffer, BufferLength);

When I display the (PUCHAR)devExt->BaseRegisterAddress+0x1000 memory address in WinDbg it is all 0s. Is it ok so?

Thanx in advance,
Daniel


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com