COMPILATION LISTING OF SEGMENT bj_storage_util Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/04/85 1001.7 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* 9* 10* ==> bj_storage_util$next_used_ci (bj_pste_ptr, ci_no) returns ci_no of next CI in used part of Circ. List. 11* 12* ==> bj_storage_util$previous_used_ci (bj_pste_ptr, ci_no) returns ci_no of previous CI in used part of Circ. List. 13* 14* ==> bj_storage_util$next_free_ci (bj_pste_ptr) returns ci_no of next free CI. 15* 16* ==> bj_storage_util$distance (bj_pste_ptr, ci_no) returns distance from origin. 17* 18**/ 19 20 21 /* HISTORY: 22*Written by Andre Bensoussan, 08/13/1982. 23*Modified: 24*12/17/82 by Andre Bensoussan: to add the previous_used_ci entrypoint 25*11/02/84 by Maggie Sharpe: to change parameter names from capitalized names 26* to names prefixed by "p_"; to use call ERROR_RETURN (code) method 27* of error handling; corrected minor format problems. 28**/ 29 30 /* format: style5,^inddcls,^indcomtxt */ 31 32 bj_storage_util: 33 proc; /* Never called here */ 34 35 signal error; 36 return; 37 38 39 /* Paramaters */ 40 41 dcl p_bj_pste_ptr ptr; 42 dcl p_current fixed bin (24) uns; 43 dcl p_ci_no fixed bin (24) uns; 44 45 46 /* Automatic */ 47 48 dcl current fixed bin (24) uns; 49 dcl next fixed bin (24) uns; 50 dcl previous fixed bin (24) uns; 51 dcl ci_no fixed bin (24) uns; 52 dcl code fixed bin (35); 53 54 /* Conditions */ 55 56 dcl error condition; 57 58 59 /* Constant */ 60 61 dcl ME char (15) internal static 62 options (constant) init ("bj_storage_util"); 63 64 /* External */ 65 66 dcl dm_error_$bj_bad_ci_no ext fixed bin (35); 67 dcl dm_error_$bj_no_next_used_ci 68 ext fixed bin (35); 69 dcl dm_error_$bj_no_previous_used_ci 70 ext fixed bin (35); 71 dcl dm_error_$bj_logic_err ext fixed bin (35); 72 73 /* Entries */ 74 75 dcl bj_storage_recycle entry (ptr, fixed bin (35)); 76 dcl bj_report_err entry (fixed bin (35), char (*)); 77 78 79 80 next_used_ci: 81 entry (p_bj_pste_ptr, p_current) returns (fixed bin (24) uns); 82 83 84 85 /* Returns the ci_no of the next CI used in the journal. 86* 87* If the next ci used is undefined, it sets a code and invokes 88* the bj_report_err procedure, which will do a non local goto 89* to the bjm primitive. The various cases where the next used ci 90* may be undefined are: 91* 92* o p_current is not in the circular list of the journal. 93* o p_current is not in the used part of the journal. 94* o p_current is the last in the used part of the journal and has no next used. */ 95 96 97 98 bj_pste_ptr = p_bj_pste_ptr; 99 current = p_current; 100 101 102 /* Note that DISTANCE checks that current is in the circular list */ 103 104 105 if DISTANCE (current) >= DISTANCE (bj_pste.last_ci_buffered) then 106 call ERROR_RETURN (dm_error_$bj_no_next_used_ci); 107 108 109 if current < bj_pste.cl.highest_ci then 110 next = current + 1; 111 112 else 113 next = bj_pste.cl.lowest_ci; 114 115 if next = bj_pste.cl.origin_ci then 116 call ERROR_RETURN (dm_error_$bj_logic_err); 117 118 return (next); 119 120 121 /**** ****** NOT USED YET -- Still an internal proc in bj_storage_append. *** ****/ 122 123 124 next_free_ci: 125 entry (p_bj_pste_ptr) returns (fixed bin (24) uns); 126 127 128 129 bj_pste_ptr = p_bj_pste_ptr; 130 current = bj_pste.last_ci_buffered; 131 132 if current < bj_pste.cl.highest_ci then 133 next = current + 1; 134 else 135 next = bj_pste.cl.lowest_ci; 136 137 if next = bj_pste.cl.origin_ci then 138 do; 139 call bj_storage_recycle (bj_pste_ptr, code); 140 if code ^= 0 then 141 call ERROR_RETURN (code); 142 end; 143 144 145 return (next); 146 147 148 previous_used_ci: 149 entry (p_bj_pste_ptr, p_current) returns (fixed bin (24) uns); 150 151 152 153 /* Returns the ci_no of the previous CI used in the journal. 154* If there is no such CI, it sets the code to an error code value 155* and invokes the bj_report_err procedure, which will do a non local 156* goto to the external label set by the bjm primitive, or the caller 157* of bj_storage_util. The various cases where there is no such CI are: 158* 159* o p_current is not a CI of the circular list of the journal 160* o p_current is not in the used part of the journal. 161* o p_current is the first CI in the used list: it has no previous. */ 162 163 164 165 bj_pste_ptr = p_bj_pste_ptr; 166 current = p_current; 167 168 169 if DISTANCE (current) > DISTANCE (bj_pste.last_ci_buffered) then 170 call ERROR_RETURN (dm_error_$bj_bad_ci_no); 171 172 173 if current = bj_pste.cl.origin_ci then 174 call ERROR_RETURN (dm_error_$bj_no_previous_used_ci); 175 176 177 if current > bj_pste.cl.lowest_ci then 178 previous = current - 1; 179 else 180 previous = bj_pste.cl.highest_ci; 181 182 return (previous); 183 184 185 distance: 186 entry (p_bj_pste_ptr, p_ci_no) returns (fixed bin (24) uns); 187 188 189 /* Returns the distance of a given CI to the origin of the 190* circular list. The given CI has to be in the circular list, 191* otherwise an error_code is set and a nonlocal goto is performed. 192* the distance returned is always positive or null, and represents 193* the number of steps forwards starting at the origin to get to 194* the given CI. 195* 196* 0 <= distance < bj_pste.cl.number_ci 197* 198**/ 199 200 201 202 203 204 bj_pste_ptr = p_bj_pste_ptr; 205 ci_no = p_ci_no; 206 207 208 return (DISTANCE (ci_no)); 209 210 211 212 DISTANCE: 213 proc (ci) returns (fixed bin (24) uns); 214 215 216 dcl ci fixed bin (24) uns; 217 218 219 220 if ci < bj_pste.cl.lowest_ci /* Make sure ci is in Circ.List */ 221 | ci > bj_pste.cl.highest_ci then 222 call ERROR_RETURN (dm_error_$bj_bad_ci_no); 223 224 225 if ci >= bj_pste.cl.origin_ci then 226 return (ci - bj_pste.cl.origin_ci); 227 else 228 return (ci - bj_pste.cl.origin_ci + bj_pste.cl.number_ci); 229 230 end DISTANCE; 231 232 233 234 ERROR_RETURN: 235 proc (error_code); 236 237 dcl error_code fixed bin (35); 238 239 call bj_report_err (error_code, ME); /* does not return */ 240 241 end ERROR_RETURN; 242 243 1 1 /* BEGIN INCLUDE FILE: dm_bj_pste.incl.pl1 */ 1 2 1 3 /* DESCRIPTION 1 4* 1 5* Layout of the per-system before journal table 1 6* entries. This structure is used to contain information 1 7* about a before journal active in a running DMS. It is 1 8* currently also used as the header of a before journal 1 9* (see dm_bj_header.incl.pl1). Version changes to this 1 10* structure require either automatic conversion to be set 1 11* up, or users to be told to re-create their journals. 1 12* 1 13* Currently, a bj_pste must be 64 words long; any 1 14* future changes must at least make sure a bj_pste is an 1 15* even # of words for the alignment of some of its 1 16* elements. 1 17**/ 1 18 1 19 /* HISTORY: 1 20* 1 21*Written by Andre Bensoussan, 06/15/82. 1 22*Modified: 1 23*08/16/82 by Andre Bensoussan: to add stamp_for_last_ci_put. 1 24*09/29/82 by Lee A. Newcomb: to fix BJ_PSTE_VERSION_1 and fix some 1 25* alignments. 1 26*11/01/82 by Andre Bensoussan: to add "stamp_for_last_ci_on_disk", 1 27* "n_bi_still_unsafe", and "n_bi_being_saved". 1 28*02/08/83 by M. Pandolf: to add append_state structure. 1 29*03/19/83 by L. A. Newcomb: to fix up some alignments and spelling problems. 1 30*04/27/83 by M. Pandolf: to add meter structure at end. 1 31*02/11/85 by Lee A. Newcomb: Fixed version constant name to agree with its 1 32* value of 2; fixed references to page files or PF's; fixed format 1 33* of description and history sections. 1 34*03/07/85 by Lee A. Newcomb: Changed a pad word to be txn_storage_limit and 1 35* expanded on the description for future generations (no 1 36* version was made). 1 37*03/27/85 by Lee A. Newcomb: Changed one of the unused meters to 1 38* n_txn_storage_limit_hits (again without a version change). 1 39**/ 1 40 /* format: style2,ll79,ind3,^indprocbody,ifthendo,ifthen,^indnoniterdo,^inddcls,dclind5,idind35,linecom */ 1 41 1 42 dcl BJ_PSTE_VERSION_2 fixed bin internal static 1 43 options (constant) init (2); 1 44 1 45 dcl bj_pste_ptr ptr; 1 46 1 47 /* MUST HAVE EVEN NUMBER OR WORDS */ 1 48 dcl 1 bj_pste based (bj_pste_ptr) aligned, 1 49 2 version fixed bin, 1 50 2 bj_ix fixed bin, /* Index of this entry in bj_pst table */ 1 51 2 lock aligned, 1 52 3 pid bit (36), /* process ID of lock owner */ 1 53 3 event bit (36), 1 54 2 bj_uid bit (36), /* UID of BJ file */ 1 55 2 ci_size fixed bin, /* In number of bytes */ 1 56 2 max_size fixed bin, /* In number of ci's */ 1 57 2 active bit (1) aligned, /* 0 means journal not being used */ 1 58 2 time_header_updated fixed bin (71), 1 59 2 earliest_meaningful_time fixed bin (71), /* time stamp on first valid control interval */ 1 60 2 update_frequency fixed bin, /* Not used yet, probably will be how many CIs */ 1 61 2 last_rec_id bit (36), /* rec id of the last logical record in journal */ 1 62 2 n_processes fixed bin, /* Number of processes using this BJ */ 1 63 2 n_txn fixed bin, /* Number of txn in progress using this BJ */ 1 64 2 last_ci_info aligned, 1 65 3 last_ci_buffered fixed bin (24) uns, /* Last ci encached in the buffer */ 1 66 3 last_ci_put fixed bin (24) uns, /* Last ci put in the BJ */ 1 67 3 last_ci_flushed fixed bin (24) uns, /* Last ci for which flush initiated */ 1 68 3 last_ci_on_disk fixed bin (24) uns, /* Last ci of that portion of the BJ known to be ... */ 1 69 /* .. completely on disk */ 1 70 3 stamp_for_last_ci_put fixed bin (71), /* Time stamp associated with the last ci put in the BJ */ 1 71 3 stamp_for_last_ci_on_disk fixed bin (71), /* Time stamp associated with the last ci on disk in the BJ */ 1 72 2 n_bi_still_unsafe fixed bin, /* number of bi's still not on disk */ 1 73 2 n_bi_being_saved fixed bin, /* number of bi's for which flush initiated */ 1 74 2 buffer_offset fixed bin (18) uns, /* Now allocated in the bj_pst segment */ 1 75 2 txn_storage_limit fixed bin (35), /* # of bytes a single txn may write */ 1 76 2 cl aligned, /* Circular List */ 1 77 3 origin_ci fixed bin (24) uns, 1 78 3 lowest_ci fixed bin (24) uns, 1 79 3 highest_ci fixed bin (24) uns, 1 80 3 number_ci fixed bin (24) uns, 1 81 2 append_state aligned, 1 82 3 current_operation char (4), /* equal to "appe" when append in progress */ 1 83 3 pending_n_txn fixed bin, /* n_txn value when append done */ 1 84 3 pending_last_rec_id bit (36), /* last_rec_id value after append done */ 1 85 3 pending_last_element_id bit (36), /* last element id after append done */ 1 86 3 txte_rec_id_relp bit (18), /* rel ptr into seg containing TXT for txte.pending_bj_rec_id */ 1 87 2 pad_to_even_word1 bit (36) aligned, 1 88 2 meters aligned, /* dim (10) fixed bin (71), */ 1 89 3 n_bi_written fixed bin (71), /* meter (1) */ 1 90 3 n_bi_bytes_written fixed bin (71), /* meter (2) */ 1 91 3 n_journal_full fixed bin (71), /* meter (3) */ 1 92 3 n_successful_recycles fixed bin (71), /* meter (4) */ 1 93 3 n_ci_recycled fixed bin (71), /* meter (5) */ 1 94 3 n_txn_started fixed bin (71), /* meter (6) */ 1 95 3 n_non_null_txn fixed bin (71), /* meter (7) */ 1 96 3 n_txn_storage_limit_hits fixed bin (71), /* meter (8) */ 1 97 3 meter (9:10) fixed bin (71), 1 98 /* meter (9) - meter (10) */ 1 99 2 pad_to_64_words (6) bit (36); /* 64 is even (see below) */ 1 100 1 101 1 102 /* END INCLUDE FILE: dm_bj_pste.incl.pl1 */ 244 245 246 end bj_storage_util; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/04/85 0915.5 bj_storage_util.pl1 >spec>on>7192.pbf-04/04/85>bj_storage_util.pl1 244 1 04/04/85 0819.1 dm_bj_pste.incl.pl1 >spec>on>7192.pbf-04/04/85>dm_bj_pste.incl.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. ME 000000 constant char(15) initial unaligned dcl 61 set ref 239* bj_pste based structure level 1 dcl 1-48 bj_pste_ptr 000114 automatic pointer dcl 1-45 set ref 98* 105 109 112 115 129* 130 132 134 137 139* 165* 169 173 177 179 204* 220 220 225 225 227 227 bj_report_err 000022 constant entry external dcl 76 ref 239 bj_storage_recycle 000020 constant entry external dcl 75 ref 139 ci parameter fixed bin(24,0) unsigned dcl 216 ref 212 220 220 225 225 227 ci_no 000103 automatic fixed bin(24,0) unsigned dcl 51 set ref 205* 208* cl 34 based structure level 2 dcl 1-48 code 000104 automatic fixed bin(35,0) dcl 52 set ref 139* 140 140* current 000100 automatic fixed bin(24,0) unsigned dcl 48 set ref 99* 105* 109 109 130* 132 132 166* 169* 173 177 177 dm_error_$bj_bad_ci_no 000010 external static fixed bin(35,0) dcl 66 set ref 169* 220* dm_error_$bj_logic_err 000016 external static fixed bin(35,0) dcl 71 set ref 115* dm_error_$bj_no_next_used_ci 000012 external static fixed bin(35,0) dcl 67 set ref 105* dm_error_$bj_no_previous_used_ci 000014 external static fixed bin(35,0) dcl 69 set ref 173* error 000106 stack reference condition dcl 56 ref 35 error_code parameter fixed bin(35,0) dcl 237 set ref 234 239* highest_ci 36 based fixed bin(24,0) level 3 unsigned dcl 1-48 ref 109 132 179 220 last_ci_buffered 20 based fixed bin(24,0) level 3 unsigned dcl 1-48 set ref 105* 130 169* last_ci_info 20 based structure level 2 dcl 1-48 lowest_ci 35 based fixed bin(24,0) level 3 unsigned dcl 1-48 ref 112 134 177 220 next 000101 automatic fixed bin(24,0) unsigned dcl 49 set ref 109* 112* 115 118 132* 134* 137 145 number_ci 37 based fixed bin(24,0) level 3 unsigned dcl 1-48 ref 227 origin_ci 34 based fixed bin(24,0) level 3 unsigned dcl 1-48 ref 115 137 173 225 225 227 p_bj_pste_ptr parameter pointer dcl 41 ref 80 98 124 129 148 165 185 204 p_ci_no parameter fixed bin(24,0) unsigned dcl 43 ref 185 205 p_current parameter fixed bin(24,0) unsigned dcl 42 ref 80 99 148 166 previous 000102 automatic fixed bin(24,0) unsigned dcl 50 set ref 177* 179* 182 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. BJ_PSTE_VERSION_2 internal static fixed bin(17,0) initial dcl 1-42 NAMES DECLARED BY EXPLICIT CONTEXT. DISTANCE 000366 constant entry internal dcl 212 ref 105 105 169 169 208 ERROR_RETURN 000421 constant entry internal dcl 234 ref 105 115 140 169 173 220 bj_storage_util 000021 constant entry external dcl 32 distance 000334 constant entry external dcl 185 next_free_ci 000151 constant entry external dcl 124 next_used_ci 000046 constant entry external dcl 80 previous_used_ci 000231 constant entry external dcl 148 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 632 656 470 642 Length 1064 470 24 171 142 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME bj_storage_util 120 external procedure is an external procedure. DISTANCE internal procedure shares stack frame of external procedure bj_storage_util. ERROR_RETURN internal procedure shares stack frame of external procedure bj_storage_util. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME bj_storage_util 000100 current bj_storage_util 000101 next bj_storage_util 000102 previous bj_storage_util 000103 ci_no bj_storage_util 000104 code bj_storage_util 000114 bj_pste_ptr bj_storage_util THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return signal ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. bj_report_err bj_storage_recycle THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_error_$bj_bad_ci_no dm_error_$bj_logic_err dm_error_$bj_no_next_used_ci dm_error_$bj_no_previous_used_ci LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 32 000020 35 000030 36 000033 80 000042 98 000057 99 000063 105 000065 109 000112 112 000121 115 000123 118 000134 124 000145 129 000162 130 000166 132 000170 134 000175 137 000177 139 000201 140 000212 145 000216 148 000227 165 000242 166 000246 169 000250 173 000275 177 000310 179 000317 182 000321 185 000332 204 000345 205 000351 208 000353 212 000366 220 000370 225 000405 227 000415 234 000421 239 000423 241 000440 ----------------------------------------------------------- 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