Return to BSD News archive
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!moe.ksu.ksu.edu!vixen.cso.uiuc.edu!uwm.edu!wupost!spool.mu.edu!agate!remarque.berkeley.edu!cuccia
From: cuccia@remarque.berkeley.edu (Nick Cuccia)
Newsgroups: comp.os.386bsd.development
Subject: [NetBSD-current] patches for soundblaster driver...
Date: 25 Jul 1993 21:23:51 GMT
Organization: Bump City Brewery and Barbecue, Berkeley, CA
Lines: 163
Message-ID: <22utl7$mf6@agate.berkeley.edu>
NNTP-Posting-Host: remarque.berkeley.edu
here are the patches required for the soundblaster driver on agate
to work on NetBSD-current.
Cheers,
--Nick
# To unbundle, sh this file
echo sb.c.pat 1>&2
cat >sb.c.pat <<'End of sb.c.pat'
*** sb.c.orig Sun Feb 21 10:51:49 1993
--- sb.c Fri Jul 23 18:55:48 1993
***************
*** 267,272 ****
--- 267,280 ----
/* Select handler stuff, one entry for each "device" */
+ #if defined(NetBSD)
+ /*
+ * Needed for 4.4BSD selwakeup() semantics.
+ * cuccia@talamasca.berkeley.ca.us 930721
+ */
+ struct selinfo sel_info[SB_BIGGEST_MINOR];
+ #else
struct proc *selects[SB_BIGGEST_MINOR];
sbFLAG sel_coll[SB_BIGGEST_MINOR];
+ #endif
struct proc *sig_proc[SB_BIGGEST_MINOR];
int flags[SB_BIGGEST_MINOR]; /* fcntl flags */
***************
*** 283,286 ****
--- 291,296 ----
};
+ long sb0mask;
+
/*
* Here are the dma page upper bits. Previously hardcoded as macros in
***************
*** 453,458 ****
--- 463,472 ----
for (i = 0; i <= SB_BIGGEST_MINOR; i++) {
status.sig_proc[i] = NULL;
+ #if defined(NetBSD)
+ status.sel_info[i].si_coll = 0;
+ #else
status.selects[i] = NULL;
status.sel_coll[i] = 0;
+ #endif
}
***************
*** 500,503 ****
--- 514,524 ----
*/
for (i = 0; i <= SB_BIGGEST_MINOR; i++) {
+ #if defined(NetBSD)
+ DPRINTF (("Waking up selecters..\n"));
+ if (status.sel_info[i].si_pid) {
+ selwakeup(&(status.sel_info[i]));
+ status.sel_info[i].si_coll = FALSE;
+ }
+ #else
if (status.selects[i]) {
DPRINTF (("Waking up selecters..\n"));
***************
*** 506,509 ****
--- 527,531 ----
status.sel_coll[i] = FALSE;
}
+ #endif
/*
***************
*** 545,550 ****
--- 567,577 ----
status.flags[minor(dev)] = flags;
status.sig_proc[minor(dev)] = NULL;
+ #if defined(NetBSD)
+ status.sel_info[minor(dev)].si_pid = NULL;
+ status.sel_info[minor(dev)].si_coll = 0;
+ #else
status.selects[minor(dev)] = NULL;
status.sel_coll[minor(dev)] = 0;
+ #endif
switch (minor (dev)) {
***************
*** 785,788 ****
--- 812,821 ----
}
+ #if defined(NetBSD)
+ if (status.sel_info[SB_DSP_NUM].si_pid)
+ status.sel_info[SB_DSP_NUM].si_coll = TRUE;
+ else
+ status.sel_info[SB_DSP_NUM].si_pid = curproc->p_pid;
+ #else
if (status.selects[SB_DSP_NUM])
status.sel_coll[SB_DSP_NUM] = TRUE;
***************
*** 789,792 ****
--- 822,826 ----
else
status.selects[SB_DSP_NUM] = curproc;
+ #endif
splx (s);
***************
*** 1267,1272 ****
--- 1301,1311 ----
if (status.dsp_in_use) return (EBUSY);
+ #if defined(NetBSD)
+ status.sel_info[SB_DSP_NUM].si_pid = NULL;
+ status.sel_info[SB_DSP_NUM].si_coll = FALSE;
+ #else
status.selects[SB_DSP_NUM] = NULL;
status.sel_coll[SB_DSP_NUM] = FALSE;
+ #endif
status.dsp_in_use = TRUE;
***************
*** 1966,1971 ****
--- 2005,2015 ----
status.dsp_in_use = TRUE;
+ #if defined(NetBSD)
+ status.sel_info[SB_MIDI_NUM].si_pid = NULL;
+ status.sel_info[SB_MIDI_NUM].si_coll = FALSE;
+ #else
status.selects[SB_MIDI_NUM] = NULL;
status.sel_coll[SB_MIDI_NUM] = FALSE;
+ #endif
dsp_reset (); /* Resets card and inits variables */
***************
*** 2006,2009 ****
--- 2050,2059 ----
/* It's not ready yet, so put them on the list of procs to notify */
+ #if defined(NetBSD)
+ if (status.sel_info[SB_MIDI_NUM].si_pid)
+ status.sel_info[SB_MIDI_NUM].si_coll = TRUE;
+ else
+ status.sel_info[SB_MIDI_NUM].si_pid = curproc->p_pid;
+ #else
if (status.selects[SB_MIDI_NUM])
status.sel_coll[SB_MIDI_NUM] = TRUE;
***************
*** 2010,2013 ****
--- 2060,2064 ----
else
status.selects[SB_MIDI_NUM] = curproc;
+ #endif
splx (s);
End of sb.c.pat
exit 0
--
===============================================================================
Nick Cuccia
cuccia@remarque.berkeley.edu
-------------------------------------------------------------------------------