FreeBSD kernel sound device code
unit.c File Reference
#include <sys/param.h>
#include <sys/systm.h>
#include <dev/sound/unit.h>
Include dependency graph for unit.c:

Go to the source code of this file.

Macros

#define SND_UNIT_ASSERT()
 
#define MKMASK(x)   ((1 << snd_##x##_shift) - 1)
 

Functions

int snd_max_u (void)
 
int snd_max_d (void)
 
int snd_max_c (void)
 
int snd_unit2u (int unit)
 
int snd_unit2d (int unit)
 
int snd_unit2c (int unit)
 
int snd_u2unit (int u)
 
int snd_d2unit (int d)
 
int snd_c2unit (int c)
 
int snd_mkunit (int u, int d, int c)
 
void snd_unit_init (void)
 

Variables

static int snd_u_shift = 9
 
static int snd_d_shift = 5
 
static int snd_c_shift = 10
 
static int snd_unit_initialized = 0
 

Macro Definition Documentation

◆ MKMASK

#define MKMASK (   x)    ((1 << snd_##x##_shift) - 1)

Definition at line 81 of file unit.c.

◆ SND_UNIT_ASSERT

#define SND_UNIT_ASSERT ( )
Value:
KASSERT(snd_unit_initialized != 0, \
("%s(): Uninitialized sound unit!", \
__func__))
static int snd_unit_initialized
Definition: unit.c:68

Definition at line 76 of file unit.c.

Function Documentation

◆ snd_c2unit()

int snd_c2unit ( int  c)

Definition at line 148 of file unit.c.

References c, MKMASK, and SND_UNIT_ASSERT.

Referenced by dsp_clone().

Here is the caller graph for this function:

◆ snd_d2unit()

int snd_d2unit ( int  d)

Definition at line 140 of file unit.c.

References MKMASK, snd_c_shift, and SND_UNIT_ASSERT.

Referenced by dsp_clone().

Here is the caller graph for this function:

◆ snd_max_c()

int snd_max_c ( void  )

Definition at line 100 of file unit.c.

References c, MKMASK, and SND_UNIT_ASSERT.

Referenced by snd_unit_init().

Here is the caller graph for this function:

◆ snd_max_d()

int snd_max_d ( void  )

Definition at line 92 of file unit.c.

References MKMASK, and SND_UNIT_ASSERT.

Referenced by snd_unit_init().

Here is the caller graph for this function:

◆ snd_max_u()

int snd_max_u ( void  )

Definition at line 84 of file unit.c.

References MKMASK, and SND_UNIT_ASSERT.

Referenced by snd_unit_init().

Here is the caller graph for this function:

◆ snd_mkunit()

int snd_mkunit ( int  u,
int  d,
int  c 
)

Definition at line 156 of file unit.c.

References c, MKMASK, snd_c_shift, snd_d_shift, and SND_UNIT_ASSERT.

Referenced by mixer_init(), and pcm_chn_create().

Here is the caller graph for this function:

◆ snd_u2unit()

int snd_u2unit ( int  u)

Definition at line 132 of file unit.c.

References MKMASK, snd_c_shift, snd_d_shift, and SND_UNIT_ASSERT.

Referenced by dsp_clone().

Here is the caller graph for this function:

◆ snd_unit2c()

int snd_unit2c ( int  unit)

Definition at line 124 of file unit.c.

References c, MKMASK, and SND_UNIT_ASSERT.

Referenced by dsp_unit2name(), and pcm_chnalloc().

Here is the caller graph for this function:

◆ snd_unit2d()

int snd_unit2d ( int  unit)

Definition at line 116 of file unit.c.

References MKMASK, snd_c_shift, and SND_UNIT_ASSERT.

Referenced by dsp_unit2name(), and pcm_chnalloc().

Here is the caller graph for this function:

◆ snd_unit2u()

int snd_unit2u ( int  unit)

Definition at line 108 of file unit.c.

References MKMASK, snd_c_shift, snd_d_shift, and SND_UNIT_ASSERT.

Referenced by dsp_unit2name().

Here is the caller graph for this function:

◆ snd_unit_init()

void snd_unit_init ( void  )

Definition at line 168 of file unit.c.

References SND_C_MASK, snd_c_shift, SND_D_MASK, snd_d_shift, snd_max_c(), snd_max_d(), snd_max_u(), SND_U_MASK, snd_u_shift, snd_unit_initialized, SND_UNIT_UMAX, and SND_UNIT_UMIN.

Referenced by dsp_sysinit(), and SLIST_HEAD().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ snd_c_shift

int snd_c_shift = 10
static

Definition at line 64 of file unit.c.

Referenced by snd_d2unit(), snd_mkunit(), snd_u2unit(), snd_unit2d(), snd_unit2u(), and snd_unit_init().

◆ snd_d_shift

int snd_d_shift = 5
static

Definition at line 63 of file unit.c.

Referenced by snd_mkunit(), snd_u2unit(), snd_unit2u(), and snd_unit_init().

◆ snd_u_shift

int snd_u_shift = 9
static

Definition at line 62 of file unit.c.

Referenced by snd_unit_init().

◆ snd_unit_initialized

int snd_unit_initialized = 0
static

Definition at line 68 of file unit.c.

Referenced by snd_unit_init().