COMPILATION LISTING OF SEGMENT tm_get_current_txn_id Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 03/05/85 0913.2 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_get_current_txn_id: proc (A_txn_id, A_code); 10 11 12 /* DESCRIPTION: 13* The entry point tm_get_current_txn_id returns the txn_id of the current 14* transaction. The entry point tm_get_current_ids does the same but also 15* returns the transaction's checkpoint_id and rollback_count. Both entries 16* return a nonzero code if the transaction is not IN-PROGRESS: 17* 18* txn_id code 19* ------ ---- 20* 1. Transaction in progress valid tid 0 21* 2. No transaction currently defined 0 dm_error_$no_current_transaction 22* 3. Transaction suspended valid tid dm_error_$transaction_suspended 23* 4. Transaction left in error state valid tid dm_error_$unfinished_abort 24* or: dm_error_$unfinished_commit 25* or: dm_error_$unfinished_rollback 26**/ 27 28 /* HISTORY: 29* 30*Written by Steve Herbst, 01/11/83. 31*Modified: 32*01/17/83 by Steve Herbst: Changed to return the combinations documented above. 33*04/08/83 by Steve Herbst: Changed to return dm_error_$no_current_transaction if 34* TIX^=0 but TID(TIX)="0"b. 35*05/27/83 by Steve Herbst: Added $tm_get_current_ids 36*03/28/84 by Lee A. Newcomb: Changed tm_get_state_info call to be 37* transaction_manager_$get_state_info. 38*10/17/84 by Steve Herbst: Changed in response to audit comments. 39**/ 40 41 42 /* DECLARATIONS */ 43 44 /* Parameters */ 45 46 dcl A_txn_id bit (36) aligned parameter; 47 dcl (A_checkpoint_id, A_rollback_count) fixed bin parameter; 48 dcl A_code fixed bin (35) parameter; 49 50 51 /* Constants */ 52 53 /* Based */ 54 55 /* Static */ 56 57 /* Automatic */ 58 59 dcl txn_index fixed bin; 60 61 /* External */ 62 63 dcl dm_data_$current_txn_index fixed bin ext; 64 dcl dm_data_$suspended_txn_index fixed bin ext; 65 dcl dm_data_$tm_tdt_ptr ptr ext; 66 dcl dm_error_$no_current_transaction fixed bin (35) ext; 67 dcl dm_error_$transaction_suspended fixed bin (35) ext; 68 dcl error_table_$unimplemented_version fixed bin (35) ext; 69 70 /* Entries */ 71 72 dcl transaction_manager_$get_state_info entry (fixed bin, char (*), fixed bin (35)); 73 74 /* Builtins */ 75 76 /* Conditions */ 77 78 /* END OF DECLARATIONS */ 79 80 call GET_TXN_ID (A_txn_id, A_code); 81 82 return; 83 84 tm_get_current_ids: entry (A_txn_id, A_checkpoint_id, A_rollback_count, A_code); 85 86 call GET_TXN_ID (A_txn_id, A_code); 87 88 if A_code = dm_error_$no_current_transaction then do; 89 A_checkpoint_id, A_rollback_count = 0; 90 return; 91 end; 92 93 A_checkpoint_id = tm_tdt.checkpoint_id (txn_index); 94 A_rollback_count = tm_tdt.rollback_count (txn_index); 95 96 return; 97 98 GET_TXN_ID: proc (P_txn_id, P_code); 99 100 dcl P_txn_id bit (36) aligned; 101 dcl P_code fixed bin (35); 102 103 tm_tdt_ptr = dm_data_$tm_tdt_ptr; 104 105 if tm_tdt.version ^= TM_TDT_VERSION_3 then do; 106 P_code = error_table_$unimplemented_version; 107 return; 108 end; 109 110 txn_index = dm_data_$current_txn_index; 111 if txn_index = 0 then 112 if dm_data_$suspended_txn_index ^= 0 then do; 113 txn_index = dm_data_$suspended_txn_index; 114 P_txn_id = tm_tdt.txn_id (txn_index); 115 P_code = dm_error_$transaction_suspended; 116 end; 117 else do; 118 P_txn_id = "0"b; 119 P_code = dm_error_$no_current_transaction; 120 end; 121 else do; 122 P_txn_id = tm_tdt.txn_id (txn_index); 123 if P_txn_id = "0"b then P_code = dm_error_$no_current_transaction; 124 else if tm_tdt.error_sw (txn_index) then /* transaction was left in the middle of an operation */ 125 call transaction_manager_$get_state_info ((tm_tdt.state (txn_index)), "", P_code); 126 else P_code = 0; /* in progress */ 127 end; 128 129 return; 130 131 end GET_TXN_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 135 136 end tm_get_current_txn_id; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 03/05/85 0759.9 tm_get_current_txn_id.pl1 >spec>on>7138.pbf>tm_get_current_txn_id.pl1 133 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_checkpoint_id parameter fixed bin(17,0) dcl 47 set ref 84 89* 93* A_code parameter fixed bin(35,0) dcl 48 set ref 9 80* 84 86* 88 A_rollback_count parameter fixed bin(17,0) dcl 47 set ref 84 89* 94* A_txn_id parameter bit(36) dcl 46 set ref 9 80* 84 86* P_code parameter fixed bin(35,0) dcl 101 set ref 98 106* 115* 119* 123* 124* 126* P_txn_id parameter bit(36) dcl 100 set ref 98 114* 118* 122* 123 TM_TDT_VERSION_3 000000 constant char(8) initial unaligned dcl 1-38 ref 105 checkpoint_id 32 based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 ref 93 dm_data_$current_txn_index 000010 external static fixed bin(17,0) dcl 63 ref 110 dm_data_$suspended_txn_index 000012 external static fixed bin(17,0) dcl 64 ref 111 113 dm_data_$tm_tdt_ptr 000014 external static pointer dcl 65 ref 103 dm_error_$no_current_transaction 000016 external static fixed bin(35,0) dcl 66 ref 88 119 123 dm_error_$transaction_suspended 000020 external static fixed bin(35,0) dcl 67 ref 115 entry 10 based structure array level 2 dcl 1-41 error_sw 34(02) based bit(1) array level 5 packed unaligned dcl 1-41 ref 124 error_table_$unimplemented_version 000022 external static fixed bin(35,0) dcl 68 ref 106 flags 34 based structure array level 4 packed unaligned dcl 1-41 rollback_count 32(18) based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 ref 94 state 30(18) based fixed bin(17,0) array level 4 packed unaligned dcl 1-41 ref 124 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 93 94 103* 105 114 122 124 124 transaction 24 based structure array level 3 unaligned dcl 1-41 transaction_manager_$get_state_info 000024 constant entry external dcl 72 ref 124 txn_id 24 based bit(36) array level 4 dcl 1-41 ref 114 122 txn_index 000100 automatic fixed bin(17,0) dcl 59 set ref 93 94 110* 111 113* 114 122 124 124 version based char(8) level 2 dcl 1-41 ref 105 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. 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. GET_TXN_ID 000106 constant entry internal dcl 98 ref 80 86 tm_get_current_ids 000040 constant entry external dcl 84 tm_get_current_txn_id 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 356 404 207 366 Length 602 207 26 162 147 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tm_get_current_txn_id 102 external procedure is an external procedure. GET_TXN_ID internal procedure shares stack frame of external procedure tm_get_current_txn_id. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tm_get_current_txn_id 000100 txn_index tm_get_current_txn_id 000102 tm_tdt_ptr tm_get_current_txn_id THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. transaction_manager_$get_state_info THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_data_$current_txn_index dm_data_$suspended_txn_index dm_data_$tm_tdt_ptr dm_error_$no_current_transaction dm_error_$transaction_suspended error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 9 000006 80 000022 82 000032 84 000033 86 000050 88 000061 89 000065 90 000070 93 000071 94 000101 96 000105 98 000106 103 000110 105 000114 106 000121 107 000123 110 000124 111 000126 113 000131 114 000132 115 000135 116 000137 118 000140 119 000141 120 000143 122 000144 123 000147 124 000154 126 000205 129 000206 ----------------------------------------------------------- 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