[if gte mso 9]>
Subject: Re: [edk2] PciIo Map() and UDK debug firmware
From: "William Marone (wmarone)" <email@example.com>
To: "firstname.lastname@example.org" <email@example.com>
Date: 2013-05-02 04:25:59
I understand what you’re saying, and after further digging I find that the code is passing a VOID** into Unmap() and not just the VOID*. Worse, it’s done inconsistently, some do it right and some do it wrong. Yet another item for cleanup to add to my list…
What do you mean “return nothing in the Mapping pointer”?
The caller’s requirement is to pass the Mapping value returned by Map() into UnMap(). The Mapping value which is type VOID * is implementation dependent and there are no requirements for it to be non-NULL. The Map() function takes a VOID**, and it is not legal to pass into a Map() a Mapping parameter of NULL.
Is it normal for EFI_PCI_IO_PROTOCOL.Map() to properly map a buffer (Status == EFI_SUCCESS, NumberOfBytes in == NumberOfBytes out, DeviceAddress is good) but return nothing in the Mapping pointer? I’m seeing otherwise normal operation, but with the UDK debug and srcdbug builds I get an ASSERT() when calling Unmap() because the Mappings are coming back zero.
ASSERT d:\uefisdv\MdeModulePkg\Core\Dxe\Mem\Page.c(695): NumberOfPages
On the release firmware and Dell 12G platforms the Map() is coming back zero as well but, as I noted above, nothing appears broken. Server 2008 R2 boots off the device readily. Maybe something subtle I am missing?