COMPILATION LISTING OF SEGMENT cm_get_bci_header Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 05/06/86 1258.9 mst Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 8 9 10 /****^ HISTORY COMMENTS: 11* 1) change(86-02-27,Pierret), approve(86-02-27,MCR7340), 12* audit(86-04-28,Newcomb), install(86-05-06,MR12.0-1054): 13* Added must_be_zero field to my_ci_parts; 14* END HISTORY COMMENTS */ 15 16 17 /* DESCRIPTION: 18* 19* This routine gets and validates the header (bci_header) of a 20* specified control interval. Four entries each provide this service in a 21* slightly different manner. The bci_header begins at the first word of 22* the addressable portion of the control interval. The caller supplies a 23* pointer (p_bci_header_ptr) to a buffer in which to put the bci_header. 24* The caller must also supply the opening id of the file 25* (p_file_opening_id) in which the specified control interval resides. 26* 27* If called through teh $cm_get_bci_header or $exclusive entrypoints, 28* number of the control interval is specified with the 29* p_control_interval_number parameter. If called through the $exclusive 30* entrypoint, an exclusive lock is obtained on the control interval; 31* otherwise a shared lock is obtained. 32* 33* If called through the $slot or $slot_exclusive entrypoints, the 34* number of the control interval is specified as part of the p_element_id 35* parameter (addr(p_element_id)->element_id.control_interval_id). Also 36* specified is the index into the slot table of an element in p_element_id 37* (addr(p_element_id)->element_id.index). The specified slot is returned, 38* using the caller-supplied buffer at p_datum_slot_ptr. If called through 39* the $slot_exclusive entrypoint, an exclusive lock is obtained. 40* 41* Possible errors are those errors that can be encountered while doing 42* a file_manager_$get, dm_error_$ci_not_allocated if the returned bci_header 43* is all zeroes and dm_error_$misformatted_ci if the returned bci_header 44* does not have a layout type of BASIC_CI_LAYOUT_1. 45**/ 46 47 /* HISTORY: 48* 49*Written by Matthew Pierret, 07/21/82. 50*Modified: 51*10/20/82 by Matthew Pierret: Converted to use file_manager_. 52*01/26/83 by Matthew Pierret: Added $slot and $slot_exclusive entries, 53* obsoleting cm_get_header_and_slot. Changed to return 54* dm_error_$ci_not_allocated if bci_header is all zeroes. 55*10/01/84 by Matthew Pierret: Changed to use my_ci_parts instead of 56* automatic_cip_buffer (an array of fixed bin (71) elements) as 57* the local storage for the ci_parts structure. my_ci_parts is 58* able to change size as the ci_parts structure changes. 59*05/20/85 by S. Cox: Added must_be_zero field to my_ci_parts. 60**/ 61 62 /* format: style2,ind3 */ 63 64 cm_get_bci_header: 65 proc (p_file_opening_id, p_control_interval_number, p_bci_header_ptr, p_code); 66 67 /* START OF DECLARATIONS */ 68 /* Parameter */ 69 70 dcl p_file_opening_id bit (36) aligned parameter; 71 dcl p_control_interval_number 72 fixed bin (24) unsigned parameter; 73 dcl p_bci_header_ptr ptr parameter; 74 dcl p_datum_slot_ptr ptr parameter; 75 dcl p_element_id ptr parameter; 76 dcl p_code fixed bin (35) parameter; 77 78 /* Automatic */ 79 80 dcl (exclusive_get, get_slot) 81 bit (1) aligned; 82 dcl 1 my_ci_parts aligned, 83 2 number_of_parts fixed bin init (-1), 84 2 must_be_zero fixed bin init (0), 85 2 part (2) like ci_parts.part; 86 dcl control_interval_number 87 fixed bin (24) unsigned; 88 dcl slot_number fixed bin (12) unsigned; 89 90 /* Based */ 91 /* Builtin */ 92 93 dcl (addr, null, size, unspec) 94 builtin; 95 96 /* Constant */ 97 98 dcl BYTES_PER_WORD init (4) fixed bin (17) int static options (constant); 99 100 /* Entry */ 101 102 dcl file_manager_$get entry (bit (36) aligned, uns fixed bin (24), ptr, fixed bin (35)); 103 dcl file_manager_$get_exclusive 104 entry (bit (36) aligned, uns fixed bin (24), ptr, fixed bin (35)); 105 106 /* External */ 107 108 dcl ( 109 dm_error_$ci_not_allocated, 110 dm_error_$misformatted_ci 111 ) ext fixed bin (35); 112 113 /* END OF DECLARATIONS */ 114 115 exclusive_get = "0"b; 116 get_slot = "0"b; 117 control_interval_number = p_control_interval_number; 118 go to JOIN; 119 120 121 exclusive: 122 entry (p_file_opening_id, p_control_interval_number, p_bci_header_ptr, p_code); 123 124 exclusive_get = "1"b; 125 get_slot = "0"b; 126 control_interval_number = p_control_interval_number; 127 go to JOIN; 128 129 slot_exclusive: 130 entry (p_file_opening_id, p_bci_header_ptr, p_datum_slot_ptr, p_element_id, p_code); 131 132 exclusive_get = "1"b; 133 get_slot = "1"b; 134 control_interval_number = addr (p_element_id) -> element_id.control_interval_id; 135 slot_number = addr (p_element_id) -> element_id.index; 136 go to JOIN; 137 138 slot: 139 entry (p_file_opening_id, p_bci_header_ptr, p_datum_slot_ptr, p_element_id, p_code); 140 141 exclusive_get = "0"b; 142 get_slot = "1"b; 143 control_interval_number = addr (p_element_id) -> element_id.control_interval_id; 144 slot_number = addr (p_element_id) -> element_id.index; 145 go to JOIN; 146 147 148 JOIN: 149 p_code = 0; 150 bci_header_ptr = p_bci_header_ptr; 151 152 my_ci_parts.number_of_parts = 1; 153 my_ci_parts.part (1).offset_in_bytes = 0; 154 my_ci_parts.part (1).length_in_bytes = size (bci_header) * BYTES_PER_WORD; 155 my_ci_parts.part (1).local_ptr = bci_header_ptr; 156 157 if get_slot 158 then if slot_number > 0 & p_datum_slot_ptr ^= null 159 then 160 do; 161 my_ci_parts.number_of_parts = 2; 162 163 my_ci_parts.part (2).offset_in_bytes = (size (bci_header) + slot_number - 1) * BYTES_PER_WORD; 164 my_ci_parts.part (2).length_in_bytes = BYTES_PER_WORD; 165 my_ci_parts.part (2).local_ptr = p_datum_slot_ptr; 166 end; 167 168 if exclusive_get 169 then call file_manager_$get_exclusive (p_file_opening_id, control_interval_number, addr (my_ci_parts), p_code); 170 else call file_manager_$get (p_file_opening_id, control_interval_number, addr (my_ci_parts), p_code); 171 if p_code = 0 172 then if bci_header.layout_type ^= BASIC_CI_LAYOUT_1 173 then if unspec (bci_header) = "0"b 174 then p_code = dm_error_$ci_not_allocated; 175 else p_code = dm_error_$misformatted_ci; 176 177 return; 178 1 1 /* BEGIN INCLUDE FILE dm_cm_basic_ci.incl.pl1 */ 1 2 1 3 /* DESCRIPTION: 1 4* 1 5* The collection_manager_ manages the structure of the addressable 1 6* portion of a control interval. The addressable portion is that portion of 1 7* a control interval which the file_manager_ will allow the 1 8* collection_manager_ to address. In this description control interval will 1 9* be used to mean the addressable portion of a control interval. 1 10* 1 11* A control interval is divided into four parts: the header, the datum 1 12* position table (also known as the slot table or slots), un-used space and 1 13* used space. The beginning of the header is at offset 0, and the end of the 1 14* used space is at the end of the control interval (curently offset 4072). 1 15* Pictoriarly, a control interval is structured as follows: 1 16* 1 17* ---------------------------------------------------------------------- 1 18* | || | | | | | || || | / / | |/| | | 1 19* | Header || | slot | || un-used space || |/ / /| |/| | | 1 20* | || | table | || || | / / | |/| | | 1 21* | || | | | | | || || |/ / /| |/| | | 1 22* ---------------------------------------------------------------------- 1 23* ^ ^ ^ ^ ^ ^ ^ 1 24* | | | | | | | 1 25* | |...........|.......|...| 1 26* start of used space| | | | 1 27* | | each| 1 28* scattered free space| is a used 1 29* datum 1 30* 1 31* The basic_control_interval structure describes the header 1 32* (basic_control_interval.header, bci_header) and the slots 1 33* (basic_control_interval.datum_position_table, datum_slot for one only). 1 34* Each datum_slot contains the offset (in bytes) and the length (in bits) of 1 35* a datum in the used space. If the offset is equal to FREE_SLOT (declared 1 36* in dm_cm_basic_ci_const.incl.pl1), the slot is un-used. The slot also 1 37* contains flags describing the type of datum (see dm_cm_datum.incl.pl1). 1 38**/ 1 39 1 40 /* HISTORY: 1 41*Written by Matthew Pierret, 02/07/82. 1 42*Modified: 1 43*03/25/82 by Matthew Pierret: Fixed alignment differences basic_control_interval 1 44* and its sub-structures. 1 45*06/14/82 by Matthew Pierret: Removed common header and buffers. Changed 1 46* basic_ci_header to bci_header. Added previous_control_interval. 1 47*07/12/82 by Matthew Pierret: Changed collection_id to be bit (36) aligned. 1 48*10/29/82 by Matthew Pierret: Added flags to datum slots. 1 49*11/10/82 by Matthew Pierret: Removed continued_datum_is_present flag, as it 1 50* is not used. 1 51*03/28/84 by Matthew Pierret: Added the constants BCI_HEADER_LENGTH_IN_BYTES 1 52* and DATUM_POSITION_TABLE_OFFSET_IN_BYTES. 1 53**/ 1 54 1 55 /* format: style2 */ 1 56 dcl 1 basic_control_interval 1 57 aligned based (basic_control_interval_ptr), 1 58 2 header like bci_header, 1 59 2 datum_position_table 1 60 (0 refer (basic_control_interval.number_of_datums)) like datum_slot; 1 61 1 62 1 63 dcl 1 bci_header aligned based (bci_header_ptr), 1 64 2 layout_type char (4) aligned, 1 65 2 collection_id bit (36) aligned, 1 66 2 next_control_interval 1 67 fixed bin (24) uns unal, 1 68 2 previous_control_interval 1 69 fixed bin (24) uns unal, 1 70 2 flags unal, 1 71 3 continuation_datum_is_present 1 72 bit (1) unal, 1 73 3 free_slot_is_present 1 74 bit (1) unal, 1 75 3 must_be_zero bit (4) unal, /* reserved */ 1 76 2 scattered_free_space 1 77 fixed bin (17) unal, 1 78 2 start_of_used_space 1 79 fixed bin (17) unal, 1 80 2 number_of_datums fixed bin (17) unal; 1 81 1 82 dcl 1 datum_slot aligned based (datum_slot_ptr), 1 83 2 flags unal, 1 84 3 special_format_datum 1 85 bit (1) unal, /* reserved */ 1 86 3 is_continued bit (1) unal, 1 87 3 is_continuation bit (1) unal, 1 88 3 mbz bit (1) unal, /* reserved */ 1 89 2 offset_in_bytes fixed bin (15) uns unal, 1 90 2 length_in_bits fixed bin (17) uns unal; 1 91 1 92 dcl basic_control_interval_ptr 1 93 ptr; 1 94 dcl bci_header_ptr ptr; 1 95 dcl datum_slot_ptr ptr; 1 96 1 97 dcl BASIC_CI_LAYOUT_1 char (4) aligned init ("bci1") internal static options (constant); 1 98 1 99 /* END INCLUDE FILE dm_cm_basic_ci.incl.pl1 */ 179 180 2 1 /* BEGIN INCLUDE FILE: dm_ci_parts.incl.pl1 */ 2 2 2 3 /* DESCRIPTION: 2 4* 2 5* This include file contains the ci_parts structure. This structure 2 6* is used across the file_manager_ interface to specify the parts of a 2 7* control interval to get or put. If the number_of parts is equal to 0, 2 8* modules which take ci_parts interpret this case to mean to do everything 2 9* except the actual requested operation, i.e., lock the control interval 2 10* but don't get anything. offset_in_bytes is the 0-originned offset in 2 11* bytes from the beginning of the addressable portion of the control interval. 2 12* An offset_in_bytes which is in the addressable portion is in error. 2 13* Likewise, if offset_in_bytes + length_in_bytes is outside of the addressable 2 14* portion, it is in error. 2 15**/ 2 16 2 17 /* HISTORY: 2 18*Written by Matthew Pierret, 01/28/82. 2 19* (01/28/82 Andre Bensoussan, Design.) 2 20*Modified: 2 21*11/07/84 by Matthew Pierret: To add must_be_zero, initial attributes on 2 22* automatic storge. 2 23**/ 2 24 2 25 /* format: style2,ind3 */ 2 26 2 27 dcl 1 ci_parts aligned based (ci_parts_ptr), 2 28 2 number_of_parts fixed bin (17), 2 29 2 must_be_zero fixed bin, 2 30 2 part (cip_number_of_parts refer (ci_parts.number_of_parts)), 2 31 3 offset_in_bytes fixed bin (17), 2 32 3 length_in_bytes fixed bin (17), 2 33 3 local_ptr ptr; 2 34 2 35 dcl ci_parts_ptr ptr init (null ()); 2 36 dcl cip_number_of_parts fixed bin (17) init (0); 2 37 2 38 2 39 /* BEGIN INCLUDE FILE: dm_ci_parts.incl.pl1 */ 181 182 3 1 /* BEGIN INCLUDE FILE dm_element_id.incl.pl1 */ 3 2 3 3 /* DESCRIPTION: 3 4* 3 5* Contains the declaration of an element identifier. Element 3 6* identifiers consist of two parts, the id (number) of the control interval 3 7* in which the element resides, and the index into the slot table of 3 8* the element in the control interval. The declaration of the element_id 3 9* structure reflects this division of the element identifier. The structure 3 10* is based on the automatic bit string element_id_string because programs 3 11* generally pass bit strings (element_id_string) to each other, then 3 12* interpret the bit string by overlaying the element_id structure ony if 3 13* it is necessary to access the parts of the id. Basing element_id on 3 14* addr(element_id_string) instead of on a pointer removes the necessity 3 15* for always setting that pointer explicitly and guarantees that changes 3 16* made to the string or structure do not get inconsistent. 3 17* 3 18* Changes made to element_id must also be made to datum_id, declared in 3 19* dm_cm_datum.incl.pl1. 3 20**/ 3 21 3 22 /* HISTORY: 3 23*Written by Matthew Pierret, 04/01/82. 3 24*Modified: 3 25*09/24/84 by Matthew Pierret: Added DESCRIPTION section. 3 26**/ 3 27 3 28 /* format: style2,ind3,ll79 */ 3 29 3 30 dcl element_id_string bit (36) aligned; 3 31 3 32 dcl 1 element_id aligned based (addr (element_id_string)), 3 33 2 control_interval_id 3 34 fixed bin (24) unal unsigned, 3 35 2 index fixed bin (12) unal unsigned; 3 36 3 37 3 38 /* END INCLUDE FILE dm_element_id.incl.pl1 */ 183 184 185 end cm_get_bci_header; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/06/86 1257.0 cm_get_bci_header.pl1 >spec>install>1054>cm_get_bci_header.pl1 179 1 01/07/85 0858.0 dm_cm_basic_ci.incl.pl1 >ldd>include>dm_cm_basic_ci.incl.pl1 181 2 01/07/85 0900.8 dm_ci_parts.incl.pl1 >ldd>include>dm_ci_parts.incl.pl1 183 3 01/07/85 0858.5 dm_element_id.incl.pl1 >ldd>include>dm_element_id.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. BASIC_CI_LAYOUT_1 000000 constant char(4) initial dcl 1-97 ref 171 BYTES_PER_WORD constant fixed bin(17,0) initial dcl 98 ref 154 163 164 addr builtin function dcl 93 ref 134 135 143 144 168 168 170 170 bci_header based structure level 1 dcl 1-63 ref 154 163 171 bci_header_ptr 000116 automatic pointer dcl 1-94 set ref 150* 154 155 163 171 171 ci_parts based structure level 1 dcl 2-27 ci_parts_ptr 000120 automatic pointer initial dcl 2-35 set ref 2-35* cip_number_of_parts 000122 automatic fixed bin(17,0) initial dcl 2-36 set ref 2-36* control_interval_id based fixed bin(24,0) level 2 packed unsigned unaligned dcl 3-32 ref 134 143 control_interval_number 000114 automatic fixed bin(24,0) unsigned dcl 86 set ref 117* 126* 134* 143* 168* 170* datum_slot based structure level 1 dcl 1-82 dm_error_$ci_not_allocated 000014 external static fixed bin(35,0) dcl 108 ref 171 dm_error_$misformatted_ci 000016 external static fixed bin(35,0) dcl 108 ref 175 element_id based structure level 1 dcl 3-32 exclusive_get 000100 automatic bit(1) dcl 80 set ref 115* 124* 132* 141* 168 file_manager_$get 000010 constant entry external dcl 102 ref 170 file_manager_$get_exclusive 000012 constant entry external dcl 103 ref 168 get_slot 000101 automatic bit(1) dcl 80 set ref 116* 125* 133* 142* 157 index 0(24) based fixed bin(12,0) level 2 packed unsigned unaligned dcl 3-32 ref 135 144 layout_type based char(4) level 2 dcl 1-63 ref 171 length_in_bytes 3 000102 automatic fixed bin(17,0) array level 3 dcl 82 set ref 154* 164* local_ptr 4 000102 automatic pointer array level 3 dcl 82 set ref 155* 165* must_be_zero 1 000102 automatic fixed bin(17,0) initial level 2 dcl 82 set ref 82* my_ci_parts 000102 automatic structure level 1 dcl 82 set ref 168 168 170 170 null builtin function dcl 93 ref 157 2-35 number_of_parts 000102 automatic fixed bin(17,0) initial level 2 dcl 82 set ref 82* 152* 161* offset_in_bytes 2 000102 automatic fixed bin(17,0) array level 3 dcl 82 set ref 153* 163* p_bci_header_ptr parameter pointer dcl 73 ref 64 121 129 138 150 p_code parameter fixed bin(35,0) dcl 76 set ref 64 121 129 138 148* 168* 170* 171 171* 175* p_control_interval_number parameter fixed bin(24,0) unsigned dcl 71 ref 64 117 121 126 p_datum_slot_ptr parameter pointer dcl 74 ref 129 138 157 165 p_element_id parameter pointer dcl 75 set ref 129 134 135 138 143 144 p_file_opening_id parameter bit(36) dcl 70 set ref 64 121 129 138 168* 170* part 2 000102 automatic structure array level 2 in structure "my_ci_parts" dcl 82 in procedure "cm_get_bci_header" part 2 based structure array level 2 in structure "ci_parts" dcl 2-27 in procedure "cm_get_bci_header" size builtin function dcl 93 ref 154 163 slot_number 000115 automatic fixed bin(12,0) unsigned dcl 88 set ref 135* 144* 157 163 unspec builtin function dcl 93 ref 171 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. basic_control_interval based structure level 1 dcl 1-56 basic_control_interval_ptr automatic pointer dcl 1-92 datum_slot_ptr automatic pointer dcl 1-95 element_id_string automatic bit(36) dcl 3-30 NAMES DECLARED BY EXPLICIT CONTEXT. JOIN 000156 constant label dcl 148 ref 118 127 136 145 cm_get_bci_header 000026 constant entry external dcl 64 exclusive 000051 constant entry external dcl 121 slot 000130 constant entry external dcl 138 slot_exclusive 000100 constant entry external dcl 129 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 412 432 300 422 Length 660 300 20 211 111 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cm_get_bci_header 102 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cm_get_bci_header 000100 exclusive_get cm_get_bci_header 000101 get_slot cm_get_bci_header 000102 my_ci_parts cm_get_bci_header 000114 control_interval_number cm_get_bci_header 000115 slot_number cm_get_bci_header 000116 bci_header_ptr cm_get_bci_header 000120 ci_parts_ptr cm_get_bci_header 000122 cip_number_of_parts cm_get_bci_header THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. file_manager_$get file_manager_$get_exclusive THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_error_$ci_not_allocated dm_error_$misformatted_ci LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 82 000011 2 35 000014 2 36 000016 64 000021 115 000041 116 000042 117 000043 118 000046 121 000047 124 000064 125 000066 126 000067 127 000072 129 000073 132 000113 133 000115 134 000116 135 000122 136 000125 138 000126 141 000143 142 000144 143 000146 144 000152 145 000155 148 000156 150 000157 152 000162 153 000164 154 000165 155 000170 157 000171 161 000201 163 000203 164 000210 165 000212 168 000215 170 000237 171 000256 175 000274 177 000277 ----------------------------------------------------------- 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