include/linux/range.h
Source file repositories/reference/linux-study-clean/include/linux/range.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/range.h- Extension
.h- Size
- 1098 bytes
- Lines
- 50
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct rangefunction range_lenfunction range_containsfunction range_overlaps
Annotated Snippet
struct range {
u64 start;
u64 end;
};
static inline u64 range_len(const struct range *range)
{
return range->end - range->start + 1;
}
/* True if r1 completely contains r2 */
static inline bool range_contains(const struct range *r1,
const struct range *r2)
{
return r1->start <= r2->start && r1->end >= r2->end;
}
/* True if any part of r1 overlaps r2 */
static inline bool range_overlaps(const struct range *r1,
const struct range *r2)
{
return r1->start <= r2->end && r1->end >= r2->start;
}
int add_range(struct range *range, int az, int nr_range,
u64 start, u64 end);
int add_range_with_merge(struct range *range, int az, int nr_range,
u64 start, u64 end);
void subtract_range(struct range *range, int az, u64 start, u64 end);
int clean_sort_range(struct range *range, int az);
void sort_range(struct range *range, int nr_range);
#define DEFINE_RANGE(_start, _end) \
(struct range) { \
.start = (_start), \
.end = (_end), \
}
#endif
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct range`, `function range_len`, `function range_contains`, `function range_overlaps`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.