summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>1999-11-21 17:15:12 +0000
committercg <cg@FreeBSD.org>1999-11-21 17:15:12 +0000
commitf4b7f8d09b4a52e7744e3b676115d1e1b5dfe30e (patch)
treef3d65b7c386ddcf082e07c1747ee8143653ce921 /sys
parent0544825ea8fdb04f31b9361cde1db9a729292937 (diff)
downloadFreeBSD-src-f4b7f8d09b4a52e7744e3b676115d1e1b5dfe30e.zip
FreeBSD-src-f4b7f8d09b4a52e7744e3b676115d1e1b5dfe30e.tar.gz
fix for -fno-builtin
PR: kern/14278
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/isa/mss.c4
-rw-r--r--sys/dev/sound/pcm/ac97.c4
-rw-r--r--sys/dev/sound/pcm/channel.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c
index c1e98dd..e09923a 100644
--- a/sys/dev/sound/isa/mss.c
+++ b/sys/dev/sound/isa/mss.c
@@ -35,6 +35,8 @@
/* board-specific include files */
#include <dev/sound/isa/mss.h>
+#define abs(x) (((x) < 0) ? -(x) : (x))
+
struct mss_info;
struct mss_chinfo {
@@ -1154,7 +1156,7 @@ mss_speed(struct mss_chinfo *ch, int speed)
ad_enter_MCE(mss);
if (mss->bd_id == MD_AD1845) { /* Use alternate speed select regs */
ad_write(mss, 22, (speed >> 8) & 0xff); /* Speed MSB */
- ad_write(mss, 23, speed & 0xff); /* Speed LSB */
+ ad_write(mss, 23, speed & 0xff); /* Speed LSB */
/* XXX must also do something in I27 for the ad1845 */
} else {
int i, sel = 0; /* assume entry 0 does not contain -1 */
diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c
index dfb1e1c..7785436 100644
--- a/sys/dev/sound/pcm/ac97.c
+++ b/sys/dev/sound/pcm/ac97.c
@@ -178,7 +178,7 @@ ac97_setmixer(struct ac97_info *codec, unsigned channel, unsigned left, unsigned
{
struct ac97mixtable_entry *e = &codec->mix[channel];
if (e->reg != 0) {
- int max, val;
+ int max, val, reg = (e->reg >= 0)? e->reg : -e->reg;
if (!e->stereo) right = left;
if (e->reg > 0) {
@@ -209,7 +209,7 @@ ac97_setmixer(struct ac97_info *codec, unsigned channel, unsigned left, unsigned
}
}
if (left == 0 && right == 0 && e->mute == 1) val = AC97_MUTE;
- codec->write(codec->devinfo, abs(e->reg), val);
+ codec->write(codec->devinfo, reg, val);
return left | (right << 8);
} else return -1;
}
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 3cdc3e9..7e441a8 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -715,7 +715,7 @@ chn_setblocksize(pcm_channel *c, int blksz)
if (CANCHANGE(c)) {
c->flags &= ~CHN_F_HAS_SIZE;
if (blksz >= 2) c->flags |= CHN_F_HAS_SIZE;
- blksz = abs(blksz);
+ if (blksz < 0) blksz = -blksz;
if (blksz < 2) blksz = (c->buffer.sample_size * c->speed) >> 2;
RANGE(blksz, 1024, c->buffer.bufsize / 4);
blksz &= ~3;
OpenPOWER on IntegriCloud