-Move libdriver to lib/ -Install all boot image services on filesystem to aid restartability
47 lines
1,018 B
C
47 lines
1,018 B
C
#include "sb16.h"
|
|
|
|
/*===========================================================================*
|
|
* mixer_set
|
|
*===========================================================================*/
|
|
PUBLIC int mixer_set(reg, data)
|
|
int reg;
|
|
int data;
|
|
{
|
|
int i;
|
|
|
|
sb16_outb(MIXER_REG, reg);
|
|
for(i = 0; i < 100; i++);
|
|
sb16_outb(MIXER_DATA, data);
|
|
|
|
return OK;
|
|
}
|
|
|
|
|
|
/*===========================================================================*
|
|
* sb16_inb
|
|
*===========================================================================*/
|
|
PUBLIC int sb16_inb(port)
|
|
int port;
|
|
{
|
|
int s;
|
|
unsigned long value;
|
|
|
|
if ((s=sys_inb(port, &value)) != OK)
|
|
panic("sys_inb() failed: %d", s);
|
|
|
|
return value;
|
|
}
|
|
|
|
|
|
/*===========================================================================*
|
|
* sb16_outb
|
|
*===========================================================================*/
|
|
PUBLIC void sb16_outb(port, value)
|
|
int port;
|
|
int value;
|
|
{
|
|
int s;
|
|
|
|
if ((s=sys_outb(port, value)) != OK)
|
|
panic("sys_outb() failed: %d", s);
|
|
}
|