COMPILATION LISTING OF SEGMENT rcp_match_ Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 0948.1 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 14 /****^ HISTORY COMMENTS: 15* 1) change(85-09-11,Farley), approve(85-09-11,MCR6979), 16* audit(85-12-02,CLJones), install(86-03-21,MR12.0-1033): 17* Add MCA support 18* END HISTORY COMMENTS */ 19 20 rcp_match_: procedure; 21 22 /* This program is an internal interface of RCP. 23* * Created on 01/29/75 by Bill Silver. 24* * Modified Jan 1985 by Paul Farley to add device_type (8) "MCA". 25* * 26* * This program is called to choose a device that is appropriate for assignment. 27* * It has the following entry points: 28* * 1. match - Given device characteristics that we want to match, see if 29* * a specified test device does match these characteristics. 30* * 2. select - Given a list of devices that match the specified character- 31* * istics, select the best device to assign. 32**/ 33 34 /* ARGUMENT DATA */ 35 36 dcl arg_match_list_ptr ptr; /* (I) Pointer to a list of devices that match. */ 37 dcl arg_match_ptr ptr; /* (I/O) I => match, O => select. */ 38 dcl arg_num_match fixed bin; /* (I) Number of devices in match list. */ 39 dcl arg_test_ptr ptr; /* (I) Pointer to a device to test. */ 40 dcl arg_volume_name char (*); /* (I) Volume to be used with assigned device. */ 41 42 43 /* AUTOMATIC DATA */ 44 45 dcl i fixed bin; 46 dcl low_time fixed bin (71); /* Current earliest time. */ 47 dcl match_density bit (4) aligned; /* Density that we must match. */ 48 dcl match_info_ptr ptr; /* Pointer to info that we must match. */ 49 dcl match_list_ptr ptr; /* Pointer to a list of devices that match. */ 50 dcl match_speed bit (3) aligned; /* Speed that we must match. */ 51 dcl num_match fixed bin; /* Number of devices in match list. */ 52 dcl test_density bit (4) aligned; /* Density of device we are testing. */ 53 dcl test_info_ptr ptr; /* Pointer to info about device we are testing. */ 54 dcl test_speed bit (3) aligned; /* Speed of device we are testing. */ 55 dcl volume_name char (32); /* Volume to be used with assigned device. */ 56 57 58 /* BASED DATA */ 59 60 dcl 1 match_info based (match_info_ptr) like rcse aligned; 61 62 dcl 1 test_info based (test_info_ptr) like rcse aligned; 63 64 dcl match_list (num_match) ptr based (match_list_ptr); 65 66 dcl based_density bit (4) aligned based; 67 68 dcl based_speed bit (3) aligned based; 69 70 /* EXTERNAL ENTRIES CALLED */ 71 72 dcl addr builtin; 73 dcl clock builtin; 74 1 1 /* Begin include file ... rcp_com_seg.incl.pl1 1 2* * 1 3* * Created on 11/20/74 by Bill Silver. 1 4* * Modified on 09/19/77 by R.J.C. Kissel to add label authentication bits. 1 5* * Modified on 12/09/78 by Michael R. Jordan to add removable media bit and label_type. 1 6* * Modified 1/79 by R.J.C. Kissel to add disk label authentication bits. 1 7* * Modified 2/79 by Michael R. Jordan to add volume_density. 1 8* * Modified 11/84 by Paul Farley to add fips flag. 1 9* * Modified 1/3/85 by Fawcett to allow room for mca device type 1 10* * Modified 02/85 by Paul Farley to add no_protect and opr_int_available flags. 1 11* * This include file defines the Resource Control Package communication segment. 1 12* * This segment is used to communicate requests between the various internal 1 13* * parts of RCP. 1 14**/ 1 15 1 16 /****^ HISTORY COMMENTS: 1 17* 1) change(85-09-09,Farley), approve(85-09-09,MCR6979), 1 18* audit(85-12-09,CLJones), install(86-03-21,MR12.0-1033): 1 19* Support MCA and FIPS. 1 20* END HISTORY COMMENTS */ 1 21 1 22 dcl lock_info_ptr ptr; /* Pointer to lock info structure. */ 1 23 dcl rcs_ptr ptr; /* Pointer to base of RCS. */ 1 24 dcl rcse_ptr ptr; /* Pointer to an RCS entry. */ 1 25 1 26 dcl 1 based_rcp_id based aligned, /* Overlay of an rcp_id. */ 1 27 (2 id_count fixed bin (17), /* Unique count index. */ 1 28 2 rcse_off bit (18)) unaligned; /* Offset of rcp_com_seg entry. */ 1 29 1 30 dcl 1 rcs based (rcs_ptr) aligned, /* Begin at word zero of rcp_com_seg. */ 1 31 2 lock_info like lock_info, /* Data used to lock this segment. */ 1 32 2 ws_maxs (8) fixed bin (19), /* Max IOI workspace size in words. */ 1 33 2 ws_pmaxs (8) fixed bin (19), /* Max IOI workspace size for priv attachments. */ 1 34 2 to_maxs (8) fixed bin (71), /* Max IOI time-out intervals in microseconds. */ 1 35 2 sys_directory char (32), /* Directory used to define a system process. */ 1 36 2 sys_acs char (32), /* Entry name used to define a system process. */ 1 37 2 acs_directory char (32), /* Directory containing device ACSs. */ 1 38 2 id_count fixed bin (35), /* Counter used to form rcp_id. */ 1 39 2 max_entries fixed bin, /* Maximum number of entries allowed. */ 1 40 2 num_entries fixed bin, /* Total number of entries. */ 1 41 2 first_free_off bit (18), /* Offset of first free entry. */ 1 42 2 entry (0 refer (rcs.num_entries)) /* Array of request entries. */ 1 43 like rcse, /* See structure below. */ 1 44 2 end bit (36); /* End of rcp_com_seg. */ 1 45 1 46 dcl 1 lock_info based (lock_info_ptr) aligned, /* Used to meter locking. */ 1 47 2 lock bit (36), /* The lock itself. */ 1 48 2 num_locks fixed bin (35), /* Number of times locked. */ 1 49 2 num_lock_waits fixed bin (35), /* Number of lock waits. */ 1 50 2 time_of_lock fixed bin (71), /* Time of last lock. */ 1 51 2 tot_lock_time fixed bin (71), /* Total time locked. */ 1 52 2 tot_wait_time fixed bin (71), /* Total time waiting for lock. */ 1 53 2 starting_time fixed bin (71); /* Time metering started. */ 1 54 1 55 dcl 1 rcse based (rcse_ptr) aligned, /* Up to state must = rcpd.device. */ 1 56 2 device_name char (8), /* Name of device associated with this entry. */ 1 57 2 volume_name char (32), /* Volume name. Blank => no volume. */ 1 58 2 dtypex fixed bin, /* Device type index. */ 1 59 2 model fixed bin, /* Device model number. */ 1 60 2 num_qualifiers fixed bin, /* Number of device qualifiers. */ 1 61 2 qualifiers (4) fixed bin (35), /* Device qualifiers. */ 1 62 2 state_time fixed bin (71), /* Time device put into current state. */ 1 63 2 state fixed bin, /* 0 - free 1 - assigning 2 - assigned */ 1 64 /* 3 - attaching 4 - attached 5 - completed. */ 1 65 1 66 /* * * * * ** Following fields are unique to RCS entry. */ 1 67 2 kind fixed bin, /* 1 => attach, 2 => assign */ 1 68 2 free_off bit (18), /* Offset of next free entry. 0 => not free. */ 1 69 2 user_off bit (18), /* Offset of next entry in user list. */ 1 70 2 device_off bit (18), /* Offset of device entry in RCPD. */ 1 71 2 volume_off bit (18), /* Offset of volume entry in RCPD. */ 1 72 2 rcse_off bit (18), /* Offset of associated RCS entry. */ 1 73 2 caller_level fixed bin, /* Caller's validation level. */ 1 74 2 disposition bit (1), /* ON => retain, OFF => unassign. */ 1 75 2 flags, /* Special info flags. */ 1 76 (3 device bit (1), /* ON => assigning a specific device. */ 1 77 3 priv bit (1), /* ON => attached with IOI privilege. */ 1 78 3 system bit (1), /* ON => assigned to a system process. */ 1 79 3 t_and_d bit (1), /* ON => T&D attachment. */ 1 80 3 volume bit (1), /* ON => volume associated with this device. */ 1 81 3 writing bit (1), /* ON => writing on volume. */ 1 82 3 have_auth bit (1), /* ON => tape volume authenticated. */ 1 83 3 need_auth bit (1), /* ON => tape volume needs authentication. */ 1 84 3 auth_set bit (1), /* ON => "have_auth" has been set. */ 1 85 3 preload_allowed bit (1), /* ON => preloading of volumes is allowed. */ 1 86 3 preloaded bit (1), /* ON => volume may be loaded on device. */ 1 87 3 not_removable_media bit (1), /* ON => cannot remove volume from device. */ 1 88 3 disk_ss_pack bit (1), /* ON => disk is a storage system volume. */ 1 89 3 disk_copy_of_ss_pack bit (1), /* ON => disk is a copy of a storage system volume. */ 1 90 3 disk_io_pack bit (1), /* ON => disk has label but is not storage system. */ 1 91 3 disk_unregistered bit (1), /* ON => disk is unregistered storage system volume. */ 1 92 3 disk_unreadable bit (1), /* ON => io error reading disk label. */ 1 93 3 must_auto_register bit (1), /* ON => unregistered volume requested */ 1 94 3 fips bit (1), /* ON => FIPS device. */ 1 95 3 no_protect bit (1), /* ON => device has no protect sw. */ 1 96 3 opr_int_available bit (1), /* ON => device connected to MPC with OI button. */ 1 97 3 unused bit (6), 1 98 3 volume_density_index fixed bin (3) unsigned, /* Density of volume */ 1 99 3 label_type fixed bin (6) unsigned)unaligned, /* Type of label read by RCP. */ 1 100 2 rcp_id bit (36), /* ID of this entry. */ 1 101 2 event_id fixed bin (71), /* Caller's event channel ID. */ 1 102 2 process_id bit (36), /* ID of calling process. */ 1 103 2 group_id char (32), /* Group ID of calling process. */ 1 104 2 ecode fixed bin (35), /* Assignment error code. */ 1 105 2 version_num fixed bin, /* Device info version number. */ 1 106 2 workspace_max fixed bin (19), /* Max size of IOI workspace buffer. */ 1 107 2 timeout_max fixed bin (71), /* Max IOI time-out interval. */ 1 108 2 ioi_index fixed bin, /* IOI device index. */ 1 109 2 workspace_ptr ptr, /* Pointer to IOI workspace buffer. */ 1 110 2 caller_comment char (64); /* Caller's comment. */ 1 111 1 112 /* End of include file ... rcp_com_seg.incl.pl1 */ 75 76 /* */ 77 match: entry (arg_match_ptr, arg_test_ptr) returns (bit (1)); 78 79 /* This entry is called to test if a device matches the specified characteristics. 80* * If it does then we will return a value of "1"b. If it does not match then 81* * we will return "0"b. If a device characteristic is not specified then it is not 82* * used in determining whether or not the device matches. 83**/ 84 match_info_ptr = arg_match_ptr; /* Copy arguments. */ 85 test_info_ptr = arg_test_ptr; 86 87 if match_info.device_name ^= " " /* Not blank => looking for specific device. */ 88 then if match_info.device_name = test_info.device_name 89 then return ("1"b); /* This is it. */ 90 else return ("0"b); /* No other testing necessary. */ 91 92 if match_info.model ^= 0 /* If model specified then test. */ 93 then if match_info.model ^= test_info.model 94 then return ("0"b); /* Device model numbers don't match. */ 95 96 goto DTYPE (match_info.dtypex); /* Match other characteristics based on device type. */ 97 98 99 DTYPE (1): /* TAPE */ 100 if match_info.qualifiers (1) ^= 0 /* If tracks specified then test. */ 101 then if match_info.qualifiers (1) ^= test_info.qualifiers (1) 102 then return ("0"b); /* Track types do not match. */ 103 match_density = addr (match_info.qualifiers (2)) -> based_density; 104 test_density = addr (test_info.qualifiers (2)) -> based_density; 105 if (match_density & test_density) ^= match_density 106 then return ("0"b); /* Tape density does not match. */ 107 match_speed = addr (match_info.qualifiers (3)) -> based_speed; 108 test_speed = addr (test_info.qualifiers (3)) -> based_speed; 109 if (match_speed & test_speed) ^= match_speed 110 then return ("0"b); /* Tape speed does not match. */ 111 return ("1"b); /* Everything that had to match did. */ 112 113 114 DTYPE (4): /* PRINTER */ 115 do i = 1 to match_info.num_qualifiers; /* Test each qualifying characteristic. */ 116 if match_info.qualifiers (i) ^= 0 /* If characteristic specified then test. */ 117 then if match_info.qualifiers (i) ^= test_info.qualifiers (i) 118 then return ("0"b); /* No match. */ 119 end; 120 return ("1"b); /* Everything that had to match did. */ 121 122 123 DTYPE (2): /* DISK */ 124 DTYPE (3): /* CONSOLE */ 125 DTYPE (5): /* PUNCH */ 126 DTYPE (6): /* READER */ 127 DTYPE (7): /* SPECIAL */ 128 DTYPE (8): /* MCA */ 129 return ("1"b); /* No characteristics => match. */ 130 /* */ 131 select: entry (arg_match_list_ptr, arg_num_match, arg_volume_name, arg_match_ptr); 132 133 /* This entry is called to select the best device to assign from among 134* * a list of devices that match the assignment requirements. If the 135* * assignment is to be made based upon a volume then if one of devices 136* * has that volume mounted we will choose that device. Otherwise, 137* * we will choose the device that has been in its current state the 138* * longest. 139**/ 140 match_list_ptr = arg_match_list_ptr; /* Copy arguments. */ 141 num_match = arg_num_match; 142 volume_name = arg_volume_name; 143 144 low_time = clock () + 1; /* Start with latest possible time. */ 145 146 do i = 1 to num_match; /* Test each device that matched. */ 147 match_info_ptr = match_list (i); /* Pointer to device info. */ 148 if (volume_name ^= " ") & /* Are we looking for a volume? */ 149 (volume_name = match_info.volume_name) 150 then do; /* Yes, and we found it. Select this device. */ 151 arg_match_ptr = match_info_ptr; 152 return; 153 end; 154 if match_info.state_time < low_time /* Has device been in this state longer? */ 155 then do; /* Yes, for now select this device. */ 156 test_info_ptr = match_info_ptr; 157 low_time = match_info.state_time; 158 end; 159 end; 160 161 arg_match_ptr = test_info_ptr; /* No volume found. */ 162 163 end rcp_match_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0807.0 rcp_match_.pl1 >spec>install>1111>rcp_match_.pl1 75 1 03/27/86 1120.0 rcp_com_seg.incl.pl1 >ldd>include>rcp_com_seg.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 72 ref 103 104 107 108 arg_match_list_ptr parameter pointer dcl 36 ref 131 140 arg_match_ptr parameter pointer dcl 37 set ref 77 84 131 151* 161* arg_num_match parameter fixed bin(17,0) dcl 38 ref 131 141 arg_test_ptr parameter pointer dcl 39 ref 77 85 arg_volume_name parameter char packed unaligned dcl 40 ref 131 142 based_density based bit(4) dcl 66 ref 103 104 based_speed based bit(3) dcl 68 ref 107 108 clock builtin function dcl 73 ref 144 device_name based char(8) level 2 in structure "test_info" dcl 62 in procedure "rcp_match_" ref 87 device_name based char(8) level 2 in structure "match_info" dcl 60 in procedure "rcp_match_" ref 87 87 dtypex 12 based fixed bin(17,0) level 2 dcl 60 ref 96 i 000100 automatic fixed bin(17,0) dcl 45 set ref 114* 116 116 116* 146* 147* lock_info based structure level 1 dcl 1-46 low_time 000102 automatic fixed bin(71,0) dcl 46 set ref 144* 154 157* match_density 000104 automatic bit(4) dcl 47 set ref 103* 105 105 match_info based structure level 1 dcl 60 match_info_ptr 000106 automatic pointer dcl 48 set ref 84* 87 87 92 92 96 99 99 103 107 114 116 116 147* 148 151 154 156 157 match_list based pointer array dcl 64 ref 147 match_list_ptr 000110 automatic pointer dcl 49 set ref 140* 147 match_speed 000112 automatic bit(3) dcl 50 set ref 107* 109 109 model 13 based fixed bin(17,0) level 2 in structure "test_info" dcl 62 in procedure "rcp_match_" ref 92 model 13 based fixed bin(17,0) level 2 in structure "match_info" dcl 60 in procedure "rcp_match_" ref 92 92 num_match 000113 automatic fixed bin(17,0) dcl 51 set ref 141* 146 num_qualifiers 14 based fixed bin(17,0) level 2 dcl 60 ref 114 qualifiers 15 based fixed bin(35,0) array level 2 in structure "match_info" dcl 60 in procedure "rcp_match_" set ref 99 99 103 107 116 116 qualifiers 15 based fixed bin(35,0) array level 2 in structure "test_info" dcl 62 in procedure "rcp_match_" set ref 99 104 108 116 rcse based structure level 1 dcl 1-55 state_time 22 based fixed bin(71,0) level 2 dcl 60 ref 154 157 test_density 000114 automatic bit(4) dcl 52 set ref 104* 105 test_info based structure level 1 dcl 62 test_info_ptr 000116 automatic pointer dcl 53 set ref 85* 87 92 99 104 108 116 156* 161 test_speed 000120 automatic bit(3) dcl 54 set ref 108* 109 volume_name 000121 automatic char(32) packed unaligned dcl 55 in procedure "rcp_match_" set ref 142* 148 148 volume_name 2 based char(32) level 2 in structure "match_info" dcl 60 in procedure "rcp_match_" ref 148 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. based_rcp_id based structure level 1 dcl 1-26 lock_info_ptr automatic pointer dcl 1-22 rcs based structure level 1 dcl 1-30 rcs_ptr automatic pointer dcl 1-23 rcse_ptr automatic pointer dcl 1-24 NAMES DECLARED BY EXPLICIT CONTEXT. DTYPE 000000 constant label array(8) dcl 99 ref 96 match 000037 constant entry external dcl 77 rcp_match_ 000023 constant entry external dcl 20 select 000332 constant entry external dcl 131 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 502 512 444 512 Length 672 444 10 144 36 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME rcp_match_ 95 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME rcp_match_ 000100 i rcp_match_ 000102 low_time rcp_match_ 000104 match_density rcp_match_ 000106 match_info_ptr rcp_match_ 000110 match_list_ptr rcp_match_ 000112 match_speed rcp_match_ 000113 num_match rcp_match_ 000114 test_density rcp_match_ 000116 test_info_ptr rcp_match_ 000120 test_speed rcp_match_ 000121 volume_name rcp_match_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return_mac signal_op ext_entry ext_entry_desc clock_mac NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 20 000022 77 000032 84 000050 85 000053 87 000057 90 000107 92 000122 96 000141 99 000143 103 000162 104 000164 105 000166 107 000204 108 000206 109 000210 111 000226 114 000241 116 000251 119 000274 120 000276 123 000312 131 000325 140 000352 141 000356 142 000360 144 000365 146 000370 147 000377 148 000403 151 000413 152 000414 154 000423 156 000426 157 000427 159 000430 161 000432 163 000434 ----------------------------------------------------------- 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