aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_alloc.c7
-rw-r--r--sys/gnu/ext2fs/ext2_extern.h2
-rw-r--r--sys/gnu/ext2fs/ext2_inode.c27
-rw-r--r--sys/gnu/ext2fs/ext2_readwrite.c7
-rw-r--r--sys/gnu/ext2fs/ext2_subr.c9
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c9
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c32
-rw-r--r--sys/gnu/i386/fpemul/fpu_entry.c48
-rw-r--r--sys/gnu/i386/isa/dgb.c13
-rw-r--r--sys/gnu/i386/isa/dgm.c17
-rw-r--r--sys/gnu/i386/isa/sound/awe_wave.c112
11 files changed, 174 insertions, 109 deletions
diff --git a/sys/gnu/ext2fs/ext2_alloc.c b/sys/gnu/ext2fs/ext2_alloc.c
index 0d4dfe3621fc..21b9165542b6 100644
--- a/sys/gnu/ext2fs/ext2_alloc.c
+++ b/sys/gnu/ext2fs/ext2_alloc.c
@@ -232,6 +232,7 @@ return ENOSPC;
daddr_t start_lbn, end_lbn, soff, eoff, newblk, blkno;
struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
int i, len, start_lvl, end_lvl, pref, ssize;
+ struct timeval tv;
vp = ap->a_vp;
ip = VTOI(vp);
@@ -338,8 +339,10 @@ return ENOSPC;
bwrite(sbp);
} else {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- if (!doasyncfree)
- UFS_UPDATE(vp, 1);
+ if (!doasyncfree) {
+ gettime(&tv);
+ UFS_UPDATE(vp, &tv, &tv, MNT_WAIT);
+ }
}
if (ssize < len)
if (doasyncfree)
diff --git a/sys/gnu/ext2fs/ext2_extern.h b/sys/gnu/ext2fs/ext2_extern.h
index 317f540af1e1..0afd890403a1 100644
--- a/sys/gnu/ext2fs/ext2_extern.h
+++ b/sys/gnu/ext2fs/ext2_extern.h
@@ -62,7 +62,7 @@ int ext2_reallocblks __P((struct vop_reallocblks_args *));
int ext2_reclaim __P((struct vop_reclaim_args *));
void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t));
int ext2_truncate __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
-int ext2_update __P((struct vnode *, int));
+int ext2_update __P((struct vnode *, struct timeval *, struct timeval *, int));
int ext2_valloc __P((struct vnode *, int, struct ucred *, struct vnode **));
int ext2_vfree __P((struct vnode *, ino_t, int));
int ext2_lookup __P((struct vop_cachedlookup_args *));
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c
index b287c1648857..4699d4d51dc0 100644
--- a/sys/gnu/ext2fs/ext2_inode.c
+++ b/sys/gnu/ext2fs/ext2_inode.c
@@ -80,8 +80,10 @@ ext2_init(struct vfsconf *vfsp)
* set, then wait for the write to complete.
*/
int
-ext2_update(vp, waitfor)
+ext2_update(vp, access, modify, waitfor)
struct vnode *vp;
+ struct timeval *access;
+ struct timeval *modify;
int waitfor;
{
register struct ext2_sb_info *fs;
@@ -140,7 +142,8 @@ ext2_truncate(vp, length, flags, cred, p)
register struct ext2_sb_info *fs;
struct buf *bp;
int offset, size, level;
- long count, nblocks, blocksreleased = 0;
+ long count, nblocks, vflags, blocksreleased = 0;
+ struct timeval tv;
register int i;
int aflags, error, allerror;
off_t osize;
@@ -154,6 +157,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
return EFBIG;
oip = VTOI(ovp);
+ getmicrotime(&tv);
if (ovp->v_type == VLNK &&
oip->i_size < ovp->v_mount->mnt_maxsymlinklen) {
#if DIAGNOSTIC
@@ -163,11 +167,11 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
oip->i_size = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
if (oip->i_size == length) {
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 0));
+ return (UFS_UPDATE(ovp, &tv, &tv, 0));
}
#if QUOTA
if (error = getinoquota(oip))
@@ -197,7 +201,7 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
else
bawrite(bp);
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- return (UFS_UPDATE(ovp, 1));
+ return (UFS_UPDATE(ovp, &tv, &tv, 1));
}
/*
* Shorten the size of the file. If the file is not being
@@ -253,8 +257,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
for (i = NDADDR - 1; i > lastblock; i--)
oip->i_db[i] = 0;
oip->i_flag |= IN_CHANGE | IN_UPDATE;
- allerror = UFS_UPDATE(ovp, 1);
-
+ if (error = UFS_UPDATE(ovp, &tv, &tv, MNT_WAIT))
+ allerror = error;
/*
* Having written the new inode to disk, save its new configuration
* and put back the old block pointers long enough to process them.
@@ -264,9 +268,8 @@ printf("ext2_truncate called %d to %d\n", VTOI(ovp)->i_number, length);
bcopy((caddr_t)&oip->i_db[0], (caddr_t)newblks, sizeof newblks);
bcopy((caddr_t)oldblks, (caddr_t)&oip->i_db[0], sizeof oldblks);
oip->i_size = osize;
- error = vtruncbuf(ovp, cred, p, length, (int)fs->s_blocksize);
- if (error && (allerror == 0))
- allerror = error;
+ vflags = ((length > 0) ? V_SAVE : 0) | V_SAVEMETA;
+ allerror = vinvalbuf(ovp, vflags, cred, p, 0, 0);
/*
* Indirect blocks first.
@@ -345,8 +348,8 @@ done:
for (i = 0; i < NDADDR; i++)
if (newblks[i] != oip->i_db[i])
panic("itrunc2");
- if (length == 0 && (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) ||
- !TAILQ_EMPTY(&ovp->v_cleanblkhd)))
+ if (length == 0 &&
+ (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first))
panic("itrunc3");
#endif /* DIAGNOSTIC */
/*
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c
index d5881e2e6f49..7efe39afe4a0 100644
--- a/sys/gnu/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/ext2fs/ext2_readwrite.c
@@ -173,6 +173,7 @@ WRITE(ap)
daddr_t lbn;
off_t osize;
int blkoffset, error, flags, ioflag, resid, size, xfersize;
+ struct timeval tv;
ioflag = ap->a_ioflag;
uio = ap->a_uio;
@@ -288,7 +289,9 @@ WRITE(ap)
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
}
- } else if (resid > uio->uio_resid && (ioflag & IO_SYNC))
- error = UFS_UPDATE(vp, 1);
+ } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) {
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
+ }
return (error);
}
diff --git a/sys/gnu/ext2fs/ext2_subr.c b/sys/gnu/ext2fs/ext2_subr.c
index ed48acf46734..30da6a7300cb 100644
--- a/sys/gnu/ext2fs/ext2_subr.c
+++ b/sys/gnu/ext2fs/ext2_subr.c
@@ -52,11 +52,7 @@
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
-#include "opt_ddb.h"
-
-#ifdef DDB
-void ext2_checkoverlap __P((struct buf *, struct inode *));
-#endif
+static void ext2_checkoverlap __P((struct buf *, struct inode *));
/*
* Return buffer with the contents of block "offset" from the beginning of
@@ -92,8 +88,9 @@ ext2_blkatoff(vp, offset, res, bpp)
return (0);
}
+#include "opt_ddb.h"
#ifdef DDB
-void
+static void
ext2_checkoverlap(bp, ip)
struct buf *bp;
struct inode *ip;
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index ea756b5a6ddd..11045341bdf9 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -276,8 +276,7 @@ ext2_mount(mp, path, data, ndp, p)
vrele(devvp);
return (ENOTBLK);
}
- if (major(devvp->v_rdev) >= nblkdev ||
- bdevsw[major(devvp->v_rdev)] == NULL) {
+ if (major(devvp->v_rdev) >= nblkdev) {
vrele(devvp);
return (ENXIO);
}
@@ -893,6 +892,7 @@ ext2_sync(mp, waitfor, cred, p)
struct inode *ip;
struct ufsmount *ump = VFSTOUFS(mp);
struct ext2_sb_info *fs;
+ struct timeval tv;
int error, allerror = 0;
fs = ump->um_e2fs;
@@ -918,7 +918,8 @@ loop:
if (vp->v_type == VNON ||
(ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
- (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) {
+ (vp->v_dirtyblkhd.lh_first == NULL ||
+ waitfor == MNT_LAZY)) {
simple_unlock(&vp->v_interlock);
continue;
}
@@ -1170,7 +1171,7 @@ ext2_sbupdate(mp, waitfor)
register struct ext2_sb_info *fs = mp->um_e2fs;
register struct ext2_super_block *es = fs->s_es;
register struct buf *bp;
- int error = 0;
+ int i, error = 0;
/*
printf("\nupdating superblock, waitfor=%s\n", waitfor == MNT_WAIT ? "yes":"no");
*/
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index f3b9bcc17109..07e94b84ef9f 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -182,6 +182,7 @@ ext2_fsync(ap)
{
register struct vnode *vp = ap->a_vp;
register struct buf *bp;
+ struct timeval tv;
struct buf *nbp;
int s;
@@ -196,8 +197,8 @@ ext2_fsync(ap)
loop:
s = splbio();
- for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_vnbufs);
+ for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
+ nbp = bp->b_vnbufs.le_next;
if ((bp->b_flags & B_BUSY))
continue;
if ((bp->b_flags & B_DELWRI) == 0)
@@ -221,14 +222,15 @@ loop:
tsleep(&vp->v_numoutput, PRIBIO + 1, "e2fsyn", 0);
}
#if DIAGNOSTIC
- if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) {
+ if (vp->v_dirtyblkhd.lh_first) {
vprint("ext2_fsync: dirty", vp);
goto loop;
}
#endif
}
splx(s);
- return (UFS_UPDATE(ap->a_vp, ap->a_waitfor == MNT_WAIT));
+ getmicrotime(&tv);
+ return (UFS_UPDATE(ap->a_vp, &tv, &tv, ap->a_waitfor == MNT_WAIT));
}
/*
@@ -318,6 +320,7 @@ ext2_link(ap)
struct componentname *cnp = ap->a_cnp;
struct proc *p = cnp->cn_proc;
struct inode *ip;
+ struct timeval tv;
int error;
#ifdef DIAGNOSTIC
@@ -346,7 +349,8 @@ ext2_link(ap)
}
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(vp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(vp, &tv, &tv, 1);
if (!error)
error = ext2_direnter(ip, tdvp, cnp);
if (error) {
@@ -385,6 +389,7 @@ ext2_rename(ap)
struct proc *p = fcnp->cn_proc;
struct inode *ip, *xp, *dp;
struct dirtemplate dirbuf;
+ struct timeval tv;
int doingdirectory = 0, oldparent = 0, newparent = 0;
int error = 0;
u_char namlen;
@@ -522,7 +527,8 @@ abortit:
*/
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
- if (error = UFS_UPDATE(fvp, 1)) {
+ getmicrotime(&tv);
+ if (error = UFS_UPDATE(fvp, &tv, &tv, 1)) {
VOP_UNLOCK(fvp, 0, p);
goto bad;
}
@@ -583,7 +589,7 @@ abortit:
}
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(tdvp, 1);
+ error = UFS_UPDATE(tdvp, &tv, &tv, 1);
if (error)
goto bad;
}
@@ -592,7 +598,7 @@ abortit:
if (doingdirectory && newparent) {
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
- (void)UFS_UPDATE(tdvp, 1);
+ (void)UFS_UPDATE(tdvp, &tv, &tv, 1);
}
goto bad;
}
@@ -801,6 +807,7 @@ ext2_mkdir(ap)
register struct inode *ip, *dp;
struct vnode *tvp;
struct dirtemplate dirtemplate, *dtp;
+ struct timeval tv;
int error, dmode;
#ifdef DIAGNOSTIC
@@ -889,7 +896,8 @@ ext2_mkdir(ap)
ip->i_nlink = 2;
if (cnp->cn_flags & ISWHITEOUT)
ip->i_flags |= UF_OPAQUE;
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
/*
* Bump link count in parent directory
@@ -899,7 +907,7 @@ ext2_mkdir(ap)
*/
dp->i_nlink++;
dp->i_flag |= IN_CHANGE;
- error = UFS_UPDATE(dvp, 1);
+ error = UFS_UPDATE(dvp, &tv, &tv, 1);
if (error)
goto bad;
@@ -1069,6 +1077,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
struct componentname *cnp;
{
register struct inode *ip, *pdir;
+ struct timeval tv;
struct vnode *tvp;
int error;
@@ -1161,7 +1170,8 @@ ext2_makeinode(mode, dvp, vpp, cnp)
/*
* Make sure inode goes to disk before directory entry.
*/
- error = UFS_UPDATE(tvp, 1);
+ getmicrotime(&tv);
+ error = UFS_UPDATE(tvp, &tv, &tv, 1);
if (error)
goto bad;
error = ext2_direnter(ip, dvp, cnp);
diff --git a/sys/gnu/i386/fpemul/fpu_entry.c b/sys/gnu/i386/fpemul/fpu_entry.c
index 0db5288e4c1e..bde2ef6dc977 100644
--- a/sys/gnu/i386/fpemul/fpu_entry.c
+++ b/sys/gnu/i386/fpemul/fpu_entry.c
@@ -55,7 +55,7 @@
*
* W. Metzenthen June 1994.
*
- * $Id: fpu_entry.c,v 1.18 1998/11/15 15:33:50 bde Exp $
+ * $Id: fpu_entry.c,v 1.14 1998/08/16 01:21:48 bde Exp $
*
*/
@@ -483,18 +483,48 @@ if (--lookahead_limit)
return (0); /* --pink-- */
}
+#ifdef LKM
+MOD_MISC(gnufpu);
static int
-gnufpu_modevent(module_t mod, int type, void *unused)
+gnufpu_load(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate) {
+ printf("Math emulator already present\n");
+ return EBUSY;
+ }
+ pmath_emulate = math_emulate;
+ return 0;
+}
+
+static int
+gnufpu_unload(struct lkm_table *lkmtp, int cmd)
+{
+ if (pmath_emulate != math_emulate) {
+ printf("Cannot unload another math emulator\n");
+ return EACCES;
+ }
+ pmath_emulate = 0;
+ return 0;
+}
+
+int
+gnufpu_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(gnufpu, lkmtp, cmd, ver, gnufpu_load, gnufpu_unload,
+ lkm_nullcmd);
+}
+#else /* !LKM */
+
+static int
+gnufpu_modevent(module_t mod, modeventtype_t type, void *unused)
{
switch (type) {
case MOD_LOAD:
if (pmath_emulate) {
printf("Another Math emulator already present\n");
return EACCES;
- }
- pmath_emulate = math_emulate;
- if (bootverbose)
- printf("GPL Math emulator present\n");
+ } else
+ pmath_emulate = math_emulate;
break;
case MOD_UNLOAD:
if (pmath_emulate != math_emulate) {
@@ -502,8 +532,6 @@ gnufpu_modevent(module_t mod, int type, void *unused)
return EACCES;
}
pmath_emulate = 0;
- if (bootverbose)
- printf("GPL Math emulator unloaded\n");
break;
default:
break;
@@ -516,4 +544,6 @@ moduledata_t gnufpumod = {
gnufpu_modevent,
0
};
-DECLARE_MODULE(gnufpu, gnufpumod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+DECLARE_MODULE(gnufpu, gnufpu_modevent, SI_SUB_PSEUDO, SI_ORDER_ANY);
+
+#endif /* LKM */
diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c
index 7aeb2583bf0d..aac272582aa2 100644
--- a/sys/gnu/i386/isa/dgb.c
+++ b/sys/gnu/i386/isa/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.40 1998/08/23 08:26:39 bde Exp $
+ * dgb.c $Id: dgb.c,v 1.39 1998/08/16 01:21:49 bde Exp $
*
* Digiboard driver.
*
@@ -407,8 +407,10 @@ dgbprobe(dev)
struct isa_device *dev;
{
struct dgb_softc *sc= &dgb_softc[dev->id_unit];
- int i, v;
+ int i, v, t;
u_long win_size; /* size of vizible memory window */
+ u_char *mem;
+ int addr;
int unit=dev->id_unit;
sc->unit=dev->id_unit;
@@ -523,6 +525,7 @@ dgbattach(dev)
int addr;
struct dgb_p *port;
volatile struct board_chan *bc;
+ struct global_data *gd;
int shrinkmem;
int nfails;
ushort *pstat;
@@ -1280,6 +1283,7 @@ dgbpoll(unit_c)
int rhead, rtail;
int whead, wtail;
int size;
+ int c=0;
u_char *ptr;
int ocount;
int ibuf_full,obuf_full;
@@ -1508,6 +1512,7 @@ dgbpoll(unit_c)
setwin(sc,0);
}
}
+ end_of_buffer: ;
}
bc->idata=1; /* require event on incoming data */
@@ -1952,6 +1957,7 @@ dgbparam(tp, t)
struct termios *t;
{
int dev=tp->t_dev;
+ int mynor=minor(dev);
int unit=MINOR_TO_UNIT(dev);
int pnum=MINOR_TO_PORT(dev);
struct dgb_softc *sc=&dgb_softc[unit];
@@ -1962,7 +1968,7 @@ dgbparam(tp, t)
int mval;
int iflag;
int hflow;
- int cs;
+ int s,cs;
BoardMemWinState ws=bmws_get();
@@ -2164,6 +2170,7 @@ dgbstop(tp, rw)
struct dgb_p *port;
struct dgb_softc *sc;
volatile struct board_chan *bc;
+ int head;
int s;
BoardMemWinState ws=bmws_get();
diff --git a/sys/gnu/i386/isa/dgm.c b/sys/gnu/i386/isa/dgm.c
index 8b0ca1ff4e78..eca931ae8639 100644
--- a/sys/gnu/i386/isa/dgm.c
+++ b/sys/gnu/i386/isa/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.5 1998/08/23 08:26:40 bde Exp $
+ * $Id: dgm.c,v 1.4 1998/08/16 01:21:49 bde Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -381,7 +381,9 @@ dgmprobe(dev)
struct isa_device *dev;
{
struct dgm_softc *sc= &dgm_softc[dev->id_unit];
- int i, v;
+ int i, v, t;
+ u_char *mem;
+ int addr;
int unit=dev->id_unit;
sc->unit=dev->id_unit;
@@ -447,9 +449,14 @@ dgmattach(dev)
int addr;
struct dgm_p *port;
volatile struct board_chan *bc;
+ struct global_data *gd;
int shrinkmem;
+ int nfails;
+ ushort *pstat;
int lowwater;
static int nports=0;
+ char ch;
+ int stuff;
if(sc->status!=ENABLED) {
DPRINT2(DB_EXCEPT,"dbg%d: try to attach a disabled card\n",unit);
@@ -1080,6 +1087,7 @@ dgmpoll(unit_c)
int rhead, rtail;
int whead, wtail;
int size;
+ int c=0;
u_char *ptr;
int ocount;
int ibuf_full,obuf_full;
@@ -1308,6 +1316,7 @@ dgmpoll(unit_c)
setwin(sc,0);
}
}
+ end_of_buffer: ;
}
bc->idata=1; /* require event on incoming data */
@@ -1752,6 +1761,7 @@ dgmparam(tp, t)
struct termios *t;
{
int dev=tp->t_dev;
+ int mynor=minor(dev);
int unit=MINOR_TO_UNIT(dev);
int pnum=MINOR_TO_PORT(dev);
struct dgm_softc *sc=&dgm_softc[unit];
@@ -1762,7 +1772,7 @@ dgmparam(tp, t)
int mval;
int iflag;
int hflow;
- int cs;
+ int s,cs;
BoardMemWinState ws=bmws_get();
@@ -1965,6 +1975,7 @@ dgmstop(tp, rw)
struct dgm_p *port;
struct dgm_softc *sc;
volatile struct board_chan *bc;
+ int head;
int s;
BoardMemWinState ws=bmws_get();
diff --git a/sys/gnu/i386/isa/sound/awe_wave.c b/sys/gnu/i386/isa/sound/awe_wave.c
index 1bffbf5a4654..3dc591e635cd 100644
--- a/sys/gnu/i386/isa/sound/awe_wave.c
+++ b/sys/gnu/i386/isa/sound/awe_wave.c
@@ -74,11 +74,11 @@
static int debug_mode = 0;
#ifdef AWE_DEBUG_ON
-#define AWE_DEBUG(LVL,XXX) {if (debug_mode > LVL) { XXX; }}
+#define DEBUG(LVL,XXX) {if (debug_mode > LVL) { XXX; }}
#define ERRMSG(XXX) {if (debug_mode) { XXX; }}
#define FATALERR(XXX) XXX
#else
-#define AWE_DEBUG(LVL,XXX) /**/
+#define DEBUG(LVL,XXX) /**/
#define ERRMSG(XXX) XXX
#define FATALERR(XXX) XXX
#endif
@@ -578,7 +578,7 @@ int attach_awe(void)
/* intialize AWE32 hardware */
awe_initialize();
- snprintf(awe_info.name, sizeof(awe_info.name), "AWE32-%s (RAM%dk)",
+ sprintf(awe_info.name, "AWE32-%s (RAM%dk)",
AWEDRV_VERSION, awe_mem_size/1024);
#ifdef __FreeBSD__
printk("awe0: <SoundBlaster EMU8000 MIDI (RAM%dk)>", awe_mem_size/1024);
@@ -806,7 +806,7 @@ awe_release_region(void)
static void
awe_initialize(void)
{
- AWE_DEBUG(0,printk("AWE32: initializing..\n"));
+ DEBUG(0,printk("AWE32: initializing..\n"));
/* initialize hardware configuration */
awe_poke(AWE_HWCF1, 0x0059);
@@ -1300,7 +1300,7 @@ awe_note_on(int voice)
temp = FX_BYTE(fx, fx_lay, AWE_FX_CHORUS, vp->parm.chorus);
temp = (temp <<24) | (unsigned int)addr;
awe_poke_dw(AWE_CSL(voice), temp);
- AWE_DEBUG(4,printk("AWE32: [-- loopend=%x/%x]\n", vp->loopend, addr));
+ DEBUG(4,printk("AWE32: [-- loopend=%x/%x]\n", vp->loopend, addr));
/* Q & current address (Q 4bit value, MSB) */
addr = vp->start - 1;
@@ -1309,7 +1309,7 @@ awe_note_on(int voice)
temp = FX_BYTE(fx, fx_lay, AWE_FX_FILTERQ, vp->parm.filterQ);
temp = (temp<<28) | (unsigned int)addr;
awe_poke_dw(AWE_CCCA(voice), temp);
- AWE_DEBUG(4,printk("AWE32: [-- startaddr=%x/%x]\n", vp->start, addr));
+ DEBUG(4,printk("AWE32: [-- startaddr=%x/%x]\n", vp->start, addr));
/* reset volume */
awe_poke_dw(AWE_VTFT(voice), 0x0000FFFF);
@@ -1385,7 +1385,7 @@ awe_exclusive_off(int voice)
if (i != voice && IS_PLAYING(i) &&
voices[i].sample && voices[i].ch == voices[voice].ch &&
voices[i].sample->exclusiveClass == exclass) {
- AWE_DEBUG(4,printk("AWE32: [exoff(%d)]\n", i));
+ DEBUG(4,printk("AWE32: [exoff(%d)]\n", i));
awe_terminate(i);
awe_voice_init(i, TRUE);
}
@@ -1403,7 +1403,7 @@ awe_set_pitch(int voice, int forced)
{
if (IS_NO_EFFECT(voice) && !forced) return;
awe_poke(AWE_IP(voice), voices[voice].apitch);
- AWE_DEBUG(3,printk("AWE32: [-- pitch=%x]\n", voices[voice].apitch));
+ DEBUG(3,printk("AWE32: [-- pitch=%x]\n", voices[voice].apitch));
}
/* calculate & change pitch */
@@ -1486,7 +1486,7 @@ awe_set_pan(int voice, int forced)
temp = (temp<<24) | (unsigned int)addr;
awe_poke_dw(AWE_PSST(voice), temp);
voices[voice].apan = temp;
- AWE_DEBUG(4,printk("AWE32: [-- loopstart=%x/%x]\n", vp->loopstart, addr));
+ DEBUG(4,printk("AWE32: [-- loopstart=%x/%x]\n", vp->loopstart, addr));
}
}
@@ -1584,26 +1584,26 @@ awe_calc_pitch(int voice)
if ((ap = vp->sample) == NULL)
return;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
/* calculate offset */
if (ap->fixkey >= 0) {
- AWE_DEBUG(3,printk("AWE32: p-> fixkey(%d) tune(%d)\n", ap->fixkey, ap->tune));
+ DEBUG(3,printk("AWE32: p-> fixkey(%d) tune(%d)\n", ap->fixkey, ap->tune));
offset = (ap->fixkey - ap->root) * 4096 / 12;
} else {
- AWE_DEBUG(3,printk("AWE32: p(%d)-> root(%d) tune(%d)\n", vp->note, ap->root, ap->tune));
+ DEBUG(3,printk("AWE32: p(%d)-> root(%d) tune(%d)\n", vp->note, ap->root, ap->tune));
offset = (vp->note - ap->root) * 4096 / 12;
- AWE_DEBUG(4,printk("AWE32: p-> ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> ofs=%d\n", offset));
}
offset = (offset * ap->scaleTuning) / 100;
- AWE_DEBUG(4,printk("AWE32: p-> scale* ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> scale* ofs=%d\n", offset));
offset += ap->tune * 4096 / 1200;
- AWE_DEBUG(4,printk("AWE32: p-> tune+ ofs=%d\n", offset));
+ DEBUG(4,printk("AWE32: p-> tune+ ofs=%d\n", offset));
if (cp->bender != 0) {
- AWE_DEBUG(3,printk("AWE32: p-> bend(%d) %d\n", voice, cp->bender));
+ DEBUG(3,printk("AWE32: p-> bend(%d) %d\n", voice, cp->bender));
/* (819200: 1 semitone) ==> (4096: 12 semitones) */
offset += cp->bender * cp->bender_range / 2400;
}
@@ -1616,7 +1616,7 @@ awe_calc_pitch(int voice)
/* 0xe000: root pitch */
vp->apitch = 0xe000 + ap->rate_offset + offset;
- AWE_DEBUG(4,printk("AWE32: p-> sum aofs=%x, rate_ofs=%d\n", vp->apitch, ap->rate_offset));
+ DEBUG(4,printk("AWE32: p-> sum aofs=%x, rate_ofs=%d\n", vp->apitch, ap->rate_offset));
if (vp->apitch > 0xffff)
vp->apitch = 0xffff;
if (vp->apitch < 0)
@@ -1643,7 +1643,7 @@ awe_calc_pitch_from_freq(int voice, int freq)
if ((ap = vp->sample) == NULL)
return;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
@@ -1696,7 +1696,7 @@ awe_calc_volume(int voice)
ap = vp->sample;
if (ap->index < 0) {
- AWE_DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
+ DEBUG(3,printk("AWE32: set sample (%d)\n", ap->sample));
if (awe_set_sample(ap) < 0)
return;
}
@@ -1714,7 +1714,7 @@ awe_calc_volume(int voice)
if (vol > 255) vol = 255;
vp->avol = vol;
- AWE_DEBUG(3,printk("AWE32: [-- voice(%d) vol=%x]\n", voice, vol));
+ DEBUG(3,printk("AWE32: [-- voice(%d) vol=%x]\n", voice, vol));
}
@@ -1985,7 +1985,7 @@ awe_kill_note(int dev, int voice, int note, int velocity)
{
int i, v2, key;
- AWE_DEBUG(2,printk("AWE32: [off(%d) nt=%d vl=%d]\n", voice, note, velocity));
+ DEBUG(2,printk("AWE32: [off(%d) nt=%d vl=%d]\n", voice, note, velocity));
if (! voice_in_range(voice))
return RET_ERROR(EINVAL);
@@ -2044,7 +2044,7 @@ awe_start_note(int dev, int voice, int note, int velocity)
{
int i, key, state, volonly;
- AWE_DEBUG(2,printk("AWE32: [on(%d) nt=%d vl=%d]\n", voice, note, velocity));
+ DEBUG(2,printk("AWE32: [on(%d) nt=%d vl=%d]\n", voice, note, velocity));
if (! voice_in_range(voice))
return RET_ERROR(EINVAL);
@@ -2171,7 +2171,7 @@ awe_set_instr(int dev, int voice, int instr_no)
cinfo->def_vrec = awe_search_instr(misc_modes[AWE_MD_DEF_BANK], instr_no);
if (cinfo->vrec < 0 && cinfo->def_vrec < 0) {
- AWE_DEBUG(1,printk("AWE32 Warning: can't find instrument %d\n", instr_no));
+ DEBUG(1,printk("AWE32 Warning: can't find instrument %d\n", instr_no));
}
cinfo->instr = instr_no;
@@ -2346,7 +2346,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_REMOVE_LAST_SAMPLES:
- AWE_DEBUG(0,printk("AWE32: remove last samples\n"));
+ DEBUG(0,printk("AWE32: remove last samples\n"));
if (locked_sf_id > 0)
awe_remove_samples(locked_sf_id);
break;
@@ -2368,7 +2368,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
if (p1 & 0x80) i = FX_FLAG_ADD;
p1 &= 0x3f;
if (p1 < AWE_FX_END) {
- AWE_DEBUG(0,printk("AWE32: effects (%d) %d %d\n", voice, p1, p2));
+ DEBUG(0,printk("AWE32: effects (%d) %d %d\n", voice, p1, p2));
if (i == FX_FLAG_SET)
FX_SET(fx, p1, p2);
else if (i == FX_FLAG_ADD)
@@ -2376,7 +2376,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
else
FX_UNSET(fx, p1);
if (i != FX_FLAG_OFF && parm_defs[p1].realtime) {
- AWE_DEBUG(0,printk("AWE32: fx_realtime (%d)\n", voice));
+ DEBUG(0,printk("AWE32: fx_realtime (%d)\n", voice));
awe_voice_change(voice, parm_defs[p1].realtime);
}
}
@@ -2402,7 +2402,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_INITIAL_VOLUME:
- AWE_DEBUG(0,printk("AWE32: init attenuation %d\n", p1));
+ DEBUG(0,printk("AWE32: init attenuation %d\n", p1));
if (p2 == 0) /* absolute value */
init_atten = (short)p1;
else /* relative value */
@@ -2422,18 +2422,18 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
case _AWE_CHANNEL_MODE:
- AWE_DEBUG(0,printk("AWE32: channel mode = %d\n", p1));
+ DEBUG(0,printk("AWE32: channel mode = %d\n", p1));
playing_mode = p1;
awe_reset(0);
break;
case _AWE_DRUM_CHANNELS:
- AWE_DEBUG(0,printk("AWE32: drum flags = %x\n", p1));
+ DEBUG(0,printk("AWE32: drum flags = %x\n", p1));
drum_flags = *(unsigned int*)&event[4];
break;
case _AWE_MISC_MODE:
- AWE_DEBUG(0,printk("AWE32: misc mode = %d %d\n", p1, p2));
+ DEBUG(0,printk("AWE32: misc mode = %d %d\n", p1, p2));
if (p1 > AWE_MD_VERSION && p1 < AWE_MD_END)
misc_modes[p1] = p2;
break;
@@ -2443,7 +2443,7 @@ awe_hw_awe_control(int dev, int cmd, unsigned char *event)
break;
default:
- AWE_DEBUG(0,printk("AWE32: hw control cmd=%d voice=%d\n", cmd, voice));
+ DEBUG(0,printk("AWE32: hw control cmd=%d voice=%d\n", cmd, voice));
break;
}
}
@@ -2455,7 +2455,7 @@ awe_aftertouch(int dev, int voice, int pressure)
{
int note;
- AWE_DEBUG(2,printk("AWE32: [after(%d) %d]\n", voice, pressure));
+ DEBUG(2,printk("AWE32: [after(%d) %d]\n", voice, pressure));
if (! voice_in_range(voice))
return;
@@ -2492,7 +2492,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
switch (ctrl_num) {
case CTL_BANK_SELECT: /* MIDI control #0 */
- AWE_DEBUG(2,printk("AWE32: [bank(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [bank(%d) %d]\n", voice, value));
if (MULTI_LAYER_MODE() && IS_DRUM_CHANNEL(voice) &&
!misc_modes[AWE_MD_TOGGLE_DRUM_BANK])
break;
@@ -2505,7 +2505,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
case CTL_MODWHEEL: /* MIDI control #1 */
- AWE_DEBUG(2,printk("AWE32: [modwheel(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [modwheel(%d) %d]\n", voice, value));
i = value * misc_modes[AWE_MD_MOD_SENSE] / 1200;
FX_ADD(&cinfo->fx, AWE_FX_LFO1_PITCH, i);
awe_voice_change(voice, awe_fx_fmmod);
@@ -2514,14 +2514,14 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
case CTRL_PITCH_BENDER: /* SEQ1 V2 contorl */
- AWE_DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, value));
/* zero centered */
cinfo->bender = value;
awe_voice_change(voice, awe_set_voice_pitch);
break;
case CTRL_PITCH_BENDER_RANGE: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [range(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [range(%d) %d]\n", voice, value));
/* value = sense x 100 */
cinfo->bender_range = value;
/* no audible pitch change yet.. */
@@ -2531,14 +2531,14 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
if (SINGLE_LAYER_MODE())
value /= 128;
case CTRL_EXPRESSION: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [expr(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [expr(%d) %d]\n", voice, value));
/* 0 - 127 */
cinfo->expression_vol = value;
awe_voice_change(voice, awe_set_voice_vol);
break;
case CTL_PAN: /* MIDI control #10 */
- AWE_DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, value));
/* (0-127) -> signed 8bit */
cinfo->panning = value * 2 - 128;
if (misc_modes[AWE_MD_REALTIME_PAN])
@@ -2549,19 +2549,19 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
if (SINGLE_LAYER_MODE())
value = (value * 100) / 16383;
case CTRL_MAIN_VOLUME: /* SEQ1 V2 control */
- AWE_DEBUG(2,printk("AWE32: [mainvol(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [mainvol(%d) %d]\n", voice, value));
/* 0 - 127 */
cinfo->main_vol = value;
awe_voice_change(voice, awe_set_voice_vol);
break;
case CTL_EXT_EFF_DEPTH: /* reverb effects: 0-127 */
- AWE_DEBUG(2,printk("AWE32: [reverb(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [reverb(%d) %d]\n", voice, value));
FX_SET(&cinfo->fx, AWE_FX_REVERB, value * 2);
break;
case CTL_CHORUS_DEPTH: /* chorus effects: 0-127 */
- AWE_DEBUG(2,printk("AWE32: [chorus(%d) %d]\n", voice, value));
+ DEBUG(2,printk("AWE32: [chorus(%d) %d]\n", voice, value));
FX_SET(&cinfo->fx, AWE_FX_CHORUS, value * 2);
break;
@@ -2588,7 +2588,7 @@ awe_controller(int dev, int voice, int ctrl_num, int value)
break;
default:
- AWE_DEBUG(0,printk("AWE32: [control(%d) ctrl=%d val=%d]\n",
+ DEBUG(0,printk("AWE32: [control(%d) ctrl=%d val=%d]\n",
voice, ctrl_num, value));
break;
}
@@ -2612,7 +2612,7 @@ awe_panning(int dev, int voice, int value)
cinfo = &channels[voice];
cinfo->panning = value;
- AWE_DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, cinfo->panning));
+ DEBUG(2,printk("AWE32: [pan(%d) %d]\n", voice, cinfo->panning));
if (misc_modes[AWE_MD_REALTIME_PAN])
awe_voice_change(voice, awe_set_pan);
}
@@ -2623,7 +2623,7 @@ static void
awe_volume_method(int dev, int mode)
{
/* not impremented */
- AWE_DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
+ DEBUG(0,printk("AWE32: [volmethod mode=%d]\n", mode));
}
@@ -2656,7 +2656,7 @@ awe_bender(int dev, int voice, int value)
/* convert to zero centered value */
cinfo = &channels[voice];
cinfo->bender = value - 8192;
- AWE_DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, cinfo->bender));
+ DEBUG(2,printk("AWE32: [bend(%d) %d]\n", voice, cinfo->bender));
awe_voice_change(voice, awe_set_voice_pitch);
}
@@ -3341,7 +3341,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_LOOP_BACK)
smp->mode_flags |= AWE_SAMPLE_REVERSE_LOOP;
- AWE_DEBUG(0,printk("AWE32: [sample %d mode %x]\n", patch.instr_no, smp->mode_flags));
+ DEBUG(0,printk("AWE32: [sample %d mode %x]\n", patch.instr_no, smp->mode_flags));
if (patch.mode & WAVE_16_BITS) {
/* convert to word offsets */
smp->size /= 2;
@@ -3369,7 +3369,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
rec->tune = -(note % 100);
rec->low = freq_to_note(patch.low_note) / 100;
rec->high = freq_to_note(patch.high_note) / 100;
- AWE_DEBUG(1,printk("AWE32: [gus base offset=%d, note=%d, range=%d-%d(%lu-%lu)]\n",
+ DEBUG(1,printk("AWE32: [gus base offset=%d, note=%d, range=%d-%d(%lu-%lu)]\n",
rec->rate_offset, note,
rec->low, rec->high,
patch.low_note, patch.high_note));
@@ -3402,7 +3402,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
rec->parm.voldcysus = (calc_gus_sustain(patch.env_offset[2]) << 8) |
calc_parm_decay(decay);
rec->parm.volrelease = 0x8000 | calc_parm_decay(release);
- AWE_DEBUG(2,printk("AWE32: [gusenv atk=%d, hld=%d, dcy=%d, rel=%d]\n", attack, hold, decay, release));
+ DEBUG(2,printk("AWE32: [gusenv atk=%d, hld=%d, dcy=%d, rel=%d]\n", attack, hold, decay, release));
rec->attenuation = calc_gus_attenuation(patch.env_offset[0]);
}
@@ -3410,7 +3410,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_TREMOLO) {
int rate = (patch.tremolo_rate * 1000 / 38) / 42;
rec->parm.tremfrq = ((patch.tremolo_depth / 2) << 8) | rate;
- AWE_DEBUG(2,printk("AWE32: [gusenv tremolo rate=%d, dep=%d, tremfrq=%x]\n",
+ DEBUG(2,printk("AWE32: [gusenv tremolo rate=%d, dep=%d, tremfrq=%x]\n",
patch.tremolo_rate, patch.tremolo_depth,
rec->parm.tremfrq));
}
@@ -3418,7 +3418,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag)
if (patch.mode & WAVE_VIBRATO) {
int rate = (patch.vibrato_rate * 1000 / 38) / 42;
rec->parm.fm2frq2 = ((patch.vibrato_depth / 6) << 8) | rate;
- AWE_DEBUG(2,printk("AWE32: [gusenv vibrato rate=%d, dep=%d, tremfrq=%x]\n",
+ DEBUG(2,printk("AWE32: [gusenv vibrato rate=%d, dep=%d, tremfrq=%x]\n",
patch.tremolo_rate, patch.tremolo_depth,
rec->parm.tremfrq));
}
@@ -3806,7 +3806,7 @@ awe_setup_voice(int dev, int voice, int chn)
if (voice < 0 || voice >= awe_max_voices)
return;
- AWE_DEBUG(2,printk("AWE32: [setup(%d) ch=%d]\n", voice, chn));
+ DEBUG(2,printk("AWE32: [setup(%d) ch=%d]\n", voice, chn));
channels[chn].expression_vol = info->controllers[CTL_EXPRESSION];
channels[chn].main_vol = info->controllers[CTL_MAIN_VOLUME];
channels[chn].panning =
@@ -3841,7 +3841,7 @@ awe_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
level = (int)IOCTL_IN(arg);
level = ((level & 0xff) + (level >> 8)) / 2;
- AWE_DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
+ DEBUG(0,printk("AWEMix: cmd=%x val=%d\n", cmd & 0xff, level));
if (IO_WRITE_CHECK(cmd)) {
switch (cmd & 0xff) {
@@ -4121,7 +4121,7 @@ awe_init_fm(void)
if (awe_mem_size <= 0)
return;
#endif
- AWE_DEBUG(3,printk("AWE32: initializing FM\n"));
+ DEBUG(3,printk("AWE32: initializing FM\n"));
/* Initialize the last two channels for DRAM refresh and producing
the reverb and chorus effects for Yamaha OPL-3 synthesizer */
@@ -4280,7 +4280,7 @@ awe_detect_base(int addr)
return 0;
if ((awe_peek(AWE_HWCF2) & 0x0003) != 0x0003)
return 0;
- AWE_DEBUG(0,printk("AWE32 found at %x\n", awe_base));
+ DEBUG(0,printk("AWE32 found at %x\n", awe_base));
return 1;
}
@@ -4292,7 +4292,7 @@ awe_detect(void)
for (base = 0x620; base <= 0x680; base += 0x20)
if (awe_detect_base(base))
return 1;
- AWE_DEBUG(0,printk("AWE32 not found\n"));
+ DEBUG(0,printk("AWE32 not found\n"));
return 0;
}
return 1;
@@ -4351,7 +4351,7 @@ awe_check_dram(void)
}
awe_close_dram();
- AWE_DEBUG(0,printk("AWE32: %d Kbytes memory detected\n", awe_mem_size));
+ DEBUG(0,printk("AWE32: %d Kbytes memory detected\n", awe_mem_size));
/* convert to Kbytes */
awe_mem_size *= 1024;