COMPILATION LISTING OF SEGMENT bjm_get_bj_oid Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/04/85 0940.6 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* An entry to return the opening ID of a before journal. If the journal 9*is not found in the PPT, then a code is returned to reflect this observation. 10* 11* BJ_DIR and BJ_ENTRY are input parameters. BJ_OID and CODE are 12*output parameters. 13**/ 14 15 /* HISTORY: 16*Written by Mike Pandolf, 08/19/82. 17*Modified: 18*10/15/82 by M. Pandolf: to use file_manger_ for manipulating 19* data management files. 20*11/03/82 by M. Pandolf: to handle codes returned by file_manager_$open 21* according to new spec. 22*11/11/82 by M. Pandolf: to conform to standard entry and exit protocol. 23*11/02/83 by M. Pandolf: to only allow entrynames ending in ".bj". 24*12/06/83 by L. A. Newcomb: Renamed before_journal_manager_static_ to 25* bjm_data_ and moved some cells from dm_data_ to bjm_data_. 26*11/15/84 by Maggie Sharpe: to correct format and dcls; to use ERROR_RETURN 27* technology; to set and rest validation level before and after 28* calls to file_manager_. 29*11/20/84 by Maggie Sharpe: to reset validation level in cleanup handler. 30*03/19/85 by Steve Herbst: Fixed to initialize bjm_data_$bj_code. 31**/ 32 33 /* format: style4,indattr,ifthenstmt,ifthen,^indcomtxt,idind33 */ 34 35 bjm_get_bj_oid: 36 procedure (p_bj_dir, p_bj_entry, p_bj_oid, p_code); 37 38 /* DECLARATIONS */ 39 40 /* Parameter */ 41 42 dcl p_bj_dir char (*) parameter; /* dir of potential before journal */ 43 dcl p_bj_entry char (*) parameter; /* entryname of potential before journal */ 44 dcl p_bj_oid bit (36) aligned parameter; /* OID of before journal */ 45 dcl p_code fixed bin (35); /* standard system status code */ 46 47 /* Automatic */ 48 49 dcl bj_dir char (168); /* local copy of bj dir */ 50 dcl bj_entry char (32); /* local copy of bj entryname */ 51 dcl saved_level fixed bin; /* saves caller's validation level */ 52 dcl current_ring fixed bin (3); 53 dcl this_ppte fixed bin; /* index into PPT entries */ 54 dcl pf_oid bit (36) aligned; /* page file opening ID */ 55 dcl bj_uid bit (36) aligned; /* before journal unique ID, used for comparisons */ 56 57 /* Static, External */ 58 59 dcl dm_error_$bj_recursive_invoc fixed bin (35) external static; 60 dcl dm_error_$bj_journal_not_opened fixed bin (35) external static; 61 dcl dm_error_$bj_invalid_name fixed bin (35) external static; 62 dcl bjm_data_$bj_ppt_ptr pointer external static; 63 64 /* Constant */ 65 66 dcl ME char (16) internal static options (constant) 67 init ("bjm_get_bj_oid"); 68 69 /* Entry */ 70 71 dcl bj_ci_zero$get_bj_uid entry (bit (36) aligned) returns (bit (36)); 72 dcl bj_oid_util$get_oid entry (ptr) returns (bit (36) aligned); 73 dcl bj_cleanup_tables$handler entry (fixed bin (35)); 74 dcl cu_$level_get entry (fixed bin); 75 dcl cu_$level_set entry (fixed bin); 76 dcl file_manager_$open entry (char (*), char (*), bit (36) aligned, fixed bin (35)); 77 dcl file_manager_$close entry (bit (36) aligned, fixed bin (35)); 78 dcl get_ring_ entry () returns (fixed bin (3)); 79 80 /* Builtin */ 81 82 dcl addr builtin; 83 84 /* Condition */ 85 86 dcl cleanup condition; 87 88 89 /* initialize parameters */ 90 91 bj_dir = p_bj_dir; /* truncation to char (168) */ 92 bj_entry = p_bj_entry; /* truncation to char (32) */ 93 p_bj_oid = (36)"0"b; 94 p_code = 0; 95 96 /* validate entry name */ 97 98 if ^is_valid_bj_name (bj_entry) 99 then do; 100 p_code = dm_error_$bj_invalid_name; 101 goto MAIN_RETURN; 102 end; 103 104 105 /* set up addresses for unexpected error */ 106 107 call cu_$level_get (saved_level); 108 current_ring = get_ring_ (); 109 110 on cleanup call CLEANUP; 111 112 if bjm_data_$bj_operation = "" 113 then bjm_data_$bj_operation = ME; 114 else do; 115 p_code = dm_error_$bj_recursive_invoc; 116 goto MAIN_RETURN; 117 end; 118 119 bjm_data_$bj_exit_err = nonlocal_exit_err; 120 bjm_data_$bj_code = 0; 121 122 /* get pointer to PPT */ 123 124 bj_ppt_ptr = bjm_data_$bj_ppt_ptr; 125 126 /* get the page file unique ID to use for comparisons later */ 127 128 call cu_$level_set ((current_ring)); 129 call file_manager_$open (bj_dir, bj_entry, pf_oid, p_code); 130 if pf_oid = (36)"0"b 131 then goto ERROR_RETURN; 132 call cu_$level_set (saved_level); 133 134 135 bj_uid = bj_ci_zero$get_bj_uid (pf_oid); 136 137 call cu_$level_set ((current_ring)); 138 call file_manager_$close (pf_oid, p_code); 139 if p_code ^= 0 140 then goto ERROR_RETURN; 141 call cu_$level_set (saved_level); 142 143 /* walk down the PPT looking for the UID we just found */ 144 145 walk_ppt: 146 do this_ppte = 1 to dm_system_data_$bj_max_n_journals; 147 148 bj_ppte_ptr = addr (bj_ppt.e (this_ppte)); 149 if bj_ppte.version = BJ_PPTE_VERSION_1 150 then do; /* an open journal */ 151 if bj_ppte.bj_uid = bj_uid 152 then do; 153 p_bj_oid = bj_oid_util$get_oid (bj_ppte_ptr); 154 goto JOURNAL_OPENED; 155 end; 156 end; 157 158 end walk_ppt; 159 160 /* did not find the before journal in our list, so the call is not successful */ 161 162 p_code = dm_error_$bj_journal_not_opened; 163 goto ERROR_RETURN; 164 165 JOURNAL_OPENED: 166 bjm_data_$bj_operation = ""; 167 168 bjm_data_$bj_exit_err = 169 bjm_data_$bj_default_error_label; 170 171 MAIN_RETURN: 172 return; 173 174 nonlocal_exit_err: 175 p_code = bjm_data_$bj_code; 176 177 ERROR_RETURN: 178 call CLEANUP; 179 goto MAIN_RETURN; 180 181 182 183 /* INTERNAL PROCEDURES */ 184 185 is_valid_bj_name: 186 proc (bj_name) 187 reducible 188 returns (bit (1) aligned); 189 190 dcl bj_name char (*) parameter; 191 dcl (length, substr, reverse, rtrim) builtin; 192 193 return ( 194 (length (rtrim (bj_name)) < 33) & 195 (substr (reverse (rtrim (bj_name)), 1, 3) = "jb.")); 196 197 end is_valid_bj_name; 198 199 200 201 CLEANUP: 202 procedure (); 203 204 dcl cleanup_code fixed bin (35); 205 206 call bj_cleanup_tables$handler (cleanup_code); 207 208 bjm_data_$bj_operation = ""; 209 bjm_data_$bj_exit_err = bjm_data_$bj_default_error_label; 210 call cu_$level_set (saved_level); 211 212 return; 213 214 end CLEANUP; 215 216 217 /* Include Files */ 218 219 /* BEGIN dm_bj_static.incl.pl1 */ 1 2 /* 1 3*Modified: 1 4*10/04/82 by Lee A. Newcomb: To change from internal static to external 1 5* static. 1 6**/ 1 7 1 8 dcl dm_system_data_$bj_max_n_journals fixed bin ext static; 1 9 dcl dm_system_data_$bj_max_n_processes fixed bin ext static; 1 10 dcl dm_system_data_$max_n_transactions fixed bin ext static; 1 11 1 12 /* END dm_bj_static.incl.pl1 */ 1 13 219 220 /* BEGIN INCLUDE FILE: dm_bj_ppt.incl.pl1 */ 2 2 /* 2 3*Layout of the per-process before journal table and entries. 2 4* 2 5*Written by Andre Bensoussan June/July 1982 2 6*Modified: 2 7*09/29/82 by Lee A. Newcomb: To make two default oid cells, pad ppte's 2 8* to account for all used space, and use dm_system_data_ for 2 9* determining dimension of bj_ppt.e. 2 10**/ 2 11 /* format: style4,indattr,idind33,^indcomtxt */ 2 12 2 13 dcl BJ_PPT_VERSION_1 fixed bin int static options (constant) init (1); 2 14 dcl BJ_PPTE_VERSION_1 fixed bin int static options (constant) init (1); 2 15 2 16 dcl bj_ppt_ptr ptr; 2 17 2 18 dcl 1 bj_ppt based (bj_ppt_ptr) aligned, 2 19 2 version fixed bin, 2 20 2 max_n_entries fixed bin, /* should be = dm_system_data_$bj_max_n_journals */ 2 21 2 n_entries_used fixed bin, /* # of BJs open in this process */ 2 22 2 highest_ix_used fixed bin, /* max. # of BJs ever opened in this process */ 2 23 2 default_bj, /* for selecting a txn def. BJ by write_before_mark protocol */ 2 24 3 user_set_oid bit (36), /* explicit user setting via $set_default_bj */ 2 25 3 last_opened_oid bit (36), /* implicit if no user setting, set by open and close */ 2 26 /* if both zero, use system default BJ */ 2 27 2 process_id bit (36), /* so we don't have to keep calling for it. */ 2 28 2 process_ix fixed bin, /* index into bj_check_in_table */ 2 29 2 mod_list_area (100) fixed bin (35), /* for keeping track of ppt mods, not curr. used */ 2 30 2 31 2 e dim (dm_system_data_$bj_max_n_journals refer (bj_ppt.max_n_entries)) 2 32 like bj_ppte; /* an entry for each BJ open in this process */ 2 33 /* always make sure bj_ppt.e is on a even word boundary */ 2 34 2 35 /* now specify the format of each per-process BJ table entry */ 2 36 2 37 dcl bj_ppte_ptr ptr; 2 38 2 39 dcl 1 bj_ppte based (bj_ppte_ptr) aligned, 2 40 2 version fixed bin, /* better be the same for all entries in a bj_ppt */ 2 41 2 bj_uid bit (36), /* UID of the BJ page file */ 2 42 2 pf_oid bit (36), /* OID of the BJ page file */ 2 43 2 n_opening fixed bin, /* how many openings this process has done for this BJ */ 2 44 2 bj_pste_ptr ptr, /* "link" to per-system BJ table entry */ 2 45 2 open_time fixed bin (71); /* used to fill in bj_ppt.default_bj.last_opened_oid */ 2 46 /* if the last opened BJ is closed */ 2 47 2 48 /* END INCLUDE FILE: bj_ppt.incl.pl1 */ 220 221 /* BEGIN INCLUDE FILE dm_bj_global_error_info.incl.pl1 */ 3 2 3 3 /* Originally found in before journal primitives written by */ 3 4 /* A. Bensoussan. Gathered into an include file for ease of use. */ 3 5 /* See the bjm_data_.alm source for details of use. */ 3 6 3 7 /* HISTORY: 3 8*Written by Mike Pandolf, 07/14/82. 3 9*Modified: 3 10*12/06/83 by L. A. Newcomb: Renamed before_journal_manager_static_ to 3 11* bjm_data_ and moved some cells from dm_data_ to bjm_data_. 3 12**/ 3 13 3 14 /* format: style4,indattr,ifthenstmt,ifthen,^indcomtxt,idind33 */ 3 15 dcl bjm_data_$bj_operation char (32) external static; 3 16 3 17 dcl bjm_data_$bj_exit_err label variable external; 3 18 3 19 dcl bjm_data_$bj_code fixed bin (35) external; 3 20 3 21 dcl bjm_data_$bj_default_error_label label external static; 3 22 3 23 3 24 /* END INCLUDE FILE dm_bj_global_error_info.incl.pl1 */ 221 222 223 224 225 end bjm_get_bj_oid; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/04/85 0826.3 bjm_get_bj_oid.pl1 >spec>on>7192.pbf-04/04/85>bjm_get_bj_oid.pl1 219 1 01/07/85 0857.8 dm_bj_static.incl.pl1 >ldd>include>dm_bj_static.incl.pl1 220 2 01/07/85 0857.6 dm_bj_ppt.incl.pl1 >ldd>include>dm_bj_ppt.incl.pl1 221 3 01/07/85 0857.3 dm_bj_global_error_info.incl.pl1 >ldd>include>dm_bj_global_error_info.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. BJ_PPTE_VERSION_1 constant fixed bin(17,0) initial dcl 2-14 ref 149 ME 000000 constant char(16) initial unaligned dcl 66 ref 112 addr builtin function dcl 82 ref 148 bj_ci_zero$get_bj_uid 000020 constant entry external dcl 71 ref 135 bj_cleanup_tables$handler 000024 constant entry external dcl 73 ref 206 bj_dir 000100 automatic char(168) unaligned dcl 49 set ref 91* 129* bj_entry 000152 automatic char(32) unaligned dcl 50 set ref 92* 98* 129* bj_name parameter char unaligned dcl 190 ref 185 193 193 bj_oid_util$get_oid 000022 constant entry external dcl 72 ref 153 bj_ppt based structure level 1 dcl 2-18 bj_ppt_ptr 000176 automatic pointer dcl 2-16 set ref 124* 148 bj_ppte based structure level 1 dcl 2-39 bj_ppte_ptr 000200 automatic pointer dcl 2-37 set ref 148* 149 151 153* bj_uid 000166 automatic bit(36) dcl 55 in procedure "bjm_get_bj_oid" set ref 135* 151 bj_uid 1 based bit(36) level 2 in structure "bj_ppte" dcl 2-39 in procedure "bjm_get_bj_oid" ref 151 bjm_data_$bj_code 000046 external static fixed bin(35,0) dcl 3-19 set ref 120* 174 bjm_data_$bj_default_error_label 000050 external static label variable dcl 3-21 ref 168 209 bjm_data_$bj_exit_err 000044 external static label variable dcl 3-17 set ref 119* 168* 209* bjm_data_$bj_operation 000042 external static char(32) unaligned dcl 3-15 set ref 112 112* 165* 208* bjm_data_$bj_ppt_ptr 000016 external static pointer dcl 62 ref 124 cleanup 000170 stack reference condition dcl 86 ref 110 cleanup_code 000100 automatic fixed bin(35,0) dcl 204 set ref 206* cu_$level_get 000026 constant entry external dcl 74 ref 107 cu_$level_set 000030 constant entry external dcl 75 ref 128 132 137 141 210 current_ring 000163 automatic fixed bin(3,0) dcl 52 set ref 108* 128 137 dm_error_$bj_invalid_name 000014 external static fixed bin(35,0) dcl 61 ref 100 dm_error_$bj_journal_not_opened 000012 external static fixed bin(35,0) dcl 60 ref 162 dm_error_$bj_recursive_invoc 000010 external static fixed bin(35,0) dcl 59 ref 115 dm_system_data_$bj_max_n_journals 000040 external static fixed bin(17,0) dcl 1-8 ref 145 e 154 based structure array level 2 dcl 2-18 set ref 148 file_manager_$close 000034 constant entry external dcl 77 ref 138 file_manager_$open 000032 constant entry external dcl 76 ref 129 get_ring_ 000036 constant entry external dcl 78 ref 108 length builtin function dcl 191 ref 193 p_bj_dir parameter char unaligned dcl 42 ref 35 91 p_bj_entry parameter char unaligned dcl 43 ref 35 92 p_bj_oid parameter bit(36) dcl 44 set ref 35 93* 153* p_code parameter fixed bin(35,0) dcl 45 set ref 35 94* 100* 115* 129* 138* 139 162* 174* pf_oid 000165 automatic bit(36) dcl 54 set ref 129* 130 135* 138* reverse builtin function dcl 191 ref 193 rtrim builtin function dcl 191 ref 193 193 saved_level 000162 automatic fixed bin(17,0) dcl 51 set ref 107* 132* 141* 210* substr builtin function dcl 191 ref 193 this_ppte 000164 automatic fixed bin(17,0) dcl 53 set ref 145* 148* version based fixed bin(17,0) level 2 dcl 2-39 ref 149 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. BJ_PPT_VERSION_1 internal static fixed bin(17,0) initial dcl 2-13 dm_system_data_$bj_max_n_processes external static fixed bin(17,0) dcl 1-9 dm_system_data_$max_n_transactions external static fixed bin(17,0) dcl 1-10 NAMES DECLARED BY EXPLICIT CONTEXT. CLEANUP 000441 constant entry internal dcl 201 ref 110 177 ERROR_RETURN 000365 constant label dcl 177 set ref 130 139 163 JOURNAL_OPENED 000345 constant label dcl 165 set ref 154 MAIN_RETURN 000360 constant label dcl 171 ref 101 116 179 bjm_get_bj_oid 000025 constant entry external dcl 35 is_valid_bj_name 000372 constant entry internal dcl 185 ref 98 nonlocal_exit_err 000361 constant label dcl 174 ref 119 walk_ppt 000301 constant label dcl 145 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 762 1034 512 772 Length 1314 512 52 243 247 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME bjm_get_bj_oid 169 external procedure is an external procedure. on unit on line 110 64 on unit is_valid_bj_name internal procedure shares stack frame of external procedure bjm_get_bj_oid. CLEANUP 70 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME CLEANUP 000100 cleanup_code CLEANUP bjm_get_bj_oid 000100 bj_dir bjm_get_bj_oid 000152 bj_entry bjm_get_bj_oid 000162 saved_level bjm_get_bj_oid 000163 current_ring bjm_get_bj_oid 000164 this_ppte bjm_get_bj_oid 000165 pf_oid bjm_get_bj_oid 000166 bj_uid bjm_get_bj_oid 000176 bj_ppt_ptr bjm_get_bj_oid 000200 bj_ppte_ptr bjm_get_bj_oid THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_l_a r_e_as call_ext_out_desc call_ext_out call_int_this call_int_other return enable shorten_stack ext_entry_desc int_entry reverse_cs set_cs_eis THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. bj_ci_zero$get_bj_uid bj_cleanup_tables$handler bj_oid_util$get_oid cu_$level_get cu_$level_set file_manager_$close file_manager_$open get_ring_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. bjm_data_$bj_code bjm_data_$bj_default_error_label bjm_data_$bj_exit_err bjm_data_$bj_operation bjm_data_$bj_ppt_ptr dm_error_$bj_invalid_name dm_error_$bj_journal_not_opened dm_error_$bj_recursive_invoc dm_system_data_$bj_max_n_journals LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 35 000020 91 000045 92 000053 93 000057 94 000060 98 000061 100 000067 101 000073 107 000074 108 000103 110 000112 112 000134 115 000146 116 000151 119 000152 120 000156 124 000157 128 000162 129 000172 130 000220 132 000222 135 000231 137 000244 138 000255 139 000267 141 000272 145 000301 148 000311 149 000315 151 000320 153 000323 154 000335 158 000336 162 000340 163 000344 165 000345 168 000352 171 000360 174 000361 177 000365 179 000371 185 000372 193 000403 201 000440 206 000446 208 000454 209 000461 210 000467 212 000476 ----------------------------------------------------------- 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