COMPILATION LISTING OF SEGMENT dm_admin_sched_shutdown Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/24/85 0836.0 mst Wed Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1984 * 4* * * 5* *********************************************************** */ 6 7 /* DESCRIPTION: 8* 9* This routine schedules a Data Management shutdown on behalf of a DM 10* administrator or operator. It is the data-management-ring portion of the 11* dm_system_shutdown command and the Data_Management daemon shutdown 12* request. Expected as input are a pointer to a shutdown_spec 13* (p_shutdown_spec_ptr) containing the reason, times and delays specified 14* by the caller of the command/request, and a pointer to a shutdown_info 15* structure (p_shutdown_info_ptr). The shutdown_info.version must be set, 16* but otherwise the structure is used to return information. The 17* shutdown_info structure, on return, contains the reason and a complete 18* set of times., as well as output flags indicating whether there was an 19* error (no_time_specified is ON) and whether any of the administrative 20* times were used to re-schedule the current shutdown (times_have_changed 21* is ON). 22* 23* The algorithm used by this routine is as follows: 24* 25* 1) Calculate a complete set of times from the times and delays specified 26* by the admnistrator. 27* 28* 2) If no times could be calculated because there was both no 29* administrator-specified time and no Multics shutdown time currently 30* scheduled, return a shutdown_info with all times equal to 0 and 31* output_flags.no_time_specified set to on. 32* 33* Otherwise, 34* 35* 3) Select a set of times by: 36* 3.1) Calculating the default times based on the scheduled Multics 37* shutdown time; 38* 3.2) If there is no Multics shutdown time currently scheduled 39* (multics_shutdown_info.output_flags.no_time_specified is on), 40* select the administrative times as the times for the new DM 41* shutdown; 42* 3.3) Otherwise, compare the administrative and Multics times, 43* selecting the earlier of each time, to create the resultant set 44* of times for the new DM shutdown. 45* 46* 4) Save the administrative times in dm_system_data_. 47* 48* 5) If any of the administrative times were selected (indicated by 49* resultant_shutdown_info.output_flags.times_have_changed being on) 50* alert the Data Management daemon to actually schedule the new DM 51* shutdown. Otherwise, don't bother the daemon, as the current 52* shutdown should not be changed. 53* 54* 6) Return to the caller the resultant times. 55**/ 56 57 /* HISTORY: 58* 59*Written by Matthew C. Pierret, 09/13/84. 60*Modified: 61*09/27/84 by Lee A. Newcomb: Saved admin shutdown reason in dm_system_data_ 62* and fixed sending shutdown request to Daemon. 63*02/19/85 by Lee A. Newcomb: Fixed to copy the ptr parameters and the 64* structures they locate before validating the structure versions. 65**/ 66 67 /* format: style2,ind3 */ 68 /* format: ll79,comcol50,^indprocbody,^indnoniterdo,indnoniterend */ 69 70 dm_admin_sched_shutdown: 71 proc (p_shutdown_spec_ptr, p_shutdown_info_ptr); 72 73 /* START OF DECLARATIONS */ 74 /* Parameter */ 75 76 dcl p_shutdown_spec_ptr ptr; /*points to a shutdown_spec.*/ 77 dcl p_shutdown_info_ptr ptr; /*points to a shutdown_info.*/ 78 79 /* Automatic */ 80 81 dcl 1 admin_shutdown_info aligned like shutdown_info; 82 dcl 1 admin_shutdown_spec aligned like shutdown_spec; 83 dcl 1 multics_shutdown_info 84 aligned like shutdown_info; 85 dcl 1 multics_shutdown_spec 86 aligned like shutdown_spec; 87 dcl 1 resultant_shutdown_info 88 aligned like shutdown_info; 89 90 /* Based */ 91 /* Builtin */ 92 93 dcl (addr, null, unspec) builtin; 94 95 /* Constant */ 96 97 dcl myname char (32) varying 98 init ("dm_admin_sched_shutdown") 99 internal static options (constant); 100 101 /* Entry */ 102 103 dcl dm_compare_shutdown_info 104 entry (ptr, ptr, ptr); 105 dcl dm_process_shutdown_spec 106 entry (ptr, ptr); 107 dcl dm_send_request_$shutdown 108 entry (fixed bin (35)); 109 dcl sub_err_ entry () options (variable); 110 111 /* External */ 112 113 dcl ( 114 dm_system_data_$saved_user_warning_time, 115 dm_system_data_$saved_begin_shutdown_time, 116 dm_system_data_$saved_user_shutdown_time, 117 dm_system_data_$saved_user_bump_time, 118 dm_system_data_$saved_daemon_logout_time 119 ) fixed bin (71) ext; 120 dcl dm_system_data_$saved_shutdown_reason 121 char (64) ext; 122 dcl error_table_$unimplemented_version 123 fixed bin (35) ext; 124 125 /* END OF DECLARATIONS */ 126 127 COPY_PARAMETERS: 128 do; 129 shutdown_spec_ptr = p_shutdown_spec_ptr; 130 shutdown_info_ptr = p_shutdown_info_ptr; 131 admin_shutdown_spec = shutdown_spec; 132 resultant_shutdown_info.version = shutdown_info.version; 133 /* all we need for the info structure */ 134 end COPY_PARAMETERS; 135 136 call CHECK_VERSION (admin_shutdown_spec.version, SHUTDOWN_SPEC_VERSION_1, 137 "shutdown_spec"); 138 call CHECK_VERSION (resultant_shutdown_info.version, 139 SHUTDOWN_INFO_VERSION_1, "shutdown_info"); 140 141 unspec (admin_shutdown_info) = ""b; 142 admin_shutdown_info.version = SHUTDOWN_INFO_VERSION_1; 143 144 unspec (multics_shutdown_spec) = ""b; 145 multics_shutdown_spec.version = SHUTDOWN_SPEC_VERSION_1; 146 unspec (multics_shutdown_info) = ""b; 147 multics_shutdown_info.version = SHUTDOWN_INFO_VERSION_1; 148 149 unspec (resultant_shutdown_info) = ""b; 150 resultant_shutdown_info.version = SHUTDOWN_INFO_VERSION_1; 151 152 call dm_process_shutdown_spec (addr (admin_shutdown_spec), 153 addr (admin_shutdown_info)); 154 155 if admin_shutdown_info.output_flags.no_time_specified 156 then p_shutdown_info_ptr -> shutdown_info = admin_shutdown_info; 157 else 158 do; 159 call dm_process_shutdown_spec (addr (multics_shutdown_spec), 160 addr (multics_shutdown_info)); 161 if multics_shutdown_info.output_flags.no_time_specified 162 then 163 TAKE_ADMIN_TIMES: 164 do; 165 resultant_shutdown_info = admin_shutdown_info; 166 resultant_shutdown_info.output_flags.times_have_changed = "1"b; 167 end TAKE_ADMIN_TIMES; 168 else 169 TAKE_EARLIER_TIMES: 170 do; 171 call dm_compare_shutdown_info (addr (multics_shutdown_info), 172 addr (admin_shutdown_info), addr (resultant_shutdown_info)); 173 end TAKE_EARLIER_TIMES; 174 175 SET_SAVED_ADMIN_SHUTDOWN_TIMES_AND_REASON: 176 do; 177 dm_system_data_$saved_user_warning_time = 178 admin_shutdown_info.times.user_warning_time; 179 dm_system_data_$saved_begin_shutdown_time = 180 admin_shutdown_info.times.begin_shutdown_time; 181 dm_system_data_$saved_user_shutdown_time = 182 admin_shutdown_info.times.user_shutdown_time; 183 dm_system_data_$saved_user_bump_time = 184 admin_shutdown_info.times.user_bump_time; 185 dm_system_data_$saved_daemon_logout_time = 186 admin_shutdown_info.times.daemon_logout_time; 187 dm_system_data_$saved_shutdown_reason = admin_shutdown_info.reason; 188 end SET_SAVED_ADMIN_SHUTDOWN_TIMES_AND_REASON; 189 190 if resultant_shutdown_info.output_flags.times_have_changed 191 then call dm_send_request_$shutdown ((0)); 192 else /* actual shutdown schedule is unchanged */ 193 ; 194 195 p_shutdown_info_ptr -> shutdown_info = resultant_shutdown_info; 196 197 end; 198 199 return; 200 201 /* end dm_admin_sched_shutdown; */ 202 203 CHECK_VERSION: 204 proc (cv_p_received_version, cv_p_expected_version, cv_p_structure_name); 205 206 dcl cv_p_received_version char (8) aligned; 207 dcl cv_p_expected_version char (8) aligned; 208 dcl cv_p_structure_name char (*); 209 210 if cv_p_received_version ^= cv_p_expected_version 211 then call sub_err_ (error_table_$unimplemented_version, myname, 212 ACTION_CANT_RESTART, null, 0, 213 "^/Expected version ^a of the ^a structure. 214 Received version ^d instead.", cv_p_expected_version, cv_p_structure_name, 215 cv_p_received_version); 216 217 end CHECK_VERSION; 218 1 1 /* ***** BEGIN INCLUDE FILE dm_shutdown_spec.incl.pl1 ***** */ 1 2 1 3 /* DESCRIPTION: 1 4* 1 5* Contains the shutdown_spec structure and the shutdown_info 1 6* structure. The shutdown_spec structure a reason for a DM 1 7* shutdown, a set of times and a set of delays. Only times and 1 8* delays which explicitly specified are set, the others are equal to 1 9* 0. 1 10* 1 11* The shutdown_spec is processed with the result being a 1 12* shutdown_info structure. It contains a reason and a set of times. 1 13* The times are either those times specified in the shutdown_spec or 1 14* times calculated from those times using delays. The delays are 1 15* those specified in the shutdown_spec, or, if not specified, 1 16* default delays. Default delays are kept in dm_system_data. 1 17**/ 1 18 1 19 /* HISTORY: 1 20*Written by Matthew Pierret, 09/06/84. 1 21*Modified: 1 22**/ 1 23 1 24 /* format: style2,ind3 */ 1 25 dcl 1 shutdown_spec aligned based (shutdown_spec_ptr), 1 26 2 version char (8) aligned, 1 27 2 reason char (64), 1 28 2 times, 1 29 3 user_warning_time 1 30 fixed bin (71), 1 31 3 begin_shutdown_time 1 32 fixed bin (71), 1 33 3 user_shutdown_time 1 34 fixed bin (71), 1 35 3 user_bump_time fixed bin (71), 1 36 3 daemon_logout_time 1 37 fixed bin (71), 1 38 2 delays, 1 39 3 begin_shutdown_delay 1 40 fixed bin (71), 1 41 3 user_shutdown_delay 1 42 fixed bin (71), 1 43 3 user_bump_delay fixed bin (71), 1 44 3 daemon_logout_delay 1 45 fixed bin (71); 1 46 1 47 dcl shutdown_spec_ptr ptr; 1 48 dcl SHUTDOWN_SPEC_VERSION_1 1 49 init ("ShutSp 1") char (8) aligned internal static options (constant); 1 50 1 51 dcl 1 shutdown_info aligned based (shutdown_info_ptr), 1 52 2 version char (8) aligned, 1 53 2 reason char (64), 1 54 2 times like shutdown_spec.times, 1 55 2 output_flags aligned, 1 56 3 no_time_specified 1 57 bit (1) unal, 1 58 3 times_have_changed 1 59 bit (1) unal, 1 60 3 mbz bit (34) unal; 1 61 1 62 dcl shutdown_info_ptr ptr init (null ()); 1 63 dcl SHUTDOWN_INFO_VERSION_1 1 64 init ("ShutIn 1") char (8) aligned internal static options (constant); 1 65 1 66 /* ******* END INCLUDE FILE dm_shutdown_spec.incl.pl1 ***** */ 219 220 2 1 /* BEGIN INCLUDE FILE sub_err_flags.incl.pl1 BIM 11/81 */ 2 2 /* format: style3 */ 2 3 2 4 /* These constants are to be used for the flags argument of sub_err_ */ 2 5 /* They are just "string (condition_info_header.action_flags)" */ 2 6 2 7 declare ( 2 8 ACTION_CAN_RESTART init (""b), 2 9 ACTION_CANT_RESTART init ("1"b), 2 10 ACTION_DEFAULT_RESTART 2 11 init ("01"b), 2 12 ACTION_QUIET_RESTART 2 13 init ("001"b), 2 14 ACTION_SUPPORT_SIGNAL 2 15 init ("0001"b) 2 16 ) bit (36) aligned internal static options (constant); 2 17 2 18 /* End include file */ 221 222 end dm_admin_sched_shutdown; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/24/85 0803.8 dm_admin_sched_shutdown.pl1 >spec>on>41-21>dm_admin_sched_shutdown.pl1 219 1 01/07/85 0859.8 dm_shutdown_spec.incl.pl1 >ldd>include>dm_shutdown_spec.incl.pl1 221 2 04/16/82 0958.1 sub_err_flags.incl.pl1 >ldd>include>sub_err_flags.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. ACTION_CANT_RESTART 000023 constant bit(36) initial dcl 2-7 set ref 210* SHUTDOWN_INFO_VERSION_1 000000 constant char(8) initial dcl 1-63 set ref 138* 142 147 150 SHUTDOWN_SPEC_VERSION_1 000002 constant char(8) initial dcl 1-48 set ref 136* 145 addr builtin function dcl 93 ref 152 152 152 152 159 159 159 159 171 171 171 171 171 171 admin_shutdown_info 000100 automatic structure level 1 dcl 81 set ref 141* 152 152 155 165 171 171 admin_shutdown_spec 000136 automatic structure level 1 dcl 82 set ref 131* 152 152 begin_shutdown_time 24 000100 automatic fixed bin(71,0) level 3 dcl 81 set ref 179 cv_p_expected_version parameter char(8) dcl 207 set ref 203 210 210* cv_p_received_version parameter char(8) dcl 206 set ref 203 210 210* cv_p_structure_name parameter char unaligned dcl 208 set ref 203 210* daemon_logout_time 32 000100 automatic fixed bin(71,0) level 3 dcl 81 set ref 185 dm_compare_shutdown_info 000010 constant entry external dcl 103 ref 171 dm_process_shutdown_spec 000012 constant entry external dcl 105 ref 152 159 dm_send_request_$shutdown 000014 constant entry external dcl 107 ref 190 dm_system_data_$saved_begin_shutdown_time 000022 external static fixed bin(71,0) dcl 113 set ref 179* dm_system_data_$saved_daemon_logout_time 000030 external static fixed bin(71,0) dcl 113 set ref 185* dm_system_data_$saved_shutdown_reason 000032 external static char(64) unaligned dcl 120 set ref 187* dm_system_data_$saved_user_bump_time 000026 external static fixed bin(71,0) dcl 113 set ref 183* dm_system_data_$saved_user_shutdown_time 000024 external static fixed bin(71,0) dcl 113 set ref 181* dm_system_data_$saved_user_warning_time 000020 external static fixed bin(71,0) dcl 113 set ref 177* error_table_$unimplemented_version 000034 external static fixed bin(35,0) dcl 122 set ref 210* multics_shutdown_info 000202 automatic structure level 1 dcl 83 set ref 146* 159 159 171 171 multics_shutdown_spec 000240 automatic structure level 1 dcl 85 set ref 144* 159 159 myname 000004 constant varying char(32) initial dcl 97 set ref 210* no_time_specified 34 000100 automatic bit(1) level 3 in structure "admin_shutdown_info" packed unaligned dcl 81 in procedure "dm_admin_sched_shutdown" set ref 155 no_time_specified 34 000202 automatic bit(1) level 3 in structure "multics_shutdown_info" packed unaligned dcl 83 in procedure "dm_admin_sched_shutdown" set ref 161 null builtin function dcl 93 ref 1-62 210 210 output_flags 34 000100 automatic structure level 2 in structure "admin_shutdown_info" dcl 81 in procedure "dm_admin_sched_shutdown" output_flags 34 000304 automatic structure level 2 in structure "resultant_shutdown_info" dcl 87 in procedure "dm_admin_sched_shutdown" output_flags 34 000202 automatic structure level 2 in structure "multics_shutdown_info" dcl 83 in procedure "dm_admin_sched_shutdown" p_shutdown_info_ptr parameter pointer dcl 77 ref 70 130 155 195 p_shutdown_spec_ptr parameter pointer dcl 76 ref 70 129 reason 2 000100 automatic char(64) level 2 dcl 81 set ref 187 resultant_shutdown_info 000304 automatic structure level 1 dcl 87 set ref 149* 165* 171 171 195 shutdown_info based structure level 1 dcl 1-51 set ref 155* 195* shutdown_info_ptr 000344 automatic pointer initial dcl 1-62 set ref 130* 132 1-62* shutdown_spec based structure level 1 dcl 1-25 ref 131 shutdown_spec_ptr 000342 automatic pointer dcl 1-47 set ref 129* 131 sub_err_ 000016 constant entry external dcl 109 ref 210 times 22 000100 automatic structure level 2 in structure "admin_shutdown_info" dcl 81 in procedure "dm_admin_sched_shutdown" times 22 000136 automatic structure level 2 in structure "admin_shutdown_spec" dcl 82 in procedure "dm_admin_sched_shutdown" times 22 based structure level 2 in structure "shutdown_spec" dcl 1-25 in procedure "dm_admin_sched_shutdown" times 22 000240 automatic structure level 2 in structure "multics_shutdown_spec" dcl 85 in procedure "dm_admin_sched_shutdown" times_have_changed 34(01) 000304 automatic bit(1) level 3 packed unaligned dcl 87 set ref 166* 190 unspec builtin function dcl 93 set ref 141* 144* 146* 149* user_bump_time 30 000100 automatic fixed bin(71,0) level 3 dcl 81 set ref 183 user_shutdown_time 26 000100 automatic fixed bin(71,0) level 3 dcl 81 set ref 181 user_warning_time 22 000100 automatic fixed bin(71,0) level 3 dcl 81 set ref 177 version based char(8) level 2 in structure "shutdown_info" dcl 1-51 in procedure "dm_admin_sched_shutdown" set ref 132 version 000136 automatic char(8) level 2 in structure "admin_shutdown_spec" dcl 82 in procedure "dm_admin_sched_shutdown" set ref 136* version 000240 automatic char(8) level 2 in structure "multics_shutdown_spec" dcl 85 in procedure "dm_admin_sched_shutdown" set ref 145* version 000100 automatic char(8) level 2 in structure "admin_shutdown_info" dcl 81 in procedure "dm_admin_sched_shutdown" set ref 142* version 000304 automatic char(8) level 2 in structure "resultant_shutdown_info" dcl 87 in procedure "dm_admin_sched_shutdown" set ref 132* 138* 150* version 000202 automatic char(8) level 2 in structure "multics_shutdown_info" dcl 83 in procedure "dm_admin_sched_shutdown" set ref 147* NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ACTION_CAN_RESTART internal static bit(36) initial dcl 2-7 ACTION_DEFAULT_RESTART internal static bit(36) initial dcl 2-7 ACTION_QUIET_RESTART internal static bit(36) initial dcl 2-7 ACTION_SUPPORT_SIGNAL internal static bit(36) initial dcl 2-7 NAMES DECLARED BY EXPLICIT CONTEXT. CHECK_VERSION 000314 constant entry internal dcl 203 ref 136 138 COPY_PARAMETERS 000077 constant label dcl 127 SET_SAVED_ADMIN_SHUTDOWN_TIMES_AND_REASON 000254 constant label dcl 175 TAKE_ADMIN_TIMES 000225 constant label dcl 161 TAKE_EARLIER_TIMES 000233 constant label dcl 168 dm_admin_sched_shutdown 000070 constant entry external dcl 70 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 660 716 452 670 Length 1142 452 36 210 206 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME dm_admin_sched_shutdown 322 external procedure is an external procedure. CHECK_VERSION internal procedure shares stack frame of external procedure dm_admin_sched_shutdown. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME dm_admin_sched_shutdown 000100 admin_shutdown_info dm_admin_sched_shutdown 000136 admin_shutdown_spec dm_admin_sched_shutdown 000202 multics_shutdown_info dm_admin_sched_shutdown 000240 multics_shutdown_spec dm_admin_sched_shutdown 000304 resultant_shutdown_info dm_admin_sched_shutdown 000342 shutdown_spec_ptr dm_admin_sched_shutdown 000344 shutdown_info_ptr dm_admin_sched_shutdown 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. dm_compare_shutdown_info dm_process_shutdown_spec dm_send_request_$shutdown sub_err_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. dm_system_data_$saved_begin_shutdown_time dm_system_data_$saved_daemon_logout_time dm_system_data_$saved_shutdown_reason dm_system_data_$saved_user_bump_time dm_system_data_$saved_user_shutdown_time dm_system_data_$saved_user_warning_time error_table_$unimplemented_version LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 70 000064 1 62 000075 129 000077 130 000103 131 000106 132 000111 136 000114 138 000123 141 000132 142 000135 144 000137 145 000142 146 000144 147 000147 149 000151 150 000154 152 000156 155 000173 159 000205 161 000222 165 000225 166 000230 167 000232 171 000233 177 000254 179 000257 181 000261 183 000263 185 000265 187 000267 190 000273 195 000305 199 000313 203 000314 210 000325 217 000415 ----------------------------------------------------------- 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