1993-10-23 10:55:52 +00:00
|
|
|
/*
|
1997-10-31 06:30:22 +00:00
|
|
|
* os.h -- only included by sound_config.h right after local.h
|
1993-10-23 10:55:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
#ifndef _OS_H_
|
|
|
|
#define _OS_H_
|
1993-10-23 10:55:52 +00:00
|
|
|
|
Reorganize how sound devices are configured. Use a snd controller
with individual devices for each type of sound card:
opl, sb, sbxvi, sbmidi, pas, mpu, gus, gusxvi, gusmax, mss, uart
EXCLUDE_* options are no longer required to be included in the config file.
They are automatically determined by local.h depending on the devices
included.
Move #includes in local.h to os.h so files are included in the proper
order to avoid warnings.
soundcard.c now has additional code to reflect the device driver
routines needed.
Define new EXCLUDE_SB16MIDI for use in sb16_midi.c and dev_table.h.
#ifndef EXCLUDE_SEQUENCER or EXCLUDE_AUDIO have been added to
soundcard.c and sound_switch.c where appropriate.
Probe outputs changed to reflect new device names.
Readme.freebsd not needed. Update sound.doc with new config instructions.
Reviewed by: wollman
1995-03-12 23:34:12 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/proc.h>
|
|
|
|
#include <sys/conf.h>
|
1997-03-23 03:37:54 +00:00
|
|
|
#include <sys/fcntl.h>
|
1996-09-21 14:53:28 +00:00
|
|
|
#include <sys/filio.h>
|
Reorganize how sound devices are configured. Use a snd controller
with individual devices for each type of sound card:
opl, sb, sbxvi, sbmidi, pas, mpu, gus, gusxvi, gusmax, mss, uart
EXCLUDE_* options are no longer required to be included in the config file.
They are automatically determined by local.h depending on the devices
included.
Move #includes in local.h to os.h so files are included in the proper
order to avoid warnings.
soundcard.c now has additional code to reflect the device driver
routines needed.
Define new EXCLUDE_SB16MIDI for use in sb16_midi.c and dev_table.h.
#ifndef EXCLUDE_SEQUENCER or EXCLUDE_AUDIO have been added to
soundcard.c and sound_switch.c where appropriate.
Probe outputs changed to reflect new device names.
Readme.freebsd not needed. Update sound.doc with new config instructions.
Reviewed by: wollman
1995-03-12 23:34:12 +00:00
|
|
|
#include <sys/uio.h>
|
|
|
|
#include <sys/kernel.h>
|
1997-09-14 03:12:54 +00:00
|
|
|
#include <sys/poll.h>
|
Reorganize how sound devices are configured. Use a snd controller
with individual devices for each type of sound card:
opl, sb, sbxvi, sbmidi, pas, mpu, gus, gusxvi, gusmax, mss, uart
EXCLUDE_* options are no longer required to be included in the config file.
They are automatically determined by local.h depending on the devices
included.
Move #includes in local.h to os.h so files are included in the proper
order to avoid warnings.
soundcard.c now has additional code to reflect the device driver
routines needed.
Define new EXCLUDE_SB16MIDI for use in sb16_midi.c and dev_table.h.
#ifndef EXCLUDE_SEQUENCER or EXCLUDE_AUDIO have been added to
soundcard.c and sound_switch.c where appropriate.
Probe outputs changed to reflect new device names.
Readme.freebsd not needed. Update sound.doc with new config instructions.
Reviewed by: wollman
1995-03-12 23:34:12 +00:00
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/buf.h>
|
1996-01-16 10:19:23 +00:00
|
|
|
#include <sys/signalvar.h>
|
1995-07-28 21:40:49 +00:00
|
|
|
|
1995-07-29 14:20:54 +00:00
|
|
|
#include <machine/soundcard.h>
|
1997-10-31 06:30:22 +00:00
|
|
|
#undef DELAY
|
|
|
|
#define DELAY(x) tenmicrosec(x)
|
1993-10-23 10:55:52 +00:00
|
|
|
typedef struct uio snd_rw_buf;
|
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
struct snd_wait {
|
|
|
|
int mode;
|
|
|
|
int aborting;
|
|
|
|
};
|
1993-10-23 10:55:52 +00:00
|
|
|
|
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
unsigned long get_time(void);
|
1993-10-23 10:55:52 +00:00
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
#endif /* _OS_H_ */
|
1993-10-23 10:55:52 +00:00
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
typedef caddr_t ioctl_arg;
|
1994-03-11 10:27:25 +00:00
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
typedef struct sound_os_info {
|
|
|
|
int unit;
|
|
|
|
} sound_os_info;
|
1994-03-11 10:27:25 +00:00
|
|
|
|
1993-10-23 10:55:52 +00:00
|
|
|
|
|
|
|
/*
|
1996-01-16 10:19:23 +00:00
|
|
|
* The following macro calls tsleep. It should be implemented such that
|
|
|
|
* the process is resumed if it receives a signal.
|
|
|
|
* The q parameter is a wait_queue defined with DEFINE_WAIT_QUEUE(),
|
1995-07-28 21:40:49 +00:00
|
|
|
* and the second is a workarea parameter. The third is a timeout
|
1994-03-11 10:27:25 +00:00
|
|
|
* in ticks. Zero means no timeout.
|
1993-10-23 10:55:52 +00:00
|
|
|
*/
|
1994-03-11 10:27:25 +00:00
|
|
|
#define DO_SLEEP(q, f, time_limit) \
|
1993-10-23 10:55:52 +00:00
|
|
|
{ \
|
1996-01-16 06:07:09 +00:00
|
|
|
int flag; \
|
1994-03-11 10:27:25 +00:00
|
|
|
f.mode = WK_SLEEP; \
|
1996-01-16 10:19:23 +00:00
|
|
|
flag=tsleep(&q, (PRIBIO-5)|PCATCH, "sndint", time_limit); \
|
1994-03-11 10:27:25 +00:00
|
|
|
f.mode &= ~WK_SLEEP; \
|
1996-01-16 12:29:37 +00:00
|
|
|
if (flag == EWOULDBLOCK) { \
|
|
|
|
f.mode |= WK_TIMEOUT; \
|
1996-01-16 10:19:23 +00:00
|
|
|
f.aborting = 0; \
|
1996-01-16 12:29:37 +00:00
|
|
|
} else \
|
|
|
|
f.aborting = flag; \
|
1993-10-23 10:55:52 +00:00
|
|
|
}
|
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
#define DO_SLEEP1(q, f, time_limit) \
|
|
|
|
{ \
|
|
|
|
int flag; \
|
|
|
|
f.mode = WK_SLEEP; \
|
|
|
|
flag=tsleep(&q, (PRIBIO-5)|PCATCH, "snd1", time_limit); \
|
|
|
|
f.mode &= ~WK_SLEEP; \
|
|
|
|
if (flag == EWOULDBLOCK) { \
|
|
|
|
f.mode |= WK_TIMEOUT; \
|
|
|
|
f.aborting = 0; \
|
|
|
|
} else \
|
|
|
|
f.aborting = flag; \
|
|
|
|
}
|
1993-10-23 10:55:52 +00:00
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
#define DO_SLEEP2(q, f, time_limit) \
|
|
|
|
{ \
|
|
|
|
int flag; \
|
|
|
|
f.mode = WK_SLEEP; \
|
|
|
|
flag=tsleep(&q, (PRIBIO-5)|PCATCH, "snd2", time_limit); \
|
|
|
|
f.mode &= ~WK_SLEEP; \
|
|
|
|
if (flag == EWOULDBLOCK) { \
|
|
|
|
f.mode |= WK_TIMEOUT; \
|
|
|
|
f.aborting = 0; \
|
|
|
|
} else \
|
|
|
|
f.aborting = flag; \
|
|
|
|
}
|
1995-07-28 21:40:49 +00:00
|
|
|
|
1997-10-31 06:30:22 +00:00
|
|
|
#define PROCESS_ABORTING( f) (f.aborting || CURSIG(curproc))
|
|
|
|
#define TIMED_OUT( f) (f.mode & WK_TIMEOUT)
|
1995-07-28 21:40:49 +00:00
|
|
|
|
1997-11-10 18:31:35 +00:00
|
|
|
#ifdef ALLOW_POLL
|
1995-07-28 21:40:49 +00:00
|
|
|
typedef struct proc select_table;
|
|
|
|
extern struct selinfo selinfo[];
|
1993-10-23 10:55:52 +00:00
|
|
|
#endif
|