diff options
Diffstat (limited to 'sys/dev/sound/pcm/buffer.h')
| -rw-r--r-- | sys/dev/sound/pcm/buffer.h | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h index ddf4083ec19f..371ba2dd94ce 100644 --- a/sys/dev/sound/pcm/buffer.h +++ b/sys/dev/sound/pcm/buffer.h @@ -3,6 +3,10 @@ * * Copyright (c) 1999 Cameron Grant <cg@freebsd.org> * All rights reserved. + * Copyright (c) 2025 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * <christos@FreeBSD.org> under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,12 +30,11 @@ * SUCH DAMAGE. */ -#define SNDBUF_F_MANAGED 0x00000008 +#define SNDBUF_F_MANAGED 0x00000001 #define SNDBUF_NAMELEN 48 struct snd_dbuf { - device_t dev; u_int8_t *buf, *tmpbuf; u_int8_t *shadbuf; /**< shadow buffer used w/ S_D_SILENCE/SKIP */ volatile int sl; /**< shadbuf ready length in # of bytes */ @@ -41,7 +44,7 @@ struct snd_dbuf { volatile int rl; /* length of ready area */ volatile int hp; volatile u_int64_t total, prev_total; - int dmachan, dir; /* dma channel */ + int dmachan; /* dma channel */ u_int32_t fmt, spd, bps, align; unsigned int blksz, blkcnt; int xrun; @@ -55,11 +58,9 @@ struct snd_dbuf { char name[SNDBUF_NAMELEN]; }; -struct snd_dbuf *sndbuf_create(device_t dev, char *drv, char *desc, struct pcm_channel *channel); +struct snd_dbuf *sndbuf_create(struct pcm_channel *channel, const char *desc); void sndbuf_destroy(struct snd_dbuf *b); -void sndbuf_dump(struct snd_dbuf *b, char *s, u_int32_t what); - int sndbuf_alloc(struct snd_dbuf *b, bus_dma_tag_t dmatag, int dmaflags, unsigned int size); int sndbuf_setup(struct snd_dbuf *b, void *buf, unsigned int size); void sndbuf_free(struct snd_dbuf *b); @@ -72,51 +73,26 @@ void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl); void sndbuf_softreset(struct snd_dbuf *b); void sndbuf_clearshadow(struct snd_dbuf *b); -u_int32_t sndbuf_getfmt(struct snd_dbuf *b); int sndbuf_setfmt(struct snd_dbuf *b, u_int32_t fmt); -unsigned int sndbuf_getspd(struct snd_dbuf *b); void sndbuf_setspd(struct snd_dbuf *b, unsigned int spd); -unsigned int sndbuf_getbps(struct snd_dbuf *b); -bus_addr_t sndbuf_getbufaddr(struct snd_dbuf *buf); - -void *sndbuf_getbuf(struct snd_dbuf *b); void *sndbuf_getbufofs(struct snd_dbuf *b, unsigned int ofs); -unsigned int sndbuf_getsize(struct snd_dbuf *b); -unsigned int sndbuf_getmaxsize(struct snd_dbuf *b); -unsigned int sndbuf_getallocsize(struct snd_dbuf *b); -unsigned int sndbuf_getalign(struct snd_dbuf *b); -unsigned int sndbuf_getblkcnt(struct snd_dbuf *b); -void sndbuf_setblkcnt(struct snd_dbuf *b, unsigned int blkcnt); -unsigned int sndbuf_getblksz(struct snd_dbuf *b); -void sndbuf_setblksz(struct snd_dbuf *b, unsigned int blksz); unsigned int sndbuf_runsz(struct snd_dbuf *b); void sndbuf_setrun(struct snd_dbuf *b, int go); -struct selinfo *sndbuf_getsel(struct snd_dbuf *b); -unsigned int sndbuf_getxrun(struct snd_dbuf *b); void sndbuf_setxrun(struct snd_dbuf *b, unsigned int xrun); -unsigned int sndbuf_gethwptr(struct snd_dbuf *b); -void sndbuf_sethwptr(struct snd_dbuf *b, unsigned int ptr); unsigned int sndbuf_getfree(struct snd_dbuf *b); unsigned int sndbuf_getfreeptr(struct snd_dbuf *b); unsigned int sndbuf_getready(struct snd_dbuf *b); unsigned int sndbuf_getreadyptr(struct snd_dbuf *b); u_int64_t sndbuf_getblocks(struct snd_dbuf *b); -u_int64_t sndbuf_getprevblocks(struct snd_dbuf *b); -u_int64_t sndbuf_gettotal(struct snd_dbuf *b); -u_int64_t sndbuf_getprevtotal(struct snd_dbuf *b); unsigned int sndbuf_xbytes(unsigned int v, struct snd_dbuf *from, struct snd_dbuf *to); u_int8_t sndbuf_zerodata(u_int32_t fmt); -void sndbuf_updateprevtotal(struct snd_dbuf *b); int sndbuf_acquire(struct snd_dbuf *b, u_int8_t *from, unsigned int count); int sndbuf_dispose(struct snd_dbuf *b, u_int8_t *to, unsigned int count); int sndbuf_feed(struct snd_dbuf *from, struct snd_dbuf *to, struct pcm_channel *channel, struct pcm_feeder *feeder, unsigned int count); -u_int32_t sndbuf_getflags(struct snd_dbuf *b); -void sndbuf_setflags(struct snd_dbuf *b, u_int32_t flags, int on); - #ifdef OSSV4_EXPERIMENT void sndbuf_getpeaks(struct snd_dbuf *b, int *lp, int *rp); #endif |
