COMPILATION LISTING OF SEGMENT attach_lv Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1723.0 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 attach_lv: alv: procedure; 12 13 /* This program is a command that may be called to attach a logical volume. 14* * Created on 04/07/76 by Bill Silver. 15* * 16* * Its calling sequence is: 17* * 18* * attach_lv volume_name 19* * 20* * volume_name The name of the logical volume to be attached. 21**/ 22 23 /* Modified 6/82 by F. W. Martinson to check number of arguments */ 24 /* AUTOMATIC DATA */ 25 26 dcl 1 info_buffer like lv_info; /* An input logical volume info buffer. */ 27 28 dcl 1 wait_list, /* Structure used to block. */ 29 2 num_chans fixed bin, /* Number of event channels to wait for. */ 30 2 channel fixed bin (71); /* The only channel we will use. */ 31 32 dcl 1 event_data, /* Event message structure, not used. */ 33 2 channel_id fixed bin (71), 34 2 message fixed bin (71), 35 2 sender bit (36), 36 2 origin bit (36), 37 2 data_ptr ptr; 38 39 dcl arg_len fixed bin; /* Length of an argument string. */ 40 dcl arg_ptr ptr; /* Pointer to an argument string. */ 41 dcl ecode fixed bin (35); /* error_table_ code. */ 42 dcl num_args fixed bin; /* Number of command arguments. */ 43 dcl rcp_id bit (36) aligned; /* RCP ID for this attach operation. */ 44 dcl statex fixed bin; /* State of device assignment. */ 45 dcl volume_name char (32); /* Volume name. */ 46 47 48 /* BASED DATA */ 49 50 dcl argument char (arg_len) based (arg_ptr); /* Used to reference argument string. */ 51 52 53 /* EXTERNAL ENTRIES CALLED */ 54 55 dcl cleanup condition; /* Used to unassign if trouble. */ 56 57 dcl (addr) builtin; 58 59 dcl (error_table_$noarg, 60 error_table_$notacted, 61 error_table_$too_many_args) fixed bin (35) external; 62 63 dcl com_err_ entry options (variable); 64 dcl convert_ipc_code_ entry (fixed bin (35)); 65 dcl cu_$arg_count entry (fixed bin); 66 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 67 dcl ioa_ entry options (variable); 68 dcl ipc_$block entry (ptr, ptr, fixed bin (35)); 69 dcl ipc_$create_ev_chn entry (fixed bin (71), fixed bin (35)); 70 dcl ipc_$delete_ev_chn entry (fixed bin (71), fixed bin (35)); 71 dcl rcp_$attach_lv entry (ptr, fixed bin (71), bit (36) aligned, fixed bin (35)); 72 dcl rcp_$check_attach_lv entry (bit (36) aligned, ptr, fixed bin, fixed bin (35)); 73 dcl rcp_$detach_lv entry (bit (36) aligned, fixed bin (35)); 74 /* */ 1 1 /* Begin include file rcp_lv_info.incl.pl1 1 2** 1 3** Created on 04/02/76 by Bill Silver. 1 4** This include file defines the RCP lv info structure. 1 5**/ 1 6 dcl lv_info_ptr ptr; /* Pointer to lv info structure. */ 1 7 1 8 dcl rlvi_version_1 fixed bin internal static init (1); 1 9 1 10 dcl 1 lv_info based(lv_info_ptr) aligned, /* RCP lv info structure. */ 1 11 2 version_num fixed bin, /* Version number of this structure. */ 1 12 2 usage_time fixed bin, /* Number of minutes lv will/may be used. */ 1 13 2 wait_time fixed bin, /* Number of minutes user will/must wait. */ 1 14 2 system_flag bit(1), /* ON => user wants to be a system process. */ 1 15 2 volume_name char(32); /* Logical volume name. */ 1 16 1 17 /* End of include file ... rcp_lv_info.incl.pl1 */ 75 76 /* */ 77 /* Begin command: attach_lv, alv 78**/ 79 ecode, /* Now initialize variables. */ 80 wait_list.channel = 0; 81 wait_list.num_chans = 1; 82 83 lv_info_ptr = addr (info_buffer); /* Set up volume info structure. */ 84 85 lv_info.version_num = rlvi_version_1; /* Assume version. */ 86 lv_info.usage_time, /* These fields not used yet. */ 87 lv_info.wait_time = 0; 88 lv_info.system_flag = "0"b; /* System process concept not supported yet. */ 89 90 call GET_VOLUME_INFO; /* Get volume name. */ 91 if ecode ^= 0 then return; 92 93 lv_info.volume_name = volume_name; 94 95 rcp_id = "0"b; /* No RCP ID yet. */ 96 97 on cleanup begin; /* If user quits detach logical volume. */ 98 call CLEANUP; 99 end; 100 101 call ipc_$create_ev_chn (wait_list.channel, ecode); 102 if ecode ^= 0 /* RCP needs an event channel. */ 103 then do; /* But we don't have one. */ 104 call convert_ipc_code_ (ecode); 105 call com_err_ (ecode, "attach_lv", "Error creating event channel."); 106 return; 107 end; 108 109 call rcp_$attach_lv (lv_info_ptr, wait_list.channel, rcp_id, ecode); 110 if ecode ^= 0 /* Was attach started OK? */ 111 then do; /* No. */ 112 call com_err_ (ecode, "attach_lv", "Error attaching ^a", volume_name); 113 call CLEANUP; 114 return; 115 end; 116 117 ATTACH_LOOP: /* Loop until attachment completed. */ 118 call rcp_$check_attach_lv (rcp_id, lv_info_ptr, statex, ecode); 119 120 goto STATE (statex); /* Process current state of attachment. */ 121 122 STATE (0): /* Attachment completed OK. */ 123 rcp_id = "0"b; /* Don't detach now. */ 124 call CLEANUP; /* Cleanup event channel. */ 125 call ioa_ ("^a attached", volume_name); 126 return; 127 128 STATE (1): /* Short wait, block until wakeup comes. */ 129 call ipc_$block (addr (wait_list), addr (event_data), ecode); 130 if ecode ^= 0 /* Error in blocking is bad. */ 131 then do; 132 call convert_ipc_code_ (ecode); 133 call com_err_ (ecode, "attach_lv", "Error waiting for attach."); 134 call CLEANUP; 135 return; 136 end; 137 goto ATTACH_LOOP; /* Waked up, check attach again. */ 138 139 STATE (2): /* Long wait, don't support this yet. */ 140 ecode = error_table_$notacted; 141 142 STATE (3): /* Fatal error. */ 143 call com_err_ (ecode, "attach_lv", "Error attaching ^a", volume_name); 144 call CLEANUP; 145 return; 146 /* */ 147 CLEANUP: procedure; 148 149 /* This procedure is called when the attachment has been aborted. 150* * If we have an RCP ID we will try to detach the volume we are attaching. 151* * If we have created an event channel then we must delete it. 152**/ 153 if rcp_id ^= "0"b /* If we have an RCP ID try to detach. */ 154 then call rcp_$detach_lv (rcp_id, ecode); 155 156 if wait_list.channel = 0 then return; /* Did we created an event channel? */ 157 158 call ipc_$delete_ev_chn (wait_list.channel, ecode); 159 if ecode ^= 0 160 then do; 161 call convert_ipc_code_ (ecode); 162 call com_err_ (ecode, "attach_lv", "Deleting event channel."); 163 end; 164 165 end CLEANUP; 166 /* */ 167 GET_VOLUME_INFO: procedure; 168 169 /* This procedure is called to get the volume name. 170**/ 171 call cu_$arg_count (num_args); /* Get number of arguments. */ 172 173 if num_args ^= 1 then do; /* Is there a volume name argument. */ 174 if num_args = 0 then ecode = error_table_$noarg; /* No. */ 175 else ecode = error_table_$too_many_args; 176 call com_err_ (ecode, "attach_lv", "One argument required"); 177 return; 178 end; 179 180 call cu_$arg_ptr (1, arg_ptr, arg_len, ecode); /* Get volume name argument. */ 181 if ecode ^= 0 182 then do; 183 call com_err_ (ecode, "attach_lv", "Error getting volume name argument"); 184 return; 185 end; 186 187 volume_name = argument; /* Save the volume name argument. */ 188 189 end GET_VOLUME_INFO; 190 191 end attach_lv; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1606.5 attach_lv.pl1 >dumps>old>recomp>attach_lv.pl1 75 1 05/20/76 0630.6 rcp_lv_info.incl.pl1 >ldd>include>rcp_lv_info.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. addr builtin function dcl 57 ref 83 128 128 128 128 arg_len 000130 automatic fixed bin(17,0) dcl 39 set ref 180* 187 arg_ptr 000132 automatic pointer dcl 40 set ref 180* 187 argument based char unaligned dcl 50 ref 187 channel 2 000114 automatic fixed bin(71,0) level 2 dcl 28 set ref 79* 101* 109* 156 158* cleanup 000150 stack reference condition dcl 55 ref 97 com_err_ 000016 constant entry external dcl 63 ref 105 112 133 142 162 176 183 convert_ipc_code_ 000020 constant entry external dcl 64 ref 104 132 161 cu_$arg_count 000022 constant entry external dcl 65 ref 171 cu_$arg_ptr 000024 constant entry external dcl 66 ref 180 ecode 000134 automatic fixed bin(35,0) dcl 41 set ref 79* 91 101* 102 104* 105* 109* 110 112* 117* 128* 130 132* 133* 139* 142* 153* 158* 159 161* 162* 174* 175* 176* 180* 181 183* error_table_$noarg 000010 external static fixed bin(35,0) dcl 59 ref 174 error_table_$notacted 000012 external static fixed bin(35,0) dcl 59 ref 139 error_table_$too_many_args 000014 external static fixed bin(35,0) dcl 59 ref 175 event_data 000120 automatic structure level 1 unaligned dcl 32 set ref 128 128 info_buffer 000100 automatic structure level 1 unaligned dcl 26 set ref 83 ioa_ 000026 constant entry external dcl 67 ref 125 ipc_$block 000030 constant entry external dcl 68 ref 128 ipc_$create_ev_chn 000032 constant entry external dcl 69 ref 101 ipc_$delete_ev_chn 000034 constant entry external dcl 70 ref 158 lv_info based structure level 1 dcl 1-10 lv_info_ptr 000156 automatic pointer dcl 1-6 set ref 83* 85 86 86 88 93 109* 117* num_args 000135 automatic fixed bin(17,0) dcl 42 set ref 171* 173 174 num_chans 000114 automatic fixed bin(17,0) level 2 dcl 28 set ref 81* rcp_$attach_lv 000036 constant entry external dcl 71 ref 109 rcp_$check_attach_lv 000040 constant entry external dcl 72 ref 117 rcp_$detach_lv 000042 constant entry external dcl 73 ref 153 rcp_id 000136 automatic bit(36) dcl 43 set ref 95* 109* 117* 122* 153 153* rlvi_version_1 constant fixed bin(17,0) initial dcl 1-8 ref 85 statex 000137 automatic fixed bin(17,0) dcl 44 set ref 117* 120 system_flag 3 based bit(1) level 2 dcl 1-10 set ref 88* usage_time 1 based fixed bin(17,0) level 2 dcl 1-10 set ref 86* version_num based fixed bin(17,0) level 2 dcl 1-10 set ref 85* volume_name 000140 automatic char(32) unaligned dcl 45 in procedure "alv" set ref 93 112* 125* 142* 187* volume_name 4 based char(32) level 2 in structure "lv_info" dcl 1-10 in procedure "alv" set ref 93* wait_list 000114 automatic structure level 1 unaligned dcl 28 set ref 128 128 wait_time 2 based fixed bin(17,0) level 2 dcl 1-10 set ref 86* NAMES DECLARED BY EXPLICIT CONTEXT. ATTACH_LOOP 000324 constant label dcl 117 ref 137 CLEANUP 000532 constant entry internal dcl 147 ref 98 113 124 134 144 GET_VOLUME_INFO 000633 constant entry internal dcl 167 ref 90 STATE 000000 constant label array(0:3) dcl 122 ref 120 alv 000102 constant entry external dcl 11 attach_lv 000111 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1170 1234 771 1200 Length 1446 771 44 176 177 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME alv 208 external procedure is an external procedure. on unit on line 97 64 on unit CLEANUP 90 internal procedure is called by several nonquick procedures. GET_VOLUME_INFO internal procedure shares stack frame of external procedure alv. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME alv 000100 info_buffer alv 000114 wait_list alv 000120 event_data alv 000130 arg_len alv 000132 arg_ptr alv 000134 ecode alv 000135 num_args alv 000136 rcp_id alv 000137 statex alv 000140 volume_name alv 000156 lv_info_ptr alv THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out call_int_this call_int_other return enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. com_err_ convert_ipc_code_ cu_$arg_count cu_$arg_ptr ioa_ ipc_$block ipc_$create_ev_chn ipc_$delete_ev_chn rcp_$attach_lv rcp_$check_attach_lv rcp_$detach_lv THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$noarg error_table_$notacted error_table_$too_many_args LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000101 79 000116 81 000121 83 000123 85 000125 86 000127 88 000131 90 000132 91 000133 93 000135 95 000141 97 000142 98 000156 99 000163 101 000164 102 000175 104 000177 105 000206 106 000237 109 000240 110 000255 112 000257 113 000317 114 000323 117 000324 120 000341 122 000343 124 000344 125 000350 126 000371 128 000372 130 000411 132 000413 133 000422 134 000453 135 000457 137 000460 139 000461 142 000464 144 000524 145 000530 147 000531 153 000537 156 000552 158 000555 159 000566 161 000571 162 000600 165 000632 167 000633 171 000634 173 000643 174 000646 175 000654 176 000657 177 000707 180 000710 181 000727 183 000731 184 000762 187 000763 189 000770 ----------------------------------------------------------- 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