COMPILATION LISTING OF SEGMENT tm_daemon_adopt Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 03/05/85 0912.9 mst Tue 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_daemon_adopt: proc (A_txn_id, A_txn_index, A_code); 10 11 /* DESCRIPTION: 12* 13* The entry point tm_daemon_adopt does the necessary creating of journals and 14* work spaces prior to operating on a transaction AS IF the calling process 15* were the process that created the transaction, i.e., on behalf of another 16* process. It sets various dm_data_ values and then calls bjm_$adopt. The 17* entry point tm_daemon_abandon reverses the process by restoring the 18* dm_data_ values to innocuous values (like zero) and calling bjm_$abandon. 19* 20*/* HISTORY: 21* 22*Written by Steve Herbst, 10/12/82. 23*Modified: 24*12/10/82 by Steve Herbst: Made to call lock_manager_$(adopt abandon). 25*01/13/83 by Steve Herbst: Added $tm_kill and made $tm_abandon work on the 26* user's owwn transaction. 27*02/22/83 by Steve Herbst: Changed to not call lock_manager_$abandon. 28*03/14/83 by Steve Herbst: Fixed argument validation. 29*04/29/83 by Steve Herbst: Changed to call file_manager_$adopt before 30* calling before_journal_manager_$adopt. 31*05/03/83 by Steve Heerbst: Changed $tm_kill to kill immediately if same 32* process & transaction not abandoned. 33*05/04/83 by Steve Herbst: Split tm_adopt into tm_daemon_adopt (this module) and 34* tm_abandon (for users to call). 35*08/11/83 by Steve Herbst: Fixed to restore dm_data_$my_tdt_index since Daemon 36* might want to begin a txn later. 37*10/19/84 by Steve Herbst: Changed in response to audit comments. 38* 39* 40*/* DECLARATIONS */ 41 42 /* Parameters */ 43 44 dcl A_txn_id bit (36) aligned parameter; 45 dcl A_txn_index fixed bin parameter; 46 dcl A_code fixed bin (35) parameter; 47 48 49 50 /* Constants */ 51 52 /* Based */ 53 54 /* Static */ 55 56 /* Automatic */ 57 58 dcl (txn_id, saved_current_txn_id) bit (36) aligned; 59 dcl (txn_index, saved_current_txn_index, saved_my_tdt_index) fixed bin; 60 dcl code fixed bin (35); 61 62 /* External */ 63 64 dcl dm_data_$current_txn_id bit (36) aligned external; 65 dcl dm_data_$current_txn_index fixed bin external; 66 dcl dm_data_$my_tdt_index fixed bin external; 67 dcl dm_data_$tm_tdt_ptr ptr external; 68 69 /* Entries */ 70 71 dcl before_journal_manager_$abandon entry (bit (36) aligned, fixed bin, fixed bin (35)); 72 dcl before_journal_manager_$adopt entry (bit (36) aligned, fixed bin, fixed bin (35)); 73 dcl file_manager_$adopt entry (bit (36) aligned, fixed bin, fixed bin (35)); 74 75 /* Builtins */ 76 77 /* Conditions */ 78 79 dcl cleanup condition; 80 81 /* END OF DECLARATIONS */ 82 83 A_code = 0; 84 txn_id = A_txn_id; 85 txn_index = A_txn_index; 86 tm_tdt_ptr = dm_data_$tm_tdt_ptr; 87 88 saved_current_txn_id = dm_data_$current_txn_id; 89 saved_current_txn_index = dm_data_$current_txn_index; 90 saved_my_tdt_index = dm_data_$my_tdt_index; 91 92 on cleanup call RESTORE_DM_DATA (); 93 94 dm_data_$current_txn_id = "0"b; 95 dm_data_$current_txn_index = 0; 96 97 call file_manager_$adopt (txn_id, txn_index, A_code); 98 if A_code ^= 0 then do; 99 call RESTORE_DM_DATA (); 100 return; 101 end; 102 103 call before_journal_manager_$adopt (txn_id, txn_index, A_code); 104 if A_code ^= 0 then do; 105 call RESTORE_DM_DATA (); 106 return; 107 end; 108 109 dm_data_$current_txn_id = txn_id; 110 dm_data_$current_txn_index, dm_data_$my_tdt_index = txn_index; 111 112 RETURN: 113 return; 114 115 tm_daemon_abandon: entry (A_txn_id, A_txn_index, A_code); 116 117 A_code = 0; 118 txn_id = A_txn_id; 119 txn_index = A_txn_index; 120 tm_tdt_ptr = dm_data_$tm_tdt_ptr; 121 122 dm_data_$current_txn_id = "0"b; 123 124 call before_journal_manager_$abandon (txn_id, txn_index, code); 125 if code ^= 0 then A_code = code; 126 127 dm_data_$current_txn_index = 0; 128 129 return; 130 131 RESTORE_DM_DATA: proc; 132 133 dm_data_$current_txn_id = saved_current_txn_id; 134 dm_data_$current_txn_index = saved_current_txn_index; 135 dm_data_$my_tdt_index = saved_my_tdt_index; 136 137 end RESTORE_DM_DATA; 138 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 */ 139 140 141 142 end tm_daemon_adopt; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 03/05/85 0759.9 tm_daemon_adopt.pl1 >spec>on>7138.pbf>tm_daemon_adopt.pl1 139 1 01/07/85 0900.1 dm_tm_tdt.incl.pl1 >ldd>include>dm_tm_tdt.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_code parameter fixed bin(35,0) dcl 46 set ref 9 83* 97* 98 103* 104 115 117* 125* A_txn_id parameter bit(36) dcl 44 ref 9 84 115 118 A_txn_index parameter fixed bin(17,0) dcl 45 ref 9 85 115 119 before_journal_manager_$abandon 000020 constant entry external dcl 71 ref 124 before_journal_manager_$adopt 000022 constant entry external dcl 72 ref 103 cleanup 000106 stack reference condition dcl 79 ref 92 code 000105 automatic fixed bin(35,0) dcl 60 set ref 124* 125 125 dm_data_$current_txn_id 000010 external static bit(36) dcl 64 set ref 88 94* 109* 122* 133* dm_data_$current_txn_index 000012 external static fixed bin(17,0) dcl 65 set ref 89 95* 110* 127* 134* dm_data_$my_tdt_index 000014 external static fixed bin(17,0) dcl 66 set ref 90 110* 135* dm_data_$tm_tdt_ptr 000016 external static pointer dcl 67 ref 86 120 file_manager_$adopt 000024 constant entry external dcl 73 ref 97 saved_current_txn_id 000101 automatic bit(36) dcl 58 set ref 88* 133 saved_current_txn_index 000103 automatic fixed bin(17,0) dcl 59 set ref 89* 134 saved_my_tdt_index 000104 automatic fixed bin(17,0) dcl 59 set ref 90* 135 tm_tdt_entry based structure level 1 dcl 1-59 tm_tdt_ptr 000114 automatic pointer dcl 1-35 set ref 86* 120* txn_id 000100 automatic bit(36) dcl 58 set ref 84* 97* 103* 109 118* 124* txn_index 000102 automatic fixed bin(17,0) dcl 59 set ref 85* 97* 103* 110 119* 124* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. TM_TDT_VERSION_3 internal static char(8) initial unaligned dcl 1-38 tdt_max_count automatic fixed bin(17,0) dcl 1-36 tm_tdt based structure level 1 dcl 1-41 tm_tdt_entry_ptr automatic pointer dcl 1-57 NAMES DECLARED BY EXPLICIT CONTEXT. RESTORE_DM_DATA 000204 constant entry internal dcl 131 ref 92 99 105 RETURN 000137 constant label dcl 112 tm_daemon_abandon 000142 constant entry external dcl 115 tm_daemon_adopt 000012 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 362 410 221 372 Length 610 221 26 163 140 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tm_daemon_adopt 87 external procedure is an external procedure. on unit on line 92 64 on unit RESTORE_DM_DATA 64 internal procedure is called by several nonquick procedures. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tm_daemon_adopt 000100 txn_id tm_daemon_adopt 000101 saved_current_txn_id tm_daemon_adopt 000102 txn_index tm_daemon_adopt 000103 saved_current_txn_index tm_daemon_adopt 000104 saved_my_tdt_index tm_daemon_adopt 000105 code tm_daemon_adopt 000114 tm_tdt_ptr tm_daemon_adopt THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out call_int_this call_int_other return enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. before_journal_manager_$abandon before_journal_manager_$adopt file_manager_$adopt THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_data_$current_txn_id dm_data_$current_txn_index dm_data_$my_tdt_index dm_data_$tm_tdt_ptr LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 9 000006 83 000017 84 000021 85 000023 86 000025 88 000030 89 000032 90 000034 92 000036 94 000060 95 000062 97 000063 98 000076 99 000101 100 000105 103 000106 104 000121 105 000124 106 000130 109 000131 110 000134 112 000137 115 000140 117 000147 118 000151 119 000153 120 000155 122 000161 124 000162 125 000174 127 000200 129 000202 131 000203 133 000211 134 000214 135 000216 137 000220 ----------------------------------------------------------- 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