COMPILATION LISTING OF SEGMENT rcp_mount_timer_poll_ 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 1029.0 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 rcp_mount_timer_poll_$init_rcp_mount_timers: init: procedure; 14 15 /* rcp_mount_timer_poll_ Bernard Greenberg 10/28/76 16* Designed by Greenberg and Silver */ 17 18 /* A brother of lv_request_, a friend of rcp_ */ 19 20 /* Critical internal static variables */ 21 22 dcl RCP_RING fixed bin static init (1); /* changes for test entry */ 23 dcl DELTA fixed bin (71) static init (240000000); /* 4 minutes */ 24 dcl SL0 fixed bin static init (0); /* similarly */ 25 dcl channel fixed bin (71) static init (0); /* event channel for all doings */ 26 dcl my_processid bit (36) aligned static init ("0"b); 27 dcl hx fixed bin static init (1); /* first available table index */ 28 29 dcl 1 tbl (100) static internal, /* the actual polling table */ 30 2 time fixed bin (71) aligned, /* maturation time */ 31 2 off bit (18) aligned; /* rcp identifying offset */ 32 33 /* DIVERS CONSTANTS */ 34 35 dcl ABS_MICROSECONDS bit (2) static init ("00"b) options (constant); /* for timer_manager_ */ 36 dcl ALARM___ char (8) static init ("alarm___") options (constant); 37 dcl KEY char (4) static init ("rcmt") options (constant); /* RCP messages */ 38 dcl myname char (32) init ("rcp_mount_timer_poll_") static options (constant); 39 40 41 /* AUTOMATIC STORAGE */ 42 43 dcl i fixed bin; 44 dcl now fixed bin (71); 45 dcl recheck_flag bit (1) aligned; 46 dcl sender bit (36) aligned; 47 dcl code fixed bin (35); 48 49 /* Format of transmissions from RCP */ 50 51 dcl 1 mess, 52 2 key char (4), /* "rcmt" */ 53 2 off bit (18) unaligned, /* rcp_data_ offset */ 54 2 mbz bit (18) unaligned; /* like it says */ 55 56 /* BASED */ 57 58 dcl mptr ptr parameter; /* sorta like based */ 59 60 /* IPC message format */ 61 62 dcl 1 evmsg based (mptr) aligned, 63 2 channel fixed bin (71), 64 2 data bit (72), /* transmission */ 65 2 pid bit (36), /* sender */ 66 2 devsignal fixed bin (17) unaligned, 67 2 ring fixed bin (17) unaligned; 68 69 /* ENTRIES */ 70 71 dcl (sys_log_, sys_log_$error_log) entry options (variable); 72 dcl ipc_$create_ev_chn entry (fixed bin (71), fixed bin (35)); 73 dcl ipc_$decl_ev_call_chn entry (fixed bin (71), entry, ptr, fixed bin, fixed bin (35)); 74 dcl timer_manager_$alarm_wakeup entry (fixed bin (71), bit (2), fixed bin (71)); 75 dcl rcp_sys_$init_mount_timer entry (fixed bin (71), fixed bin (35)); 76 dcl rcp_sys_$check_mount_timer entry (bit (18) aligned, bit (1) aligned, fixed bin (35)); 77 dcl clock_ entry returns (fixed bin (52)); 78 dcl get_process_id_ entry returns (bit (36) aligned); 79 dcl get_ring_ entry returns (fixed bin); 80 81 82 /* ------------------------------------------------------- */ 83 84 /* Init entry point */ 85 86 87 unspec (tbl) = "0"b; /* for test re-inits */ 88 89 my_processid = "0"b; /* ditto */ 90 hx = 1; 91 92 93 call ipc_$create_ev_chn (channel, code); 94 if code ^= 0 then do; 95 call sys_log_$error_log (2, code, myname, "Cannot create event channel"); 96 return; 97 end; 98 99 call ipc_$decl_ev_call_chn (channel, interrupt, null (), 10, code); 100 if code ^= 0 then do; 101 call sys_log_$error_log (2, code, myname, "Cannot declare event call channel"); 102 return; 103 end; 104 105 call rcp_sys_$init_mount_timer (channel, code); 106 107 if code ^= 0 then do; 108 call sys_log_$error_log (2, code, myname, "Error from rcp_sys_$init_mount_timer"); 109 return; 110 end; 111 112 my_processid = get_process_id_ (); 113 return; 114 115 116 117 118 /* -------------------------------------------------------- */ 119 interrupt: entry (mptr); 120 121 if my_processid = "0"b then return; /* ignore if not init */ 122 123 /* Entry for timer interrupts and RCP wakeups */ 124 125 now = clock_ (); 126 127 if ^legal_message () 128 then return; 129 130 if ^good_message () 131 then do; 132 call sys_log_ (SL0, "^a: Bad message from pid ^w: ^w ^w", myname, sender, evmsg.data); 133 return; 134 end; 135 136 if mess.key = KEY then do; /* Slot wanted */ 137 138 do i = 1 by 1 while (i < hx); 139 if tbl (i).off = mess.off then do; 140 call set_timer (i); /* Simply reorganize slot. */ 141 return; 142 end; 143 end; 144 145 if hx > hbound (tbl, 1) then do; 146 call sys_log_ (SL0, "^a: No slot available for pid ^w, ^o", myname, sender, fixed (mess.off, 18)); 147 return; 148 end; 149 150 151 hx = hx + 1; 152 tbl (i).off = mess.off; 153 call set_timer (i); 154 return; 155 end; 156 else if unspec (evmsg.data) = unspec (ALARM___) then do; /* a timer */ 157 do i = 1 by 1 while (i < hx); 158 call check_time (i); 159 end; 160 return; 161 end; 162 163 /* --------------------------------------------------------- */ 164 165 check_time: proc (j); 166 167 dcl j fixed bin; 168 169 do while (tbl (j).time < now); 170 if tbl (j).time = 0 then return; 171 call rcp_sys_$check_mount_timer ((tbl (j).off), recheck_flag, code); 172 if code ^= 0 then do; 173 call sys_log_$error_log (SL0, code, myname, "From pid ^w on ^o", 174 sender, fixed (tbl (j).off, 18)); 175 call new_tenant; 176 end; 177 else if recheck_flag then call set_timer (j); 178 else call new_tenant; 179 end; 180 return; 181 182 new_tenant: procedure; /* move up tbl (hx) into tbl (j) */ 183 184 hx = hx -1; /* Can't possibly be 1 if new_tenant called */ 185 if hx ^= j then tbl (j) = tbl (hx); 186 unspec (tbl (hx)) = "0"b; 187 188 end new_tenant; 189 190 end check_time; 191 192 /* ---------------------------------------------------------- */ 193 194 set_timer: procedure (k); /* Put time in slot, set off bomb */ 195 196 dcl k fixed bin; 197 198 tbl (k).time = now + DELTA; 199 call timer_manager_$alarm_wakeup (tbl (k).time, ABS_MICROSECONDS, channel); 200 end set_timer; 201 202 /* --------------------------------------------------------- */ 203 204 legal_message: procedure returns (bit (1)); 205 206 sender = evmsg.pid; /* copy out */ 207 208 if evmsg.ring = RCP_RING then return ("1"b); 209 if sender = my_processid then return ("1"b); 210 return ("0"b); 211 212 end legal_message; 213 214 /* --------------------------------------------------------- */ 215 216 good_message: procedure returns (bit (1)); 217 218 unspec (mess) = evmsg.data; /* copy good stuff */ 219 220 if evmsg.data = unspec (ALARM___) then return ("1"b); 221 if mess.key = KEY then return ("1"b); 222 return ("0"b); 223 224 end good_message; 225 226 /* ----------------------------------------------------------- */ 227 228 test: entry; 229 SL0 = 1; /* all messages come out */ 230 RCP_RING = get_ring_ (); 231 DELTA = 120000000; /* don't have all nite */ 232 return; 233 234 235 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0800.9 rcp_mount_timer_poll_.pl1 >spec>install>1110>rcp_mount_timer_poll_.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. ABS_MICROSECONDS 000026 constant bit(2) initial packed unaligned dcl 35 set ref 199* ALARM___ 000012 constant char(8) initial packed unaligned dcl 36 ref 156 220 DELTA 000012 internal static fixed bin(71,0) initial dcl 23 set ref 198 231* KEY 000010 constant char(4) initial packed unaligned dcl 37 ref 136 221 RCP_RING 000010 internal static fixed bin(17,0) initial dcl 22 set ref 208 230* SL0 000014 internal static fixed bin(17,0) initial dcl 24 set ref 132* 146* 173* 229* channel 000016 internal static fixed bin(71,0) initial dcl 25 set ref 93* 99* 105* 199* clock_ 000660 constant entry external dcl 77 ref 125 code 000106 automatic fixed bin(35,0) dcl 47 set ref 93* 94 95* 99* 100 101* 105* 107 108* 171* 172 173* data 2 based bit(72) level 2 dcl 62 set ref 132* 156 218 220 evmsg based structure level 1 dcl 62 get_process_id_ 000662 constant entry external dcl 78 ref 112 get_ring_ 000664 constant entry external dcl 79 ref 230 hx 000021 internal static fixed bin(17,0) initial dcl 27 set ref 90* 138 145 151* 151 157 184* 184 185 185 186 i 000100 automatic fixed bin(17,0) dcl 43 set ref 138* 138* 139 140* 152 153* 157* 157* 158* ipc_$create_ev_chn 000646 constant entry external dcl 72 ref 93 ipc_$decl_ev_call_chn 000650 constant entry external dcl 73 ref 99 j parameter fixed bin(17,0) dcl 167 set ref 165 169 170 171 173 173 177* 185 185 k parameter fixed bin(17,0) dcl 196 ref 194 198 199 key 000110 automatic char(4) level 2 packed packed unaligned dcl 51 set ref 136 221 mess 000110 automatic structure level 1 packed packed unaligned dcl 51 set ref 218* mptr parameter pointer dcl 58 ref 119 132 156 206 208 218 220 my_processid 000020 internal static bit(36) initial dcl 26 set ref 89* 112* 121 209 myname 000000 constant char(32) initial packed unaligned dcl 38 set ref 95* 101* 108* 132* 146* 173* now 000102 automatic fixed bin(71,0) dcl 44 set ref 125* 169 198 off 2 000022 internal static bit(18) array level 2 in structure "tbl" dcl 29 in procedure "init" set ref 139 152* 171 173 173 off 1 000110 automatic bit(18) level 2 in structure "mess" packed packed unaligned dcl 51 in procedure "init" set ref 139 146 146 152 pid 4 based bit(36) level 2 dcl 62 ref 206 rcp_sys_$check_mount_timer 000656 constant entry external dcl 76 ref 171 rcp_sys_$init_mount_timer 000654 constant entry external dcl 75 ref 105 recheck_flag 000104 automatic bit(1) dcl 45 set ref 171* 177 ring 5(18) based fixed bin(17,0) level 2 packed packed unaligned dcl 62 ref 208 sender 000105 automatic bit(36) dcl 46 set ref 132* 146* 173* 206* 209 sys_log_ 000642 constant entry external dcl 71 ref 132 146 sys_log_$error_log 000644 constant entry external dcl 71 ref 95 101 108 173 tbl 000022 internal static structure array level 1 unaligned dcl 29 set ref 87* 145 185* 185 186* time 000022 internal static fixed bin(71,0) array level 2 dcl 29 set ref 169 170 198* 199* timer_manager_$alarm_wakeup 000652 constant entry external dcl 74 ref 199 NAMES DECLARED BY EXPLICIT CONTEXT. check_time 000615 constant entry internal dcl 165 ref 158 good_message 001057 constant entry internal dcl 216 ref 130 init 000121 constant entry external dcl 13 interrupt 000355 constant entry external dcl 119 ref 99 99 legal_message 001020 constant entry internal dcl 204 ref 127 new_tenant 000743 constant entry internal dcl 182 ref 175 178 rcp_mount_timer_poll_$init_rcp_mount_timers 000130 constant entry external dcl 13 set_timer 000774 constant entry internal dcl 194 ref 140 153 177 test 000573 constant entry external dcl 228 NAMES DECLARED BY CONTEXT OR IMPLICATION. fixed builtin function ref 146 146 173 173 hbound builtin function ref 145 null builtin function ref 99 99 unspec builtin function set ref 87 156 156 186* 218* 220 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1336 2224 1126 1346 Length 2436 1126 666 175 210 632 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME init 228 external procedure is an external procedure. check_time internal procedure shares stack frame of external procedure init. new_tenant internal procedure shares stack frame of external procedure init. set_timer internal procedure shares stack frame of external procedure init. legal_message internal procedure shares stack frame of external procedure init. good_message internal procedure shares stack frame of external procedure init. STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 RCP_RING init 000012 DELTA init 000014 SL0 init 000016 channel init 000020 my_processid init 000021 hx init 000022 tbl init STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME init 000100 i init 000102 now init 000104 recheck_flag init 000105 sender init 000106 code init 000110 mess init THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ get_process_id_ get_ring_ ipc_$create_ev_chn ipc_$decl_ev_call_chn rcp_sys_$check_mount_timer rcp_sys_$init_mount_timer sys_log_ sys_log_$error_log timer_manager_$alarm_wakeup NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 13 000120 87 000135 89 000140 90 000141 93 000143 94 000153 95 000155 96 000207 99 000210 100 000237 101 000241 102 000273 105 000274 107 000305 108 000307 109 000341 112 000342 113 000351 119 000352 121 000362 125 000365 127 000375 130 000402 132 000407 133 000446 136 000447 138 000452 139 000460 140 000466 141 000470 143 000471 145 000473 146 000476 147 000534 151 000535 152 000536 153 000544 154 000546 156 000547 157 000556 158 000564 159 000566 160 000570 228 000571 229 000600 230 000603 231 000611 232 000614 165 000615 169 000617 170 000630 171 000634 172 000650 173 000652 175 000723 176 000724 177 000725 178 000740 179 000741 180 000742 182 000743 184 000744 185 000747 186 000765 188 000773 194 000774 198 000776 199 001005 200 001017 204 001020 206 001022 208 001027 209 001042 210 001052 216 001057 218 001061 220 001067 221 001076 222 001106 ----------------------------------------------------------- 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