Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - utilities/wind.mac
There are no other files named wind.mac in the archive.
	title WIND  - TOPS-20 Class Scheduler Windfall Utility - KWPaetzold

	comment \

	This program can be used to turn the class scheduler windfall
allocation on or off for a specific class.  This feature of TOPS-20 
is not guaranteed to work in future versions of TOPS-20.  

	This program written by:

			Kevin W. paetzold
			Digital Equipment Corporation

\


	search monsym,macsym
	.require sys:macrel.rel
	sall
	.directive flblst

				; symbol macros
	define sym(a,b),<a=b>
	define syms(a,b),<a==b>
	define dsym(a,b),<ifndef a,<a=b>>
	define dsyms(a,b),<ifndef a,<a==b>>

				; version information
	dsyms vwho,1		; who last hacked
	dsyms vmajor,1		; major version number
	dsyms vminor,0		; minor version number
	dsyms vedit,0		; edit number
	versio==<vwho>b2!<vmajor>b11!<vminor>b17!<vedit>b35

				; parameters
	dsyms pdlsiz,100	; stack size
	dsyms atmsiz,^d100	; atom buffer size
	dsyms txtsiz,^d300	; text buffer size
	dsyms ddtadr,770000	; ddt starting address

				; ac names
	sym t1,1		; \
	sym t2,2		;  \
	sym t3,3		;   > temporaries
	sym t4,4		;  /
	sym t5,5		; /
	sym cx,16		; macsym's ac
	sym p,17		; pdl stack pointer

	define jsysf,<ercal .jsysf>
	define noerr,<erjmp .+1>

				; io macros
	define type(str),<
	hrroi t1,[asciz\
str\]
	psout>

	define typen(str),<
	hrroi t1,[asciz\str\]
	psout>

	define numo(adr,rdx,siz),<
	move t2,adr
	movei t1,.priou
	movx t3,<<siz>b17!<rdx>b35>
	nout
	 jsysf>

				; comnd jsys macros
	define cmd(name,disp,flags),<
	ifb <disp>,<[	cm%fw!flags
			asciz\name\],,.'name>
	ifnb <disp>,<[	cm%fw!flags
			asciz\name\],,disp>>

	define docmd(fnc,data),<
	movx t1,<<fnc>b8>
	ifnb <data>,<movx t2,<data>>
	ifb <data>,<setz t2,>
	call .docmd>

	define dodsp,<
	hrrz t2,0(t2)
	call (t2)>

	define noise(str),<docmd .cmnoi,<-1,,[asciz\str\]>>
	define cnfirm,<docmd .cmcfm>

pcmds:	npcmds,,npcmds		; primary comnd table
	cmd ALLOCATE,		; allocate windfall
	cmd DDT,		; go to uddt
	cmd DEALLOCATE,		; deallocate windfall
	cmd EXIT,		; return to exec
	cmd HELP,		; display help text
	cmd MDDT,		; go to mddt
	cmd SHOW,		; display allocation information
	npcmds==.-pcmds-1

evec:				; entry vector
	jrst wind		; start
	jrst wind		; reenter
	versio			; version information
	evecl==.-evec

wind:				; starting address
	reset			; reset the world
	move p,pdlptr		; get the stack
	movei t1,.fhslf		; this fork
	rpcap			; get my privs
	 jsysf
	txnn t3,<sc%opr!sc%whl>	; are we special?
	 jrst nopriv		; no
	type <WIND - TOPS-20 Class Scheduler Windfall Allocation Utility>
	type <>
	type <>
	movx t1,<csbv,,csb>	; get blt ac
	blt t1,csb+csbsiz-1	; build virgin comnd state block
wind2:				; command parsing begins here
	docmd .cmini		; initialize a new command
wind3:				; reparse dispatch address
	docmd .cmkey,pcmds	; get a keyword
	dodsp			; go do the command
	jrst wind2		; on return do another command

nopriv:				; here when you have no privs
	type <?Wind needs Wheel or Operator capabilities to operate>
	type <>
	type <>
	haltf			; stop
	jrst .-1		; continue

.jsysf:				; routine to handle jsys errors
	movem 17,erracs+17	; save ac 17
	hrrzi 17,erracs		; get blt ac
	blt 17,erracs+16	; save acs 0-16
	move 17,erracs+17	; get ac 17 back
	typen <?>
	type <?Fatal JSYS Error at user PC >
	numo 0(p),10,0		; output user pc
	type <?Error string - >
	movei t1,.priou		; output to tty
	movx t2,<.fhslf,,-1>	; my last error
	setzb t3,t4
	erstr			; output error string
	 noerr
	 noerr
	haltf			; stop
	jrst .-1		; no continues

.docmd:				; routine to do comnd jsys stuff
	movem t1,cfb+.cmfnp	; save function code
	movem t2,cfb+.cmdat	; save data code
	movei t1,csb		; get csb address
	movei t2,cfb		; get cfb address
	comnd			; do the comnd jsys
	 jsysf			;  trap bad errors
	txnn t1,cm%nop		; errors?
	ret			; no so return
	movei t1,.priou		; tty
	rfpos			; get tty position
	 jsysf
	hrrzs t2		; zero left half
	hrroi t1,[asciz\
\]
	skipe t2		; at position zero?
	 psout			; no so put it there
	type <?Command error - >
	movei t1,.priou		; tty output
	movx t2,<.fhslf,,-1>	; my fork
	setzb t3,t4
	erstr			; output the error string
	 noerr
	 noerr
	jrst wind2		; go get another command 

