COMPILATION LISTING OF SEGMENT find_input_switch_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/18/82 1651.1 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 find_input_switch_: proc (a_info_p, a_block, a_sw_idx, a_code); 12 13 /* This procedure accepts a list of IO switches and searches for the first one in the list which has input 14* available for a successful read operation (get_chars) without blocking. The index of this iocbp 15* in the info structure is returned. If no switch currently has input available, the procedure will 16* either block until input is available or return an index of zero as determined by the a_block bit. 17**/ 18 19 /* Written by J. C. Whitmore, Feb 1980 */ 20 21 dcl a_info_p ptr parameter; /* pointer to the switch info structure (INPUT) */ 22 dcl a_block bit (1); /* TRUE - if we are to block until input is available (INPUT) */ 23 dcl a_sw_idx fixed bin; /* index of iocbp to be read (OUTPUT) */ 24 dcl a_code fixed bin (35); /* system error code (OUTPUT) */ 25 26 27 dcl max_switches fixed bin; 28 dcl idx fixed bin; 29 30 dcl 1 read_info aligned, /* for the read_status control order */ 31 2 read_ev_chan fixed bin (71), 32 2 input_available bit (1) unal; 33 34 dcl 1 wait_info aligned, /* data returned from ipc_$block */ 35 2 ev_chan fixed bin (71), 36 2 ev_msg fixed bin (71), 37 2 sender_proc_id bit (36), 38 2 origin fixed bin, 39 2 wait_list_idx fixed bin; 40 41 dcl convert_ipc_code_ entry (fixed bin (35)); 42 dcl ipc_$block entry (ptr, ptr, fixed bin (35)); 43 dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); 44 45 dcl error_table_$bad_arg fixed bin (35) ext; 46 dcl error_table_$unimplemented_version fixed bin (35) ext; 47 48 dcl addr builtin; 49 1 1 /* BEGIN INCLUDE FILE - find_input_sw_info.incl.pl1 */ 1 2 1 3 /* this is the structure to be used with the find_input_switch_ subroutine */ 1 4 1 5 dcl sw_info_p ptr; /* automatic pointer for the based structure */ 1 6 1 7 dcl 1 sw_info aligned based (sw_info_p), 1 8 2 version fixed bin, /* version of this structure */ 1 9 2 n_iocb_ptrs fixed bin, /* number of active switches in iocbp array */ 1 10 2 iocbp (10) ptr, /* array of iocb ptrs we are using */ 1 11 2 wait_list, /* wait list for blocking on read events */ 1 12 /* there is one entry for each active iocbp */ 1 13 3 n_channels fixed bin, /* must equal n_iocb_ptrs, must be even word aligned */ 1 14 3 pad fixed bin, /* breakage */ 1 15 3 ev_chan (10) fixed bin (71); /* one event channel for each active iocbp */ 1 16 1 17 dcl sw_info_version_1 fixed bin int static options (constant) init (1); 1 18 1 19 /* END INCLUDE FILE - find_input_sw_info.incl.pl1 */ 50 51 52 53 54 a_sw_idx, a_code = 0; /* clear the output values */ 55 sw_info_p = a_info_p; /* set up automatic based references */ 56 57 if sw_info.version ^= sw_info_version_1 then do; /* enforce the version number */ 58 a_code = error_table_$unimplemented_version; 59 return; 60 end; 61 62 max_switches = sw_info.n_iocb_ptrs; /* there is one ipc_ channel per iocbp */ 63 if max_switches ^= sw_info.n_channels then do; /* just a consistency check */ 64 no_go: a_code = error_table_$bad_arg; 65 return; 66 end; 67 68 check_for_input: 69 70 read_info.input_available = "0"b; /* because some IO modules forget to clear this */ 71 72 do idx = 1 to max_switches; 73 74 call iox_$control (sw_info.iocbp (idx), "read_status", addr (read_info), a_code); 75 if a_code ^= 0 then return; 76 77 if read_info.input_available then do; 78 a_sw_idx = idx; 79 return; 80 end; 81 end; 82 83 if ^a_block then return; 84 85 call ipc_$block (addr (sw_info.wait_list), addr (wait_info), a_code); 86 if a_code ^= 0 then do; 87 call convert_ipc_code_ (a_code); 88 return; 89 end; 90 91 go to check_for_input; 92 93 end find_input_switch_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/18/82 1629.5 find_input_switch_.pl1 >dumps>old>recomp>find_input_switch_.pl1 50 1 10/30/80 1648.7 find_input_sw_info.incl.pl1 >ldd>include>find_input_sw_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. a_block parameter bit(1) unaligned dcl 22 ref 11 83 a_code parameter fixed bin(35,0) dcl 24 set ref 11 54* 58* 64* 74* 75 85* 86 87* a_info_p parameter pointer dcl 21 ref 11 55 a_sw_idx parameter fixed bin(17,0) dcl 23 set ref 11 54* 78* addr builtin function dcl 48 ref 74 74 85 85 85 85 convert_ipc_code_ 000010 constant entry external dcl 41 ref 87 error_table_$bad_arg 000016 external static fixed bin(35,0) dcl 45 ref 64 error_table_$unimplemented_version 000020 external static fixed bin(35,0) dcl 46 ref 58 idx 000101 automatic fixed bin(17,0) dcl 28 set ref 72* 74 78* input_available 2 000102 automatic bit(1) level 2 packed unaligned dcl 30 set ref 68* 77 iocbp 2 based pointer array level 2 dcl 1-7 set ref 74* iox_$control 000014 constant entry external dcl 43 ref 74 ipc_$block 000012 constant entry external dcl 42 ref 85 max_switches 000100 automatic fixed bin(17,0) dcl 27 set ref 62* 63 72 n_channels 26 based fixed bin(17,0) level 3 dcl 1-7 set ref 63 n_iocb_ptrs 1 based fixed bin(17,0) level 2 dcl 1-7 ref 62 read_info 000102 automatic structure level 1 dcl 30 set ref 74 74 sw_info based structure level 1 dcl 1-7 sw_info_p 000116 automatic pointer dcl 1-5 set ref 55* 57 62 63 74 85 85 sw_info_version_1 constant fixed bin(17,0) initial dcl 1-17 ref 57 version based fixed bin(17,0) level 2 dcl 1-7 ref 57 wait_info 000106 automatic structure level 1 dcl 34 set ref 85 85 wait_list 26 based structure level 2 dcl 1-7 set ref 85 85 NAMES DECLARED BY EXPLICIT CONTEXT. check_for_input 000045 constant label dcl 68 ref 91 find_input_switch_ 000015 constant entry external dcl 11 no_go 000042 constant label dcl 64 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 266 310 167 276 Length 502 167 22 155 76 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME find_input_switch_ 108 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME find_input_switch_ 000100 max_switches find_input_switch_ 000101 idx find_input_switch_ 000102 read_info find_input_switch_ 000106 wait_info find_input_switch_ 000116 sw_info_p find_input_switch_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. convert_ipc_code_ iox_$control ipc_$block THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_arg error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000010 54 000022 55 000025 57 000030 58 000033 59 000035 62 000036 63 000040 64 000042 65 000044 68 000045 72 000046 74 000055 75 000113 77 000116 78 000120 79 000122 81 000123 83 000125 85 000133 86 000153 87 000156 88 000165 91 000166 ----------------------------------------------------------- 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