Grzegorz Bernacki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74778 )
Change subject: device/pci_rom: Add simple pci_rom_free() ......................................................................
device/pci_rom: Add simple pci_rom_free()
It adds simple function, which frees the memory which could be allocated by pci_rom_probe(). In the next step it will be modified to free only memory, which was mapped from CBFS.
BUG=278264488 TEST=Build and run with additional debug prints added to confirm that data are correctly unmapped
Change-Id: Ibc9aad34b6bf101a3a0c06b92ed2dc6f2d7b9b33 Signed-off-by: Grzegorz Bernacki bernacki@google.com --- M src/device/pci_rom.c M src/include/device/pci_rom.h 2 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/74778/1
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c index a454c9e..4d9a53e 100644 --- a/src/device/pci_rom.c +++ b/src/device/pci_rom.c @@ -49,6 +49,11 @@ return cbfs_map(name, NULL); }
+void pci_rom_free(struct rom_header *rom_header) +{ + cbfs_unmap(rom_header); +} + struct rom_header *pci_rom_probe(const struct device *dev) { struct rom_header *rom_header = NULL; diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h index 83015a1..47b1a50 100644 --- a/src/include/device/pci_rom.h +++ b/src/include/device/pci_rom.h @@ -41,6 +41,7 @@ struct rom_header *pci_rom_probe(const struct device *dev); struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header); +void pci_rom_free(struct rom_header *rom_header);
unsigned long pci_rom_write_acpi_tables(const struct device *device,