COMPILATION LISTING OF SEGMENT fm_stream_ Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 03/05/85 0907.1 mst Tue Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION 8*These routines implement stream I/O for Data Management files. They simplify 9*I/O for the simple stream case. We decompose a single stream get/put into 10*seperate gets/puts on each control interval involved. 11**/ 12 13 /* HISTORY: 14*Written by Jeff Ives, 06/22/82. 15*Modified: 16*05/24/84 by R. Michael Tague: Changed the name of the entries from 17* $read and $write to $get_stream and $put_stream. 18* Changed the error handling to return a code instead of signaling 19* an error. 20*12/13/84 by R. Michael Tague: Changed some variable names and generally fixed 21* up due to auditing comments. 22**/ 23 24 /* format: style2 */ 25 26 get_stream: 27 proc (p_opening_id, p_file_offset_in_bytes, p_buffer_ptr, p_buffer_len_in_bytes, p_code); 28 operation_kind = "get"; 29 go to JOIN; 30 31 /* START OF DECLARATIONS */ 32 33 /* Parameters */ 34 35 dcl p_opening_id bit (36) aligned parm; 36 dcl p_file_offset_in_bytes fixed bin (48) parm; 37 dcl p_buffer_ptr ptr parm; 38 dcl p_buffer_len_in_bytes fixed bin (21) parm; 39 dcl p_code fixed bin (35) parm; 40 41 /* Automatic */ 42 43 dcl adjusted_file_first_byte 44 fixed bin (49) init (0); 45 dcl buffer_ptr ptr init (null ()); 46 dcl chunk_ptr ptr init (null ()); 47 dcl ci_first_byte fixed bin (17) init (0); 48 dcl ci_number_of_bytes fixed bin (17) init (0); 49 dcl ci_num fixed bin (27) init (0); 50 dcl code fixed bin (35) init (0); 51 dcl eof_byte fixed bin (49) init (0); 52 dcl file_chunk_first_byte fixed bin (49) init (0); 53 dcl file_first_byte fixed bin (48) init (0); 54 dcl number_of_bytes fixed bin (21) init (0); 55 dcl opening_id bit (36) aligned init (""b); 56 dcl operation_kind char (8) aligned; 57 58 /* Conditions */ 59 /* Based */ 60 /* Builtin */ 61 62 dcl (addcharno, divide, min, mod, null) 63 builtin; 64 65 /* External Variables */ 66 /* External Entries */ 67 68 dcl file_manager_$simple_get 69 entry (bit (36) aligned, fixed bin (27), fixed bin (17), ptr, fixed bin (17), 70 fixed bin (35)); 71 dcl file_manager_$simple_put 72 entry (bit (36) aligned, fixed bin (27), fixed bin (17), ptr, fixed bin (17), 73 fixed bin (35)); 74 75 /* Static */ 76 77 /* END OF DECLARATIONS */ 78 79 put_stream: 80 entry (p_opening_id, p_file_offset_in_bytes, p_buffer_ptr, p_buffer_len_in_bytes, p_code); 81 operation_kind = "put"; 82 go to JOIN; 83 84 JOIN: 85 opening_id = p_opening_id; 86 file_first_byte = p_file_offset_in_bytes; 87 buffer_ptr = p_buffer_ptr; 88 number_of_bytes = p_buffer_len_in_bytes; 89 90 if number_of_bytes = 0 91 then /* Do nothing */ 92 ; 93 else do; 94 eof_byte = file_first_byte + number_of_bytes; 95 if file_first_byte < CI_0_ADDRESSABLE_LENGTH 96 then do; 97 ci_num = 0; 98 ci_first_byte = file_first_byte; 99 chunk_ptr = buffer_ptr; 100 ci_number_of_bytes = 101 min (CI_0_ADDRESSABLE_LENGTH - ci_first_byte, eof_byte - file_first_byte); 102 end; 103 else do; 104 adjusted_file_first_byte = 105 file_first_byte + (CI_ADDRESSABLE_LENGTH - CI_0_ADDRESSABLE_LENGTH); 106 ci_num = divide (adjusted_file_first_byte, CI_ADDRESSABLE_LENGTH, 49); 107 ci_first_byte = mod (adjusted_file_first_byte, CI_ADDRESSABLE_LENGTH); 108 chunk_ptr = buffer_ptr; 109 ci_number_of_bytes = 110 min (CI_ADDRESSABLE_LENGTH - ci_first_byte, eof_byte - file_first_byte); 111 end; 112 file_chunk_first_byte = file_first_byte; 113 code = 0; 114 do while (ci_number_of_bytes ^= 0 & code = 0); 115 if operation_kind = "get" 116 then call file_manager_$simple_get (opening_id, ci_num, ci_first_byte, chunk_ptr, 117 ci_number_of_bytes, code); 118 else call file_manager_$simple_put (opening_id, ci_num, ci_first_byte, chunk_ptr, 119 ci_number_of_bytes, code); 120 ci_num = ci_num + 1; 121 ci_first_byte = 0; 122 chunk_ptr = addcharno (chunk_ptr, ci_number_of_bytes); 123 file_chunk_first_byte = file_chunk_first_byte + ci_number_of_bytes; 124 ci_number_of_bytes = min (CI_ADDRESSABLE_LENGTH, eof_byte - file_chunk_first_byte); 125 end; 126 end; 127 128 p_code = code; 129 return; 130 131 /* START OF INCLUDE FILES */ 1 1 /* BEGIN INCLUDE FILE dm_ci_lengths.incl.pl1 */ 1 2 1 3 /* DESCRIPTION: 1 4* This include file contains constants which are the length in bytes 1 5* of the addressable portion of a control interval. The addressable portion 1 6* is that part of the control interval which callers of file_manager_ 1 7* may access, specifically, everything between the end of the control 1 8* interval header (ci_header) and the control interval trailer (ci_trailer). 1 9* Control interval 0 is slightly different, as it also contains an 1 10* unaddressable portion in which it maintains the file attributes. For 1 11* control interval 0 the addressable portion is everything between the end 1 12* of the control interval header and the beginning of the file attributes. 1 13**/ 1 14 1 15 /* HISTORY: 1 16*Written by Matthew Pierret, 11/02/84. 1 17*Modified: 1 18**/ 1 19 1 20 /* format: style2,ind3 */ 1 21 1 22 dcl CONTROL_INTERVAL_ADDRESSABLE_LENGTH_IN_BYTES 1 23 fixed bin (17) init (4072) int static options (constant); 1 24 1 25 dcl CONTROL_INTERVAL_ZERO_ADDRESSABLE_LENGTH_IN_BYTES 1 26 fixed bin (17) init (3176) int static options (constant); 1 27 1 28 1 29 dcl CI_ADDRESSABLE_LENGTH fixed bin (17) init (4072) int static options (constant); 1 30 1 31 dcl CI_0_ADDRESSABLE_LENGTH 1 32 fixed bin (17) init (3176) int static options (constant); 1 33 1 34 /* END INCLUDE FILE dm_ci_lengths.incl.pl1 */ 132 133 134 end get_stream; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 03/05/85 0759.4 fm_stream_.pl1 >spec>on>7138.pbf>fm_stream_.pl1 132 1 01/07/85 0900.7 dm_ci_lengths.incl.pl1 >ldd>include>dm_ci_lengths.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. CI_0_ADDRESSABLE_LENGTH constant fixed bin(17,0) initial dcl 1-31 ref 95 100 104 CI_ADDRESSABLE_LENGTH 000273 constant fixed bin(17,0) initial dcl 1-29 ref 104 106 107 109 124 addcharno builtin function dcl 62 ref 122 adjusted_file_first_byte 000100 automatic fixed bin(49,0) initial dcl 43 set ref 43* 104* 106 107 buffer_ptr 000102 automatic pointer initial dcl 45 set ref 45* 87* 99 108 chunk_ptr 000104 automatic pointer initial dcl 46 set ref 46* 99* 108* 115* 118* 122* 122 ci_first_byte 000106 automatic fixed bin(17,0) initial dcl 47 set ref 47* 98* 100 107* 109 115* 118* 121* ci_num 000110 automatic fixed bin(27,0) initial dcl 49 set ref 49* 97* 106* 115* 118* 120* 120 ci_number_of_bytes 000107 automatic fixed bin(17,0) initial dcl 48 set ref 48* 100* 109* 114 115* 118* 122 123 124* code 000111 automatic fixed bin(35,0) initial dcl 50 set ref 50* 113* 114 115* 118* 128 divide builtin function dcl 62 ref 106 eof_byte 000112 automatic fixed bin(49,0) initial dcl 51 set ref 51* 94* 100 109 124 file_chunk_first_byte 000114 automatic fixed bin(49,0) initial dcl 52 set ref 52* 112* 123* 123 124 file_first_byte 000116 automatic fixed bin(48,0) initial dcl 53 set ref 53* 86* 94 95 98 100 104 109 112 file_manager_$simple_get 000010 constant entry external dcl 68 ref 115 file_manager_$simple_put 000012 constant entry external dcl 71 ref 118 min builtin function dcl 62 ref 100 109 124 mod builtin function dcl 62 ref 107 null builtin function dcl 62 ref 45 46 number_of_bytes 000120 automatic fixed bin(21,0) initial dcl 54 set ref 54* 88* 90 94 opening_id 000121 automatic bit(36) initial dcl 55 set ref 55* 84* 115* 118* operation_kind 000122 automatic char(8) dcl 56 set ref 28* 81* 115 p_buffer_len_in_bytes parameter fixed bin(21,0) dcl 38 ref 26 79 88 p_buffer_ptr parameter pointer dcl 37 ref 26 79 87 p_code parameter fixed bin(35,0) dcl 39 set ref 26 79 128* p_file_offset_in_bytes parameter fixed bin(48,0) dcl 36 ref 26 79 86 p_opening_id parameter bit(36) dcl 35 ref 26 79 84 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. CONTROL_INTERVAL_ADDRESSABLE_LENGTH_IN_BYTES internal static fixed bin(17,0) initial dcl 1-22 CONTROL_INTERVAL_ZERO_ADDRESSABLE_LENGTH_IN_BYTES internal static fixed bin(17,0) initial dcl 1-25 NAMES DECLARED BY EXPLICIT CONTEXT. JOIN 000072 constant label dcl 84 ref 29 82 get_stream 000046 constant entry external dcl 26 put_stream 000061 constant entry external dcl 79 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 352 366 274 362 Length 550 274 14 145 55 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME get_stream 102 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME get_stream 000100 adjusted_file_first_byte get_stream 000102 buffer_ptr get_stream 000104 chunk_ptr get_stream 000106 ci_first_byte get_stream 000107 ci_number_of_bytes get_stream 000110 ci_num get_stream 000111 code get_stream 000112 eof_byte get_stream 000114 file_chunk_first_byte get_stream 000116 file_first_byte get_stream 000120 number_of_bytes get_stream 000121 opening_id get_stream 000122 operation_kind get_stream THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return mod_fx3 ext_entry divide_fx3 THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. file_manager_$simple_get file_manager_$simple_put NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 43 000017 45 000021 46 000023 47 000024 48 000025 49 000026 50 000027 51 000030 52 000032 53 000033 54 000035 55 000036 26 000041 28 000054 29 000056 79 000057 81 000067 82 000071 84 000072 86 000075 87 000077 88 000102 90 000104 94 000106 95 000111 97 000115 98 000116 99 000120 100 000121 102 000134 104 000135 106 000141 107 000145 108 000150 109 000151 112 000164 113 000166 114 000167 115 000174 118 000223 120 000244 121 000245 122 000246 123 000252 124 000255 125 000266 128 000267 129 000272 ----------------------------------------------------------- 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