/* ****************************************************** * * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * * * ****************************************************** */ test_timer_manager:proc; /* Modified 01/09/74 by S.Herbst. Outside calls added. */ dcl time fixed bin(71) aligned; dcl time_char char(24); dcl flags bit(2); dcl (cex,cin) fixed bin(71) int static; dcl status bit(72) aligned; dcl j fixed bin(17); dcl i fixed bin(17); dcl chan fixed bin(71); dcl (inhibit,command,timer_type,signal_type,time_type,routine) char(10) varying; dcl release_label label int static; dcl (addr,null,substr) builtin; dcl call_entry entry variable; dcl condition_ ext entry(char(*),entry); dcl ios_$order ext entry(char(*),char(*),ptr,bit(72) aligned); dcl test_timer_manager$external ext entry; dcl test_timer_manager$wexternal ext entry; dcl ipc_$create_ev_chn ext entry(fixed bin(71),fixed bin(17)); dcl ipc_$decl_ev_call_chn ext entry(fixed bin(71),entry,ptr,fixed bin(17),fixed bin(17)); dcl read_list_$prompt ext entry options(variable); dcl (timer_manager_$alarm_call,timer_manager_$cpu_call,timer_manager_$alarm_call_inhibit, timer_manager_$cpu_call_inhibit) ext entry(fixed bin(71),bit(2),entry); dcl (timer_manager_$sleep,timer_manager_$sleep_lss) ext entry(fixed bin(71),bit(2)); dcl (timer_manager_$reset_alarm_call,timer_manager_$reset_cpu_call) ext entry(entry); dcl (timer_manager_$reset_alarm_wakeup,timer_manager_$reset_cpu_wakeup) ext entry(fixed bin(71)); dcl (timer_manager_$alarm_interrupt,timer_manager_$cpu_time_interrupt) ext entry; dcl debug ext entry; dcl ioa_ ext entry options(variable); dcl hcs_$usage_values ext entry(fixed bin(17),fixed bin(71)); dcl clock_ ext entry returns(fixed bin(71)); dcl (timer_manager_$cpu_wakeup,timer_manager_$alarm_wakeup) ext entry(fixed bin(71),bit(2),fixed bin(71)); dcl date_time_ ext entry(fixed bin(71), char(*)); call condition_("cput",timer_manager_$cpu_time_interrupt); call condition_("alrm",timer_manager_$alarm_interrupt); /* set up condition handlers */ call ipc_$create_ev_chn(cex,j); call ipc_$create_ev_chn(cin,j); call ipc_$decl_ev_call_chn(cex,test_timer_manager$wexternal,null,5,j); call ipc_$decl_ev_call_chn(cin,winternal,null,5,j); release_label = command_loop; command_loop: call read_list_$prompt("c:",command); /* get command */ if command = "debug" then call debug; else if command = "release" then go to release_label; else if command = "return" then do; call ios_$order("user_i/o","start",null,status); return; end; else if command = "time" then do; get_type: call read_list_$prompt("type? ", time_type); if substr(time_type,1,2) = "cp" then call hcs_$usage_values(j,time); else if substr(time_type,1,2) = "al" then time = clock_(); else do; call ioa_("Types are alarm or cpu."); go to get_type; end; call date_time_(time, time_char); call ioa_("^a",time_char); end; else if command = "loop" then do; call read_list_$prompt("How many times? ",j); do i = 1 to j; call hcs_$usage_values(j,time); end; end; else reread: if command = "set" then do; call read_list_$prompt("Alarm or cpu? ",timer_type,"Wakeup or call? ",signal_type, "Routine external or internal? ",routine, "Inhibited or enabled? ",inhibit, "Absolute or relative? ",time_type, "When? ",time); if substr(routine,1,2) = "ex" then do; chan = cex; if substr(signal_type,1,1) = "c" then call find_entry(call_entry); end; else if substr(routine,1,3) = "int" then chan = cin; else go to reread; if substr(time_type,1,1) = "a" then flags = "00"b; else if substr(time_type,1,1) = "r" then flags = "10"b; else go to reread; if substr(timer_type,1,2) = "al" then if substr(signal_type,1,1) = "w" then call timer_manager_$alarm_wakeup(time,flags,chan); else if substr(signal_type,1,1)="c" then if chan = cex then if substr(inhibit,1,3)="inh" then call timer_manager_$alarm_call_inhibit(time,flags,call_entry); else call timer_manager_$alarm_call(time,flags,call_entry); else if substr(inhibit,1,3)="inh" then call timer_manager_$alarm_call_inhibit(time,flags,internal); else call timer_manager_$alarm_call(time,flags,internal); else go to reread; else if substr(timer_type,1,2) = "cp" then if substr(signal_type,1,1) = "w" then call timer_manager_$cpu_wakeup(time,flags,chan); else if substr(signal_type,1,1)= "c" then if chan = cex then if substr(inhibit,1,3)="inh" then call timer_manager_$cpu_call_inhibit(time,flags,call_entry); else call timer_manager_$cpu_call(time,flags,call_entry); else if substr(inhibit,1,3)="inh" then call timer_manager_$cpu_call_inhibit(time,flags,internal); else call timer_manager_$cpu_call(time,flags,internal); else go to reread; end; else if command = "reset" then do; call read_list_$prompt("Alarm or cpu? ",timer_type,"Wakeup or call? ",signal_type, "Routine external or internal? ",routine); if substr(routine,1,2) = "ex" then do; chan = cex; if substr(signal_type,1,1) = "c" then call find_entry(call_entry); end; else if substr(routine,1,2) = "in" then chan = cin; else go to reread; if substr(timer_type,1,2) = "al" then if substr(signal_type,1,1) = "w" then call timer_manager_$reset_alarm_wakeup(chan); else if substr(signal_type,1,1) = "c" then if chan = cex then call timer_manager_$reset_alarm_call(call_entry); else call timer_manager_$reset_alarm_call(internal); else go to reread; else if substr(timer_type,1,2) = "cp" then if substr(signal_type,1,1) = "w" then call timer_manager_$reset_cpu_wakeup(chan); else if substr(signal_type,1,1) = "c" then if chan = cex then call timer_manager_$reset_cpu_call(call_entry); else call timer_manager_$reset_cpu_call(internal); else go to reread; else go to reread; end; else if substr(command,1,5) = "sleep" then do; read_again: call read_list_$prompt("Absolute or relative? ",time_type,"How long? ",time); if substr(time_type,1,1) = "a" then flags = "00"b; else if substr(time_type,1,1) = "r" then flags = "10"b; else go to read_again; if substr(command,6,4) = "_lss" then call timer_manager_$sleep_lss(time,flags); else call timer_manager_$sleep(time,flags); end; else call ioa_("The legal commands are: set reset time sleep sleep_lss loop debug return release "); go to command_loop; external:entry(mcptr1,name1); dcl mcptr1 ptr; dcl name1 char(*); if name1 = "cput" then call hcs_$usage_values(j,time); else time = clock_(); call date_time_(time,time_char); call ioa_("external ^a ^p ^a",name1,mcptr1,time_char); go to command_loop; wexternal:entry(msgptr); dcl msgptr ptr; dcl 1 ev_message based(msgptr), 2 event_channel fixed bin(71), 2 message char(8) aligned, 2 sending_process bit(36); if ev_message.message = "alarm___" then time = clock_(); else call hcs_$usage_values(j,time); call date_time_(time,time_char); call ioa_("wexternal ^a ^a",ev_message.message,time_char); go to command_loop; internal:proc(mcptr2,name2); dcl j fixed bin(17), time fixed bin(71); dcl mcptr2 ptr; dcl name2 char(*); if name2 = "cput" then call hcs_$usage_values(j,time); else time = clock_(); call date_time_(time,time_char); call ioa_("internal ^a ^p ^a",name2,mcptr2,time_char); end; winternal:proc(msgptr1); dcl j fixed bin(17), time fixed bin(71); dcl msgptr1 ptr; dcl 1 ev_message based(msgptr1), 2 event_channel fixed bin(71), 2 message char(8) aligned; if message = "alarm___" then time = clock_(); else call hcs_$usage_values(j,time); call date_time_(time,time_char); call ioa_("winternal ^a ^a",message,time_char); end; find_entry: proc(call_entry); /* takes char. string and returns an entry */ dcl call_name char(168) varying; dcl call_entry entry variable; dcl 1 structure based(addr(call_entry)), 2 segp pointer, 2 actp pointer; dcl (lg,posn) fixed bin(35); dcl ref_name char(168); dcl entry_name char(32); dcl index builtin; dcl error_table_$segknown ext fixed bin(35); dcl expand_path_ ext entry (ptr,fixed bin(35),ptr,ptr,fixed bin(35)); dcl hcs_$initiate_count ext entry (char(*),char(*),char(*),fixed bin(24),fixed bin(2),ptr,fixed bin(35)); dcl hcs_$make_ptr ext entry (ptr,char(*),char(*),ptr,fixed bin(35)); dcl com_err_ ext entry options(variable); dcl code fixed bin(35); ask_name: call read_list_$prompt("Calling what program? ",call_name); if call_name= "." then do; /* "." means use the "external" entry. */ call_entry = test_timer_manager$external; return; end; ref_name = call_name; lg = length(call_name); actp = null; /* Separate out entry name */ posn = index(call_name, "$"); if posn^=0 then do; ref_name = substr(call_name,1,posn-1); entry_name = substr(call_name,posn+1,lg-posn); lg = posn-1; end; else entry_name = substr(ref_name,1,32); /* If path name, get reference name */ posn = index(ref_name, ">"); if posn=0 then do; posn = index(ref_name, "<"); if posn=0 then go to ref_okay; end; call expand_path_(addr(call_name),lg,addr(ref_name),addr(entry_name),code); if code^=0 then do; call com_err_(code,"test_timer_manager"); go to ask_name; end; call hcs_$initiate_count(ref_name,entry_name,ref_name,0,1,segp,code); if code^=0 then if code^=error_table_$segknown then do; call com_err_(code,"test_timer_manager"); go to ask_name; end; ref_okay: call hcs_$make_ptr(null(),ref_name,entry_name,segp,code); if code^=0 then do; call com_err_(code,"test_timer_manager"); go to ask_name; end; return; end find_entry; end; */ ----------------------------------------------------------- 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 */