1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00
freebsd/sys/i386/isa/sound/os.h
Poul-Henning Kamp 9626b608de Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter
2000-05-05 09:59:14 +00:00

102 lines
2.1 KiB
C

/*
* os.h -- only included by sound_config.h right after local.h
*
* $FreeBSD$
*/
#ifndef _OS_H_
#define _OS_H_
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/filio.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/poll.h>
#include <sys/malloc.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/signalvar.h>
#include <sys/soundcard.h>
#include <i386/isa/isa_device.h>
#undef DELAY
#define DELAY(x) tenmicrosec(x)
typedef struct uio snd_rw_buf;
struct snd_wait {
int mode;
int aborting;
};
unsigned long get_time(void);
#endif /* _OS_H_ */
typedef caddr_t ioctl_arg;
typedef struct sound_os_info {
int unit;
} sound_os_info;
/*
* 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(),
* and the second is a workarea parameter. The third is a timeout
* in ticks. Zero means no timeout.
*/
#define DO_SLEEP(q, f, time_limit) \
{ \
int flag; \
f.mode = WK_SLEEP; \
flag=tsleep(&q, (PRIBIO-5)|PCATCH, "sndint", time_limit); \
f.mode &= ~WK_SLEEP; \
if (flag == EWOULDBLOCK) { \
f.mode |= WK_TIMEOUT; \
f.aborting = 0; \
} else \
f.aborting = flag; \
}
#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; \
}
#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; \
}
#define PROCESS_ABORTING( f) (f.aborting || CURSIG(curproc))
#define TIMED_OUT( f) (f.mode & WK_TIMEOUT)
#ifdef ALLOW_POLL
typedef struct proc select_table;
extern struct selinfo selinfo[];
#endif