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