COMPILATION LISTING OF SEGMENT tdcm_attach_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/30/82 1338.5 mst Tue 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 /* format: style4,delnl,insnl,indattr,ifthen,dclind9 */ 12 tdcm_attach_: 13 procedure (arg_tsegp, arg_ecode); 14 15 /* This program implements the entry point tdcm_$tdcm_attach. 16* * Created on 02/20/75 by Bill Silver. 17* * Modified 7/79 by R.J.C. Kissel to use version 1 tseg. 18* * 19* * This program is called by tdcm_ to attach a tape drive. No concept of 20* * privilege is recognized. RCP will determine the privilege of the caller. 21* * Since at this time we do not know the name of the tape reel the caller 22* * wants mounted we will not be able to call RCP to make the attachment. 23* * The actual attachment will be made by tdcm_$tdcm_message_. We will use the 24* * first tseg buffer for a temporary IOI workspace. We will return a 0 in the 25* * tseg drive_number field. Thus the tseg will be in an inconsistent state 26* * until the first call to tdcm_$tdcm_message. 27**/ 28 29 dcl arg_ecode fixed bin (35); /* (O) Standard error_table_ code. */ 30 dcl arg_tsegp ptr; /* (I) Pointer to user's tseg. */ 31 32 dcl ecode fixed bin (35); /* Temporary error code. */ 33 34 dcl init_flag bit (1) internal static init ("0"b); 35 36 dcl based_ws_info (size (ws_info)) bit (36) based (ws_ptr); 37 38 dcl (addr, size, string) builtin; 39 40 dcl default_buf_size fixed bin /* tdcm_ I/O buffer size. Room for 2 MST records. */ internal static 41 init (2080); 42 43 dcl convert_ipc_code_ entry (fixed bin (35)); 44 dcl hcs_$assign_channel entry (fixed bin (71), fixed bin (35)); 45 dcl ipc_$create_ev_chn entry (fixed bin (71), fixed bin (35)); 46 dcl tdcm_detach_ entry (ptr, fixed bin (35)); 47 dcl error_table_$unimplemented_version 48 fixed bin (35) external; /* */ 1 1 /* Include segment tseg.incl.pl1 --- declaration for Tape DSM-DCM Interface Segment */ 1 2 /* Modified 10 July 1973 by MJ Grady */ 1 3 /* Modified 7/79 by R.J.C. Kissel to add a version number, tracks, density, and drive_name, and get rid of drive_number. */ 1 4 /* Modified 5 August 1981 by Chris Jones to add speed specification */ 1 5 1 6 /* NB: tape_ansi_cseg.incl.pl1 has a parallel version of this tseg declared in it. Any changes made here MUST 1 7* be made there too. */ 1 8 1 9 /* format: style4,delnl,insnl,indattr,ifthen,dclind9 */ 1 10 dcl ( 1 11 nbuffs init (12), /* # of buffers in structure */ 1 12 max_rec_size init (2080) 1 13 ) fixed bin (17) int static; /* Max # of words that may be transmitted (2 * 1040) */ 1 14 1 15 dcl tsegp ptr; /* Used to access Ring-0/Ring-4 shared structure */ 1 16 dcl tseg_version_2 fixed bin internal static options (constant) init (2); 1 17 1 18 declare 1 tseg based (tsegp) aligned, 1 19 2 version_num fixed bin, 1 20 2 areap ptr, /* pointer to DSM area */ 1 21 2 ev_chan fixed bin (71), /* event channel number */ 1 22 2 write_sw fixed bin (1), /* 0 = read, 1 = write */ 1 23 2 sync fixed bin (1), /* non-zero for synchronous i/o */ 1 24 2 get_size fixed bin (1), /* ON for record sizes to be returned */ 1 25 2 ws_segno bit (18), /* segment number of IOI workspace */ 1 26 2 drive_name char (32), /* physical drive name. */ 1 27 2 tracks fixed bin, /* 0 = 9-track, 1 = 7-track. */ 1 28 2 density bit (36), /* bits are 200, 556, 800 1600, 6250 respectively. */ 1 29 2 speed bit (36), /* bits are 75, 125, 200 ips respectively */ 1 30 2 pad99 bit (36), /* so that buffers start on an evenword boundary */ 1 31 2 buffer_offset fixed bin (12), /* offset (from 1) of first buffer to be processed */ 1 32 2 buffer_count fixed bin (12), /* number of buffers to be processed */ 1 33 2 completion_status fixed bin (2), /* 0 = no pending i/o or no status */ 1 34 /* 1 = normal termination of i/o */ 1 35 /* 2 = non-zero major status from previous i/o */ 1 36 2 hardware_status bit (36) aligned, /* major and sub-status */ 1 37 2 error_buffer fixed bin (12), /* buffer in which i/o error occurred */ 1 38 2 command_count fixed bin (12), /* number of non-data commands to execute */ 1 39 2 command_queue (10) fixed bin (6) aligned, /* non-data-transfer commands */ 1 40 2 bufferptr (12) fixed bin (18) aligned,/* relative ptrs to buffers */ 1 41 2 buffer_size (12) fixed bin (18) aligned,/* size of buffer */ 1 42 2 mode (12) fixed bin (2) aligned, /* 0 = bin, 1 = bcd, 2 = 9 track */ 1 43 2 buffer (12) bit (37440) aligned, /* data buffers - 1040 words */ 1 44 2 dsm_area area ((100 /* strictly nominal */)); 1 45 /* DSM workspace */ 1 46 1 47 /* End include segment tseg.incl.pl1 */ 49 50 /* */ 2 1 /* Begin include file ... tdcm_info.incl.pl1 2 2* * 2 3* * Created on 02/20/75 by Bill Silver. 2 4* * Modified 5/20/77 by Noel I. Morris for DCC. 2 5* * Modified 3/19/82 by J. A. Bush for Marker interrupt processing 2 6* * This include file defines the IOI workspace used by tdcm_. 2 7**/ 2 8 dcl ws_ptr ptr; /* Pointer to base of tdcm_ IOI workspace. */ 2 9 2 10 dcl 1 ws based (ws_ptr) aligned, /* Starts at base of ioi_ workspace. */ 2 11 2 info like ws_info, /* See ws_info structure below. */ 2 12 2 ndt_list (10), /* List of non-data transfer IDCWs. */ 2 13 3 idcw bit (36), /* IDCWs. */ 2 14 2 rw_list (12), /* DCW list for reads and writes. */ 2 15 3 idcw bit (36), /* IDCW. */ 2 16 3 dcw bit (36), /* DCW. */ 2 17 2 mark_tdcw bit (36), /* TDCW to chain the DCW list when processing Markers */ 2 18 2 statq (4) like istat, /* A queue of IOI status entries. */ 2 19 2 pad_ev ptr, /* to force buffer to even location */ 2 20 2 buffer (0 refer (ws.info.buf_size)) bit (36) aligned, 2 21 2 buf_end bit (36); /* Marks end of data buffer. */ 2 22 2 23 dcl 1 ws_info based aligned, /* Control information. */ 2 24 2 flags, /* All flags in one word. */ 2 25 (3 attached bit (1), /* ON => tape drive has been attached. */ 2 26 3 connected bit (1), /* ON => there is a connect in progress. */ 2 27 3 get_size bit (1), /* ON => return actual read count. */ 2 28 3 ndtrans bit (1), /* ON => non-data transfer type connect. */ 2 29 3 reading bit (1), /* ON => connect issued for reading. */ 2 30 3 large_rec bit (1), /* ON => transmitting record longer than 4096 words */ 2 31 3 allow_marker bit (1), /* ON => Set up DCW list for marker interrupt processing */ 2 32 3 good_ws bit (1)) unaligned, /* ON => can get a workspace big enough to satisfy user. */ 2 33 2 buf_size fixed bin, /* Current size of tdcm_ I/O buffer. */ 2 34 2 rcp_id bit (36) aligned, /* ID used to communicate with rcp_. */ 2 35 2 ioix fixed bin, /* Index used to communicate with ioi_. */ 2 36 2 statqx fixed bin, /* Index of current status queue entry. */ 2 37 2 process_id bit (36) aligned, /* User's process ID. */ 2 38 2 tracks fixed bin, /* Temporary place to save track type. */ 2 39 2 wait_list, /* Used to block. */ 2 40 3 num_ev_chans fixed bin, /* Number of channels in list. */ 2 41 3 wait_echan fixed bin (71), /* Used to wait when blocked. */ 2 42 2 fast_echan fixed bin (71), /* Fast event channel used to wait. */ 2 43 2 special_echan fixed bin (71), /* Event call channel for special interrupts. */ 2 44 2 user_echan fixed bin (71), /* Event channel set up by user in tseg. */ 2 45 2 init_echan fixed bin (71), /* Event channel to use after drive attached. */ 2 46 2 meters, /* temporary meters */ 2 47 3 last_io_time fixed bin (71), /* clock time of last data xfer I/O */ 2 48 3 io_delta fixed bin (71), /* total delta times */ 2 49 3 low_delta fixed bin (71), /* lowest time between data xfer i/os */ 2 50 3 high_delta fixed bin (71), /* longest time between data xfer i/os */ 2 51 3 number_ios fixed bin (35), /* number of data xfer i/os */ 2 52 3 block fixed bin (35), /* # of times we went blocked awaiting I/O to complete */ 2 53 3 no_block fixed bin (35), /* # of times status queue precessed w/o going blocked */ 2 54 3 mark_st fixed bin (35), /* # of marker interrupts received */ 2 55 3 term_st fixed bin (35), /* # of term interrupts received */ 2 56 3 term_ne fixed bin (35), /* # of term interrupts received with no error status */ 2 57 3 most_consec_mark fixed bin (35), /* longest burst of marker interrupts processed */ 2 58 3 consec_mark fixed bin (35), /* counter for keeping track of consecutive markers */ 2 59 3 block_count fixed bin, /* highest number of blocks per I/O call */ 2 60 2 subset_size fixed bin, /* max block size of data xfer I/O */ 2 61 2 detachx fixed bin, /* Index that tells what has been set up. */ 2 62 2 disposition bit (1), /* RCP assignment disposition. */ 2 63 2 read_start fixed bin, /* First tseg buffer we are reading into. */ 2 64 2 buffer_size (12) fixed bin, /* Data size in each workspace buffer. */ 2 65 2 ndt_offsetx fixed bin, /* Offset of non-data transfer DCW list. */ 2 66 2 rw_offsetx fixed bin, /* Offset of read/write DCW list. */ 2 67 2 mark_offset fixed bin, /* buffer offset of last marker interrupt */ 2 68 2 error_count fixed bin, /* Count of errors during attachment. */ 2 69 2 read_idcws (0:5) bit (36) aligned, /* An array of read and write IDCW's. */ 2 70 2 write_idcws (0:5) bit (36) aligned; /* One for each possible buffer in 1 connect. */ 2 71 2 72 /* End of include file ... tdcm_info.incl.pl1 */ 51 52 /* */ 3 1 3 2 /* Begin include file ...... ioi_stat.incl.pl1 */ 3 3 /* Last modified 3/24/75 by Noel I. Morris */ 3 4 3 5 dcl isp ptr; /* pointer to status structure */ 3 6 3 7 dcl 1 istat based (isp) aligned, /* I/O Interfacer status structure */ 3 8 2 completion, /* completion flags */ 3 9 (3 st bit (1), /* "1"b if status returned */ 3 10 3 er bit (1), /* "1"b if status indicates error condition */ 3 11 3 run bit (1), /* "1"b if channel still running */ 3 12 3 time_out bit (1)) unal, /* "1"b if time-out occurred */ 3 13 2 level fixed bin (3), /* IOM interrupt level */ 3 14 2 offset fixed bin (18), /* DCW list offset */ 3 15 2 absaddr fixed bin (24), /* absolute address of workspace */ 3 16 2 iom_stat bit (72), /* IOM status */ 3 17 2 lpw bit (72); /* LPW residue */ 3 18 3 19 dcl imp ptr; /* pointer to message structure */ 3 20 3 21 dcl 1 imess based (imp) aligned, /* I/O Interfacer event message structure */ 3 22 (2 completion like istat.completion, /* completion flags */ 3 23 2 pad bit (11), 3 24 2 level bit (3), /* interrupt level */ 3 25 2 offset bit (18), /* DCW list offset */ 3 26 2 status bit (36)) unal; /* first 36 bits of status */ 3 27 3 28 /* End of include file ...... ioi_stat.incl.pl1 */ 3 29 53 54 /* */ 55 tsegp = arg_tsegp; /* Pick up argument. */ 56 57 if tseg.version_num ^= tseg_version_2 then do; 58 arg_ecode = error_table_$unimplemented_version; 59 return; 60 end; 61 62 tseg.ws_segno = "0"b; /* We don't have a real IOI workspace yet. */ 63 ws_ptr = addr (tseg.buffer (1)); /* Use first buffer for temp workspace. */ 64 string (based_ws_info) = "0"b; /* Initialize all info fields to zero. */ 65 66 /* We must set up three event channels. 67* * 1. A user event channel - found in the tseg. 68* * 2. A fast event channel - used to wait for status. 69* * 3. A call event channel - used to handle special interrupts. 70**/ 71 ws.info.wait_list.num_ev_chans = 1; /* Set up the wait list count. */ 72 ws.info.user_echan = tseg.ev_chan; /* Get event channel ID from tseg. */ 73 74 /* Created our main (fast) event channel. */ 75 call hcs_$assign_channel (ws.info.fast_echan, ecode); 76 if ecode ^= 0 /* Did we get a fast channel? */ 77 then do; /* No, get regular channel. */ 78 call ipc_$create_ev_chn (ws.info.fast_echan, ecode); 79 if ecode ^= 0 then do; 80 call convert_ipc_code_ (ecode); 81 goto RETURN; 82 end; 83 end; 84 ws.info.detachx = 1; /* Note that fast channel was created OK. */ 85 ws.info.init_echan = ws.info.fast_echan; /* Start out using the fast channel. */ 86 87 /* Create a regular event channel for special interrupts. */ 88 call ipc_$create_ev_chn (ws.info.special_echan, ecode); 89 if ecode ^= 0 /* When drive attached it becomes a call channel. */ 90 then do; 91 call convert_ipc_code_ (ecode); 92 goto RETURN; 93 end; 94 ws.info.detachx = 2; /* Note that this channel was created OK. */ 95 96 /* Now initialize some fields in the temporary workspace. They will 97* * be copied into the real workspace when we get one. 98**/ 99 ws.info.buf_size = default_buf_size; /* Set up size of tdcm_ I/O buffer. */ 100 if tseg.tracks = 1 /* Save requested track type. */ 101 then ws.info.tracks = 7; /* 1 => seven track. */ 102 else ws.info.tracks = 9; /* Otherwise it is nine track. */ 103 tseg.drive_name = ""; /* Don't let caller think it has a real drive. */ 104 105 RETURN: 106 arg_ecode = ecode; 107 if ecode ^= 0 /* Was there any error? */ 108 then call tdcm_detach_ (ws_ptr, ecode); 109 110 end tdcm_attach_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/30/82 1207.7 tdcm_attach_.pl1 >spec>on>11/30/82>tdcm_attach_.pl1 49 1 06/10/82 1045.4 tseg.incl.pl1 >ldd>include>tseg.incl.pl1 51 2 06/09/82 2051.4 tdcm_info.incl.pl1 >ldd>include>tdcm_info.incl.pl1 53 3 08/17/79 2215.0 ioi_stat.incl.pl1 >ldd>include>ioi_stat.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 38 ref 63 arg_ecode parameter fixed bin(35,0) dcl 29 set ref 12 58* 105* arg_tsegp parameter pointer dcl 30 ref 12 55 based_ws_info based bit(36) array unaligned dcl 36 set ref 64* buf_size 1 based fixed bin(17,0) level 3 dcl 2-10 set ref 99* buffer 112 based bit(37440) array level 2 dcl 1-18 set ref 63 completion based structure level 2 in structure "istat" dcl 3-7 in procedure "tdcm_attach_" completion 150 based structure array level 3 in structure "ws" dcl 2-10 in procedure "tdcm_attach_" convert_ipc_code_ 000010 constant entry external dcl 43 ref 80 91 default_buf_size constant fixed bin(17,0) initial dcl 40 ref 99 detachx 46 based fixed bin(17,0) level 3 dcl 2-10 set ref 84* 94* drive_name 12 based char(32) level 2 dcl 1-18 set ref 103* ecode 000100 automatic fixed bin(35,0) dcl 32 set ref 75* 76 78* 79 80* 88* 89 91* 105 107 107* error_table_$unimplemented_version 000020 external static fixed bin(35,0) dcl 47 ref 58 ev_chan 4 based fixed bin(71,0) level 2 dcl 1-18 ref 72 fast_echan 14 based fixed bin(71,0) level 3 dcl 2-10 set ref 75* 78* 85 hcs_$assign_channel 000012 constant entry external dcl 44 ref 75 info based structure level 2 dcl 2-10 init_echan 22 based fixed bin(71,0) level 3 dcl 2-10 set ref 85* ipc_$create_ev_chn 000014 constant entry external dcl 45 ref 78 88 istat based structure level 1 dcl 3-7 num_ev_chans 10 based fixed bin(17,0) level 4 dcl 2-10 set ref 71* size builtin function dcl 38 ref 64 special_echan 16 based fixed bin(71,0) level 3 dcl 2-10 set ref 88* string builtin function dcl 38 set ref 64* tdcm_detach_ 000016 constant entry external dcl 46 ref 107 tracks 6 based fixed bin(17,0) level 3 in structure "ws" dcl 2-10 in procedure "tdcm_attach_" set ref 100* 102* tracks 22 based fixed bin(17,0) level 2 in structure "tseg" dcl 1-18 in procedure "tdcm_attach_" ref 100 tseg based structure level 1 dcl 1-18 tseg_version_2 constant fixed bin(17,0) initial dcl 1-16 ref 57 tsegp 000102 automatic pointer dcl 1-15 set ref 55* 57 62 63 72 100 103 user_echan 20 based fixed bin(71,0) level 3 dcl 2-10 set ref 72* version_num based fixed bin(17,0) level 2 dcl 1-18 ref 57 wait_list 10 based structure level 3 dcl 2-10 ws based structure level 1 dcl 2-10 ws_info based structure level 1 dcl 2-23 ref 64 ws_ptr 000104 automatic pointer dcl 2-8 set ref 63* 64 71 72 75 78 84 85 85 88 94 99 100 102 107* ws_segno 11 based bit(18) level 2 dcl 1-18 set ref 62* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. imess based structure level 1 dcl 3-21 imp automatic pointer dcl 3-19 init_flag internal static bit(1) initial unaligned dcl 34 isp automatic pointer dcl 3-5 max_rec_size internal static fixed bin(17,0) initial dcl 1-10 nbuffs internal static fixed bin(17,0) initial dcl 1-10 NAMES DECLARED BY EXPLICIT CONTEXT. RETURN 000147 constant label dcl 105 ref 81 92 tdcm_attach_ 000006 constant entry external dcl 12 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 270 312 165 300 Length 526 165 22 177 103 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME tdcm_attach_ 76 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME tdcm_attach_ 000100 ecode tdcm_attach_ 000102 tsegp tdcm_attach_ 000104 ws_ptr tdcm_attach_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. convert_ipc_code_ hcs_$assign_channel ipc_$create_ev_chn tdcm_detach_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 12 000002 55 000013 57 000017 58 000022 59 000024 62 000025 63 000026 64 000030 71 000034 72 000036 75 000040 76 000050 78 000052 79 000064 80 000066 81 000075 84 000076 85 000101 88 000103 89 000114 91 000116 92 000125 94 000126 99 000131 100 000133 102 000142 103 000144 105 000147 107 000152 110 000164 ----------------------------------------------------------- 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