COMPILATION LISTING OF SEGMENT tm_user_shutdown_real Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 05/06/86 1259.1 mst Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1984 * 4* * * 5* *********************************************************** */ 6 7 8 /****^ HISTORY COMMENTS: 9* 1) change(86-02-27,Pierret), approve(86-02-27,MCR7340), 10* audit(86-04-28,Newcomb), install(86-05-06,MR12.0-1054): 11* Changed to use dm_misc_util_$is_process_using_dm instead of using the gate 12* entry directly. 13* END HISTORY COMMENTS */ 14 15 16 /* format: style2,ifthenstmt,^indproc,^indcomtxt */ 17 /*---------------*/ 18 19 tm_user_shutdown_real: 20 proc (A_area_ptr, A_tm_shutdown_info_ptr, A_code); 21 22 /* DESCRIPTION: 23* 24* This program shuts down (terminates) a process' usage of a 25* Data Management System (DMS). It is mainly called by the static 26* handler for the dm_user_shutdown_ IPS and by the terminate_dm 27* command. It does the following: 28* 29* 1) returns if the process is not using a DMS, 30* 2) calls transaction_manager_$user_shutdown_adjust, 31* 3) call the other DM inner ring managers to do whatever steps 32* necessary for them to do user shutdown, 33* 4) calls transaction_manager_$user_shutdown_free, 34* 5) terminates (shuts down) the user references to the DMS. 35* 36* Note that IPS interrupts are masked while the above steps are 37* being done to shut a very small window between each one. This is to 38* prevent possible future problems for processes logged in from rings 39* lower than or equal to the DM ring. 40**/ 41 42 /* HISTORY: 43* 44*Written by Steve Herbst, 11/28/83. 45*Modified: 46*02/16/84 by S. Herbst: Fixed to free a TDT entry if no txn left in it. 47*05/01/84 by L. A. Newcomb: Changed to fix several problems and to call 48* other inner ring manager's user shutdown entrypoints. 49*05/16/84 by S. Herbst: Changed to return first nonzero error code from 50* its various calls. 51*05/31/84 by Lindsey L. Spratt: Fixed to do the "is_using_dm" check after 52* masking ips signals. Changed the clean_up proc to be the FINISH 53* proc, which is always called before returning. Added the RETURN 54* proc which calls FINISH and goes to MAIN_RETURN. Extended FINISH 55* to only free the tm_shutdown_info if the tsi ptr is different from 56* the A_tsi ptr and is non-null, allowing the FINISH proc to be used 57* after setting the A_tsi ptr without causing the tsi structure to 58* be freed. 59*10/23/84 by Steve Herbst: Changed in response to audit comments. 60*12/07/84 by R. Michael Tague: Changed dm_util_$terminate_dm to dm_misc_util_$=. 61*01/31/85 by Steve Herbst: Allow null A_area_ptr, don't set 62* A_tm_shutdown_info_ptr. 63*05/08/85 by Lee A. Newcomb: Fixed to use dm_misc_util_$is_process_using_dm to 64* follow project standard instead of directly calling the gate 65* entry. 66**/ 67 68 /* DECLARATIONS */ 69 70 /* Parameters */ 71 72 dcl A_area_ptr ptr parameter; 73 dcl A_tm_shutdown_info_ptr ptr parameter; 74 dcl A_code fixed bin (35) parameter; 75 76 /* Constants */ 77 78 /* Based */ 79 80 dcl based_area area based; 81 82 /* Automatic */ 83 84 dcl area_ptr ptr; 85 dcl saved_ips_mask bit (36) aligned; 86 dcl code fixed bin (35); 87 88 /* Entries */ 89 90 dcl before_journal_manager_$user_shutdown 91 entry (); 92 dcl dm_misc_util_$terminate_dm 93 entry (fixed bin (35)); 94 dcl dm_misc_util_$is_process_using_dm 95 entry returns (bit (1)); 96 dcl file_manager_$user_shutdown 97 entry (); 98 dcl get_system_free_area_ entry returns (ptr); 99 dcl hcs_$set_ips_mask entry (bit (36) aligned, bit (36) aligned); 100 dcl lock_manager_$user_shutdown 101 entry (); 102 dcl transaction_manager_$user_shutdown_adjust 103 entry (ptr, ptr, fixed bin (35)); 104 dcl transaction_manager_$user_shutdown_free 105 entry (fixed bin (35)); 106 107 /* Builtins */ 108 109 dcl null builtin; 110 111 /* Conditions */ 112 113 dcl cleanup condition; 114 115 /* END OF DECLARATIONS */ 116 117 A_code = 0; 118 A_tm_shutdown_info_ptr = null; 119 tm_shutdown_info_ptr = null; 120 121 if A_area_ptr ^= null 122 then area_ptr = A_area_ptr; 123 else area_ptr = get_system_free_area_ (); 124 125 saved_ips_mask = ""b; 126 on cleanup call FINISH (); 127 128 call hcs_$set_ips_mask (""b, saved_ips_mask); 129 if ^dm_misc_util_$is_process_using_dm () 130 then do; /* DM not initialized, */ 131 call FINISH (); /* our work is done. */ 132 return; 133 end; 134 135 call transaction_manager_$user_shutdown_adjust (area_ptr, tm_shutdown_info_ptr, code); 136 if code ^= 0 & A_code = 0 then A_code = code; 137 138 /* call the other DM-ring managers to do whatever they must */ 139 140 call lock_manager_$user_shutdown (); 141 call before_journal_manager_$user_shutdown (); 142 call file_manager_$user_shutdown (); 143 144 /* now free TDT entries, reset the first reference traps, and reset IPS mask */ 145 146 call transaction_manager_$user_shutdown_free (code); 147 if code ^= 0 & A_code = 0 then A_code = code; 148 149 call dm_misc_util_$terminate_dm (code); 150 if code ^= 0 & A_code = 0 then A_code = code; 151 152 if A_area_ptr ^= null then A_tm_shutdown_info_ptr = tm_shutdown_info_ptr; 153 154 call FINISH (); 155 156 return; 157 158 FINISH: 159 proc; 160 161 if A_tm_shutdown_info_ptr ^= tm_shutdown_info_ptr & tm_shutdown_info_ptr ^= null 162 then free tm_shutdown_info in (area_ptr -> based_area); 163 164 if saved_ips_mask ^= ""b then call hcs_$set_ips_mask (saved_ips_mask, saved_ips_mask); 165 166 end FINISH; 167 1 1 /* BEGIN INCLUDE FILE dm_tm_shutdown_info.incl.pl1 */ 1 2 1 3 /* DESCRIPTION: 1 4* 1 5* This contains the structure used to pass information from 1 6* the DM ring to the user ring about a process' transactions that 1 7* existed when the process terminated its usage of a Data 1 8* Management System. 1 9**/ 1 10 1 11 /* HISTORY: 1 12*Written by Steve Herbst, 11/22/83. 1 13*Modified: 1 14*04/27/84 by L. A. Newcomb: Renamed structure shutdown_info to 1 15* tm_shutdown_info to prevent collision with system shutdown info 1 16* structure. 1 17*05/16/84 by Steve Herbst: Added ABANDONED constant. 1 18*09/20/84 by Lee A. Newcomb: Added an abandoned entry to the OP_NAME array, 1 19* aligned the version, and init'd tm_shutdown_info_ptr to null. 1 20**/ 1 21 1 22 /* format: style4,indattr,^indcomtxt,idind33 */ 1 23 1 24 dcl 1 tm_shutdown_info aligned based (tm_shutdown_info_ptr), 1 25 2 version char (8) aligned, /* = "TMSHUT 1" */ 1 26 2 count fixed bin, 1 27 2 transaction (tm_shutdown_alloc_count refer (tm_shutdown_info.count)), 1 28 3 txn_id bit (36) aligned, 1 29 3 op_completed fixed bin, 1 30 3 state fixed bin, 1 31 3 error_code fixed bin (35); 1 32 1 33 dcl tm_shutdown_info_ptr ptr init (null ()); 1 34 dcl tm_shutdown_alloc_count fixed bin; 1 35 1 36 dcl ( /* constants */ 1 37 TM_SHUTDOWN_INFO_VERSION_1 char (8) aligned init ("TMSHUT 1"), 1 38 (ABORTED init (1), 1 39 FINISHED_ABORT init (2), 1 40 FINISHED_COMMIT init (3), 1 41 ABANDONED init (4)) fixed bin, 1 42 OP_NAME (4) char (32) init 1 43 ("Aborted", "Finished aborting", "Finished committing", "Abandoned") 1 44 ) int static options (constant); 1 45 1 46 /* END INCLUDE FILE - dm_tm_shutdown_info.incl.pl1 */ 168 169 170 171 end tm_user_shutdown_real; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/06/86 1257.2 tm_user_shutdown_real.pl1 >spec>install>1054>tm_user_shutdown_real.pl1 168 1 01/07/85 0900.0 dm_tm_shutdown_info.incl.pl1 >ldd>include>dm_tm_shutdown_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. A_area_ptr parameter pointer dcl 72 ref 19 121 121 152 A_code parameter fixed bin(35,0) dcl 74 set ref 19 117* 136 136* 147 147* 150 150* A_tm_shutdown_info_ptr parameter pointer dcl 73 set ref 19 118* 152* 161 area_ptr 000100 automatic pointer dcl 84 set ref 121* 123* 135* 161 based_area based area(1024) dcl 80 ref 161 before_journal_manager_$user_shutdown 000010 constant entry external dcl 90 ref 141 cleanup 000104 stack reference condition dcl 113 ref 126 code 000103 automatic fixed bin(35,0) dcl 86 set ref 135* 136 136 146* 147 147 149* 150 150 count 2 based fixed bin(17,0) level 2 dcl 1-24 ref 161 dm_misc_util_$is_process_using_dm 000014 constant entry external dcl 94 ref 129 dm_misc_util_$terminate_dm 000012 constant entry external dcl 92 ref 149 file_manager_$user_shutdown 000016 constant entry external dcl 96 ref 142 get_system_free_area_ 000020 constant entry external dcl 98 ref 123 hcs_$set_ips_mask 000022 constant entry external dcl 99 ref 128 164 lock_manager_$user_shutdown 000024 constant entry external dcl 100 ref 140 null builtin function dcl 109 ref 118 119 121 152 1-33 161 saved_ips_mask 000102 automatic bit(36) dcl 85 set ref 125* 128* 164 164* 164* tm_shutdown_info based structure level 1 dcl 1-24 ref 161 tm_shutdown_info_ptr 000112 automatic pointer initial dcl 1-33 set ref 119* 135* 152 1-33* 161 161 161 transaction_manager_$user_shutdown_adjust 000026 constant entry external dcl 102 ref 135 transaction_manager_$user_shutdown_free 000030 constant entry external dcl 104 ref 146 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ABANDONED internal static fixed bin(17,0) initial dcl 1-36 ABORTED internal static fixed bin(17,0) initial dcl 1-36 FINISHED_ABORT internal static fixed bin(17,0) initial dcl 1-36 FINISHED_COMMIT internal static fixed bin(17,0) initial dcl 1-36 OP_NAME internal static char(32) initial array unaligned dcl 1-36 TM_SHUTDOWN_INFO_VERSION_1 internal static char(8) initial dcl 1-36 tm_shutdown_alloc_count automatic fixed bin(17,0) dcl 1-34 NAMES DECLARED BY EXPLICIT CONTEXT. FINISH 000232 constant entry internal dcl 158 ref 126 131 154 tm_user_shutdown_real 000014 constant entry external dcl 19 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 464 516 273 474 Length 724 273 32 171 171 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tm_user_shutdown_real 96 external procedure is an external procedure. on unit on line 126 64 on unit FINISH 70 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tm_user_shutdown_real 000100 area_ptr tm_user_shutdown_real 000102 saved_ips_mask tm_user_shutdown_real 000103 code tm_user_shutdown_real 000112 tm_shutdown_info_ptr tm_user_shutdown_real THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out call_int_this call_int_other return enable ext_entry int_entry free_based THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. before_journal_manager_$user_shutdown dm_misc_util_$is_process_using_dm dm_misc_util_$terminate_dm file_manager_$user_shutdown get_system_free_area_ hcs_$set_ips_mask lock_manager_$user_shutdown transaction_manager_$user_shutdown_adjust transaction_manager_$user_shutdown_free NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 19 000010 1 33 000021 117 000023 118 000025 121 000026 123 000035 125 000043 126 000044 128 000066 129 000101 131 000113 132 000117 135 000120 136 000133 140 000142 141 000147 142 000154 146 000161 147 000170 149 000177 150 000206 152 000215 154 000224 156 000230 158 000231 161 000237 164 000257 166 000272 ----------------------------------------------------------- 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