sound/pci/emu10k1/emuproc.c
Source file repositories/reference/linux-study-clean/sound/pci/emu10k1/emuproc.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/emu10k1/emuproc.c- Extension
.c- Size
- 25235 bytes
- Lines
- 727
- Domain
- Driver Families
- Bucket
- sound/pci
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/init.hlinux/string_choices.hsound/core.hsound/emu10k1.hp16v.h
Detected Declarations
struct emu10k1_reg_entryfunction Copyrightfunction snd_emu10k1_proc_readfunction snd_emu10k1_proc_spdif_readfunction snd_emu10k1_proc_rates_readfunction disasm_emu10k1_regfunction disasm_sblive_regfunction disasm_audigy_regfunction snd_emu10k1_proc_acode_readfunction snd_emu10k1_fx8010_readfunction snd_emu10k1_proc_voices_readfunction snd_emu_proc_emu1010_link_readfunction snd_emu_proc_emu1010_reg_readfunction snd_emu_proc_io_reg_readfunction snd_emu_proc_io_reg_writefunction snd_ptr_readfunction snd_ptr_writefunction snd_emu_proc_ptr_reg_readfunction snd_emu_proc_ptr_reg_writefunction snd_emu_proc_ptr_reg_write00function snd_emu_proc_ptr_reg_write20function snd_emu_proc_ptr_reg_read00afunction snd_emu_proc_ptr_reg_read00bfunction snd_emu_proc_ptr_reg_read20afunction snd_emu_proc_ptr_reg_read20bfunction snd_emu_proc_ptr_reg_read20cfunction snd_emu10k1_proc_init
Annotated Snippet
struct emu10k1_reg_entry {
unsigned short base, size;
const char *name;
};
static const struct emu10k1_reg_entry sblive_reg_entries[] = {
{ 0, 0x10, "FXBUS" },
{ 0x10, 0x10, "EXTIN" },
{ 0x20, 0x10, "EXTOUT" },
{ 0x30, 0x10, "FXBUS2" },
{ 0x40, 0x20, NULL }, // Constants
{ 0x100, 0x100, "GPR" },
{ 0x200, 0x80, "ITRAM_DATA" },
{ 0x280, 0x20, "ETRAM_DATA" },
{ 0x300, 0x80, "ITRAM_ADDR" },
{ 0x380, 0x20, "ETRAM_ADDR" },
{ 0x400, 0, NULL }
};
static const struct emu10k1_reg_entry audigy_reg_entries[] = {
{ 0, 0x40, "FXBUS" },
{ 0x40, 0x10, "EXTIN" },
{ 0x50, 0x10, "P16VIN" },
{ 0x60, 0x20, "EXTOUT" },
{ 0x80, 0x20, "FXBUS2" },
{ 0xa0, 0x10, "EMU32OUTH" },
{ 0xb0, 0x10, "EMU32OUTL" },
{ 0xc0, 0x20, NULL }, // Constants
// This can't be quite right - overlap.
//{ 0x100, 0xc0, "ITRAM_CTL" },
//{ 0x1c0, 0x40, "ETRAM_CTL" },
{ 0x160, 0x20, "A3_EMU32IN" },
{ 0x1e0, 0x20, "A3_EMU32OUT" },
{ 0x200, 0xc0, "ITRAM_DATA" },
{ 0x2c0, 0x40, "ETRAM_DATA" },
{ 0x300, 0xc0, "ITRAM_ADDR" },
{ 0x3c0, 0x40, "ETRAM_ADDR" },
{ 0x400, 0x200, "GPR" },
{ 0x600, 0, NULL }
};
static const char * const emu10k1_const_entries[] = {
"C_00000000",
"C_00000001",
"C_00000002",
"C_00000003",
"C_00000004",
"C_00000008",
"C_00000010",
"C_00000020",
"C_00000100",
"C_00010000",
"C_00000800",
"C_10000000",
"C_20000000",
"C_40000000",
"C_80000000",
"C_7fffffff",
"C_ffffffff",
"C_fffffffe",
"C_c0000000",
"C_4f1bbcdc",
"C_5a7ef9db",
"C_00100000",
"GPR_ACCU",
"GPR_COND",
"GPR_NOISE0",
"GPR_NOISE1",
"GPR_IRQ",
"GPR_DBAC",
"GPR_DBACE",
"???",
};
static int disasm_emu10k1_reg(char *buffer,
const struct emu10k1_reg_entry *entries,
unsigned reg, const char *pfx)
{
for (int i = 0; ; i++) {
unsigned base = entries[i].base;
unsigned size = entries[i].size;
if (!size)
return sprintf(buffer, "%s0x%03x", pfx, reg);
if (reg >= base && reg < base + size) {
const char *name = entries[i].name;
reg -= base;
if (name)
return sprintf(buffer, "%s%s(%u)", pfx, name, reg);
return sprintf(buffer, "%s%s", pfx, emu10k1_const_entries[reg]);
}
Annotation
- Immediate include surface: `linux/slab.h`, `linux/init.h`, `linux/string_choices.h`, `sound/core.h`, `sound/emu10k1.h`, `p16v.h`.
- Detected declarations: `struct emu10k1_reg_entry`, `function Copyright`, `function snd_emu10k1_proc_read`, `function snd_emu10k1_proc_spdif_read`, `function snd_emu10k1_proc_rates_read`, `function disasm_emu10k1_reg`, `function disasm_sblive_reg`, `function disasm_audigy_reg`, `function snd_emu10k1_proc_acode_read`, `function snd_emu10k1_fx8010_read`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.