drivers/char/tpm/eventlog/of.c
Source file repositories/reference/linux-study-clean/drivers/char/tpm/eventlog/of.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/char/tpm/eventlog/of.c- Extension
.c- Size
- 2877 bytes
- Lines
- 103
- Domain
- Driver Families
- Bucket
- drivers/char
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/slab.hlinux/io.hlinux/ioport.hlinux/of.hlinux/of_address.hlinux/of_reserved_mem.hlinux/tpm_eventlog.h../tpm.hcommon.h
Detected Declarations
function tpm_read_log_memory_regionfunction tpm_read_log_offunction of_property_match_string
Annotated Snippet
of_property_match_string(np, "compatible", "IBM,vtpm20") < 0) {
size = be32_to_cpup((__force __be32 *)sizep);
base = be64_to_cpup((__force __be64 *)basep);
} else {
size = *sizep;
base = *basep;
}
if (size == 0) {
dev_warn(&chip->dev, "%s: Event log area empty\n", __func__);
return -EIO;
}
log->bios_event_log = devm_kmemdup(&chip->dev, __va(base), size, GFP_KERNEL);
if (!log->bios_event_log)
return -ENOMEM;
log->bios_event_log_end = log->bios_event_log + size;
if (chip->flags & TPM_CHIP_FLAG_TPM2)
return EFI_TCG2_EVENT_LOG_FORMAT_TCG_2;
return EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2;
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/slab.h`, `linux/io.h`, `linux/ioport.h`, `linux/of.h`, `linux/of_address.h`, `linux/of_reserved_mem.h`, `linux/tpm_eventlog.h`.
- Detected declarations: `function tpm_read_log_memory_region`, `function tpm_read_log_of`, `function of_property_match_string`.
- Atlas domain: Driver Families / drivers/char.
- Implementation status: source 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.