drivers/of/of_test.c
Source file repositories/reference/linux-study-clean/drivers/of/of_test.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/of/of_test.c- Extension
.c- Size
- 3922 bytes
- Lines
- 179
- Domain
- Driver Families
- Bucket
- drivers/of
- 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/ioport.hlinux/module.hlinux/of.hkunit/test.hof_private.h
Detected Declarations
struct of_address_resource_bounds_casefunction of_dtb_root_node_found_by_pathfunction of_dtb_root_node_populates_of_rootfunction of_dtb_test_initfunction of_address_resource_bounds_case_descfunction of_address_resource_bounds
Annotated Snippet
struct of_address_resource_bounds_case {
u64 start;
u64 size;
int ret;
u64 res_start;
u64 res_end;
};
static void of_address_resource_bounds_case_desc(const struct of_address_resource_bounds_case *p,
char *name)
{
snprintf(name, KUNIT_PARAM_DESC_SIZE, "start=0x%016llx,size=0x%016llx", p->start, p->size);
}
static const struct of_address_resource_bounds_case of_address_resource_bounds_cases[] = {
{
.start = 0,
.size = 0,
.ret = 0,
.res_start = 0,
.res_end = -1,
},
{
.start = 0,
.size = 0x1000,
.ret = 0,
.res_start = 0,
.res_end = 0xfff,
},
{
.start = 0x1000,
.size = 0,
.ret = 0,
.res_start = 0x1000,
.res_end = 0xfff,
},
{
.start = 0x1000,
.size = 0x1000,
.ret = 0,
.res_start = 0x1000,
.res_end = 0x1fff,
},
{
.start = 1,
.size = RESOURCE_SIZE_MAX,
.ret = 0,
.res_start = 1,
.res_end = RESOURCE_SIZE_MAX,
},
{
.start = RESOURCE_SIZE_MAX,
.size = 1,
.ret = 0,
.res_start = RESOURCE_SIZE_MAX,
.res_end = RESOURCE_SIZE_MAX,
},
{
.start = 2,
.size = RESOURCE_SIZE_MAX,
.ret = -EOVERFLOW,
},
{
.start = RESOURCE_SIZE_MAX,
.size = 2,
.ret = -EOVERFLOW,
},
{
.start = ULL(0x100000000),
.size = 1,
.ret = sizeof(resource_size_t) > sizeof(u32) ? 0 : -EOVERFLOW,
.res_start = ULL(0x100000000),
.res_end = ULL(0x100000000),
},
{
.start = 0x1000,
.size = 0xffffffff,
.ret = sizeof(resource_size_t) > sizeof(u32) ? 0 : -EOVERFLOW,
.res_start = 0x1000,
.res_end = ULL(0x100000ffe),
},
};
KUNIT_ARRAY_PARAM(of_address_resource_bounds,
of_address_resource_bounds_cases, of_address_resource_bounds_case_desc);
static void of_address_resource_bounds(struct kunit *test)
{
const struct of_address_resource_bounds_case *param = test->param_value;
Annotation
- Immediate include surface: `linux/ioport.h`, `linux/module.h`, `linux/of.h`, `kunit/test.h`, `of_private.h`.
- Detected declarations: `struct of_address_resource_bounds_case`, `function of_dtb_root_node_found_by_path`, `function of_dtb_root_node_populates_of_root`, `function of_dtb_test_init`, `function of_address_resource_bounds_case_desc`, `function of_address_resource_bounds`.
- Atlas domain: Driver Families / drivers/of.
- 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.