diff options
author | Grzegorz Bernacki <bernacki@google.com> | 2023-04-25 15:33:34 +0000 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-06-02 21:48:58 +0000 |
commit | e6b4597fefae3e4fd30e66c522e0e57753b03813 (patch) | |
tree | 07f1b164000e2db21da1f5cee8ef0bedfeb53287 /src/include | |
parent | d34dbe5888fb11f2a6bb9bd0e4624d2e2f9f350a (diff) |
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>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/device/pci_rom.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h index 83015a12b4..19728f2225 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_probe(const struct device *dev); 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, |