COMPILATION LISTING OF SEGMENT hc_dm_util_ Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 05/17/85 1456.3 mst Fri Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* Utility routines for Data Management Support 9* 10* set_journal_stamp - set the time stamp of a journal for Page Control 11* 12* allocate_journal_index - get ring-2 Data Management a free journal index 13* 14* free_journal_index - free a previously allocated journal index 15* 16* check_activate - determine whether a synchronized segment of a given size 17* can be activated. 18* 19* activate - note activation of a synchronized segment of a given size. 20* 21* deactivate - note deactivation of a synchronized segment of a given size. 22* get_journal_stamp - return current value of bj stamp. 23* 24* get_max_held_per_journal - return dm_journal.max_held_per_journal. 25* 26* get_n_journals - return dm_journal.n_journals 27* 28* validate_bj_uid - check supplied BJ uid against dm_journal_seg_ bj uid. 29**/ 30 31 /* HISTORY: 32*Written by J. Bongiovanni, 10/15/82. 33*Modified: 34*11/15/82 by J. Bongiovanni: to run in user-ring for testing 35*03/01/83 by Lee A. Newcomb: to preserve the journal index 36* value passed to the free_journal entry. 37*11/29/84 by Stanford S. Cox: MAIN: Chg to use parm prefix. ER: Added. 38*05/14/85 by R. Michael Tague: Added $get_journal_stamp, 39* $get_max_held_per_journal, $get_n_journals, and $validate_bj_uid. 40**/ 41 42 /* format: style3 */ 43 hc_dm_util_$set_journal_stamp: 44 proc (p_journal_idx, p_time_stamp, p_code); 45 46 /* Parameter */ 47 48 dcl p_code fixed bin (35) parameter; /* Standard Error Code */ 49 dcl p_journal_idx fixed bin parameter; /* Journal Index */ 50 dcl p_time_stamp fixed bin (71) parameter; /* New time stamp */ 51 dcl p_uid bit (36) aligned; /* Ring-2 Unique ID for Journal */ 52 53 /* Automatic */ 54 55 dcl code fixed bin (35); 56 dcl local_journal_idx fixed bin; 57 dcl journal_loop_idx fixed bin; 58 dcl local_time_stamp fixed bin (71); 59 dcl local_uid bit (36) aligned; 60 dcl time_stamp fixed bin (71); 61 dcl validated bit (1) aligned; 62 63 /* Static */ 64 65 dcl END_OF_TIME fixed bin (71) int static options (constant) 66 init (1111111111111111111111111111111111111111111111111111b); 67 68 /* External */ 69 70 dcl error_table_$bad_arg 71 fixed bin (35) external; 72 dcl error_table_$invalid_dm_journal_index 73 fixed bin (35) external; 74 dcl error_table_$no_journals_free 75 fixed bin (35) external; 76 77 /* Entry */ 78 79 dcl get_authorization_ entry returns (bit (72) aligned); 80 81 /* Builtin */ 82 83 dcl (addr, clock, divide) 84 builtin; 85 86 /* Condition */ 87 88 /* SET_JOURNAL_STAMP - sets the time stamp for a specified journal */ 89 90 local_journal_idx = p_journal_idx; 91 local_time_stamp = p_time_stamp; 92 p_code = 0; 93 94 95 dm_journal_segp = addr (dm_journal_seg_$); 96 dm_journal.set_stamp_calls = dm_journal.set_stamp_calls + 1; 97 98 if (local_journal_idx <= 0) | (local_journal_idx > dm_journal.n_journals) 99 then call ERROR_RETURN (error_table_$invalid_dm_journal_index); 100 101 dm_per_journalp = addr (dm_journal.per_journal (local_journal_idx)); 102 if dm_per_journal.uid = ""b 103 then call ERROR_RETURN (error_table_$invalid_dm_journal_index); 104 105 dm_per_journal.time_stamp = local_time_stamp; 106 107 MAIN_RETURN: 108 return; 109 110 111 /* ALLOCATE_JOURNAL_INDEX - give ring-2 an unused journal index */ 112 113 allocate_journal_index: 114 entry (p_uid, p_journal_idx, p_code); 115 116 117 p_code = 0; 118 119 dm_journal_segp = addr (dm_journal_seg_$); 120 dm_journal.allocate_calls = dm_journal.allocate_calls + 1; 121 122 if p_uid = ""b 123 then call ERROR_RETURN (error_table_$bad_arg); 124 125 local_uid = p_uid; 126 127 journal_loop_idx = 0; 128 code = 0; 129 130 if dm_journal.n_journals <= dm_journal.n_journals_inuse 131 then do; 132 p_journal_idx = journal_loop_idx; 133 call ERROR_RETURN (error_table_$no_journals_free); 134 end; 135 136 do journal_loop_idx = 1 to n_journals; 137 dm_per_journalp = addr (dm_journal.per_journal (journal_loop_idx)); 138 if dm_per_journal.uid = ""b 139 then do; 140 dm_journal.n_journals_inuse = dm_journal.n_journals_inuse + 1; 141 dm_per_journal.time_stamp = clock (); 142 dm_per_journal.access_class = get_authorization_ (); 143 dm_per_journal.uid = local_uid; 144 call RECOMPUTE_THRESH; 145 p_journal_idx = journal_loop_idx; 146 goto MAIN_RETURN; 147 end; 148 end; 149 150 call ERROR_RETURN (error_table_$no_journals_free); 151 152 /* ************************************************************************ 153* * get_journal_stamp - Returns the value of the journal stamp for a * 154* * given dm_journal_seg_ index. An access class check is performed * 155* * before the information is returned. * 156* ************************************************************************ */ 157 158 get_journal_stamp: 159 entry (p_journal_idx) returns (fixed bin (71)); 160 161 time_stamp = 0; 162 163 dm_journal_segp = addr (dm_journal_seg_$); 164 if (p_journal_idx > 0) & (p_journal_idx <= dm_journal.n_journals) 165 then do; 166 dm_per_journalp = addr (dm_journal.per_journal (p_journal_idx)); 167 if dm_per_journal.uid ^= ""b 168 then time_stamp = dm_per_journal.time_stamp; 169 end; 170 return (time_stamp); 171 172 /* ************************************************************************ 173* * get_max_held_per_journal - Return the value of * 174* * dm_journal.max_held_per_journal from dm_journal_seg_. * 175* ************************************************************************ */ 176 177 get_max_held_per_journal: 178 entry () returns (fixed bin); 179 180 return (addr (dm_journal_seg_$) -> dm_journal.max_held_per_journal); 181 182 /* ************************************************************************ 183* * get_n_journals - Return the value of dm_journal.get_n_journals from * 184* * dm_journal_seg_. * 185* ************************************************************************ */ 186 187 get_n_journals: 188 entry () returns (fixed bin); 189 190 return (addr (dm_journal_seg_$) -> dm_journal.n_journals); 191 192 /* ************************************************************************ 193* * validate_bj_uid - Given a dm_journal_seg_ index and BJ uid, this * 194* * entry returns true if the supplied uid matches the uid indexed in * 195* * the dm_journal_seg_ and the caller has authorization to know this. * 196* ************************************************************************ */ 197 198 validate_bj_uid: 199 entry (p_uid, p_journal_idx) returns (bit (1) aligned); 200 201 validated = "0"b; 202 203 dm_journal_segp = addr (dm_journal_seg_$); 204 if (p_journal_idx > 0) & (p_journal_idx <= dm_journal.n_journals) 205 then do; 206 dm_per_journalp = addr (dm_journal.per_journal (p_journal_idx)); 207 if p_uid ^= ""b & p_uid = dm_per_journal.uid 208 then validated = "1"b; 209 end; 210 return (validated); 211 212 /* FREE_JOURNAL_INDEX - frees a previously allocated journal index */ 213 214 free_journal_index: 215 entry (p_journal_idx, p_code); 216 217 218 219 p_code = 0; 220 221 dm_journal_segp = addr (dm_journal_seg_$); 222 dm_journal.free_calls = dm_journal.free_calls + 1; 223 224 code = 0; 225 226 227 local_journal_idx = p_journal_idx; 228 229 if (local_journal_idx <= 0) | (local_journal_idx > dm_journal.n_journals) 230 then call ERROR_RETURN (error_table_$invalid_dm_journal_index); 231 232 dm_per_journalp = addr (dm_journal.per_journal (local_journal_idx)); 233 if dm_per_journal.access_class ^= get_authorization_ () | dm_per_journal.uid = ""b 234 then call ERROR_RETURN (error_table_$invalid_dm_journal_index); 235 236 dm_per_journal.time_stamp = END_OF_TIME; 237 dm_per_journal.uid = ""b; 238 dm_per_journal.access_class = ""b; 239 240 241 dm_journal.n_journals_inuse = dm_journal.n_journals_inuse - 1; 242 call RECOMPUTE_THRESH; 243 goto MAIN_RETURN; 244 245 /* RECOMPUTE_THRESH - Internal Procedure to recompute max held pages per 246* journal, which is used by ring-2 Data Management to prevent flooding 247* the system with held pages. */ 248 249 RECOMPUTE_THRESH: 250 proc; 251 252 if dm_journal.n_journals_inuse = 0 253 then dm_journal.max_held_per_journal = dm_journal.max_held_pages_mem; 254 else dm_journal.max_held_per_journal = divide (dm_journal.max_held_pages_mem, dm_journal.n_journals_inuse, 17); 255 256 end RECOMPUTE_THRESH; 257 258 ERROR_RETURN: 259 proc (er_code); 260 261 dcl er_code fixed bin (35) parameter; 262 263 p_code = er_code; 264 goto MAIN_RETURN; 265 end ERROR_RETURN; 266 1 1 /* START OF: dm_journal_seg_.incl.pl1 October 1982 * * * * * * * * * * * * * * * * */ 1 2 /* modified June 1982 by M. Pandolf for more meters * * * * * * * */ 1 3 1 4 dcl dm_journal_seg_$ external; 1 5 1 6 dcl dm_journal_segp ptr; 1 7 dcl dm_per_journalp ptr; 1 8 dcl dm_per_journal_arrayp ptr; 1 9 dcl dm_page_entryp ptr; 1 10 1 11 dcl n_dm_journals fixed bin; 1 12 dcl max_dm_pages fixed bin; 1 13 1 14 1 15 dcl 1 dm_journal aligned based (dm_journal_segp), 1 16 1 17 2 lock bit (36) aligned, /* Lock for manipulating journal entries */ 1 18 2 wait_event bit (36) aligned, /* Wait Event for lock */ 1 19 2 notify_sw bit (1) aligned, 1 20 1 21 2 n_journals fixed bin, /* Number of journals */ 1 22 2 n_journals_inuse fixed bin, /* Number of journals in use now */ 1 23 2 max_held_pages_mem fixed bin, /* Maximum number of pages held in memory */ 1 24 2 n_held_pages_mem fixed bin, /* Number of pages held in memory */ 1 25 2 max_held_per_journal fixed bin, /* max_held_pages_mem / n_journals_inuse */ 1 26 2 per_aste_pool (0:3) aligned, 1 27 3 threshold fixed bin, /* Maximum number of active segments */ 1 28 3 n_active fixed bin, /* Number currently active */ 1 29 2 free_list_relp bit (18) aligned, /* Free entry list first ptr */ 1 30 2 synch_write_calls fixed bin (35), /* Number of calls to check write */ 1 31 2 synch_write_holds fixed bin (35), /* Number of times page held for call */ 1 32 2 synch_write_no_stamp 1 33 fixed bin (35), /* Number of times page had null DM stamp */ 1 34 2 synch_write_inv_vers 1 35 fixed bin (35), /* Number of times page had invalid DM stamp */ 1 36 2 synch_write_inv_ix 1 37 fixed bin (35), /* Number of times page had invalid BJ index */ 1 38 2 synch_write_inv_time 1 39 fixed bin (35), /* Number of times page had future time stamp */ 1 40 2 synch_write_tosses fixed bin (35), /* Number of times page tossed because of threshold */ 1 41 2 unlink_calls fixed bin (35), /* Number of calls to unlink all entries to a journal */ 1 42 2 unlink_steps fixed bin (35), /* Number of CMEs unlinked */ 1 43 2 activate_calls fixed bin (35), /* Number of times synch segment activated */ 1 44 2 deactivate_calls fixed bin (35), /* Number of times synch segment deactivated */ 1 45 2 activate_denied fixed bin (35), /* Number of times activation threshold exceeded */ 1 46 2 set_stamp_calls fixed bin (35), /* Number of times called to set time stamp */ 1 47 2 allocate_calls fixed bin (35), /* Number of times called to allocate a journal */ 1 48 2 free_calls fixed bin (35), /* Number of times called to free a journal */ 1 49 1 50 2 per_journal (n_dm_journals refer (dm_journal.n_journals)) aligned like dm_per_journal, 1 51 2 page_entry (max_dm_pages refer (dm_journal.max_held_pages_mem)) aligned like dm_page_entry; 1 52 1 53 1 54 dcl 1 dm_per_journal_array (dm_journal.n_journals) aligned like dm_per_journal based (dm_per_journal_arrayp); 1 55 1 56 dcl 1 dm_per_journal aligned based (dm_per_journalp), /* One entry per DM journal */ 1 57 2 time_stamp fixed bin (71), /* Pages before this time can be written */ 1 58 2 n_held fixed bin, /* Number of pages held in memory */ 1 59 2 uid bit (36) aligned, /* Unique ID for owner - ""b => not used */ 1 60 2 access_class bit (72) aligned, /* Access Class of Owner */ 1 61 2 entry_relp bit (18) aligned, /* Pointer to list of pages held for this journal */ 1 62 2 pad bit (36) aligned; 1 63 1 64 1 65 dcl 1 dm_page_entry aligned based (dm_page_entryp), 1 66 2 fp bit (18) unal, /* Forward pointer */ 1 67 2 bp bit (18) unal, /* Backward pointer */ 1 68 2 cme_relp bit (18) unal, /* Rel ptr -> CME */ 1 69 2 journal_relp bit (18) unal; /* Rel ptr -> dm_per_journal */ 1 70 1 71 1 72 /* END OF: dm_journal_seg_.incl.pl1 * * * * * * * * * * * * * * * * */ 1 73 267 268 269 end hc_dm_util_$set_journal_stamp; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/17/85 1328.5 hc_dm_util_.pl1 >spec>online>pbf-05/17/85>hc_dm_util_.pl1 267 1 09/07/83 1610.6 dm_journal_seg_.incl.pl1 >ldd>include>dm_journal_seg_.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. END_OF_TIME 000000 constant fixed bin(71,0) initial dcl 65 ref 236 access_class 4 based bit(72) level 2 dcl 1-56 set ref 142* 233 238* addr builtin function dcl 83 ref 95 101 119 137 163 166 180 190 203 206 221 232 allocate_calls 36 based fixed bin(35,0) level 2 dcl 1-15 set ref 120* 120 clock builtin function dcl 83 ref 141 code 000100 automatic fixed bin(35,0) dcl 55 set ref 128* 224* divide builtin function dcl 83 ref 254 dm_journal based structure level 1 dcl 1-15 dm_journal_seg_$ 000020 external static fixed bin(17,0) dcl 1-4 set ref 95 119 163 180 190 203 221 dm_journal_segp 000114 automatic pointer dcl 1-6 set ref 95* 96 96 98 101 119* 120 120 130 130 136 137 140 140 163* 164 166 203* 204 206 221* 222 222 229 232 241 241 252 252 252 254 254 254 dm_page_entry based structure level 1 dcl 1-65 dm_per_journal based structure level 1 dcl 1-56 dm_per_journalp 000116 automatic pointer dcl 1-7 set ref 101* 102 105 137* 138 141 142 143 166* 167 167 206* 207 232* 233 233 236 237 238 er_code parameter fixed bin(35,0) dcl 261 ref 258 263 error_table_$bad_arg 000010 external static fixed bin(35,0) dcl 70 set ref 122* error_table_$invalid_dm_journal_index 000012 external static fixed bin(35,0) dcl 72 set ref 98* 102* 229* 233* error_table_$no_journals_free 000014 external static fixed bin(35,0) dcl 74 set ref 133* 150* free_calls 37 based fixed bin(35,0) level 2 dcl 1-15 set ref 222* 222 get_authorization_ 000016 constant entry external dcl 79 ref 142 233 journal_loop_idx 000102 automatic fixed bin(17,0) dcl 57 set ref 127* 132 136* 137 145* local_journal_idx 000101 automatic fixed bin(17,0) dcl 56 set ref 90* 98 98 101 227* 229 229 232 local_time_stamp 000104 automatic fixed bin(71,0) dcl 58 set ref 91* 105 local_uid 000106 automatic bit(36) dcl 59 set ref 125* 143 max_held_pages_mem 5 based fixed bin(17,0) level 2 dcl 1-15 ref 252 254 max_held_per_journal 7 based fixed bin(17,0) level 2 dcl 1-15 set ref 180 252* 254* n_journals 3 based fixed bin(17,0) level 2 dcl 1-15 ref 98 130 136 164 190 204 229 n_journals_inuse 4 based fixed bin(17,0) level 2 dcl 1-15 set ref 130 140* 140 241* 241 252 254 p_code parameter fixed bin(35,0) dcl 48 set ref 43 92* 113 117* 214 219* 263* p_journal_idx parameter fixed bin(17,0) dcl 49 set ref 43 90 113 132* 145* 158 164 164 166 198 204 204 206 214 227 p_time_stamp parameter fixed bin(71,0) dcl 50 ref 43 91 p_uid parameter bit(36) dcl 51 ref 113 122 125 198 207 207 per_journal 40 based structure array level 2 dcl 1-15 set ref 101 137 166 206 232 set_stamp_calls 35 based fixed bin(35,0) level 2 dcl 1-15 set ref 96* 96 time_stamp based fixed bin(71,0) level 2 in structure "dm_per_journal" dcl 1-56 in procedure "hc_dm_util_$set_journal_stamp" set ref 105* 141* 167 236* time_stamp 000110 automatic fixed bin(71,0) dcl 60 in procedure "hc_dm_util_$set_journal_stamp" set ref 161* 167* 170 uid 3 based bit(36) level 2 dcl 1-56 set ref 102 138 143* 167 207 233 237* validated 000112 automatic bit(1) dcl 61 set ref 201* 207* 210 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. dm_page_entryp automatic pointer dcl 1-9 dm_per_journal_array based structure array level 1 dcl 1-54 dm_per_journal_arrayp automatic pointer dcl 1-8 max_dm_pages automatic fixed bin(17,0) dcl 1-12 n_dm_journals automatic fixed bin(17,0) dcl 1-11 NAMES DECLARED BY EXPLICIT CONTEXT. ERROR_RETURN 000706 constant entry internal dcl 258 ref 98 102 122 133 150 229 233 MAIN_RETURN 000105 constant label dcl 107 ref 146 243 264 RECOMPUTE_THRESH 000673 constant entry internal dcl 249 ref 144 242 allocate_journal_index 000126 constant entry external dcl 113 free_journal_index 000562 constant entry external dcl 214 get_journal_stamp 000264 constant entry external dcl 158 get_max_held_per_journal 000353 constant entry external dcl 177 get_n_journals 000422 constant entry external dcl 187 hc_dm_util_$set_journal_stamp 000024 constant entry external dcl 43 validate_bj_uid 000473 constant entry external dcl 198 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1112 1134 713 1122 Length 1350 713 22 200 177 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME hc_dm_util_$set_journal_stamp 109 external procedure is an external procedure. RECOMPUTE_THRESH internal procedure shares stack frame of external procedure hc_dm_util_$set_journal_stamp ERROR_RETURN internal procedure shares stack frame of external procedure hc_dm_util_$set_journal_stamp STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME hc_dm_util_$set_journal_stamp 000100 code hc_dm_util_$set_journal_stamp 000101 local_journal_idx hc_dm_util_$set_journal_stamp 000102 journal_loop_idx hc_dm_util_$set_journal_stamp 000104 local_time_stamp hc_dm_util_$set_journal_stamp 000106 local_uid hc_dm_util_$set_journal_stamp 000110 time_stamp hc_dm_util_$set_journal_stamp 000112 validated hc_dm_util_$set_journal_stamp 000114 dm_journal_segp hc_dm_util_$set_journal_stamp 000116 dm_per_journalp hc_dm_util_$set_journal_stamp THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_e_as r_ne_as call_ext_out return signal ext_entry clock THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. get_authorization_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_journal_seg_$ error_table_$bad_arg error_table_$invalid_dm_journal_index error_table_$no_journals_free LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 43 000020 90 000040 91 000042 92 000044 95 000045 96 000047 98 000053 101 000065 102 000072 105 000103 107 000105 113 000122 117 000142 119 000143 120 000146 122 000152 125 000163 127 000166 128 000167 130 000170 132 000174 133 000176 136 000205 137 000215 138 000221 140 000223 141 000225 142 000227 143 000237 144 000242 145 000243 146 000245 148 000246 150 000250 158 000257 161 000276 163 000300 164 000303 166 000307 167 000312 170 000316 177 000350 180 000362 187 000420 190 000431 198 000467 201 000504 203 000505 204 000510 206 000514 207 000517 210 000526 214 000556 219 000576 221 000577 222 000602 224 000606 227 000607 229 000611 232 000622 233 000627 236 000657 237 000661 238 000663 241 000666 242 000671 243 000672 249 000673 252 000674 254 000702 256 000705 258 000706 263 000710 264 000712 ----------------------------------------------------------- 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