drivers/virt/nitro_enclaves/ne_misc_dev_test.c
Source file repositories/reference/linux-study-clean/drivers/virt/nitro_enclaves/ne_misc_dev_test.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/virt/nitro_enclaves/ne_misc_dev_test.c- Extension
.c- Size
- 4485 bytes
- Lines
- 155
- Domain
- Driver Families
- Bucket
- drivers/virt
- 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
kunit/test.h
Detected Declarations
struct ne_phys_regions_testfunction ne_misc_dev_test_merge_phys_contig_memory_regions
Annotated Snippet
struct ne_phys_regions_test {
u64 paddr;
u64 size;
int expect_rc;
unsigned long expect_num;
u64 expect_last_paddr;
u64 expect_last_size;
} phys_regions_test_cases[] = {
/*
* Add the region from 0x1000 to (0x1000 + 0x200000 - 1):
* Expected result:
* Failed, start address is not 2M-aligned
*
* Now the instance of struct ne_phys_contig_mem_regions is:
* num = 0
* regions = {}
*/
{0x1000, 0x200000, -EINVAL, 0, INVALID_VALUE, INVALID_VALUE},
/*
* Add the region from 0x200000 to (0x200000 + 0x1000 - 1):
* Expected result:
* Failed, size is not 2M-aligned
*
* Now the instance of struct ne_phys_contig_mem_regions is:
* num = 0
* regions = {}
*/
{0x200000, 0x1000, -EINVAL, 0, INVALID_VALUE, INVALID_VALUE},
/*
* Add the region from 0x200000 to (0x200000 + 0x200000 - 1):
* Expected result:
* Successful
*
* Now the instance of struct ne_phys_contig_mem_regions is:
* num = 1
* regions = {
* {start=0x200000, end=0x3fffff}, // len=0x200000
* }
*/
{0x200000, 0x200000, 0, 1, 0x200000, 0x200000},
/*
* Add the region from 0x0 to (0x0 + 0x200000 - 1):
* Expected result:
* Successful
*
* Now the instance of struct ne_phys_contig_mem_regions is:
* num = 2
* regions = {
* {start=0x200000, end=0x3fffff}, // len=0x200000
* {start=0x0, end=0x1fffff}, // len=0x200000
* }
*/
{0x0, 0x200000, 0, 2, 0x0, 0x200000},
/*
* Add the region from 0x600000 to (0x600000 + 0x400000 - 1):
* Expected result:
* Successful
*
* Now the instance of struct ne_phys_contig_mem_regions is:
* num = 3
* regions = {
* {start=0x200000, end=0x3fffff}, // len=0x200000
* {start=0x0, end=0x1fffff}, // len=0x200000
* {start=0x600000, end=0x9fffff}, // len=0x400000
* }
*/
{0x600000, 0x400000, 0, 3, 0x600000, 0x400000},
/*
* Add the region from 0xa00000 to (0xa00000 + 0x400000 - 1):
* Expected result:
* Successful, merging case!
*
* Now the instance of struct ne_phys_contig_mem_regions is:
* num = 3
* regions = {
* {start=0x200000, end=0x3fffff}, // len=0x200000
* {start=0x0, end=0x1fffff}, // len=0x200000
* {start=0x600000, end=0xdfffff}, // len=0x800000
* }
*/
{0xa00000, 0x400000, 0, 3, 0x600000, 0x800000},
/*
* Add the region from 0x1000 to (0x1000 + 0x200000 - 1):
* Expected result:
Annotation
- Immediate include surface: `kunit/test.h`.
- Detected declarations: `struct ne_phys_regions_test`, `function ne_misc_dev_test_merge_phys_contig_memory_regions`.
- Atlas domain: Driver Families / drivers/virt.
- 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.