COMPILATION LISTING OF SEGMENT ioam_ 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 1018.7 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) 1976 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* * Copyright (c) 1972 by Massachusetts Institute of * 11* * Technology and Honeywell Information Systems, Inc. * 12* * * 13* *********************************************************** */ 14 15 /* format: off */ 16 17 ioam_: proc; 18 19 /* The I/O assignment manager - maintains a table of devices 20* owned by various subsystems so that the subsystem can be 21* notified if the process dies without properly detaching 22* its devices. 23* 24* Rewritten 4/14/76 by Mike Grady. 25**/ 26 27 28 /****^ HISTORY COMMENTS: 29* 1) change(86-09-17,Farley), approve(86-07-18,MCR7439), 30* audit(86-09-24,Fawcett), install(86-10-20,MR12.0-1189): 31* Changed to execute in the BCE environment. 32* END HISTORY COMMENTS */ 33 34 35 dcl devx fixed bin, 36 handler entry, 37 code fixed bin (35), 38 pid bit (36) aligned; 39 40 dcl ioat_uidc char (4) int static init ("ioat") options (constant), 41 ioat_uid bit (36) based (addr (ioat_uidc)); 42 43 dcl pds$processid bit (36) ext, 44 (error_table_$bad_index, 45 error_table_$dev_nt_assnd, 46 error_table_$already_assigned, 47 error_table_$ioat_err) fixed bin (35) ext; 48 49 dcl sys_info$service_system 50 bit (1) aligned external static; 51 52 dcl ignore fixed bin (35), 53 isize fixed bin, 54 i fixed bin; 55 56 dcl (addr, baseno, divide, fixed, hbound, rel, size) builtin; 57 58 dcl syserr_sw bit (1) int static init ("0"b); 59 60 dcl syserr entry options (variable), 61 lock$wait entry (ptr, bit (36), fixed bin (35)), 62 lock$unlock entry (ptr, bit (36)); 63 64 dcl (ioatp, ioatep) ptr, 65 (dseg$, ioat$) fixed bin ext; 66 67 dcl 1 ioat aligned based (ioatp), /* The IO assigment table */ 68 2 lock bit (36), /* lock while doing updates */ 69 2 last_entry fixed bin, /* highest entry used in table */ 70 2 max_entries fixed bin, /* highest entry we can use in table */ 71 2 entries (2048) like ioate; /* the ioat entries */ 72 73 dcl 1 ioate aligned based (ioatep), /* declaration of ioat entries */ 74 2 pid bit (36), /* process id of this devices owner */ 75 2 devx fixed bin, /* device index assigned by dstint */ 76 2 handler entry (fixed bin, fixed bin (35)); /* routine to call when process dies */ 77 1 1 /* BEGIN INCLUDE FILE ... sdw.incl.pl1 ... last modified 12 May 1976 */ 1 2 1 3 dcl sdwp ptr; 1 4 1 5 dcl 1 sdw based (sdwp) aligned, /* Segment Descriptor Word */ 1 6 1 7 (2 add bit (24), /* main memory address of page table */ 1 8 2 (r1, r2, r3) bit (3), /* ring brackets for the segment */ 1 9 2 df bit (1), /* directed fault bit (0 => fault) */ 1 10 2 df_no bit (2), /* directed fault number */ 1 11 1 12 2 pad1 bit (1), 1 13 2 bound bit (14), /* boundary field (in 16 word blocks) */ 1 14 2 access, /* access bits */ 1 15 3 read bit (1), /* read permission bit */ 1 16 3 execute bit (1), /* execute permission bit */ 1 17 3 write bit (1), /* write permission bit */ 1 18 3 privileged bit (1), /* privileged bit */ 1 19 2 unpaged bit (1), /* segment is unpaged if this is 1 */ 1 20 2 entry_bound_sw bit (1), /* if this is 0 the entry bound is checked by hardware */ 1 21 2 cache bit (1), /* cache enable bit */ 1 22 2 entry_bound bit (14)) unaligned; /* entry bound */ 1 23 1 24 dcl 1 sdwa (0: 1) based (sdwp) aligned like sdw; /* SDW array (descriptor segment) */ 1 25 1 26 /* END INCLUDE FILE sdw.incl.pl1 */ 78 79 80 assign: entry (devx, handler, code); /* entry to assign a device to a process */ 81 82 call setup; /* init some stuff and set ptrs */ 83 84 call find_device (code); /* attempt to see if already assigned */ 85 if code = 0 then /* it is already assigned to us */ 86 ioate.handler = handler; /* just update detach handler */ 87 else if code = error_table_$dev_nt_assnd then do; /* if not assigned, then assign it */ 88 call find_free; /* assign new block in ioat */ 89 90 ioate.pid = pds$processid; /* use this processid */ 91 ioate.devx = devx; /* fill in devx and */ 92 ioate.handler = handler; /* the unassign_handler */ 93 code = 0; /* no error */ 94 end; 95 96 if sys_info$service_system then 97 call lock$unlock (ioatp, ioat_uid); /* unlock IOAT */ 98 return; 99 100 101 102 unassign: entry (devx, code); /* entry to unassign a device from this process */ 103 104 call setup; 105 call find_device (code); /* it had better be our device */ 106 if code = 0 then /* it was ours, unassign */ 107 ioate.pid = "0"b; /* clear processid to indicate entry free */ 108 109 if sys_info$service_system then 110 call lock$unlock (ioatp, ioat_uid); 111 return; 112 113 preempt: entry (pid, devx, code); /* entry to force the unassign of a device */ 114 115 call setup; /* setup stuff */ 116 call find_device (code); /* locate the device, it had better be assigned */ 117 if code ^= error_table_$dev_nt_assnd then do; /* if it was assigned at all, dump it */ 118 call ioate.handler (ioate.devx, code); /* call the detach handler */ 119 120 ioate.pid = "0"b; /* mark entry free */ 121 end; 122 123 if sys_info$service_system then 124 call lock$unlock (ioatp, ioat_uid); 125 return; 126 127 128 129 process_release: entry (pid); /* entry to release all devices from a process */ 130 131 ioatp = addr (ioat$); /* make ptr, can't call setup */ 132 if sys_info$service_system then do; 133 call lock$wait (ioatp, ioat_uid, ignore); /* lock the IOAT lock */ 134 if ignore ^= 0 then return; /* some locking error has occured */ 135 end; 136 137 do i = 1 to ioat.last_entry; /* search the table for this processid */ 138 ioatep = addr (ioat.entries (i)); /* get entry ptr */ 139 140 if (ioate.pid ^= "0"b) & (ioate.pid = pid) then do; /* if owned and owned by this guy then */ 141 call ioate.handler (ioate.devx, ignore); /* call unassign handler, ignore code */ 142 ioate.pid = "0"b; /* free the slot */ 143 end; 144 end; 145 146 if sys_info$service_system then 147 call lock$unlock (ioatp, ioat_uid); 148 return; 149 150 setup: proc; /* proc to setup ptrs and validate devx */ 151 152 if (devx < 0) | (devx > hbound (ioat.entries, 1)) then do; /* validate the devx */ 153 code = error_table_$bad_index; 154 goto RETURN; 155 end; 156 157 code = 0; /* initialize the code */ 158 ioatp = addr (ioat$); /* get ptr to the IOAT */ 159 160 if ioat.max_entries = 0 then do; /* init the max size of the IOAT */ 161 sdwp = addr (dseg$); 162 sdwp = addr (sdwa (fixed (baseno (ioatp), 17))); /* get ptr to sdw */ 163 isize = fixed (sdw.bound, 17) * 16; /* get size of seg */ 164 165 isize = isize - fixed (rel (addr (ioat.entries)), 17); /* minus the header */ 166 ioat.max_entries = divide (isize, size (ioate), 17, 0); /* divided by size of an entry */ 167 end; 168 169 if sys_info$service_system then do; 170 call lock$wait (ioatp, ioat_uid, code); /* lock the IOAT */ 171 if code ^= 0 then goto RETURN; /* some locking error */ 172 end; 173 return; 174 175 end; 176 177 178 RETURN: return; /* non-local return */ 179 180 181 find_device: proc (acode); /* proc to find the device in the IOAT */ 182 183 dcl acode fixed bin (35); 184 185 acode = 0; /* init the return code */ 186 do i = 1 to ioat.last_entry; /* loop over whole IOAT */ 187 ioatep = addr (ioat.entries (i)); /* get ptr to entry */ 188 189 if ioate.devx = devx then /* if we found devx then */ 190 if ioate.pid = pds$processid then return; /* and it is this process, we got it */ 191 else if ioate.pid = "0"b then do; /* else if not assigned, say so */ 192 acode = error_table_$dev_nt_assnd; 193 return; 194 end; 195 else do; /* else it is assigned, but not to us */ 196 acode = error_table_$already_assigned; 197 return; 198 end; 199 end; 200 201 acode = error_table_$dev_nt_assnd; /* devx not in table at all */ 202 return; 203 204 end; 205 206 207 208 find_free: proc; 209 210 do i = 1 to ioat.last_entry; /* search the IOAT for a free slot */ 211 ioatep = addr (ioat.entries (i)); /* get ptr to this slot */ 212 if ioate.pid = "0"b then return; /* found a free slot */ 213 end; 214 215 if ioat.last_entry < ioat.max_entries then do; /* if still room in IOAT at end, take one */ 216 ioat.last_entry = ioat.last_entry + 1; /* bump counter */ 217 ioatep = addr (ioat.entries (ioat.last_entry)); /* set ptr */ 218 return; 219 end; 220 221 if ^syserr_sw then /* no more room in table, type message */ 222 call syserr (3, "ioam_: The IOAT is too small, use TBLS config card to increase size."); 223 syserr_sw = "1"b; /* message goes out only once */ 224 code = error_table_$ioat_err; 225 goto RETURN; /* jump back to caller */ 226 227 end; 228 229 230 /* BEGIN MESSAGE DOCUMENTATION 231* 232*Message: 233*ioam_: The IOAT is too small, use TBLS config card to increase size. 234* 235*S: $beep 236* 237*T: $init 238* 239*M: The system was unable to make an entry in the IO Assignment Table. 240*One or more devices may be unattachable. 241* 242*A: $inform 243*Correct the configuration deck before the next bootload. 244* 245* 246*END MESSAGE DOCUMENTATION */ 247 248 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0801.3 ioam_.pl1 >spec>install>1110>ioam_.pl1 78 1 09/14/76 0759.8 sdw.incl.pl1 >ldd>include>sdw.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. acode parameter fixed bin(35,0) dcl 183 set ref 181 185* 192* 196* 201* addr builtin function dcl 56 ref 96 109 123 131 133 138 146 158 161 162 165 170 187 211 217 baseno builtin function dcl 56 ref 162 bound 1(01) based bit(14) level 2 packed packed unaligned dcl 1-5 ref 163 code parameter fixed bin(35,0) dcl 35 set ref 80 84* 85 87 93* 102 105* 106 113 116* 117 118* 153* 157* 170* 171 224* devx parameter fixed bin(17,0) dcl 35 in procedure "ioam_" ref 80 91 102 113 152 152 189 devx 1 based fixed bin(17,0) level 2 in structure "ioate" dcl 73 in procedure "ioam_" set ref 91* 118* 141* 189 divide builtin function dcl 56 ref 166 dseg$ 000034 external static fixed bin(17,0) dcl 64 set ref 161 entries 4 based structure array level 2 dcl 67 set ref 138 152 165 187 211 217 error_table_$already_assigned 000020 external static fixed bin(35,0) dcl 43 ref 196 error_table_$bad_index 000014 external static fixed bin(35,0) dcl 43 ref 153 error_table_$dev_nt_assnd 000016 external static fixed bin(35,0) dcl 43 ref 87 117 192 201 error_table_$ioat_err 000022 external static fixed bin(35,0) dcl 43 ref 224 fixed builtin function dcl 56 ref 162 163 165 handler parameter entry variable dcl 35 in procedure "ioam_" ref 80 85 92 handler 2 based entry variable level 2 in structure "ioate" dcl 73 in procedure "ioam_" set ref 85* 92* 118 141 hbound builtin function dcl 56 ref 152 i 000102 automatic fixed bin(17,0) dcl 52 set ref 137* 138* 186* 187* 210* 211* ignore 000100 automatic fixed bin(35,0) dcl 52 set ref 133* 134 141* ioat based structure level 1 dcl 67 ioat$ 000036 external static fixed bin(17,0) dcl 64 set ref 131 158 ioat_uid based bit(36) packed unaligned dcl 40 set ref 96* 109* 123* 133* 146* 170* ioat_uidc 000000 constant char(4) initial packed unaligned dcl 40 set ref 96 109 123 133 146 170 ioate based structure level 1 dcl 73 set ref 166 ioatep 000106 automatic pointer dcl 64 set ref 85 90 91 92 106 118 118 120 138* 140 140 141 141 142 166 187* 189 189 191 211* 212 217* ioatp 000104 automatic pointer dcl 64 set ref 96* 109* 123* 131* 133* 137 138 146* 152 158* 160 162 165 166 170* 186 187 210 211 215 215 216 216 217 217 isize 000101 automatic fixed bin(17,0) dcl 52 set ref 163* 165* 165 166 last_entry 1 based fixed bin(17,0) level 2 dcl 67 set ref 137 186 210 215 216* 216 217 lock$unlock 000032 constant entry external dcl 60 ref 96 109 123 146 lock$wait 000030 constant entry external dcl 60 ref 133 170 max_entries 2 based fixed bin(17,0) level 2 dcl 67 set ref 160 166* 215 pds$processid 000012 external static bit(36) packed unaligned dcl 43 ref 90 189 pid parameter bit(36) dcl 35 in procedure "ioam_" ref 113 129 140 pid based bit(36) level 2 in structure "ioate" dcl 73 in procedure "ioam_" set ref 90* 106* 120* 140 140 142* 189 191 212 rel builtin function dcl 56 ref 165 sdw based structure level 1 dcl 1-5 sdwa based structure array level 1 dcl 1-24 set ref 162 sdwp 000110 automatic pointer dcl 1-3 set ref 161* 162* 162 163 size builtin function dcl 56 ref 166 sys_info$service_system 000024 external static bit(1) dcl 49 ref 96 109 123 132 146 169 syserr 000026 constant entry external dcl 60 ref 221 syserr_sw 000010 internal static bit(1) initial packed unaligned dcl 58 set ref 221 223* NAMES DECLARED BY EXPLICIT CONTEXT. RETURN 000357 constant label dcl 178 ref 154 171 225 assign 000043 constant entry external dcl 80 find_device 000445 constant entry internal dcl 181 ref 84 105 116 find_free 000516 constant entry internal dcl 208 ref 88 ioam_ 000031 constant entry external dcl 17 preempt 000203 constant entry external dcl 113 process_release 000261 constant entry external dcl 129 setup 000360 constant entry internal dcl 150 ref 82 104 115 unassign 000137 constant entry external dcl 102 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 772 1032 605 1002 Length 1242 605 40 173 165 2 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME ioam_ 158 external procedure is an external procedure. setup internal procedure shares stack frame of external procedure ioam_. find_device internal procedure shares stack frame of external procedure ioam_. find_free internal procedure shares stack frame of external procedure ioam_. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 syserr_sw ioam_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME ioam_ 000100 ignore ioam_ 000101 isize ioam_ 000102 i ioam_ 000104 ioatp ioam_ 000106 ioatep ioam_ 000110 sdwp ioam_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ent_var call_ext_out_desc call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. lock$unlock lock$wait syserr THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dseg$ error_table_$already_assigned error_table_$bad_index error_table_$dev_nt_assnd error_table_$ioat_err ioat$ pds$processid sys_info$service_system LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 17 000030 80 000036 82 000055 84 000056 85 000064 87 000076 88 000101 90 000102 91 000105 92 000110 93 000116 96 000117 98 000132 102 000133 104 000151 105 000152 106 000160 109 000163 111 000176 113 000177 115 000215 116 000216 117 000224 118 000230 120 000241 123 000242 125 000255 129 000256 131 000266 132 000271 133 000273 134 000305 137 000307 138 000317 140 000323 141 000330 142 000340 144 000341 146 000343 148 000356 178 000357 150 000360 152 000361 153 000365 154 000370 157 000371 158 000372 160 000375 161 000377 162 000401 163 000407 165 000414 166 000422 167 000425 169 000426 170 000430 171 000442 173 000444 181 000445 185 000447 186 000450 187 000461 189 000465 191 000475 192 000477 193 000502 196 000503 197 000506 199 000507 201 000511 202 000515 208 000516 210 000517 211 000527 212 000533 213 000536 215 000540 216 000544 217 000545 218 000551 221 000552 223 000576 224 000601 225 000603 ----------------------------------------------------------- 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