1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 prtdim_util$init: proc (sdb_ptr, rcode);
20
21 dcl rcode fixed bin (35);
22
23 dcl temp_iom_stat bit (72) aligned,
24 load_proc entry (ptr, ptr, entry, fixed bin (35)) variable,
25 save_buffer (100) fixed bin (35),
26 wseg_low (100) fixed bin (35) based (wsegp),
27 ecode fixed bin (35);
28
29 dcl ipc_$block entry (ptr, ptr, fixed bin (35)),
30 ioi_$connect entry (fixed bin, fixed bin (18), fixed bin (35)),
31 init_printer_ entry (ptr, ptr, entry, fixed bin (35)),
32 init_printer_$load_image entry (ptr, ptr, entry, fixed bin (35)),
33 init_printer_$load_vfc entry (ptr, ptr, entry, fixed bin (35)),
34 analyze_device_stat_ entry (char (*) aligned, ptr, bit (72) aligned, bit (18) aligned),
35 analyze_system_fault_ entry (char (*) aligned, bit (72) aligned);
36
37 dcl error_table_$net_timeout fixed bin (35) ext,
38 error_table_$no_operation fixed bin (35) ext,
39 prt_status_table_$prt_status_table_ ext;
40
41 dcl 1 ipc_message aligned,
42 2 chname fixed bin (71),
43 2 message fixed bin (71),
44 2 sender bit (36),
45 2 origin,
46 3 devsignal bit (18),
47 3 ring bit (18),
48 2 channel_index fixed bin;
49
50 dcl (addr, addrel, bit, rel, string) builtin;
51
52
53
54
55
56 % include prt_sdb;
57
58 % include prt_info;
59
60
61
62
63 % include prt_conv_info;
64
65
66
67
68 % include iom_pcw;
69
70 % include iom_dcw;
71
72
73
74 % include ioi_stat;
75
76
77
78
79 pip = addr (sdb.info);
80 pcip = addr (sdb.conv_info);
81
82 call init_printer_ (pip, pcip, sync_io, rcode);
83
84 sdb.stop_every,
85 sdb.stop_counter = 0;
86 sdb.mode = "0"b;
87
88 return;
89
90
91
92
93 load_image: entry (sdb_ptr, rcode);
94
95
96 load_proc = init_printer_$load_image;
97 go to load_join;
98
99
100
101
102 load_vfc: entry (sdb_ptr, rcode);
103
104
105 load_proc = init_printer_$load_vfc;
106
107 load_join:
108 pip = addr (sdb.info);
109 pcip = addr (sdb.conv_info);
110
111 save_buffer = wseg_low;
112
113 call load_proc (pip, pcip, sync_io, rcode);
114
115 wseg_low = save_buffer;
116
117 if rcode = 5 then
118 rcode = error_table_$no_operation;
119
120 return;
121
122
123
124
125 sync_io: proc (i, rw, d, l, e);
126
127 dcl i bit (36) aligned,
128 rw bit (2) aligned,
129 d ptr,
130 l fixed bin (12),
131 e bit (1) aligned;
132
133 dcl sdata (l) fixed bin based,
134 dp ptr,
135 b bit (18) aligned;
136
137
138 idcwp = wsegp;
139 string (idcw) = i;
140
141 dcwp = addrel (idcwp, 1);
142 dp = addrel (dcwp, 1);
143
144 string (dcw) = "0"b;
145 dcw.address = rel (dp);
146 dcw.tally = bit (l);
147
148 if rw & "01"b then
149 dp -> sdata = d -> sdata;
150
151 redo_sync:
152 call ioi_$connect (prt_info.devx, 0, ecode);
153 if ecode ^= 0 then do;
154 e = "1"b;
155 return;
156 end;
157
158
159
160
161 sync_wait:
162 call ipc_$block (addr (sdb.ev_list), addr (ipc_message), ecode);
163 if ecode ^= 0 then do;
164 e = "1"b;
165 return;
166 end;
167
168 imp = addr (ipc_message.message);
169 if imess.level = "111"b then go to redo_sync;
170
171 if imess.st then do;
172 if imess.time_out then do;
173 e = "1"b;
174 ecode = error_table_$net_timeout;
175 return;
176 end;
177
178 temp_iom_stat = imess.status;
179 if imess.level = "011"b then do;
180 if imess.er then
181 call analyze_device_stat_ (prt_info.devname, addr (prt_status_table_$prt_status_table_),
182 temp_iom_stat, b);
183 end;
184
185 else if imess.level = "001"b then
186 call analyze_system_fault_ (prt_info.devname, temp_iom_stat);
187
188 if imess.er then go to sync_wait;
189 end;
190 else go to sync_wait;
191
192 if rw & "10"b then
193 d -> sdata = dp -> sdata;
194
195 e = "0"b;
196
197 return;
198
199
200 end sync_io;
201
202
203
204
205 end prtdim_util$init;