drivers/ptp/ptp_vclock.c
Source file repositories/reference/linux-study-clean/drivers/ptp/ptp_vclock.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ptp/ptp_vclock.c- Extension
.c- Size
- 7174 bytes
- Lines
- 307
- Domain
- Driver Families
- Bucket
- drivers/ptp
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/slab.hlinux/hashtable.hptp_private.h
Detected Declarations
function ptp_vclock_hash_addfunction ptp_vclock_hash_delfunction ptp_vclock_adjfinefunction ptp_vclock_adjtimefunction ptp_vclock_gettimefunction ptp_vclock_gettimexfunction ptp_vclock_settimefunction ptp_vclock_getcrosststampfunction ptp_vclock_refreshfunction ptp_vclock_set_subclassfunction ptp_vclock_readfunction ptp_vclock_unregisterfunction ptp_get_vclocks_indexfunction ptp_convert_timestampfunction hlist_for_each_entry_srcuexport ptp_get_vclocks_indexexport ptp_convert_timestamp
Annotated Snippet
srcu_read_lock_held(&vclock_srcu)) {
if (vclock->clock->index != vclock_index)
continue;
if (mutex_lock_interruptible(&vclock->lock))
break;
vclock_ns = timecounter_cyc2time(&vclock->tc, ns);
mutex_unlock(&vclock->lock);
break;
}
srcu_read_unlock(&vclock_srcu, srcu_idx);
return ns_to_ktime(vclock_ns);
}
EXPORT_SYMBOL(ptp_convert_timestamp);
#endif
Annotation
- Immediate include surface: `linux/slab.h`, `linux/hashtable.h`, `ptp_private.h`.
- Detected declarations: `function ptp_vclock_hash_add`, `function ptp_vclock_hash_del`, `function ptp_vclock_adjfine`, `function ptp_vclock_adjtime`, `function ptp_vclock_gettime`, `function ptp_vclock_gettimex`, `function ptp_vclock_settime`, `function ptp_vclock_getcrosststamp`, `function ptp_vclock_refresh`, `function ptp_vclock_set_subclass`.
- Atlas domain: Driver Families / drivers/ptp.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.