COMPILATION LISTING OF SEGMENT lm_init_fast_lock_ Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 03/05/85 0908.7 mst Tue Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* Program to initialize a user-supplied double-word as a fast lock. 9* 10* The steps are the following: 11* 12* 1. Fill in an automatic copy of the fast lock block. 13* 14* 2. Get a free block from fast_lock_data. 15* 16* 3. Copy the automatic block to the free block. 17* 18* 4. Fill in the fast lock double-word. Avoid races with other 19* processes doing the same thing for this lock. 20**/ 21 22 /* HISTORY: 23*Written by J. Bongiovanni, 06/15/82 24*Modified: 25*10/11/84 by Stanford S. Cox: For DM program standards, and to meter fast 26* locks. 27**/ 28 29 /* format: style3 */ 30 lm_init_fast_lock_: 31 proc (p_fast_lock_ptr, p_code); 32 33 /* Parameter */ 34 35 dcl p_fast_lock_ptr ptr; /* Pointer to fast lock */ 36 dcl p_code fixed bin (35); /* Status code */ 37 38 /* Automatic */ 39 40 dcl Ap ptr; 41 dcl 1 new_fast_lock aligned like fast_lock; 42 dcl 1 old_fast_lock aligned like fast_lock; 43 dcl Qp ptr; 44 dcl 1 temp_fast_lock_block 45 aligned like fast_lock_block; 46 dcl Wp ptr; 47 48 49 /* Based */ 50 51 dcl A bit (36) aligned based (Ap); 52 dcl Q bit (36) aligned based (Qp); 53 dcl W bit (36) aligned based (Wp); 54 55 /* Static */ 56 57 dcl ME char (18) int static options (constant) init ("lm_init_fast_lock_"); 58 59 /* External */ 60 61 dcl lm_data_$fast_lock_data_ptr 62 ptr external static; 63 dcl lm_data_$lock_list_meters_ptr 64 ptr external static; 65 dcl dm_error_$fast_lock_not_cleared 66 fixed bin (35) external static; 67 dcl dm_error_$fast_lock_no_free 68 fixed bin (35) external static; 69 dcl error_table_$unimplemented_version 70 fixed bin (35) ext static; 71 72 /* Entry */ 73 74 dcl find_fast_lock_data_ 75 entry (ptr, fixed bin (18), fixed bin (35)); 76 dcl hcs_$get_uid_seg entry (ptr, bit (36) aligned, fixed bin (35)); 77 dcl lm_fast_lock_list_$thread_in 78 entry (ptr, ptr, ptr); 79 dcl lm_fast_lock_list_$thread_out_first 80 entry (ptr, ptr, ptr, ptr); 81 dcl sub_err_ entry () options (variable); 82 83 /* Builtin */ 84 85 dcl addr builtin; 86 dcl null builtin; 87 dcl rel builtin; 88 dcl stacq builtin; 89 dcl unspec builtin; 90 91 92 p_code = 0; 93 fast_lock_ptr = p_fast_lock_ptr; 94 95 fast_lock_data_ptr = lm_data_$fast_lock_data_ptr; 96 call CHECK_VERSION (FAST_LOCK_DATA_VERSION_1, fast_lock_data.version, "fast_lock_data"); 97 lock_list_meters_ptr = lm_data_$lock_list_meters_ptr; 98 if lock_list_meters_ptr ^= null () 99 then call CHECK_VERSION (LOCK_LIST_METERS_VERSION_1, lock_list_meters.version, "lock_list_meters"); 100 101 /* Save a copy of the fast lock. Make sure it hasn't been initialized 102* already. */ 103 104 RETRY: 105 unspec (old_fast_lock) = unspec (fast_lock); 106 if old_fast_lock.offset ^= ""b 107 then do; 108 p_code = dm_error_$fast_lock_not_cleared; 109 return; 110 end; 111 112 113 /* Build copy of fast lock block */ 114 115 unspec (temp_fast_lock_block) = ""b; 116 117 call hcs_$get_uid_seg (fast_lock_ptr, temp_fast_lock_block.uid, p_code); 118 if p_code ^= 0 119 then return; 120 121 temp_fast_lock_block.offset = rel (fast_lock_ptr); 122 123 /* Get a free block for the fast lock */ 124 125 call lm_fast_lock_list_$thread_out_first (addr (fast_lock_data.free_list_head), fast_lock_data_ptr, null (), 126 lock_list_block_ptr); 127 if lock_list_block_ptr = null () 128 then do; /* None free */ 129 p_code = dm_error_$fast_lock_no_free; 130 return; 131 end; 132 133 /* Copy the block into the free block */ 134 135 fast_lock_block_ptr = addr (lock_list_block.block_data); 136 unspec (fast_lock_block) = unspec (temp_fast_lock_block); 137 138 /* Fill in the fast lock double-word (this must be last). Watch 139* for races. */ 140 141 unspec (new_fast_lock) = unspec (old_fast_lock); 142 new_fast_lock.offset = rel (lock_list_block_ptr); 143 144 Ap = addr (new_fast_lock.offset); 145 Qp = addr (old_fast_lock.offset); 146 Wp = addr (fast_lock.offset); 147 if ^stacq (W, A, Q) 148 then do; 149 call lm_fast_lock_list_$thread_in (addr (fast_lock_data.free_list_head), lock_list_meters_ptr, 150 lock_list_block_ptr); 151 goto RETRY; 152 end; 153 154 return; 155 156 CHECK_VERSION: 157 proc (cv_p_expected_version, cv_p_received_version, cv_p_structure_name); 158 159 dcl cv_p_expected_version 160 char (8) aligned parameter; 161 dcl cv_p_received_version 162 char (8) aligned parameter; 163 dcl cv_p_structure_name char (32) aligned parameter; 164 165 if cv_p_expected_version ^= cv_p_received_version 166 then call sub_err_ (error_table_$unimplemented_version, ME, ACTION_CANT_RESTART, null (), 0, 167 "^/Expected version ^a of the ^a structure." || "^/Received version ^a instead.", 168 cv_p_expected_version, cv_p_structure_name, cv_p_received_version); 169 end CHECK_VERSION; 170 1 1 /* START OF: dm_fast_lock_strucs.incl.pl1 ... June 1982 * * * * * * * * * * * * * * * * */ 1 2 1 3 /* DESCRIPTION: 1 4* There is a fast_lock_block per segment to be locked. There is a 1 5* fast_lock_wakeup_block per waiter on the lock. The fast*block's are 1 6* taken from the fast_lock_data.list, which is a list of lock_list_block's. 1 7**/ 1 8 1 9 /* HISTORY: 1 10*Written by J. Bongiovanni, 06/15/82. 1 11*Modified: 1 12*10/12/84 by Stanford S. Cox: Added version constants. 1 13*11/14/84 by Stanford S. Cox: Chg to make fast_lock_data.free_list_head 1 14* like lock_list_head. 1 15**/ 1 16 1 17 /* format: style2,^inddcls,ifthenstmt,ifthendo,^indnoniterdo,^inditerdo,ind3,idind32 */ 1 18 dcl fast_lock_ptr ptr; 1 19 dcl fast_lock_block_ptr ptr; 1 20 dcl fast_lock_wakeup_block_ptr ptr; 1 21 dcl fast_lock_data_ptr ptr; 1 22 1 23 dcl FAST_LOCK_DATA_VERSION_1 char (8) aligned init ("fastlk 1") int static options (constant); 1 24 1 25 dcl 1 fast_lock aligned based (fast_lock_ptr), 1 26 /* A fast lock */ 1 27 2 lock_word bit (36) aligned, /* "0"b (unlocked) or processid (locked) */ 1 28 2 notify_sw bit (1) unal, /* ON => notify on unlock */ 1 29 2 pad bit (17) unal, 1 30 2 offset bit (18) unal; /* Offset of block in fast_lock_data */ 1 31 1 32 1 33 dcl 1 fast_lock_block aligned based (fast_lock_block_ptr), 1 34 /* Per-lock info, inner-ring */ 1 35 2 uid bit (36) aligned, /* Unique ID of segment */ 1 36 2 offset bit (18) unal, /* Offset of lock in segment */ 1 37 2 pad bit (18) unal, 1 38 2 list_head bit (18) unal, /* Thread pointer for wakeups */ 1 39 2 mbz bit (18) unal, 1 40 2 pad1 bit (36) aligned; 1 41 1 42 1 43 dcl 1 fast_lock_wakeup_block aligned based (fast_lock_wakeup_block_ptr), 1 44 /* Notify info */ 1 45 2 event_channel fixed bin (71), 1 46 2 processid bit (36) aligned, 1 47 2 message char (4); 1 48 1 49 dcl 1 fast_lock_data aligned based (fast_lock_data_ptr), 1 50 2 version char (8), 1 51 2 size fixed bin, 1 52 2 n_list_entries fixed bin, 1 53 2 free_list_head aligned like lock_list_head, 1 54 2 list fixed bin (71) aligned; 1 55 1 56 /* END OF: dm_fast_lock_strucs.incl.pl1 * * * * * * * * * * * * * * * * */ 171 172 2 1 /* START OF: dm_lock_list_strucs_.incl.pl1 June 1982 * * * * * * * * * * * * * * * * */ 2 2 2 3 /* DESCRIPTION: 2 4* fast_lock_data.free_list_head is lock_list_head. fast_lock_data.list is the 2 5* first two words of lock_list_block. Other lock_list_block's are threaded 2 6* to make a list. block_data is large enough to contain 2 7* fast_lock_wakeup_block (largest fast lock block type). 2 8**/ 2 9 2 10 /* HISTORY: 2 11*Written by John Bongiovanni, 06/15/82. 2 12*Modified: 2 13*10/12/84 by Stanford S. Cox: Added version constants. 2 14*11/14/84 by Stanford S. Cox: Removed lock_list_head.version as fast_lock_data 2 15* has a version. 2 16**/ 2 17 2 18 /* format: style2,^inddcls,ifthenstmt,ifthendo,^indnoniterdo,^inditerdo,ind3,idind32 */ 2 19 dcl lock_list_head_ptr ptr; 2 20 dcl lock_list_block_ptr ptr; 2 21 dcl lock_list_meters_ptr ptr; 2 22 2 23 dcl lock_list_block_words fixed bin; 2 24 2 25 dcl LOCK_LIST_METERS_VERSION_1 char (8) aligned init ("lklsmt 1") int static options (constant); 2 26 2 27 dcl 1 lock_list_head aligned based (lock_list_head_ptr), 2 28 2 firstp bit (18) unal, 2 29 2 mbz bit (18) unal; 2 30 2 31 dcl 1 lock_list_block aligned based (lock_list_block_ptr), 2 32 2 nextp bit (18) unal, 2 33 2 mbz bit (18) unal, 2 34 2 block_words fixed bin (17) unal, 2 35 2 pad bit (18) unal, 2 36 2 block_data (lock_list_block_words refer (lock_list_block.block_words)) bit (36) aligned; 2 37 2 38 dcl 1 lock_list_meters aligned based (lock_list_meters_ptr), 2 39 2 version char (8) aligned, 2 40 2 thrdout_calls fixed bin (35), 2 41 2 thrdin_calls fixed bin (35), 2 42 2 thrdout_steps fixed bin (35), 2 43 2 thrdin_steps fixed bin (35); 2 44 2 45 2 46 /* END OF: dm_lock_list_strucs_.incl.pl1 * * * * * * * * * * * * * * * * */ 173 3 1 /* BEGIN INCLUDE FILE sub_err_flags.incl.pl1 BIM 11/81 */ 3 2 /* format: style3 */ 3 3 3 4 /* These constants are to be used for the flags argument of sub_err_ */ 3 5 /* They are just "string (condition_info_header.action_flags)" */ 3 6 3 7 declare ( 3 8 ACTION_CAN_RESTART init (""b), 3 9 ACTION_CANT_RESTART init ("1"b), 3 10 ACTION_DEFAULT_RESTART 3 11 init ("01"b), 3 12 ACTION_QUIET_RESTART 3 13 init ("001"b), 3 14 ACTION_SUPPORT_SIGNAL 3 15 init ("0001"b) 3 16 ) bit (36) aligned internal static options (constant); 3 17 3 18 /* End include file */ 174 175 176 end lm_init_fast_lock_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 03/05/85 0759.6 lm_init_fast_lock_.pl1 >spec>on>7138.pbf>lm_init_fast_lock_.pl1 171 1 01/07/85 0858.7 dm_fast_lock_strucs.incl.pl1 >ldd>include>dm_fast_lock_strucs.incl.pl1 173 2 01/07/85 0859.2 dm_lock_list_strucs.incl.pl1 >ldd>include>dm_lock_list_strucs.incl.pl1 174 3 04/16/82 0958.1 sub_err_flags.incl.pl1 >ldd>include>sub_err_flags.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 based bit(36) dcl 51 ref 147 ACTION_CANT_RESTART 000000 constant bit(36) initial dcl 3-7 set ref 165* Ap 000100 automatic pointer dcl 40 set ref 144* 147 FAST_LOCK_DATA_VERSION_1 000004 constant char(8) initial dcl 1-23 set ref 96* LOCK_LIST_METERS_VERSION_1 000002 constant char(8) initial dcl 2-25 set ref 98* ME 000006 constant char(18) initial unaligned dcl 57 set ref 165* Q based bit(36) dcl 52 ref 147 Qp 000106 automatic pointer dcl 43 set ref 145* 147 W based bit(36) dcl 53 ref 147 Wp 000114 automatic pointer dcl 46 set ref 146* 147 addr builtin function dcl 85 ref 125 125 135 144 145 146 149 149 block_data 2 based bit(36) array level 2 dcl 2-31 set ref 135 cv_p_expected_version parameter char(8) dcl 159 set ref 156 165 165* cv_p_received_version parameter char(8) dcl 161 set ref 156 165 165* cv_p_structure_name parameter char(32) dcl 163 set ref 156 165* dm_error_$fast_lock_no_free 000016 external static fixed bin(35,0) dcl 67 ref 129 dm_error_$fast_lock_not_cleared 000014 external static fixed bin(35,0) dcl 65 ref 108 error_table_$unimplemented_version 000020 external static fixed bin(35,0) dcl 69 set ref 165* fast_lock based structure level 1 dcl 1-25 set ref 104 fast_lock_block based structure level 1 dcl 1-33 set ref 136* fast_lock_block_ptr 000120 automatic pointer dcl 1-19 set ref 135* 136 fast_lock_data based structure level 1 dcl 1-49 fast_lock_data_ptr 000122 automatic pointer dcl 1-21 set ref 95* 96 125 125 125* 149 149 fast_lock_ptr 000116 automatic pointer dcl 1-18 set ref 93* 104 117* 121 146 free_list_head 4 based structure level 2 dcl 1-49 set ref 125 125 149 149 hcs_$get_uid_seg 000022 constant entry external dcl 76 ref 117 lm_data_$fast_lock_data_ptr 000010 external static pointer dcl 61 ref 95 lm_data_$lock_list_meters_ptr 000012 external static pointer dcl 63 ref 97 lm_fast_lock_list_$thread_in 000024 constant entry external dcl 77 ref 149 lm_fast_lock_list_$thread_out_first 000026 constant entry external dcl 79 ref 125 lock_list_block based structure level 1 dcl 2-31 lock_list_block_ptr 000124 automatic pointer dcl 2-20 set ref 125* 127 135 142 149* lock_list_head based structure level 1 dcl 2-27 lock_list_meters based structure level 1 dcl 2-38 lock_list_meters_ptr 000126 automatic pointer dcl 2-21 set ref 97* 98 98 149* new_fast_lock 000102 automatic structure level 1 dcl 41 set ref 141* null builtin function dcl 86 ref 98 125 125 127 165 165 offset 1(18) 000102 automatic bit(18) level 2 in structure "new_fast_lock" packed unaligned dcl 41 in procedure "lm_init_fast_lock_" set ref 142* 144 offset 1(18) 000104 automatic bit(18) level 2 in structure "old_fast_lock" packed unaligned dcl 42 in procedure "lm_init_fast_lock_" set ref 106 145 offset 1(18) based bit(18) level 2 in structure "fast_lock" packed unaligned dcl 1-25 in procedure "lm_init_fast_lock_" set ref 146 offset 1 000110 automatic bit(18) level 2 in structure "temp_fast_lock_block" packed unaligned dcl 44 in procedure "lm_init_fast_lock_" set ref 121* old_fast_lock 000104 automatic structure level 1 dcl 42 set ref 104* 141 p_code parameter fixed bin(35,0) dcl 36 set ref 30 92* 108* 117* 118 129* p_fast_lock_ptr parameter pointer dcl 35 ref 30 93 rel builtin function dcl 87 ref 121 142 stacq builtin function dcl 88 ref 147 sub_err_ 000030 constant entry external dcl 81 ref 165 temp_fast_lock_block 000110 automatic structure level 1 dcl 44 set ref 115* 136 uid 000110 automatic bit(36) level 2 dcl 44 set ref 117* unspec builtin function dcl 89 set ref 104* 104 115* 136* 136 141* 141 version based char(8) level 2 in structure "lock_list_meters" dcl 2-38 in procedure "lm_init_fast_lock_" set ref 98* version based char(8) level 2 in structure "fast_lock_data" dcl 1-49 in procedure "lm_init_fast_lock_" set ref 96* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ACTION_CAN_RESTART internal static bit(36) initial dcl 3-7 ACTION_DEFAULT_RESTART internal static bit(36) initial dcl 3-7 ACTION_QUIET_RESTART internal static bit(36) initial dcl 3-7 ACTION_SUPPORT_SIGNAL internal static bit(36) initial dcl 3-7 fast_lock_wakeup_block based structure level 1 dcl 1-43 fast_lock_wakeup_block_ptr automatic pointer dcl 1-20 find_fast_lock_data_ 000000 constant entry external dcl 74 lock_list_block_words automatic fixed bin(17,0) dcl 2-23 lock_list_head_ptr automatic pointer dcl 2-19 NAMES DECLARED BY EXPLICIT CONTEXT. CHECK_VERSION 000313 constant entry internal dcl 156 ref 96 98 RETRY 000143 constant label dcl 104 ref 151 lm_init_fast_lock_ 000064 constant entry external dcl 30 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 562 614 405 572 Length 1052 405 32 221 154 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME lm_init_fast_lock_ 176 external procedure is an external procedure. CHECK_VERSION internal procedure shares stack frame of external procedure lm_init_fast_lock_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME lm_init_fast_lock_ 000100 Ap lm_init_fast_lock_ 000102 new_fast_lock lm_init_fast_lock_ 000104 old_fast_lock lm_init_fast_lock_ 000106 Qp lm_init_fast_lock_ 000110 temp_fast_lock_block lm_init_fast_lock_ 000114 Wp lm_init_fast_lock_ 000116 fast_lock_ptr lm_init_fast_lock_ 000120 fast_lock_block_ptr lm_init_fast_lock_ 000122 fast_lock_data_ptr lm_init_fast_lock_ 000124 lock_list_block_ptr lm_init_fast_lock_ 000126 lock_list_meters_ptr lm_init_fast_lock_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry stacq THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. hcs_$get_uid_seg lm_fast_lock_list_$thread_in lm_fast_lock_list_$thread_out_first sub_err_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_error_$fast_lock_no_free dm_error_$fast_lock_not_cleared error_table_$unimplemented_version lm_data_$fast_lock_data_ptr lm_data_$lock_list_meters_ptr LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 30 000060 92 000071 93 000073 95 000076 96 000101 97 000116 98 000122 104 000143 106 000147 108 000152 109 000156 115 000157 117 000162 118 000176 121 000201 125 000203 127 000225 129 000231 130 000235 135 000236 136 000241 141 000247 142 000251 144 000254 145 000260 146 000263 147 000267 149 000273 151 000311 154 000312 156 000313 165 000315 169 000404 ----------------------------------------------------------- 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