COMPILATION LISTING OF SEGMENT adjust_bit_count_ Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 07/26/84 1214.6 mst Thu 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 adjust_bit_count_: proc (dn, en, ascii, a_bit_count, a_code); 12 13 /* Subroutine that does adjusting on individual files. 14* 15* 16* Prepared for installation by C Garman, July 1971 17* 18* */ 19 20 /* re-modified to work on MSF's by Steve Herbst 12/15/74 */ 21 /* fixed by M. Asherman 9/2/76 to return a bit_count for msf's */ 22 /* Modified 06/08/82 by Jim Lippard to not require aligned dname 23* and ename, and to compile without error */ 24 /* Modified 08/02/83 by Jim Lippard to properly handle MSFs */ 25 /* Modified 04/09/84 by Jim Lippard to return proper error code on MSF 26* to which caller has no access */ 27 28 /* DECLARATIONS */ 29 dcl sum_prev_bcs fixed(35); /* sum of bit counts of MSF components */ 30 31 32 /* fixed bin */ 33 34 dcl (current_block, 35 i, 36 j, 37 k init (0), 38 components, 39 ldn 40 ) fixed bin (17); 41 42 dcl block_offset fixed bin (18); 43 44 dcl a_bit_count fixed(35); 45 dcl (bc,bit_count) fixed(24); 46 47 dcl (a_code, 48 code, 49 error_table_$dirseg ext, 50 error_table_$noentry ext, 51 error_table_$segknown ext) fixed bin (35); 52 53 54 /* bit */ 55 56 dcl ascii bit (1) aligned; 57 dcl msf bit (1) aligned; 58 59 60 /* character */ 61 62 dcl (en, enc) char (32); /* entry name */ 63 64 dcl (dn, dnc) char (168); /* directory name */ 65 66 67 /* pointer */ 68 69 dcl (blockp, 70 compp init (null), 71 eptr, 72 fcbp init (null), 73 segp, 74 wordp) ptr; 75 76 77 /* builtin */ 78 79 dcl (addr, addrel, fixed, max, null) builtin; 80 81 82 /* structures and based declarations */ 83 84 declare 1 br aligned, /* status branch */ 85 (2 (type bit (2), nnames bit (16), nrp bit (18)), 86 2 dtm bit (36), 87 2 dtu bit (36), 88 2 (mode bit (5), pad1 bit (13), records bit (18)), 89 2 dtd bit (36), 90 2 dtem bit (36), 91 2 acct bit (36), 92 2 (curlen bit (12), bitcnt bit (24)), 93 2 (did bit (4), imdid bit (4), 94 copysw bit (1), pad3 bit (9), 95 rbs (0:2) bit (6)), 96 2 uid bit (36)) unaligned; 97 98 dcl word_mask (0:1023) fixed bin based (blockp); 99 100 declare 1 char_mask aligned based (wordp), 101 2 char (1:4) bit (9) unaligned; 102 103 104 /* external entries */ 105 106 dcl hcs_$fs_get_path_name entry (ptr, char(*), fixed bin, char(*), fixed bin(35)); 107 dcl hcs_$initiate entry (char(*), char(*), char(*), fixed bin(1), fixed bin(2), ptr, fixed bin(35)); 108 dcl hcs_$set_bc entry (char(*), char(*), fixed bin(24), fixed bin(35)); 109 dcl hcs_$set_bc_seg entry (ptr, fixed bin(24), fixed bin(35)); 110 dcl hcs_$status_long entry (char(*), char(*), fixed bin(1), ptr, ptr, fixed bin(35)); 111 dcl hcs_$terminate_noname entry (ptr, fixed bin(35)); 112 dcl msf_manager_$adjust entry (ptr, fixed bin, fixed bin(24), bit(3), fixed bin(35)); 113 dcl msf_manager_$close entry (ptr); 114 dcl msf_manager_$get_ptr entry (ptr, fixed bin, bit(1), ptr, fixed bin(24), fixed bin(35)); 115 dcl msf_manager_$open entry (char(*), char(*), ptr, fixed bin(35)); 116 /* 117* adjust_bit_count_: proc (dn, en, ascii, a_bit_count, a_code); */ 118 119 bit_count = -1; 120 msf = "0"b; 121 sum_prev_bcs=0; 122 123 eptr = addr (br); 124 call hcs_$status_long (dn, en, 1, eptr, null, code); /* Get length and type of segment */ 125 if code ^= 0 126 then go to FIN; 127 128 if br.type = "10"b then 129 if br.bitcnt = "0"b then do; 130 code = error_table_$dirseg; 131 go to FIN; 132 end; 133 else do; 134 msf = "1"b; 135 call msf_manager_$open (dn, en, fcbp, code); 136 if code ^= 0 then go to FIN; 137 components = -1; 138 bc=0; 139 140 msf_loop: components = components + 1; 141 sum_prev_bcs=sum_prev_bcs+bc; 142 segp = compp; 143 call msf_manager_$get_ptr (fcbp, components, "0"b, compp, bc, code); 144 if code = 0 | code = error_table_$segknown then go to msf_loop; 145 else if code ^= error_table_$noentry then do; 146 sum_prev_bcs = 0; 147 go to FIN; 148 end; 149 call hcs_$fs_get_path_name (segp, dnc, ldn, enc, code); 150 if code ^= 0 then go to FIN; 151 call hcs_$status_long (dnc, enc, 1, eptr, null, code); 152 if code ^= 0 then go to FIN; 153 end; 154 155 else call hcs_$initiate (dn, en, "", 0, 1, segp, code); /* Get pointer to segment */ 156 157 if segp = null 158 then go to FIN; /* this is the only non-zero code that worries us */ 159 160 last: code = 0; 161 162 current_block = fixed (br.curlen, 12) -1; /* get current block number */ 163 if current_block >= 0 /* If non-zero current length */ 164 then do i = current_block to 0 by -1 while (bit_count < 0); 165 166 block_offset = i * 1024; /* Compute start of current block */ 167 blockp = addrel (segp, block_offset); 168 169 do j = 1023 by -1 to 0 while 170 (blockp -> word_mask (j) = 0); /* Search current block for non-zero word */ 171 end; 172 173 if j >= 0 /* (Should always be, but ...) */ 174 then do; 175 176 if ascii /* If character adjustment wanted, test last word */ 177 then do; 178 179 wordp = addr (blockp -> word_mask (j)); /* Get pointer to last word */ 180 181 do k = 4 by -1 to 1 while (wordp -> char_mask.char (k) = (9)"0"b); 182 /* Now test characters */ 183 end; 184 185 end; 186 187 else /* no character adjustment wanted */ 188 j = j + 1; /* include full last non-zero word */ 189 190 end; 191 192 if j >= 0 /* a non-zero length block was found */ 193 then bit_count = (((block_offset + j) * 4) + k) * 9; /* inner expression is multiplied by 36 */ 194 195 end; 196 197 bit_count = max (bit_count, 0); 198 199 if msf then do; 200 call msf_manager_$adjust (fcbp, components-1, bit_count, "110"b, code); 201 if code ^= 0 then go to FIN; 202 if components>1 then call hcs_$set_bc (dn, en, (components), code); 203 if code ^= 0 then go to FIN; 204 end; 205 call hcs_$set_bc_seg(segp,bit_count,code); 206 if code ^= 0 then go to FIN; 207 208 if msf then call msf_manager_$close (fcbp); 209 else call hcs_$terminate_noname (segp, (0)); 210 211 FIN: 212 a_bit_count = bit_count+sum_prev_bcs; 213 214 a_code = code; /* Return the last error code */ 215 216 end adjust_bit_count_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 07/26/84 1137.3 adjust_bit_count_.pl1 >special_ldd>on>07/26/84>adjust_bit_count_.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. a_bit_count parameter fixed bin(35,0) dcl 44 set ref 11 211* a_code parameter fixed bin(35,0) dcl 47 set ref 11 214* addr builtin function dcl 79 ref 123 179 addrel builtin function dcl 79 ref 167 ascii parameter bit(1) dcl 56 ref 11 176 bc 000110 automatic fixed bin(24,0) dcl 45 set ref 138* 141 143* bit_count 000111 automatic fixed bin(24,0) dcl 45 set ref 119* 163 192* 197* 197 200* 205* 211 bitcnt 7(12) 000212 automatic bit(24) level 2 packed unaligned dcl 84 set ref 128 block_offset 000107 automatic fixed bin(18,0) dcl 42 set ref 166* 167 192 blockp 000176 automatic pointer dcl 69 set ref 167* 169 179 br 000212 automatic structure level 1 dcl 84 set ref 123 char based bit(9) array level 2 packed unaligned dcl 100 ref 181 char_mask based structure level 1 dcl 100 code 000112 automatic fixed bin(35,0) dcl 47 set ref 124* 125 130* 135* 136 143* 144 144 145 149* 150 151* 152 155* 160* 200* 201 202* 203 205* 206 214 components 000105 automatic fixed bin(17,0) dcl 34 set ref 137* 140* 140 143* 200 202 202 compp 000200 automatic pointer initial dcl 69 set ref 69* 142 143* curlen 7 000212 automatic bit(12) level 2 packed unaligned dcl 84 set ref 162 current_block 000101 automatic fixed bin(17,0) dcl 34 set ref 162* 163 163 dn parameter char(168) unaligned dcl 64 set ref 11 124* 135* 155* 202* dnc 000124 automatic char(168) unaligned dcl 64 set ref 149* 151* en parameter char(32) unaligned dcl 62 set ref 11 124* 135* 155* 202* enc 000114 automatic char(32) unaligned dcl 62 set ref 149* 151* eptr 000202 automatic pointer dcl 69 set ref 123* 124* 151* error_table_$dirseg 000010 external static fixed bin(35,0) dcl 47 ref 130 error_table_$noentry 000012 external static fixed bin(35,0) dcl 47 ref 145 error_table_$segknown 000014 external static fixed bin(35,0) dcl 47 ref 144 fcbp 000204 automatic pointer initial dcl 69 set ref 69* 135* 143* 200* 208* fixed builtin function dcl 79 ref 162 hcs_$fs_get_path_name 000016 constant entry external dcl 106 ref 149 hcs_$initiate 000020 constant entry external dcl 107 ref 155 hcs_$set_bc 000022 constant entry external dcl 108 ref 202 hcs_$set_bc_seg 000024 constant entry external dcl 109 ref 205 hcs_$status_long 000026 constant entry external dcl 110 ref 124 151 hcs_$terminate_noname 000030 constant entry external dcl 111 ref 209 i 000102 automatic fixed bin(17,0) dcl 34 set ref 163* 166* j 000103 automatic fixed bin(17,0) dcl 34 set ref 169* 169* 173 179 187* 187 192 192 k 000104 automatic fixed bin(17,0) initial dcl 34 set ref 34* 181* 181* 192 ldn 000106 automatic fixed bin(17,0) dcl 34 set ref 149* max builtin function dcl 79 ref 197 msf 000113 automatic bit(1) dcl 57 set ref 120* 134* 199 208 msf_manager_$adjust 000032 constant entry external dcl 112 ref 200 msf_manager_$close 000034 constant entry external dcl 113 ref 208 msf_manager_$get_ptr 000036 constant entry external dcl 114 ref 143 msf_manager_$open 000040 constant entry external dcl 115 ref 135 null builtin function dcl 79 ref 69 69 124 124 151 151 157 segp 000206 automatic pointer dcl 69 set ref 142* 149* 155* 157 167 205* 209* sum_prev_bcs 000100 automatic fixed bin(35,0) dcl 29 set ref 121* 141* 141 146* 211 type 000212 automatic bit(2) level 2 packed unaligned dcl 84 set ref 128 word_mask based fixed bin(17,0) array dcl 98 set ref 169 179 wordp 000210 automatic pointer dcl 69 set ref 179* 181 NAMES DECLARED BY EXPLICIT CONTEXT. FIN 000612 constant label dcl 211 ref 125 131 136 147 150 152 157 201 203 206 adjust_bit_count_ 000021 constant entry external dcl 11 last 000363 constant label dcl 160 msf_loop 000152 constant label dcl 140 ref 144 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 776 1040 623 1006 Length 1232 623 42 155 153 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME adjust_bit_count_ 210 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME adjust_bit_count_ 000100 sum_prev_bcs adjust_bit_count_ 000101 current_block adjust_bit_count_ 000102 i adjust_bit_count_ 000103 j adjust_bit_count_ 000104 k adjust_bit_count_ 000105 components adjust_bit_count_ 000106 ldn adjust_bit_count_ 000107 block_offset adjust_bit_count_ 000110 bc adjust_bit_count_ 000111 bit_count adjust_bit_count_ 000112 code adjust_bit_count_ 000113 msf adjust_bit_count_ 000114 enc adjust_bit_count_ 000124 dnc adjust_bit_count_ 000176 blockp adjust_bit_count_ 000200 compp adjust_bit_count_ 000202 eptr adjust_bit_count_ 000204 fcbp adjust_bit_count_ 000206 segp adjust_bit_count_ 000210 wordp adjust_bit_count_ 000212 br adjust_bit_count_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. hcs_$fs_get_path_name hcs_$initiate hcs_$set_bc hcs_$set_bc_seg hcs_$status_long hcs_$terminate_noname msf_manager_$adjust msf_manager_$close msf_manager_$get_ptr msf_manager_$open THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$dirseg error_table_$noentry error_table_$segknown LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000014 34 000026 69 000027 119 000032 120 000034 121 000035 123 000036 124 000040 125 000100 128 000102 130 000111 131 000114 134 000115 135 000117 136 000145 137 000147 138 000151 140 000152 141 000153 142 000157 143 000161 144 000204 145 000211 146 000213 147 000214 149 000215 150 000245 151 000247 152 000307 153 000311 155 000312 157 000357 160 000363 162 000364 163 000370 166 000376 167 000401 169 000404 171 000412 173 000415 176 000417 179 000423 181 000425 183 000441 185 000444 187 000445 192 000446 195 000455 197 000460 199 000465 200 000467 201 000513 202 000515 203 000547 205 000551 206 000564 208 000566 209 000600 211 000612 214 000617 216 000621 ----------------------------------------------------------- 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