1 |
1005 |
ivang |
/*
|
2 |
|
|
* PDC support
|
3 |
|
|
*/
|
4 |
|
|
#define OPT_PDC_CACHE 5
|
5 |
|
|
#define OPT_PDC_ADD_VALID 12
|
6 |
|
|
#define OPT_PDC_CHASSIS 2 /* LED's */
|
7 |
|
|
#define OPT_PDC_IODC 8 /* console I/O */
|
8 |
|
|
#define IODC_CONSOLE_OUT 3 /* bytes out serial port */
|
9 |
|
|
#define IODC_CONSOLE_IN 2 /* bytes in serial port */
|
10 |
|
|
|
11 |
|
|
#define PGZ_MEM_PDC 0x0388 /* location of PDC_ENTRY in memory */
|
12 |
|
|
#define PGZ_CONSOLE_STRUCT 0x3A0 /* console config info */
|
13 |
|
|
#define CALL_PDC (*(int (*)())((int *)(*((int *)PGZ_MEM_PDC))))
|
14 |
|
|
|
15 |
|
|
#define putDebugChar outbyte
|
16 |
|
|
#define getDebugChar inbyte
|
17 |
|
|
|
18 |
|
|
/*
|
19 |
|
|
* IODC support
|
20 |
|
|
*/
|
21 |
|
|
#define MAX_BUS_CONVERTERS 6
|
22 |
|
|
#define MAX_LAYERS 6
|
23 |
|
|
#define IO_CONSOLE_INPUT 2
|
24 |
|
|
#define IO_CONSOLE_OUTPUT 3
|
25 |
|
|
|
26 |
|
|
struct _dev {
|
27 |
|
|
unsigned char flags; /* auto-search and auto-boot */
|
28 |
|
|
unsigned char bus_convert[MAX_BUS_CONVERTERS];
|
29 |
|
|
unsigned char pm; /* fixed field of HPA */
|
30 |
|
|
unsigned int layer[MAX_LAYERS]; /* device dependent layers */
|
31 |
|
|
unsigned int hpa; /* device HPA */
|
32 |
|
|
unsigned int spa; /* device SPA */
|
33 |
|
|
unsigned int *iodc_io; /* address of ENTRY_IO in mem */
|
34 |
|
|
unsigned int class; /* device class */
|
35 |
|
|
};
|
36 |
|
|
|
37 |
|
|
/*
|
38 |
|
|
* Register defintions
|
39 |
|
|
*/
|
40 |
|
|
#define gr0 %r0 /* always ZERO */
|
41 |
|
|
#define gr1 %r1 /* ADDIL results only */
|
42 |
|
|
#define gr2 %r2 /* return address */
|
43 |
|
|
#define gr3 %r3 /* scratch registers */
|
44 |
|
|
#define gr4 %r4
|
45 |
|
|
#define gr5 %r5
|
46 |
|
|
#define gr6 %r6
|
47 |
|
|
#define gr7 %r7
|
48 |
|
|
#define gr8 %r8
|
49 |
|
|
#define gr9 %r9
|
50 |
|
|
#define gr10 %r10
|
51 |
|
|
#define gr11 %r11
|
52 |
|
|
#define gr12 %r12
|
53 |
|
|
#define gr13 %r13
|
54 |
|
|
#define gr14 %r14
|
55 |
|
|
#define gr15 %r15
|
56 |
|
|
#define gr16 %r16
|
57 |
|
|
#define gr17 %r17
|
58 |
|
|
#define gr18 %r18
|
59 |
|
|
#define gr19 %r19 /* 4th temp register */
|
60 |
|
|
#define gr20 %r20 /* 3rd temp register */
|
61 |
|
|
#define gr21 %r21 /* 2rd temp register */
|
62 |
|
|
#define gr22 %r22 /* 1rd temp register */
|
63 |
|
|
#define gr23 %r23 /* argument 3 */
|
64 |
|
|
#define gr24 %r24 /* argument 2 */
|
65 |
|
|
#define gr25 %r25 /* argument 1 */
|
66 |
|
|
#define gr26 %r26 /* argument 0 */
|
67 |
|
|
#define gr27 %r27 /* global data pointer */
|
68 |
|
|
#define gr28 %r28 /* return value */
|
69 |
|
|
#define gr29 %r29 /* return value, static link */
|
70 |
|
|
#define gr30 %r30 /* stack pointer */
|
71 |
|
|
#define gr31 %r31 /* millicode return pointer */
|
72 |
|
|
|
73 |
|
|
/*
|
74 |
|
|
* extra definitions, calling conventions
|
75 |
|
|
*/
|
76 |
|
|
#define rp gr2 /* return address */
|
77 |
|
|
#define sp gr30 /* stack pointer */
|
78 |
|
|
#define dp gr27 /* global data area pointer */
|
79 |
|
|
|
80 |
|
|
/*
|
81 |
|
|
* extra definitions, argument passing
|
82 |
|
|
*/
|
83 |
|
|
#define Arg0 gr26 /* pdc function to perform */
|
84 |
|
|
#define Arg1 gr25 /* args to the pdc function */
|
85 |
|
|
#define Arg2 gr24
|
86 |
|
|
#define Arg3 gr23
|
87 |
|
|
|
88 |
|
|
/*
|
89 |
|
|
* Special Processor Registers
|
90 |
|
|
*/
|
91 |
|
|
#define SAR %cr11 /* shift amount register */
|
92 |
|
|
#define IVA %cr14 /* Interruption Vector Address */
|
93 |
|
|
#define EIEM %cr15 /* EIEM reg */
|
94 |
|
|
#define EIR %cr23 /* EIR reg */
|
95 |
|
|
#define TIMER %cr16 /* interval timer */
|
96 |
|
|
#define CCR %cr10 /* coprocessor control reg. */
|
97 |
|
|
|
98 |
|
|
/*
|
99 |
|
|
* ASCII escape code
|
100 |
|
|
*/
|
101 |
|
|
#define NULL 0x00 /* <break> soft-reset (input only) */
|
102 |
|
|
#define DELP 0x03 /* <ctrl>C del-collapse (input only, non-std) */
|
103 |
|
|
#define DELE 0x04 /* <ctrl>D del-to_eol (input only, non-std) */
|
104 |
|
|
#define BELL 0x07 /* <ctrl>G bell - audio */
|
105 |
|
|
#define BS 0x08 /* <ctrl>H back space (left arrow) */
|
106 |
|
|
#define HT 0x09 /* <ctrl>I horizontal tab */
|
107 |
|
|
#define LF 0x0a /* <ctrl>J line feed (down arrow) */
|
108 |
|
|
#define VT 0x0b /* <ctrl>K vertical tab (up arrow) */
|
109 |
|
|
#define FF 0x0c /* <ctrl>L form feed (right arrow) */
|
110 |
|
|
#define RTN 0x0d /* <ctrl>M carrage return */
|
111 |
|
|
#define CR 0x0d /* <ctrl>M carrage return */
|
112 |
|
|
|
113 |
|
|
#define INSC 0x0e /* <ctrl>N insert char (input only, non-std) */
|
114 |
|
|
#define XON 0x11 /* <ctrl>Q DC1 - continue */
|
115 |
|
|
#define BT 0x12 /* <ctrl>R reverse tab (input only, non-std) */
|
116 |
|
|
#define XOFF 0x13 /* <ctrl>S DC3 - wait */
|
117 |
|
|
#define INSE 0x16 /* <ctrl>V insert-expand (input only, non-std) */
|
118 |
|
|
#define DELC 0x18 /* <ctrl>X delete char (input only, non-std) */
|
119 |
|
|
#define CLRH 0x1a /* <ctrl>Z clear/home (input only) */
|
120 |
|
|
#define ESC 0x1b /* <ctrl>[ escape (must call key again) */
|
121 |
|
|
#define ENDL 0x1c /* <ctrl>\ cursor-to-eol (input only, non-std) */
|
122 |
|
|
#define HOME 0x1e /* <ctrl>^ cursor home (input only) */
|
123 |
|
|
#define DEL 0x7f /* <shift>BS destructive backspace */
|