[efi] Provide Map_Mem() and associated UNDI callbacks
authorMichael Brown <mcb30@ipxe.org>
Tue, 20 Mar 2018 11:22:30 +0000 (13:22 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 20 Mar 2018 11:31:45 +0000 (13:31 +0200)
commite8e9ca36130bed2ed241a38fa57e9a35c8ac61f3
treee641dcd858ae604f7b98e184bbf4774d7a602630
parent342ff967cc109f8e21e743d841434b08737d9e6c
[efi] Provide Map_Mem() and associated UNDI callbacks

Some drivers are known to call the optional Map_Mem() callback without
first checking that the callback exists.  Provide a usable basic
implementation of Map_Mem() along with the other callbacks that become
mandatory if Map_Mem() is provided.

Note that in theory the PCI I/O protocol is allowed to require
multiple calls to Map(), with each call handling only a subset of the
overall mapped range.  However, the reference implementation in EDK2
assumes that a single Map() will always suffice, so we can probably
make the same simplifying assumption here.

Tested with the Intel E3522X2.EFI driver (which, incidentally, fails
to cleanly remove one of its mappings).

Originally-implemented-by: Maor Dickman <maord@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/efi/nii.c