~kris/9p

9hist

ref: 1ab3f5e46b66d2a6220fe84fce7c6dbdbf462cd3 9hist/pc/archncr3170.c -rw-r--r-- 578 bytes
1ab3f5e4 — David du Colombier Plan 9 from Bell Labs 1995-12-06 30 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include	"u.h"
#include	"../port/lib.h"
#include	"mem.h"
#include	"dat.h"
#include	"fns.h"
#include	"io.h"

enum
{
	Pindex=	0x198,
	Pdata=	0x199,
};

static Lock pmulock;
static int
pmuwrbit(int index, int bit, int pos)
{
	uchar x;

	lock(&pmulock);
	outb(Pindex, index);
	x = inb(Pdata);
	if(bit)
		x |= 1<<pos;
	else
		x &= ~(1<<pos);
	outb(Pindex, index);
	outb(Pdata, x);
	unlock(&pmulock);
	return 0;
}

static int
ncr3170serialpower(int onoff)
{
	return pmuwrbit(0x85, 1^onoff, 4);
}

PCArch ncr3170 =
{
	"NCRD.0",
	i8042reset,
	0,
	0,
	0,
	ncr3170serialpower,
	0,
	0,
};