~kris/9p

9hist

ref: bd4a67d71f12e72305d8abdc372f73c30d088dd1 9hist/gnot/io.h -rw-r--r-- 1.2 KiB
bd4a67d7 — David du Colombier Plan 9 from Bell Labs 1992-09-01 34 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
50
51
52
53
54
55
56
57
58
typedef struct	Duart	Duart;

#define	SYNCREG		((char*)0x40400000)
#define	DISPLAYRAM	0x02000000
#define	DUARTREG	((Duart*)0x40100000)
#define	PORT		((uchar *)0x40300000)

/*
 * Balu
 */
typedef struct Balu Balu;

struct Balu{
	ulong	src[4];
	ulong	dst[4];
	ulong	res[4];
	ulong	cr0;
	ulong	cr1;
};

#define BALU	((Balu *) 0xc0000000)
#define OR(x,n)	(ulong *) (((ulong) (x)) | n)
#define SOR(x)	(OR(x,0x30000000))
#define DOR(x)	(OR(x,0x20000000))

/* goo for cr0 manipulations */
#define	OPLENMA		0x0000ffff /* 15 bits only needed */
#define	OPLENSH		0
#define	OPCNTMA		0xffff0000 /* 16 bit signed */
#define	OPCNTSH		16

/* goo for cr1 manipulations */
#define	ALUOPMA		0x0000001f /* 5bits */
#define	ALUOPSH		0
#define	PIXELMA		0x00000060 /* 2bits */
#define	PIXELSH		5
#define	SHMAGMA		0x00000f80 /* 5bits */
#define	SHMAGSH		7
#define	ALIGNMA		0x00003000 /* 2bits */
#define	ALIGNSH		12
#define	RLSCANMA	0x00004000 /* 1bit */
#define	RLSCANSH	14
#define	QOPMA		0x00008000 /* 1bit */
#define	QOPSH		15
#define	RMASKMA		0x001f0000 /* 5bits */
#define	RMASKSH		16
#define	LMASKMA		0x03e00000 /* 5bits */
#define	LMASKSH		21

enum
{
	SUB		= 0x10,		/* balu arithmetic codes */
	SSUB		= 0x11,
	ADD		= 0x12,
	SADD		= 0x13,
	MIN		= 0x14,
	MAX		= 0x15
};