1 /* 2 * Copyright (c) 1992 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This software was developed by the Computer Systems Engineering group 6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7 * contributed to Berkeley. 8 * 9 * All advertising materials mentioning features or use of this software 10 * must display the following acknowledgement: 11 * This product includes software developed by the University of 12 * California, Lawrence Berkeley Laboratories. 13 * 14 * %sccs.include.redist.c% 15 * 16 * @(#)bsd_audiovar.h 7.2 (Berkeley) 07/21/92 17 * 18 * from: $Header: bsd_audiovar.h,v 1.4 92/07/03 23:23:12 mccanne Exp $ (LBL) 19 */ 20 21 #define AUCB_SIZE 4096 22 #define AUCB_MOD(k) ((k) & (AUCB_SIZE - 1)) 23 24 #define AUCB_INIT(cb) ((cb)->cb_head = (cb)->cb_tail = (cb)->cb_drops = \ 25 (cb)->cb_pdrops = 0) 26 27 #define AUCB_EMPTY(cb) ((cb)->cb_head == (cb)->cb_tail) 28 #define AUCB_FULL(cb) (AUCB_MOD((cb)->cb_tail + 1) == (cb)->cb_head) 29 #define AUCB_LEN(cb) (AUCB_MOD((cb)->cb_tail - (cb)->cb_head)) 30 31 #define MAXBLKSIZE (AUCB_SIZE / 2) 32 #define DEFBLKSIZE 128 33 34 #ifndef LOCORE 35 /* 36 * aucb's are used for communication between the trap handler and 37 * the software interrupt. 38 */ 39 struct aucb { 40 int cb_head; /* queue head */ 41 int cb_tail; /* queue tail */ 42 int cb_thresh; /* threshold for wakeup */ 43 u_short cb_waking; /* needs wakeup at softint level */ 44 u_short cb_pause; /* io paused */ 45 u_long cb_drops; /* missed samples from over/underrun */ 46 u_long cb_pdrops; /* sun compat -- paused samples */ 47 u_char cb_data[AUCB_SIZE]; /* data buffer */ 48 }; 49 50 #if !defined(__STDC__) && !defined(volatile) 51 #define volatile 52 #endif 53 54 struct auio { 55 volatile struct amd7930 *au_amd;/* chip registers */ 56 u_long au_stamp; /* time stamp */ 57 int au_lowat; /* xmit low water mark (for wakeup) */ 58 int au_hiwat; /* xmit high water mark (for wakeup) */ 59 int au_blksize; /* recv block (chunk) size */ 60 struct aucb au_rb; /* read (recv) buffer */ 61 struct aucb au_wb; /* write (xmit) buffer */ 62 }; 63 #endif 64