include/sound/gus.h
Source file repositories/reference/linux-study-clean/include/sound/gus.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/gus.h- Extension
.h- Size
- 19198 bytes
- Lines
- 606
- Domain
- Driver Families
- Bucket
- include/sound
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/pcm.hsound/rawmidi.hsound/timer.hsound/seq_midi_emul.hsound/seq_device.hlinux/io.h
Detected Declarations
struct snd_gus_cardstruct snd_gf1_bank_infostruct snd_gf1_mem_blockstruct snd_gf1_memstruct snd_gf1_dma_blockstruct snd_gus_portstruct snd_gus_voicestruct snd_gus_voicestruct snd_gf1struct snd_gus_cardstruct _SND_IW_LFO_PROGRAMenum snd_gus_volume_statefunction snd_gf1_select_voicefunction snd_gf1_uart_cmdfunction snd_gf1_uart_statfunction snd_gf1_uart_putfunction snd_gf1_uart_getfunction snd_gf1_read8function snd_gf1_read16function snd_gf1_i_read8function snd_gf1_i_read16
Annotated Snippet
struct snd_gf1_bank_info {
unsigned int address;
unsigned int size;
};
struct snd_gf1_mem_block {
unsigned short flags; /* flags - SNDRV_GF1_MEM_BLOCK_XXXX */
unsigned short owner; /* owner - SNDRV_GF1_MEM_OWNER_XXXX */
unsigned int share; /* share count */
unsigned int share_id[4]; /* share ID */
unsigned int ptr;
unsigned int size;
char *name;
struct snd_gf1_mem_block *next;
struct snd_gf1_mem_block *prev;
};
struct snd_gf1_mem {
struct snd_gf1_bank_info banks_8[4];
struct snd_gf1_bank_info banks_16[4];
struct snd_gf1_mem_block *first;
struct snd_gf1_mem_block *last;
struct mutex memory_mutex;
};
struct snd_gf1_dma_block {
void *buffer; /* buffer in computer's RAM */
unsigned long buf_addr; /* buffer address */
unsigned int addr; /* address in onboard memory */
unsigned int count; /* count in bytes */
unsigned int cmd; /* DMA command (format) */
void (*ack)(struct snd_gus_card * gus, void *private_data);
void *private_data;
struct snd_gf1_dma_block *next;
};
struct snd_gus_port {
struct snd_midi_channel_set * chset;
struct snd_gus_card * gus;
int mode; /* operation mode */
int client; /* sequencer client number */
int port; /* sequencer port number */
unsigned int midi_has_voices: 1;
};
struct snd_gus_voice;
#define SNDRV_GF1_VOICE_TYPE_PCM 0
#define SNDRV_GF1_VOICE_TYPE_SYNTH 1
#define SNDRV_GF1_VOICE_TYPE_MIDI 2
#define SNDRV_GF1_VFLG_RUNNING (1<<0)
#define SNDRV_GF1_VFLG_EFFECT_TIMER1 (1<<1)
#define SNDRV_GF1_VFLG_PAN (1<<2)
enum snd_gus_volume_state {
VENV_BEFORE,
VENV_ATTACK,
VENV_SUSTAIN,
VENV_RELEASE,
VENV_DONE,
VENV_VOLUME
};
struct snd_gus_voice {
int number;
unsigned int use: 1,
pcm: 1,
synth:1,
midi: 1;
unsigned int flags;
unsigned char client;
unsigned char port;
unsigned char index;
unsigned char pad;
#ifdef CONFIG_SND_DEBUG
unsigned int interrupt_stat_wave;
unsigned int interrupt_stat_volume;
#endif
void (*handler_wave) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
void (*handler_volume) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
void (*handler_effect) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
void (*volume_change) (struct snd_gus_card * gus);
struct snd_gus_sample_ops *sample_ops;
/* running status / registers */
unsigned short fc_register;
Annotation
- Immediate include surface: `sound/pcm.h`, `sound/rawmidi.h`, `sound/timer.h`, `sound/seq_midi_emul.h`, `sound/seq_device.h`, `linux/io.h`.
- Detected declarations: `struct snd_gus_card`, `struct snd_gf1_bank_info`, `struct snd_gf1_mem_block`, `struct snd_gf1_mem`, `struct snd_gf1_dma_block`, `struct snd_gus_port`, `struct snd_gus_voice`, `struct snd_gus_voice`, `struct snd_gf1`, `struct snd_gus_card`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.