sound/core/pcm_native.c
Source file repositories/reference/linux-study-clean/sound/core/pcm_native.c
File Facts
- System
- Linux kernel
- Corpus path
sound/core/pcm_native.c- Extension
.c- Size
- 120505 bytes
- Lines
- 4261
- Domain
- Driver Families
- Bucket
- sound/core
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/compat.hlinux/mm.hlinux/module.hlinux/file.hlinux/slab.hlinux/sched/signal.hlinux/time.hlinux/pm_qos.hlinux/io.hlinux/dma-mapping.hlinux/vmalloc.hsound/core.hsound/control.hsound/info.hsound/pcm.hsound/pcm_params.hsound/timer.hsound/minors.hlinux/uio.hlinux/delay.hlinux/bitops.hpcm_local.hpcm_param_trace.hpcm_compat.c
Detected Declarations
struct snd_pcm_hw_params_oldstruct action_opsstruct snd_pcm_mmap_status32struct snd_pcm_mmap_control32struct snd_pcm_sync_ptr32function snd_pcm_group_initfunction snd_pcm_stream_lockfunction snd_pcm_stream_lockfunction snd_pcm_stream_lockfunction snd_pcm_stream_lock_nestedfunction snd_pcm_stream_unlock_irqfunction _snd_pcm_stream_lock_irqsavefunction _snd_pcm_stream_lock_irqsave_nestedfunction snd_pcm_stream_unlock_irqrestorefunction snd_pcm_ops_ioctlfunction snd_pcm_infofunction snd_pcm_info_userfunction hw_support_mmapfunction constrain_mask_paramsfunction constrain_interval_paramsfunction constrain_params_by_rulesfunction fixup_unreferenced_paramsfunction snd_pcm_hw_refinefunction snd_pcm_hw_refine_userfunction period_to_usecsfunction snd_pcm_set_statefunction snd_pcm_get_statefunction snd_pcm_state_open_or_disconnectedfunction snd_pcm_timer_notifyfunction snd_pcm_sync_stopfunction snd_pcm_hw_params_choosefunction snd_pcm_buffer_access_lockfunction snd_pcm_buffer_access_unlockfunction snd_pcm_runtime_buffer_set_silencefunction snd_pcm_hw_paramsfunction snd_pcm_hw_params_userfunction do_hw_freefunction snd_pcm_hw_freefunction snd_pcm_sw_paramsfunction snd_pcm_sw_params_userfunction snd_pcm_calc_delayfunction snd_pcm_status64function snd_pcm_status_user64function snd_pcm_status_user32function snd_pcm_channel_infofunction snd_pcm_channel_info_userfunction snd_pcm_trigger_tstampfunction snd_pcm_action_group
Annotated Snippet
const struct file_operations snd_pcm_f_ops[2] = {
{
.owner = THIS_MODULE,
.write = snd_pcm_write,
.write_iter = snd_pcm_writev,
.open = snd_pcm_playback_open,
.release = snd_pcm_release,
.poll = snd_pcm_poll,
.unlocked_ioctl = snd_pcm_ioctl,
.compat_ioctl = snd_pcm_ioctl_compat,
.mmap = snd_pcm_mmap,
.fasync = snd_pcm_fasync,
.get_unmapped_area = snd_pcm_get_unmapped_area,
},
{
.owner = THIS_MODULE,
.read = snd_pcm_read,
.read_iter = snd_pcm_readv,
.open = snd_pcm_capture_open,
.release = snd_pcm_release,
.poll = snd_pcm_poll,
.unlocked_ioctl = snd_pcm_ioctl,
.compat_ioctl = snd_pcm_ioctl_compat,
.mmap = snd_pcm_mmap,
.fasync = snd_pcm_fasync,
.get_unmapped_area = snd_pcm_get_unmapped_area,
}
};
Annotation
- Immediate include surface: `linux/compat.h`, `linux/mm.h`, `linux/module.h`, `linux/file.h`, `linux/slab.h`, `linux/sched/signal.h`, `linux/time.h`, `linux/pm_qos.h`.
- Detected declarations: `struct snd_pcm_hw_params_old`, `struct action_ops`, `struct snd_pcm_mmap_status32`, `struct snd_pcm_mmap_control32`, `struct snd_pcm_sync_ptr32`, `function snd_pcm_group_init`, `function snd_pcm_stream_lock`, `function snd_pcm_stream_lock`, `function snd_pcm_stream_lock`, `function snd_pcm_stream_lock_nested`.
- Atlas domain: Driver Families / sound/core.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.