Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/74778?usp=email )
(
13 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )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=b: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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74778 Reviewed-by: Karthik Ramasubramanian kramasub@google.com Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Reviewed-by: Himanshu Sahdev himanshu.sahdev@intel.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/include/device/pci_rom.h 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Felix Singer: Looks good to me, approved Karthik Ramasubramanian: Looks good to me, approved build bot (Jenkins): Verified Himanshu Sahdev: Looks good to me, but someone else must approve
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h index 83015a1..19728f2 100644 --- a/src/include/device/pci_rom.h +++ b/src/include/device/pci_rom.h @@ -5,6 +5,7 @@
#include <endian.h> #include <acpi/acpi.h> +#include <cbfs.h> #include <stdint.h>
#define PCI_ROM_HDR 0xAA55 @@ -42,6 +43,11 @@ struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header);
+static inline void pci_rom_free(struct rom_header *rom_header) +{ + cbfs_unmap(rom_header); +} + unsigned long pci_rom_write_acpi_tables(const struct device *device, unsigned long current,