COMPILATION LISTING OF SEGMENT check_cpu_speed Compiled by: Multics PL/I Compiler, Release 29, of July 28, 1986 Compiled at: Honeywell Bull, Phx. Az., Sys-M Compiled on: 08/18/87 1526.4 mst Tue 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(87-05-18,Lippard), approve(87-02-09,MCR7616), 16* audit(87-06-03,Farley), install(87-08-06,MR12.1-1064): 17* Modified to use hcs_$set_procs_required instead of 18* phcs_$set_procs_required. 19* 2) change(87-08-13,Lippard), approve(87-02-09,PBF7616), 20* audit(87-08-13,Farley), install(87-08-18,MR12.1-1090): 21* Modified to use hcs_$get_procs_required instead of ring_zero_peek_. 22* END HISTORY COMMENTS */ 23 24 25 /* format: ^inddcls,ind4,ifthenstmt,ifthendo,thendo,ifthen,tree,^case */ 26 27 check_cpu_speed: proc; 28 29 /* 30* Program to test the speed of a CPU and determine whether cache and 31* associative memory are on. 32* R. E. Mullen 33**/ 34 35 /* 36* Modified 83 June 6 by Art Beattie: changed to look at all of the 37* configuration deck for CPU cards. 38* Modified 83 July by Art Beattie: made the following changes; 39* 1) If no arguments were supplied, it should use only the users subset of 40* CPUs that are currently online. 41* 2) If arguments are supplied (CPUs tags), it should run on them and only 42* them. 43* 3) In either of the above two cases, the user is left running on the same 44* subset of CPUs that check_cpu_speed found the user running on. 45* 4) If the user does not have access to phcs_, program will not run. 46* Modified 84 May 25 to fix bug where user process wasn't getting default 47* set of CPUs restored properly. 48**/ 49 50 call cu_$af_return_arg (n_args, arg_ptr, arg_len, code); 51 if code = 0 then do; 52 call active_fnc_err_ (error_table_$active_function, my_name); 53 return; 54 end; 55 56 /* Determine desired set of CPUs to test. */ 57 58 test_cpu_string = "0"b; 59 do argno = 1 to n_args; 60 call cu_$arg_ptr (argno, arg_ptr, arg_len, code); 61 if arg = "-bf" | arg = "-brief" then brief_mode = "1"b; 62 else if arg = "-warn" then loud_mode = "1"b; 63 else do; 64 65 if verify (arg, CPU_TAGS) ^= 0 then do; 66 call com_err_ (0, my_name, "invalid cpu in argument: ^a", arg); 67 return; 68 end; 69 70 do i = 1 to arg_len; 71 substr (test_cpu_string, mod (index (CPU_TAGS, substr (arg, i, 1)) - 1, 8) + 1, 1) = "1"b; 72 end; 73 74 end; 75 end; /* ends argno do loop */ 76 77 if loud_mode then do; 78 call check_gate_access_ ("phcs_", codeptr (check_cpu_speed), code); 79 if code ^= 0 then do; 80 call com_err_ (code, my_name, "Cannot use -warn without access to phcs_."); 81 return; 82 end; 83 end; 84 85 /* Determine user's current set of CPUs. */ 86 87 call hcs_$get_procs_required (initial_cpu_string, default_procs_flag, code); 88 89 if code ^= 0 then do; 90 call com_err_ (code, my_name, "set_proc_required.acs"); 91 return; 92 end; 93 94 if test_cpu_string = "0"b then do; 95 test_cpu_string = initial_cpu_string; 96 requested_procs_flag = "0"b; 97 end; 98 99 on cleanup call hcs_$set_procs_required (initial_cpu_string, code); 100 101 do cpu_num = 1 to 8; 102 if substr (test_cpu_string, cpu_num, 1) then do; 103 current_cpu_string = copy ("0"b, cpu_num - 1) || "1"b; 104 call hcs_$set_procs_required (current_cpu_string, code); 105 if code = error_table_$insufficient_access then do; 106 call com_err_ (code, my_name, "While doing set_proc_required."); 107 return; 108 end; 109 else if code ^= 0 then 110 if requested_procs_flag 111 then call ioa_ ("CPU ^a is not online.", substr ("ABCDEFGH", cpu_num, 1)); 112 else ; 113 else call do_one_cpu (substr ("ABCDEFGH", cpu_num, 1)); 114 end; 115 end; 116 /* this will force system default flag back on */ 117 if default_procs_flag then initial_cpu_string = "0"b; 118 119 call hcs_$set_procs_required (initial_cpu_string, code); 120 return; 121 122 do_one_cpu: proc (cpu_tag); 123 124 dcl cpu_tag char (1); 125 126 t3 = 1000000; /* init to large value */ 127 do k = 1 to 10; 128 t1 = vclock (); 129 do i = 1 to 100; 130 do j = 1 to 120; 131 end; 132 end; 133 t2 = vclock (); 134 if t2 - t1 < t3 then t3 = t2 - t1; 135 end; 136 137 if t3 > 150000 then thing = "associative memory"; 138 else thing = "cache"; 139 140 if t3 > 80000 then onf = "OFF"; 141 else onf = "ON "; 142 143 if onf = "ON " & brief_mode then return; 144 145 t4 = float (t3) / 1e3; 146 call ioa_ ("CPU ^a ^a: ^3a ^8.3f", cpu_tag, thing, onf, t4); 147 148 if onf = "OFF" & loud_mode then 149 call phcs_$ring_0_message ("cpu " || cpu_tag || " " || thing || " off"); 150 return; 151 152 end do_one_cpu; 153 154 155 dcl CPU_TAGS char (16) init ("ABCDEFGHabcdefgh") int static options (constant); 156 dcl active_fnc_err_ entry options (variable); 157 dcl arg char (arg_len) based (arg_ptr); 158 dcl arg_len fixed bin (21); 159 dcl arg_ptr ptr; 160 dcl argno fixed bin; 161 dcl brief_mode bit (1) init ("0"b); 162 dcl check_gate_access_ entry (char(*), ptr, fixed bin(35)); 163 dcl cleanup condition; 164 dcl code fixed bin (35); 165 dcl codeptr builtin; 166 dcl com_err_ entry options (variable); 167 dcl copy builtin; 168 dcl cpu_num fixed bin; 169 dcl cu_$af_return_arg entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 170 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 171 dcl (current_cpu_string, initial_cpu_string, test_cpu_string) bit (8) aligned; 172 dcl default_procs_flag bit (1) aligned init ("0"b); 173 dcl error_table_$active_function fixed bin (35) ext static; 174 dcl error_table_$insufficient_access fixed bin (35) ext static; 175 dcl (i, j, k) fixed bin; 176 dcl float builtin; 177 dcl hcs_$get_procs_required entry (bit (8) aligned, bit (1) aligned, fixed bin (35)); 178 dcl hcs_$set_procs_required entry (bit (8) aligned, fixed bin (35)); 179 dcl index builtin; 180 dcl ioa_ entry options (variable); 181 dcl loud_mode bit (1) init ("0"b); 182 dcl mod builtin; 183 dcl my_name char (15) init ("check_cpu_speed") int static options (constant); 184 dcl n_args fixed bin; 185 dcl onf char (3); 186 dcl phcs_$ring_0_message entry (char (*)); 187 dcl requested_procs_flag bit (1) init ("1"b); /* procs supplied to command */ 188 dcl substr builtin; 189 dcl (t1, t2) fixed bin (71); 190 dcl t3 fixed bin (35); 191 dcl t4 float bin; 192 dcl thing char (24); 193 dcl vclock builtin; 194 dcl verify builtin; 195 end check_cpu_speed; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 08/18/87 1500.0 check_cpu_speed.pl1 >special_ldd>install>MR12.1-1090>check_cpu_speed.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. CPU_TAGS 000004 constant char(16) initial unaligned dcl 155 ref 65 71 active_fnc_err_ 000010 constant entry external dcl 156 ref 52 arg based char unaligned dcl 157 set ref 61 61 62 65 66* 71 arg_len 000100 automatic fixed bin(21,0) dcl 158 set ref 50* 60* 61 61 62 65 66 66 70 71 arg_ptr 000102 automatic pointer dcl 159 set ref 50* 60* 61 61 62 65 66 71 argno 000104 automatic fixed bin(17,0) dcl 160 set ref 59* 60* brief_mode 000105 automatic bit(1) initial unaligned dcl 161 set ref 61* 143 161* check_gate_access_ 000012 constant entry external dcl 162 ref 78 cleanup 000106 stack reference condition dcl 163 ref 99 code 000114 automatic fixed bin(35,0) dcl 164 set ref 50* 51 60* 78* 79 80* 87* 89 90* 99* 104* 105 106* 109 119* codeptr builtin function dcl 165 ref 78 78 com_err_ 000014 constant entry external dcl 166 ref 66 80 90 106 copy builtin function dcl 167 ref 103 cpu_num 000115 automatic fixed bin(17,0) dcl 168 set ref 101* 102 103 109 109 113 113* cpu_tag parameter char(1) unaligned dcl 124 set ref 122 146* 148 cu_$af_return_arg 000016 constant entry external dcl 169 ref 50 cu_$arg_ptr 000020 constant entry external dcl 170 ref 60 current_cpu_string 000116 automatic bit(8) dcl 171 set ref 103* 104* default_procs_flag 000121 automatic bit(1) initial dcl 172 set ref 87* 117 172* error_table_$active_function 000022 external static fixed bin(35,0) dcl 173 set ref 52* error_table_$insufficient_access 000024 external static fixed bin(35,0) dcl 174 ref 105 float builtin function dcl 176 ref 145 hcs_$get_procs_required 000026 constant entry external dcl 177 ref 87 hcs_$set_procs_required 000030 constant entry external dcl 178 ref 99 104 119 i 000122 automatic fixed bin(17,0) dcl 175 set ref 70* 71* 129* index builtin function dcl 179 ref 71 initial_cpu_string 000117 automatic bit(8) dcl 171 set ref 87* 95 99* 117* 119* ioa_ 000032 constant entry external dcl 180 ref 109 146 j 000123 automatic fixed bin(17,0) dcl 175 set ref 130* k 000124 automatic fixed bin(17,0) dcl 175 set ref 127* loud_mode 000125 automatic bit(1) initial unaligned dcl 181 set ref 62* 77 148 181* mod builtin function dcl 182 ref 71 my_name 000000 constant char(15) initial unaligned dcl 183 set ref 52* 66* 80* 90* 106* n_args 000126 automatic fixed bin(17,0) dcl 184 set ref 50* 59 onf 000127 automatic char(3) unaligned dcl 185 set ref 140* 141* 143 146* 148 phcs_$ring_0_message 000034 constant entry external dcl 186 ref 148 requested_procs_flag 000130 automatic bit(1) initial unaligned dcl 187 set ref 96* 109 187* substr builtin function dcl 188 set ref 71* 71 102 109 109 113 113 t1 000132 automatic fixed bin(71,0) dcl 189 set ref 128* 134 134 t2 000134 automatic fixed bin(71,0) dcl 189 set ref 133* 134 134 t3 000136 automatic fixed bin(35,0) dcl 190 set ref 126* 134 134* 137 140 145 t4 000137 automatic float bin(27) dcl 191 set ref 145* 146* test_cpu_string 000120 automatic bit(8) dcl 171 set ref 58* 71* 94 95* 102 thing 000140 automatic char(24) unaligned dcl 192 set ref 137* 138* 146* 148 vclock builtin function dcl 193 ref 128 133 verify builtin function dcl 194 ref 65 NAMES DECLARED BY EXPLICIT CONTEXT. check_cpu_speed 000135 constant entry external dcl 27 ref 78 78 do_one_cpu 000714 constant entry internal dcl 122 ref 113 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1524 1562 1344 1534 Length 1756 1344 36 160 160 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME check_cpu_speed 194 external procedure is an external procedure. on unit on line 99 70 on unit do_one_cpu internal procedure shares stack frame of external procedure check_cpu_speed. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME check_cpu_speed 000100 arg_len check_cpu_speed 000102 arg_ptr check_cpu_speed 000104 argno check_cpu_speed 000105 brief_mode check_cpu_speed 000114 code check_cpu_speed 000115 cpu_num check_cpu_speed 000116 current_cpu_string check_cpu_speed 000117 initial_cpu_string check_cpu_speed 000120 test_cpu_string check_cpu_speed 000121 default_procs_flag check_cpu_speed 000122 i check_cpu_speed 000123 j check_cpu_speed 000124 k check_cpu_speed 000125 loud_mode check_cpu_speed 000126 n_args check_cpu_speed 000127 onf check_cpu_speed 000130 requested_procs_flag check_cpu_speed 000132 t1 check_cpu_speed 000134 t2 check_cpu_speed 000136 t3 check_cpu_speed 000137 t4 check_cpu_speed 000140 thing check_cpu_speed THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. fx1_to_fl2 alloc_char_temp alloc_bit_temp cat_realloc_bits call_ext_out_desc call_ext_out return_mac mdfx1 enable_op shorten_stack ext_entry int_entry vclock_mac THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. active_fnc_err_ check_gate_access_ com_err_ cu_$af_return_arg cu_$arg_ptr hcs_$get_procs_required hcs_$set_procs_required ioa_ phcs_$ring_0_message THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$active_function error_table_$insufficient_access LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 27 000134 161 000142 172 000143 181 000144 187 000145 50 000147 51 000163 52 000165 53 000202 58 000203 59 000204 60 000213 61 000230 62 000245 65 000254 66 000266 67 000322 70 000323 71 000333 72 000350 75 000352 77 000354 78 000356 79 000403 80 000405 81 000431 87 000432 89 000445 90 000447 91 000476 94 000477 95 000502 96 000505 99 000506 101 000534 102 000541 103 000545 104 000567 105 000601 106 000605 107 000630 109 000631 112 000664 113 000665 115 000674 117 000676 119 000702 120 000713 122 000714 126 000716 127 000720 128 000725 129 000727 130 000735 131 000743 132 000745 133 000747 134 000751 135 000761 137 000763 138 000772 140 000775 141 001002 143 001004 145 001011 146 001017 148 001057 150 001132 ----------------------------------------------------------- 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