COMPILATION LISTING OF SEGMENT meter_signal Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1742.8 mst Mon Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 /* Originally coded by Paul Karger August 17, 1971 */ 12 /* Updated by Alan Bier - March l974. */ 13 /* Fixed to eliminate ERROR 295, 05/01/81, W. Olin Sibert */ 14 15 meter_signal: proc; 16 17 dcl cu_$arg_count entry (fixed bin), 18 cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin), 19 com_err_ entry options (variable), 20 clock_ entry returns (fixed bin (71)), 21 ioa_ entry options (variable), 22 ioa_$nnl entry options (variable), 23 ios_$write_ptr entry (ptr, fixed bin, fixed bin), 24 (unclaimed_signal, zerodivide) condition, 25 condition_ entry (char (*), entry), 26 default_error_handler_ entry, 27 convert_binary_integer_$decimal_string entry (fixed bin) returns (char (12) varying), 28 cv_dec_check_ entry (char (*), fixed bin) returns (fixed bin (35)); 29 30 dcl p pointer, 31 newline char (1) aligned; 32 dcl (mod, unspec, divide, addr, min) builtin; 33 dcl (nargs, code, argl, c, q, k, i) fixed bin, 34 nfaults fixed bin init (1), /* number of faults to take */ 35 nframes fixed bin init (1), /* number of frames to create */ 36 nuncl fixed bin init (0), /* frame number for the unclaimed_signal handler */ 37 nhandlers fixed bin init (0), /* number of dummy handlers to create */ 38 (diff, j, l) fixed bin (35), 39 (time, newtime) fixed bin (71), 40 frame_count fixed bin; 41 42 dcl argp ptr, 43 arg char (argl) based (argp), 44 unclaimed bit (1) aligned init ("0"b); 45 46 47 48 /* */ 49 50 p = addr (newline); /* Used to use init (addr (...)), got ERROR 295 */ 51 i, j = 0; 52 unspec (newline) = "000001010"b; 53 l = 11111111111111111111111111111111111b; 54 call cu_$arg_count (nargs); /* get number of arguments */ 55 if mod (nargs, 2) ^= 0 then 56 do; /* must be even number of args */ 57 call com_err_ (0, "meter_signal", "Odd number of arguments."); 58 return; 59 end; 60 do k = 1 to nargs by 2; /* loop through the arguments two by two */ 61 call cu_$arg_ptr (k, argp, argl, code); /* get pointer to arg */ 62 if code ^= 0 then 63 do; 64 err1: 65 call com_err_ (code, "meter_signal"); 66 return; 67 end; 68 if arg = "-nfaults" then 69 do; /* specify number of faults to take */ 70 call cu_$arg_ptr (k+1, argp, argl, code); 71 /* get number */ 72 if code ^= 0 then go to err1; 73 74 nfaults = cv_dec_check_ (arg, code); /* convert it */ 75 if code ^= 0 then 76 do; 77 err2: 78 call com_err_ (0, "meter_signal", arg); 79 return; 80 end; 81 if nfaults <= 0 then go to err2; /* must be at least 1 fault */ 82 go to next; /* get next arg */ 83 end; 84 if arg = "-nframes" then 85 do; /* sepcify how many stack frames to establish */ 86 call cu_$arg_ptr (k+1, argp, argl, code); 87 /* get the number */ 88 if code ^= 0 then go to err1; 89 90 nframes = cv_dec_check_ (arg, code); /* convert it */ 91 if code ^= 0 then go to err2; 92 if nframes <= 0 then go to err2; 93 94 go to next; 95 end; 96 if arg = "-unclaimed" then 97 do; /* we want an uncliamed signal handler */ 98 call cu_$arg_ptr (k+1, argp, argl, code); 99 /* get the number of the frame to put it in */ 100 if code ^= 0 then go to err1; 101 102 nuncl = cv_dec_check_ (arg, code); /* convert it */ 103 if code ^= 0 then go to err2; 104 if nuncl <= 0 then go to err2; 105 unclaimed = "1"b; 106 go to next; 107 end; 108 if arg = "-nhandlers" then 109 do; /* sets the number of dummy handlers */ 110 call cu_$arg_ptr (k+1, argp, argl, code); 111 if code ^= 0 then go to err1; 112 113 nhandlers = cv_dec_check_ (arg, code); 114 if code ^= 0 then go to err2; 115 if nhandlers <= 0 then go to err2; 116 117 go to next; 118 end; 119 call com_err_ (0, "meter_signal", "Invalid argument. ^R^a^B", arg); 120 /* print error */ 121 return; 122 next: 123 end; 124 call ioa_ ("The following environment will be established:"); 125 call ioa_ ("^/^d stack frames will be laid down.", nframes); 126 if unclaimed then call ioa_ ("An unclaimed signal handler will be in stack frame ^d.", nuncl); 127 call ioa_ ("^d dummy interrupt handlers will be established in each frame.", nhandlers); 128 call ioa_ ("^d zerodivide faults will be signalled.", nfaults); 129 call ioa_ ("^/^/Following are the times in microseconds for each fault:^/^/"); 130 if ^unclaimed then 131 on zerodivide 132 begin; /* set up zerodivide handler */ 133 newtime = clock_ (); /* read the clock */ 134 diff = newtime - time; /* get the difference */ 135 call ioa_$nnl ("^10d", diff); /* print it out */ 136 j = j + diff; /* accumulate the sum */ 137 l = min (l, diff); /* get the minimum fault time */ 138 i = i + 1; 139 if mod (i, 4) = 0 then call ios_$write_ptr (p, 0, 1); /* put out newline every four */ 140 if i >= nfaults then go to all_done; 141 /* check fault counter */ 142 end; /* return to fault to permit resignalling */ 143 frame_count = 1; 144 if unclaimed then 145 if nuncl = frame_count then 146 on condition (unclaimed_signal) 147 begin; 148 149 newtime = clock_ (); 150 diff = newtime - time; 151 call ioa_$nnl ("^10d", diff); 152 j = j + diff; 153 l = min (l, diff); 154 if mod (i, 4) = 0 then call ios_$write_ptr (p, 0, 1); 155 i = i + 1; 156 if i >= nfaults then go to all_done; 157 end; 158 do c = 1 to nhandlers; /* set up the dummy handlers */ 159 call condition_ ("meter_signal_"|| (convert_binary_integer_$decimal_string (c)), 160 default_error_handler_); 161 end; 162 if nframes = frame_count then 163 do; /* is this the last frame? */ 164 div_loop: 165 time = clock_ (); /* read the clock */ 166 q = divide (1, 0, 17, 0); /* divide by zero */ 167 go to div_loop; /* loop back - the handler will turn it off at the right time */ 168 end; 169 call frame; 170 171 all_done: 172 call ioa_ ("^/^/Minimum value = ^d Mean = ^d", l, divide (j, nfaults, 35, 0)); 173 return; 174 frame: 175 proc; /* This is the recursive procedure to set up n stack frames */ 176 frame_count = frame_count + 1; /* increment frame counter */ 177 if unclaimed then 178 if nuncl = frame_count then 179 on condition (unclaimed_signal) 180 begin; 181 182 newtime = clock_ (); 183 diff = newtime - time; 184 call ioa_$nnl ("^10d", diff); 185 j = j + diff; 186 l = min (l, diff); 187 if mod (i, 4) = 0 then call ios_$write_ptr (p, 0, 1); 188 i = i + 1; 189 if i >= nfaults then go to all_done; 190 end; 191 do c = 1 to nhandlers; /* set up the dummy handlers */ 192 call condition_ ("meter_signal_"|| (convert_binary_integer_$decimal_string (c)), 193 default_error_handler_); 194 end; 195 if nframes = frame_count then 196 do; /* is this the last frame */ 197 div_loop: 198 time = clock_ (); 199 q = divide (1, 0, 17, 0); /* cause fault */ 200 go to div_loop; 201 end; 202 call frame; /* recurse to next frame */ 203 end; 204 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1526.1 meter_signal.pl1 >dumps>old>recomp>meter_signal.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. addr builtin function dcl 32 ref 50 arg based char unaligned dcl 42 set ref 68 74* 77* 84 90* 96 102* 108 113* 119* argl 000121 automatic fixed bin(17,0) dcl 33 set ref 61* 68 70* 74 74 77 77 84 86* 90 90 96 98* 102 102 108 110* 113 113 119 119 argp 000144 automatic pointer dcl 42 set ref 61* 68 70* 74 77 84 86* 90 96 98* 102 108 110* 113 119 c 000122 automatic fixed bin(17,0) dcl 33 set ref 158* 159* 191* 192* clock_ 000016 constant entry external dcl 17 ref 133 149 164 182 197 code 000120 automatic fixed bin(17,0) dcl 33 set ref 61* 62 64* 70* 72 74* 75 86* 88 90* 91 98* 100 102* 103 110* 111 113* 114 com_err_ 000014 constant entry external dcl 17 ref 57 64 77 119 condition_ 000026 constant entry external dcl 17 ref 159 192 convert_binary_integer_$decimal_string 000032 constant entry external dcl 17 ref 159 192 cu_$arg_count 000010 constant entry external dcl 17 ref 54 cu_$arg_ptr 000012 constant entry external dcl 17 ref 61 70 86 98 110 cv_dec_check_ 000034 constant entry external dcl 17 ref 74 90 102 113 default_error_handler_ 000030 constant entry external dcl 17 ref 159 159 192 192 diff 000132 automatic fixed bin(35,0) dcl 33 set ref 134* 135* 136 137 150* 151* 152 153 183* 184* 185 186 divide builtin function dcl 32 ref 166 171 171 199 frame_count 000142 automatic fixed bin(17,0) dcl 33 set ref 143* 144 162 176* 176 177 195 i 000125 automatic fixed bin(17,0) dcl 33 set ref 51* 138* 138 139 140 154 155* 155 156 187 188* 188 189 ioa_ 000020 constant entry external dcl 17 ref 124 125 126 127 128 129 171 ioa_$nnl 000022 constant entry external dcl 17 ref 135 151 184 ios_$write_ptr 000024 constant entry external dcl 17 ref 139 154 187 j 000133 automatic fixed bin(35,0) dcl 33 set ref 51* 136* 136 152* 152 171 171 185* 185 k 000124 automatic fixed bin(17,0) dcl 33 set ref 60* 61* 70 86 98 110* l 000134 automatic fixed bin(35,0) dcl 33 set ref 53* 137* 137 153* 153 171* 186* 186 min builtin function dcl 32 ref 137 153 186 mod builtin function dcl 32 ref 55 139 154 187 nargs 000117 automatic fixed bin(17,0) dcl 33 set ref 54* 55 60 newline 000116 automatic char(1) dcl 30 set ref 50 52* newtime 000140 automatic fixed bin(71,0) dcl 33 set ref 133* 134 149* 150 182* 183 nfaults 000126 automatic fixed bin(17,0) initial dcl 33 set ref 33* 74* 81 128* 140 156 171 171 189 nframes 000127 automatic fixed bin(17,0) initial dcl 33 set ref 33* 90* 92 125* 162 195 nhandlers 000131 automatic fixed bin(17,0) initial dcl 33 set ref 33* 113* 115 127* 158 191 nuncl 000130 automatic fixed bin(17,0) initial dcl 33 set ref 33* 102* 104 126* 144 177 p 000114 automatic pointer dcl 30 set ref 50* 139* 154* 187* q 000123 automatic fixed bin(17,0) dcl 33 set ref 166* 199* time 000136 automatic fixed bin(71,0) dcl 33 set ref 134 150 164* 183 197* unclaimed 000146 automatic bit(1) initial dcl 42 set ref 42* 105* 126 130 144 177 unclaimed_signal 000100 stack reference condition dcl 17 ref 144 177 unspec builtin function dcl 32 set ref 52* zerodivide 000106 stack reference condition dcl 17 ref 130 NAMES DECLARED BY EXPLICIT CONTEXT. all_done 001471 constant label dcl 171 ref 140 156 189 div_loop 001446 constant label dcl 164 in procedure "meter_signal" ref 167 div_loop 001743 constant label dcl 197 in procedure "frame" ref 200 err1 000342 constant label dcl 64 ref 72 88 100 111 err2 000444 constant label dcl 77 ref 81 91 92 103 104 114 115 frame 001521 constant entry internal dcl 174 ref 169 202 meter_signal 000222 constant entry external dcl 15 next 000767 constant label dcl 122 ref 82 94 106 117 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2174 2232 2000 2204 Length 2440 2000 36 172 174 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME meter_signal 152 external procedure is an external procedure. on unit on line 130 80 on unit on unit on line 144 80 on unit frame 96 internal procedure enables or reverts conditions. on unit on line 177 80 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME meter_signal 000114 p meter_signal 000116 newline meter_signal 000117 nargs meter_signal 000120 code meter_signal 000121 argl meter_signal 000122 c meter_signal 000123 q meter_signal 000124 k meter_signal 000125 i meter_signal 000126 nfaults meter_signal 000127 nframes meter_signal 000130 nuncl meter_signal 000131 nhandlers meter_signal 000132 diff meter_signal 000133 j meter_signal 000134 l meter_signal 000136 time meter_signal 000140 newtime meter_signal 000142 frame_count meter_signal 000144 argp meter_signal 000146 unclaimed meter_signal THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs call_ext_out_desc call_ext_out call_int_this call_int_other return tra_ext mod_fx1 enable shorten_stack ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ com_err_ condition_ convert_binary_integer_$decimal_string cu_$arg_count cu_$arg_ptr cv_dec_check_ default_error_handler_ ioa_ ioa_$nnl ios_$write_ptr NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 15 000221 33 000227 42 000234 50 000235 51 000237 52 000241 53 000243 54 000245 55 000253 57 000257 58 000313 60 000314 61 000323 62 000340 64 000342 66 000363 68 000364 70 000372 72 000412 74 000414 75 000442 77 000444 79 000475 81 000476 82 000500 84 000501 86 000505 88 000525 90 000527 91 000555 92 000557 94 000561 96 000562 98 000566 100 000606 102 000610 103 000636 104 000640 105 000642 106 000644 108 000645 110 000651 111 000671 113 000673 114 000721 115 000723 117 000725 119 000726 121 000766 122 000767 124 000772 125 001006 126 001026 127 001050 128 001070 129 001110 130 001124 133 001142 134 001151 135 001155 136 001174 137 001201 138 001206 139 001207 140 001231 142 001240 143 001241 144 001243 149 001263 150 001272 151 001276 152 001315 153 001322 154 001327 155 001351 156 001353 157 001361 158 001362 159 001371 161 001440 162 001443 164 001446 166 001455 167 001464 169 001465 171 001471 173 001517 174 001520 176 001526 177 001530 182 001551 183 001561 184 001566 185 001605 186 001613 187 001620 188 001642 189 001645 190 001653 191 001654 192 001665 194 001734 195 001740 197 001743 199 001753 200 001763 202 001764 203 001771 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved