COMPILATION LISTING OF SEGMENT tm_adjust_tdt Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/04/85 0947.9 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 /* format: style4,ifthenstmt,^indproc,^indcomtxt */ 7 /*---------------*/ 8 9 tm_adjust_tdt: proc; 10 11 /* DESCRIPTION: 12* 13* This procedure adjusts all the dead transactions in the TDT. 14* A dead transaction is one that either 1) belongs to a process whose 15* process_id is rejected by hcs_$validate_processid (dead process) or 16* 2) has its dead_process_sw on (turned on by tm_$terminate_process) 17* even though the owner process may not yet be dead. 18**/ 19 20 /* HISTORY: 21* 22*Written by Steve Herbst, 11/01/82 23*Modified: 24*12/07/82 by Steve Herbst: Fixed to adjust only if txn is not in error state. 25*01/11/83 by Steve Herbst: Changed to adjust txn only if daemon has not erred 26* trying to adjust it. 27*01/24/83 by Steve Herbst: Refined this to "if daemon has not erred 28* MAX_DAEMON_ERRORS times". 29*02/16/83 by Steve Herbst: Changed to log failure to adjust a txn 30* MAX_DAEMON_ERRORS times. 31*09/25/84 by Steve Herbst: Changed in response to audit comments. 32*11/27/84 by Steve Herbst: Changed further in response to audit comments. 33*03/05/85 by Steve Herbst: Replaced dm_log_ with dm_misc_util_$log. 34**/ 35 36 /* DECLARATIONS */ 37 38 /* Parameters */ 39 40 41 /* Constants */ 42 43 dcl MAX_DAEMON_ERRORS fixed bin int static options (constant) init (3); 44 dcl ME char (32) int static options (constant) init ("tm_adjust_tdt"); 45 46 /* Based */ 47 48 /* Static */ 49 50 /* Automatic */ 51 52 dcl tdt_index fixed bin; 53 54 /* External */ 55 56 dcl dm_data_$tm_tdt_ptr ptr ext; 57 dcl error_table_$unimplemented_version fixed bin (35) ext; 58 59 /* Entries */ 60 61 dcl dm_misc_util_$log entry options (variable); 62 dcl dm_send_request_$adjust_tdt_entry entry (bit (36) aligned, fixed bin, fixed bin (35)); 63 dcl dm_send_request_$adjust_txn entry (bit (36) aligned, fixed bin, fixed bin (35)); 64 dcl hcs_$validate_processid entry (bit (36) aligned, fixed bin (35)); 65 66 /* Builtins */ 67 68 dcl (fixed, index, substr) builtin; 69 70 /* Conditions */ 71 72 /* END OF DECLARATIONS */ 73 74 tm_tdt_ptr = dm_data_$tm_tdt_ptr; 75 76 if tm_tdt.version ^= TM_TDT_VERSION_3 then do; 77 call dm_misc_util_$log (ERROR_SV, error_table_$unimplemented_version, ME); 78 return; 79 end; 80 81 do tdt_index = 1 to tm_tdt.entry_count; 82 83 if tm_tdt.process_id (tdt_index) ^= "0"b then /* entry in use */ 84 85 if tm_tdt.daemon_adjust_count (tdt_index) = MAX_DAEMON_ERRORS then do; 86 87 tm_tdt.daemon_adjust_count (tdt_index) = tm_tdt.daemon_adjust_count (tdt_index) + 1; 88 call dm_misc_util_$log (ERROR_SV, "**** Daemon tried ^d times to adjust TDT entry and is giving up. 89 ^7x(index = ^d, id = ^o, process = ^w (^[d^;a^]), owner = ^a, state = ^d)", 90 MAX_DAEMON_ERRORS, tdt_index, fixed (tm_tdt.txn_id (tdt_index)), 91 tm_tdt.process_id (tdt_index), DEAD_PROCESS (tdt_index), 92 PERSON_ID (tdt_index), tm_tdt.state (tdt_index)); 93 end; 94 95 else if tm_tdt.daemon_adjust_count (tdt_index) < MAX_DAEMON_ERRORS then do; 96 97 if DEAD_PROCESS (tdt_index) | tm_tdt.dead_process_sw (tdt_index) then 98 99 if tm_tdt.txn_id (tdt_index) ^= "0"b then 100 call dm_send_request_$adjust_txn (tm_tdt.txn_id (tdt_index), tdt_index, 0); 101 /* causes tm_$adjust_txn to be called, cleans up txn too */ 102 103 else call dm_send_request_$adjust_tdt_entry ("0"b, tdt_index, 0); 104 /* causes tm_$adjust_tdt_entry to be called */ 105 /* (No transaction to adjust before cleaning up TDT entry) */ 106 end; 107 end; 108 109 return; 110 111 DEAD_PROCESS: proc (P_index) returns (bit (1)); 112 113 dcl P_index fixed bin; 114 dcl code fixed bin (35); 115 116 if tm_tdt.process_id (P_index) = "0"b then return ("0"b); 117 118 call hcs_$validate_processid (tm_tdt.process_id (P_index), code); 119 return (code ^= 0); 120 121 end DEAD_PROCESS; 122 123 PERSON_ID: proc (P_index) returns (char (22)); 124 125 dcl P_index fixed bin; 126 dcl name char (32); 127 128 name = tm_tdt.owner_name (P_index); 129 return (substr (name, 1, index (name, ".") - 1)); 130 131 end PERSON_ID; 132 1 1 /* START OF: dm_tm_tdt.incl.pl1 */ 1 2 1 3 /* Transaction Definition Table for transaction_manager_ */ 1 4 /* This structure is used to reference the TDT. The process_id field for the 1 5* i'th TDT entry, for example, is usually referenced as tm_tdt.process_id (i). 1 6* A TDT entry is in use by a process when its process_id field is nonzero. 1 7* An entry is reserved by using the stacq builtin to set process_id, if and 1 8* only if it is already zero. The entry is being used for a transaction when 1 9* tm_tdt.txn_id (i) is nonzero. The possible values of tm_tdt.state (i) are 1 10* listed in dm_tm_states.incl.pl1. If state = 0, no operation has been 1 11* performed yet on the transaction. */ 1 12 1 13 1 14 /* HISTORY: 1 15*Designed by Matt Pierret, 01/26/82. 1 16*Coded by Steve Herbst, 07/27/82. 1 17*Modified: 1 18*08/05/82 by Steve Herbst: Added tm_tdt.operation and padded last_uid to full word. 1 19*08/05/82 by Steve Herbst: Changed creator_process_id to bit (36). 1 20*08/16/82 by Steve Herbst: Added contents of dm_tm_tdt_entry.incl.pl1. 1 21*09/09/82 by Steve Herbst: Removed in_use flag from TDT entry and rearranged fields. 1 22*09/20/82 by Steve Herbst: Removed tm_tdt.operation. 1 23*11/01/82 by Steve Herbst: Added event_channel and error_sw to tm_tdt_entry. 1 24*11/05/82 by Steve Herbst: Added suspended_sw and error_code to tm_tdt_entry. 1 25*11/11/82 by Steve Herbst: Deleted tm_tdt_entry.alloc_complete. 1 26*11/23/82 by Steve Herbst: Compacted, changed some numbers to unsigned. 1 27*12/14/82 by Steve Herbst: Added tm_tdt_entry.daemon_error_sw. 1 28*01/11/83 by Steve Herbst: Added owner_name, abandoned_sw & kill_sw to tm_tdt_entry. 1 29*01/24/83 by Steve Herbst: Replaced daemon_error_sw with daemon_adjust_count. 1 30*01/25/83 by Steve Herbst: Moved abandoned_sw from transaction portion to entry header portion. 1 31*05/13/83 by Steve Herbst: Version 3, changed all fixed bin (18) unal uns numbers to fixed bin (17) unaligned. 1 32*05/26/83 by Steve Herbst: Added rollback_count and checkpoint_id. 1 33**/ 1 34 1 35 dcl tm_tdt_ptr ptr; 1 36 dcl tdt_max_count fixed bin; 1 37 1 38 dcl TM_TDT_VERSION_3 char (8) int static options (constant) init ("TM-TDT 3"); 1 39 1 40 1 41 dcl 1 tm_tdt aligned based (tm_tdt_ptr), 1 42 2 version char (8), /* = "TM-TDT 3" */ 1 43 2 lock fixed bin (71), /* (currently not used) */ 1 44 2 last_uid bit (27) aligned, /* last transaction uid assigned */ 1 45 2 flags, 1 46 3 no_begins bit (1) unaligned, /* ON => only priv process can begin transaction */ 1 47 3 mbz1 bit (35) unaligned, 1 48 2 entry_count fixed bin, /* number of slots allocated */ 1 49 2 mbz2 fixed bin, /* for even word boundary */ 1 50 2 entry (tdt_max_count refer (tm_tdt.entry_count)) 1 51 like tm_tdt_entry; 1 52 1 53 1 54 1 55 /* TDT entries: */ 1 56 1 57 dcl tm_tdt_entry_ptr ptr; 1 58 1 59 dcl 1 tm_tdt_entry aligned based (tm_tdt_entry_ptr), 1 60 2 event_channel fixed bin (71), /* for communication with the process */ 1 61 2 process_id bit (36) aligned, /* process for which this entry is reserved */ 1 62 2 owner_name char (32), /* person.project of owner process */ 1 63 2 entry_flags, 1 64 3 abandoned_sw bit (1) unaligned, /* ON => owner has called tm_$abandon on this entry */ 1 65 3 mbz3 bit (35) unaligned, 1 66 2 transaction unaligned, 1 67 3 txn_id bit (36) aligned, /* unique identifier assigned at begin time */ 1 68 3 date_time_created fixed bin (71) aligned, 1 69 3 mode fixed bin (17) unaligned, /* mode specified with transaction begin */ 1 70 3 state fixed bin (17) unaligned, /* state transaction is currently in */ 1 71 3 error_code fixed bin (35) aligned, /* goes along with error_sw and error state */ 1 72 3 checkpoint_id fixed bin (17) unaligned, /* identifier of the current rollback checkpoint */ 1 73 3 rollback_count fixed bin (17) unaligned, /* number of times bjm_$rollback has been called */ 1 74 3 daemon_adjust_count fixed bin (17) unaligned, /* number of times daemon has tried to adjust since user */ 1 75 3 return_idx fixed bin (17) unaligned, /* parent transaction, or zero */ 1 76 3 flags, 1 77 4 dead_process_sw bit (1) unaligned, /* ON => treat process as dead even if it isn't yet */ 1 78 4 suspended_sw bit (1) unaligned, /* ON => suspended by tm_$suspend_txn */ 1 79 4 error_sw bit (1) unaligned, /* ON => state is one of the error states */ 1 80 4 kill_sw bit (1) unaligned, /* ON => being processed by tm_$kill */ 1 81 4 mbz4 bit (29) unaligned, 1 82 3 post_commit_flags, 1 83 4 (fmgr, 1 84 bjmgr, 1 85 ajmgr) bit (1) unaligned, 1 86 3 mbz4 fixed bin; 1 87 1 88 1 89 /* END OF: dm_tm_tdt.incl.pl1 */ 133 134 2 1 /* BEGIN INCLUDE FILE dm_log_sv_codes.incl.pl1 */ 2 2 2 3 /* format: ^indcom */ 2 4 2 5 /* DESCRIPTION: 2 6* These are the severity codes used by the dms daemon when calling its logger. 2 7* The severity is ranked thusly: 2 8* 2 9* severity log write situation 2 10* -------- --- ----- --------- 2 11* 0 no yes standard output, query, etc. 2 12* 1 yes yes fatal error, terminate dms daemon. 2 13* 2 yes yes nonfatal error. 2 14* 3 yes yes informative message. 2 15* 4 yes no log information only. 2 16**/ 2 17 2 18 /* HISTORY: 2 19* 2 20*Written by M. Pandolf, 10/06/82. 2 21*Modified: 2 22*12/10/84 by R. Michael Tague: Rename and reformat description/history. 2 23*01/13/85 by Lee A. Newcomb: Renamed to dm_log_sv_codes from 2 24* dm_daemon_sv_codes as the severity codes for the DM log are not 2 25* restrained to the DM Daemon's use. 2 26*01/24/85 by Lee A. Newcomb: Fixed to say dm_log_sv_codes.incl.pl1 in the 2 27* BEGIN and END INCLUDE comments, instead of dm_daemon_sv_codes.==. 2 28**/ 2 29 2 30 /* format: style5 */ 2 31 2 32 dcl (PRINT_SV, QUERY_SV) fixed bin internal static 2 33 options (constant) init (0); 2 34 dcl (CRASH_SV, FATAL_SV) fixed bin internal static 2 35 options (constant) init (1); 2 36 dcl ERROR_SV fixed bin internal static 2 37 options (constant) init (2); 2 38 dcl INFORM_SV fixed bin internal static 2 39 options (constant) init (3); 2 40 dcl LOG_SV fixed bin internal static 2 41 options (constant) init (4); 2 42 2 43 /* END INCLUDE FILE dm_log_sv_codes.incl.pl1 */ 135 136 137 138 end tm_adjust_tdt; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/04/85 0827.0 tm_adjust_tdt.pl1 >spec>on>7192.pbf-04/04/85>tm_adjust_tdt.pl1 133 1 01/07/85 0900.1 dm_tm_tdt.incl.pl1 >ldd>include>dm_tm_tdt.incl.pl1 135 2 03/06/85 1031.1 dm_log_sv_codes.incl.pl1 >ldd>include>dm_log_sv_codes.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. ERROR_SV 000013 constant fixed bin(17,0) initial dcl 2-36 set ref 77* 88* MAX_DAEMON_ERRORS 000012 constant fixed bin(17,0) initial dcl 43 set ref 83 88* 95 ME 000002 constant char(32) initial unaligned dcl 44 set ref 77* P_index parameter fixed bin(17,0) dcl 113 in procedure "DEAD_PROCESS" ref 111 116 118 P_index parameter fixed bin(17,0) dcl 125 in procedure "PERSON_ID" ref 123 128 TM_TDT_VERSION_3 000000 constant char(8) initial unaligned dcl 1-38 ref 76 code 000114 automatic fixed bin(35,0) dcl 114 set ref 118* 119 daemon_adjust_count 33 based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 set ref 83 87* 87 95 dead_process_sw 34 based bit(1) array level 5 packed unaligned dcl 1-41 ref 97 dm_data_$tm_tdt_ptr 000010 external static pointer dcl 56 ref 74 dm_misc_util_$log 000014 constant entry external dcl 61 ref 77 88 dm_send_request_$adjust_tdt_entry 000016 constant entry external dcl 62 ref 103 dm_send_request_$adjust_txn 000020 constant entry external dcl 63 ref 97 entry 10 based structure array level 2 dcl 1-41 entry_count 6 based fixed bin(17,0) level 2 dcl 1-41 ref 81 error_table_$unimplemented_version 000012 external static fixed bin(35,0) dcl 57 set ref 77* fixed builtin function dcl 68 ref 88 88 flags 34 based structure array level 4 packed unaligned dcl 1-41 hcs_$validate_processid 000022 constant entry external dcl 64 ref 118 index builtin function dcl 68 ref 129 name 000124 automatic char(32) unaligned dcl 126 set ref 128* 129 129 owner_name 13 based char(32) array level 3 dcl 1-41 ref 128 process_id 12 based bit(36) array level 3 dcl 1-41 set ref 83 88* 116 118* state 30(18) based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 set ref 88* substr builtin function dcl 68 ref 129 tdt_index 000100 automatic fixed bin(17,0) dcl 52 set ref 81* 83 83 87 87 88* 88 88 88 88* 88* 88* 88* 88 95 97* 97 97 97 97* 103* tm_tdt based structure level 1 dcl 1-41 tm_tdt_entry based structure level 1 dcl 1-59 tm_tdt_ptr 000102 automatic pointer dcl 1-35 set ref 74* 76 81 83 83 87 87 88 88 88 88 95 97 97 97 116 118 128 transaction 24 based structure array level 3 unaligned dcl 1-41 txn_id 24 based bit(36) array level 4 dcl 1-41 set ref 88 88 97 97* version based char(8) level 2 dcl 1-41 ref 76 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. CRASH_SV internal static fixed bin(17,0) initial dcl 2-34 FATAL_SV internal static fixed bin(17,0) initial dcl 2-34 INFORM_SV internal static fixed bin(17,0) initial dcl 2-38 LOG_SV internal static fixed bin(17,0) initial dcl 2-40 PRINT_SV internal static fixed bin(17,0) initial dcl 2-32 QUERY_SV internal static fixed bin(17,0) initial dcl 2-32 tdt_max_count automatic fixed bin(17,0) dcl 1-36 tm_tdt_entry_ptr automatic pointer dcl 1-57 NAMES DECLARED BY EXPLICIT CONTEXT. DEAD_PROCESS 000333 constant entry internal dcl 111 ref 88 88 97 PERSON_ID 000372 constant entry internal dcl 123 ref 88 88 tm_adjust_tdt 000073 constant entry external dcl 9 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 562 606 442 572 Length 1014 442 24 172 120 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tm_adjust_tdt 194 external procedure is an external procedure. DEAD_PROCESS internal procedure shares stack frame of external procedure tm_adjust_tdt. PERSON_ID internal procedure shares stack frame of external procedure tm_adjust_tdt. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tm_adjust_tdt 000100 tdt_index tm_adjust_tdt 000102 tm_tdt_ptr tm_adjust_tdt 000114 code DEAD_PROCESS 000124 name PERSON_ID THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as call_ext_out_desc call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. dm_misc_util_$log dm_send_request_$adjust_tdt_entry dm_send_request_$adjust_txn hcs_$validate_processid THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_data_$tm_tdt_ptr error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 9 000072 74 000100 76 000103 77 000110 78 000130 81 000131 83 000141 87 000153 88 000160 93 000253 95 000254 97 000255 103 000312 107 000330 109 000332 111 000333 116 000335 118 000350 119 000361 123 000372 128 000374 129 000403 ----------------------------------------------------------- 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