drivers/firmware/efi/embedded-firmware.c
Source file repositories/reference/linux-study-clean/drivers/firmware/efi/embedded-firmware.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/efi/embedded-firmware.c- Extension
.c- Size
- 3437 bytes
- Lines
- 148
- Domain
- Driver Families
- Bucket
- drivers/firmware
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dmi.hlinux/efi.hlinux/efi_embedded_fw.hlinux/io.hlinux/slab.hlinux/types.hlinux/vmalloc.hcrypto/sha2.h
Detected Declarations
function efi_check_for_embedded_firmwaresfunction efi_check_for_embedded_firmwaresfunction for_each_efi_memory_descfunction efi_get_embedded_fwfunction list_for_each_entryexport efi_get_embedded_fw
Annotated Snippet
for_each_efi_memory_desc(md) {
if (md->type != EFI_BOOT_SERVICES_CODE)
continue;
r = efi_check_md_for_embedded_firmware(md, fw_desc);
if (r == 0)
break;
}
}
efi_embedded_fw_checked = true;
}
int efi_get_embedded_fw(const char *name, const u8 **data, size_t *size)
{
struct efi_embedded_fw *iter, *fw = NULL;
if (!efi_embedded_fw_checked) {
pr_warn("Warning %s called while we did not check for embedded fw\n",
__func__);
return -ENOENT;
}
list_for_each_entry(iter, &efi_embedded_fw_list, list) {
if (strcmp(name, iter->name) == 0) {
fw = iter;
break;
}
}
if (!fw)
return -ENOENT;
*data = fw->data;
*size = fw->length;
return 0;
}
EXPORT_SYMBOL_GPL(efi_get_embedded_fw);
Annotation
- Immediate include surface: `linux/dmi.h`, `linux/efi.h`, `linux/efi_embedded_fw.h`, `linux/io.h`, `linux/slab.h`, `linux/types.h`, `linux/vmalloc.h`, `crypto/sha2.h`.
- Detected declarations: `function efi_check_for_embedded_firmwares`, `function efi_check_for_embedded_firmwares`, `function for_each_efi_memory_desc`, `function efi_get_embedded_fw`, `function list_for_each_entry`, `export efi_get_embedded_fw`.
- Atlas domain: Driver Families / drivers/firmware.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.