.ddt:				; transfer to uddt
	noise <MODE IF LOADED>
	cnfirm
	skipe ddtadr		; ddt loaded?
	 jrst .ddt2		; yes
	typen <%DDT not loaded>
	ret			; return to caller
.ddt2:				; here when ddt is loaded
	typen <[R$G to return to WIND]>
	type <>
	jrst ddtadr		; go to it
	ret			; this should never be executed

.mddt:				; transfer to mddt
	noise <TRANSFER TO MONITOR DDT>
	cnfirm
	mddt%			; go play with monitor
	 jsysf			; handle errors
	ret			; return to get another command

.exit:				; exit command
	noise <FROM WIND>
	cnfirm
	haltf			; stop
	ret			; on continue get another command

.help:				; help command
	noise <WITH USING WIND>
	cnfirm
	hrroi t1,hlptxt		; get pointer to help text
	psout			; output it
	ret			; get another command

.show:				; show windfall status
	noise <WINDFALL CLASS ALLOCATION STATUS>
	cnfirm
	skipe maxcls		; did we lookup data yet?
	jrst .show2		; yes
	movei t1,.snpsy		; no so get lookup function
	movx t2,<squoze 0,maxcls> ; symbol name
	setz t3,
	snoop			; lookup number of classes
	 jsysf
	movem t2,maxcls		; save number of classes
	movei t1,.snpsy		; symbol lookup function	
	movx t2,<squoze 0,wa>	; symbol name
	setz t3,		; we dont care where it is
	snoop			; lookup windfall allocation table
	 jsysf			; trap errors
	movem t2,wa		; save wa address
.show2:				; may fall in
	type < Monitor supports >
	numo maxcls,12,0	; output number of classes
	typen < class's.>
	type <>			; extra crlf
	type < Class  Windfall Status>
	type < ---------------------->
	setz t5,		; reset index
.show3:				; loop address
	type < >		; do crlf
	numo t5,12,5		; output class number
	move t1,wa		; get address of wa table
	add t1,t5		; add in class number
	hrli t1,1		; we want one word
	movei t2,wac		; put it into wac
	peek			; get word from TOPS-20
	 jsysf
	hrroi t1,[asciz/  Allocated/] ; assume allocated
	skipn wac		; is it allocated?
	hrroi t1,[asciz/  Deallocated/] ; no
	psout			; output the string
	move t4,maxcls		; get number of classes
	subi t4,1		; decrement
	camge t5,t4		; all class's done?
	 aoja t5,.show3		; no
	type <>			; yes
	type <>
	ret			; get another command

.deall:				; deallocate command
	tdza t5,t5		; skip and set flag
.alloc:				; allocate command
	seto t5,		; set the flag
	noise <WINDFALL FOR CLASS>
	docmd .cmnum,12		; input class number
	move t4,t2		; save class number for a while
	cnfirm			; confirm the command
	stkvar <skclas,skflag,<skblok,.sause+1>> ; get some storage
	movem t5,skflag		; save the flag
	movem t4,skclas		; save the class number
	movei t1,.skrcs		; read class parameters function
	movei t2,skblok		; get data address
	movei t3,.sause+1	; get length of arg block
	movem t3,(t2)		; and save it
	move t3,skclas		; get the class number
	movem t3,.sacls(t2)	; save the class number
	sked%			; read class parameters
	 jsysf
	move t3,skflag		; get the flag
	movem t3,.sashr+1+skblok ; set the item
	movei t1,.skscs		; set class parameters
	movei t2,skblok		; get data address
	sked%			; set widfall stuff for class
	 jsysf			; trap errors
	ret			; return to caller

hlptxt:				; help command text
	asciz\

	Wind is a program to assist the system administrator in allocating
or deallocating TOPS-20 class scheduler windfall parameters for a specific
scheduler class.  At this time windfall may be allocated or deallocated 
only.  The class scheduler must also be allocating windfall in order for
any class to get windfall.

	The following commands are available:

Command		Description
--------------------------------------------------------------------------

ALLOCATE	Give windfall allocation rights to specified class.

DEALLOCATE	Remove windfall allocation rights from specified class.

DDT		Transfer control to UDDT.

EXIT		Return to the exec.

HELP		Type this text.

MDDT		Transfer control to MDDT

SHOW		Display current windfall allocation parameters for system.

\

prompt:	asciz/WIND>/		; the prompt

csbv:				; comnd state block virgin
	wind3			; reparse address
	.priin,,.priou		; io jfns
	-1,,prompt		; prompt
	-1,,text		; text buffer pointer
	-1,,text		; next field to parse
	txtsiz			; text buffer size
	z			; unparsed character count
	-1,,atom		; atom buffer pointer
	atmsiz			; atom buffer size
	cgb			; gtjfn block storage
	csbsiz==.-csbv		; size of csb 

	xlist			; lit follows
	lit
	list			; end of lit

pdlptr:	iowd pdlsiz,pdl		; pdl stack pointer
pdl:	block pdlsiz		; pdl stack
erracs:	block 20		; error ac storage
maxcls:	z			; number of classes
wa:	z			; wa table address
wac:	z			; wa table word contents

csb:	block csbsiz		; comnd state block
cfb:	block .cmbrk+1		; comnd function block
cgb:	block .gjatr+1		; comnd gtjfn block
atom:	block <atmsiz/5>+1	; atom buffer
text:	block <txtsiz/5>+1	; text buffer


	end <evecl,,evec>	; thats all folks