" BEGIN INCLUDE FILE ...... gate_macros.incl.alm " Last modified 6/77 by N. Morris, B. Greenberg, & T. VanVleck " Modified 741212 by PG to inhibit while computing virtual CPU time " Modified 83-03-14 by E. N. Kittlitz to clear IR " Modified 83-06-01 BIM for ring alarm polling " Modified 85-04-03 by Keith Loepere to make polling a little smarter. " This file contains several macros used when generating gate segments. " The major macros that are defined are: " " gate_info general setup code for normal gates " hardcore_gate_info general setup code for hardcore gates " bad_dir_handler setup and handler for bad_dir_ condition (goes at bottom) " bad_dir_handler_entry entrypoint for above (goes at top) " gate to define a normal gate " hgate to define a hardcore gate " fgate to define a fast hardcore gate " maclist off " HGATE - define a hardcore gate entry " " hgate gatename,procedure,entry,args{,bad_dir_trap} " " The entrypoint gatename is defined in the gate segment. If args " is nonzero, the number of arguments passed to gatename must be " equal to args. When gatename is called, it will in turn call " procedure$entry. " macro hgate gentry &1,&4*2,&1.t tsx2 .setup &=&5,bad_dir_trap&[ tsx0 .set_dir_trap &] ldi =0,dl short_call &2$&3(ap|0) eppbp lp|&1.t tra .return_code maclist restore use linkage even maclist on,save &1.t: bss ,gate_entry_data_size maclist restore &end " FGATE - define a fast hardcore gate " " fgate gatename,procedure,entry " macro fgate gentry &1,0,0 ldi =0,dl epplp .my_lp,* tra &2$&3 maclist off &end " GATE - define a normal gate entry " " gate gatename,procedure,entry,args " macro gate gentry &1,&4*2,0 tsx2 .setup ldi =0,dl short_call &2$&3(ap|0) return maclist restore &end macro gentry maclist on,save segdef &1 maclist restore use transfer_vector maclist on,save &1: tra &1.e maclist restore use main maclist on,save zero &2,&3 &1.e: &end " HARDCORE_GATE_INFO - general info for hardcore gates macro hardcore_gate_info maclist on,save name &1 include stack_header include stack_frame include gate_data maclist restore eject tempd .temp tempd .label_variable(0) tempd .time1,.time2 tempd .unwinder_arglist(0) tempd .on_unit(5) temp .pf,.entryp tempd .vfl_arglist(2) tempd .mcptr use transfer_vector equ .tv_begin,* tra .actor use tv_end entrybound segdef .tv_end .tv_end: vfd 14/(*-.tv_begin) use main segdef .my_lp even .my_lp: bss ,2 join /text/transfer_vector,tv_end,main use linkage join /link/linkage use main maclist restore eject .actor: epplp .my_lp,* maclist restore gate_actor .setup: push epplp .my_lp,* sprilp sp|stack_frame.lp_ptr maclist restore gcheck inhibit on <+><+><+><+><+><+><+><+><+><+><+><+> rccl sys_info$clock_,* calculate times sbaq pds$cpu_time staq .time1 sbaq pds$virtual_delta staq .time2 lda pds$page_waits sta .pf inhibit off <-><-><-><-><-><-><-><-><-><-><-><-> tra 0,2 maclist restore eject .return_code: inhibit on <+><+><+><+><+><+><+><+><+><+><+><+> rccl sys_info$clock_,* calculate times sbaq pds$cpu_time staq .temp sbaq .time1 adaq bp|gate_entry_data.cpu_time staq bp|gate_entry_data.cpu_time ldaq .temp sbaq pds$virtual_delta sbaq .time2 adaq bp|gate_entry_data.vcpu_time staq bp|gate_entry_data.vcpu_time lda pds$page_waits sbla .pf asa bp|gate_entry_data.page_waits aos bp|gate_entry_data.calls inhibit off <-><-><-><-><-><-><-><-><-><-><-><-> " Poll for ring alarms sra .temp Borrow from time calc szn .temp Zero? tze .return_code_return epp1 sp|stack_frame.prev_sp,* "possible ring alarm epaq pr1|stack_frame.return_ptr,* ana 7,dl " ring number to which we return cmpa .temp tpl .ring_alarm " ring alarm will occur .return_code_return: return .ring_alarm: " perhaps we can handle without faults? aos bp|gate_entry_data.ring_alarms stz .temp " return argument for ring_alarm$poll ldaq .one_arg_header staq .ring_alarm_arg_list epp1 .temp spri1 .ring_alarm_arg_list+2 eppap .ring_alarm_arg_list short_call ring_alarm$poll szn .temp tze .return_code_return eppsp sp|stack_frame.prev_sp,* sprisp pds$pre_empt_poll_return " short-return from here epp1 sb|stack_header.stack_begin_ptr,* " abandoning this stack frame. spri1 sb|stack_header.stack_end_ptr " Leave SB as stack_0, so pxss can get to operators. tra pxss$pre_empt_poll tempd .ring_alarm_arg_list(2) even .one_arg_header: vfd 17/2,1/0,18/4 vfd 18/0,18/0 maclist restore eject maclist restore &end " BAD_DIR_HANDLER - code to setup and handle bad_dir_ condition " put this after the last hgate macro macro bad_dir_handler maclist on,save include on_unit use transfer_vector .handler_entry: tra .handler .handler_restart_entry: tra .handler_restart_point use main .set_dir_trap: stx0 .entryp save for restart mlr (),(pr),fill(000) desc9a 0,0 desc9a .on_unit,10*4 eppbp .bad_dir_name spribp .on_unit+on_unit.name eppbp .handler_entry spribp .on_unit+on_unit.body lxl1 .bad_dir_desc sxl1 .on_unit+on_unit.size eaa .on_unit set up on-unit for bad_dir_ sbla sp|0,du .. make rel to sp sta sp|stack_frame.on_unit_rel_ptrs lda stack_frame.condition_bit,dl orsa sp|stack_frame.flag_word tra 0,0 string bad_dir_ .handler: epaq sp|0 verify that call came from ring 0 cana -1,dl check ring number in AL tze *+2 zero 0 go way kid you bother me push " ok, we like the call epplp .my_lp,* ldx0 ap|0 get display eppbp ap|2,0* lda bp|stack_frame.prev_sp cana =o700000,dl from another ring? tze .continue_signal if not, back to signal_ eppap ap|2,* Get mcptr eppap ap|0,* .. spriap bp|.mcptr .. save in gate frame spribp .label_variable+2 eppbp .handler_restart_entry spribp .label_variable eppbp .label_variable spribp .unwinder_arglist+2 fld =1b24,dl staq .unwinder_arglist call unwinder_$unwinder_(.unwinder_arglist) .continue_signal: lda =o400000,du "1"b sta ap|10,* set continue bit return .handler_restart_point: epaq sp|0 check that call came from ring 0 cana -1,dl tze *+2 zero 1 epplp .my_lp,* lca stack_frame.condition_bit+1,dl Vanish on-unit ansa sp|stack_frame.flag_word eppbp .mcptr spribp .vfl_arglist+2 fld =1b24,dl staq .vfl_arglist short_call verify_lock$verify_lock_bad_dir(.vfl_arglist) ldx0 .entryp eppap sp|stack_frame.arg_ptr,* tra 0,0 retry the call maclist restore eject maclist restore &end " GATE_INFO - general info for non-hardcore gates macro gate_info maclist on,save use transfer_vector tra .actor use tv_end entrybound use main join /text/transfer_vector,tv_end,main maclist restore eject .actor: getlp maclist restore gate_actor maclist restore eject .setup: push getlp maclist restore gcheck tra 0,2 maclist restore eject maclist restore &end " Macro to generate gate actor. macro gate_actor maclist on,save eppbp ap|2,* lda bp|-1 get length of string tze .return_name zero length => get name adla 1,dl include length of acc stz ap|4,* tsx0 .search_defs cmpc (pr,rl),(pr,rl) compare name desc9a bp|-1(3),al desc9a bb|0,al tnz .next_def lda ab|1,2 return location arl 18 sta ap|4,* short_return .return_name: lxl3 ap|4,* get location tsx0 .search_defs cmpx3 ab|1,2 compare location tnz .next_def lda bb|0 get length of name arl 27 sta bp|-1 set length of varying string mlr (pr,rl),(pr,rl) return string desc9a bb|0(1),al desc9a bp|0,al short_return .search_defs: eax2 0 eppab lp|0,* ab -> defs .defs_loop: lxl1 ab|1,2 get class and flags cmpx1 =o400000,du must be class 0 tnz .next_def ldx7 ab|2,2 eppbb ab|0,7 bb -> name tra 0,0 test definition .next_def: ldx2 ab|0,2 chain to next def tnz .defs_loop short_return &end " Miscellaneous macros. macro gcheck maclist on,save ldx1 -2,2 get number of args expected tze .no_gate_error if zero, none or doesn't matter cmpx1 ap|0 compare against number given tze .no_gate_error args match, call procedure call signal_$signal_(signal_arglist) oct 0 even signal_arglist: zero 2,4 zero 2,0 arg .gate_errorname arg arg .gate_errordesc arg string gate_error .no_gate_error: &end macro string .&1name: aci "&1" .&1desc: vfd o9/525,o27/&l1 &end macro eject maclist on,save &end " END INCLUDE FILE ...... gate_macros.incl.alm " To arrange the return it wants to return, it will have to reach back 2 frames. " " " ----------------------------------------------------------- " " " " 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 " "