nuke the splstack stuff, snd_mtx* will now be no-ops on 4.x
This commit is contained in:
parent
84d8ce8b70
commit
a983d57528
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=73757
@ -95,14 +95,6 @@ TUNABLE_INT_DECL("hw.snd.unit", 0, snd_unit);
|
||||
|
||||
SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver");
|
||||
|
||||
#ifndef USING_MUTEX
|
||||
#define SPLSTACK_MAX 32
|
||||
struct splstack {
|
||||
int depth;
|
||||
u_int32_t stack[SPLSTACK_MAX];
|
||||
};
|
||||
#endif
|
||||
|
||||
void *
|
||||
snd_mtxcreate(const char *desc)
|
||||
{
|
||||
@ -115,11 +107,7 @@ snd_mtxcreate(const char *desc)
|
||||
mtx_init(m, desc, MTX_RECURSE);
|
||||
return m;
|
||||
#else
|
||||
struct splstack *s;
|
||||
|
||||
s = malloc(sizeof(*s), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
s->depth = 0;
|
||||
return s;
|
||||
return (void *)0xcafebabe;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -132,10 +120,6 @@ snd_mtxfree(void *m)
|
||||
mtx_assert(mtx, MA_OWNED);
|
||||
mtx_destroy(mtx);
|
||||
free(mtx, M_DEVBUF);
|
||||
#else
|
||||
struct splstack *s = m;
|
||||
|
||||
free(s, M_DEVBUF);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -146,8 +130,6 @@ snd_mtxassert(void *m)
|
||||
struct mtx *mtx = m;
|
||||
|
||||
mtx_assert(mtx, MA_OWNED);
|
||||
#else
|
||||
KASSERT(((struct splstack *)s)->depth > 0, ("splstack depth <= 0"));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -158,11 +140,6 @@ snd_mtxlock(void *m)
|
||||
struct mtx *mtx = m;
|
||||
|
||||
mtx_lock(mtx);
|
||||
#else
|
||||
struct splstack *s = m;
|
||||
|
||||
KASSERT((s->depth >= 0) && (s->depth < SPLSTACK_MAX), ("bad depth %d", s->depth));
|
||||
s->stack[s->depth++] = spltty();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -173,11 +150,6 @@ snd_mtxunlock(void *m)
|
||||
struct mtx *mtx = m;
|
||||
|
||||
mtx_unlock(mtx);
|
||||
#else
|
||||
struct splstack *s = m;
|
||||
|
||||
KASSERT((s->depth >= 1) && (s->depth < SPLSTACK_MAX), ("bad depth %d", s->depth));
|
||||
splx(s->stack[s->depth--]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user