From:	SMTP%"turion@research.ptt.nl" 21-MAR-1994 15:08:10.07
To:	EVERHART
CC:	
Subj:	part 3 status tool

X-Newsgroups: comp.os.vms
From: turion_s@dnlts0research.ptt.nl. (Paul Turion)
Subject: part 3 status tool
Message-ID: <1994Mar21.144019.879@news.research.ptt.nl>
Sender: turion_s@research.ptt.nl (Paul Turion)
Nntp-Posting-Host: dnlts0.research.ptt.nl
Reply-To: turion@research.ptt.nl
Organization: PTT Research
X-Newsreader: mxrn 6.18-4
Date: Mon, 21 Mar 1994 14:40:19 GMT
Lines: 440
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET


-- 
 ------- --------------------  			Paul Turion 
| p t t |  r e s e a r c h   |			The Netherlands
|      _|                    | 			e-mail address
|    _|_|   .  .  .  .  .    |			P.Turion@research.ptt.nl
|___|_|      
My interest is in the future because
I am going to spend the rest of my life there.
-+-+-+-+-+-+-+-+ START OF PART 3 -+-+-+-+-+-+-+-+
X                rsb                             ; End of Get_foreign
X;
X;
Xfailure:        blbs    signal_bool, just_dassgn ; If we don't want to signa
Vlerrors, skip LIB$SIGNAL call
X;
X                pushl   r0                      ; Push the error returned
X                pushal  node_descr              ; What node failed
X                pushl   #1                      ; How many arguments we are
V passing
X                pushl   #WHAT_TALKFAIL          ; Failure talking to the dae
Vmon
X                calls   #4, g`094lib$signal        ; Signal the error
X;
Xjust_dassgn:    $dassgn_s -                     ; Issue the deassign request
X                        chan = dev_chan
X;
X                clrl    r0                      ; Return that we failed
X                rsb                             ; Leave
X;
X;
X;
X;***************************************************************************
V****
X;* Storedata *
X;*      This procedure is intended to take the information returned and add
V *
X;* it to the accumulated data, if there is enough room. *
X;***************************************************************************
V****
X;
Xstoredata:      tstl    buffer_len              ; If we don't have any proce
Vss, skip sending them
X                beql    end_storedata           ; Branch to the end
X;
X                subl3   r6, #MAX_BUFFER, r0     ; How much room left
X                cmpl    buffer_len, r0
X                bgtr    move_some               ; Move only what we have lef
Vt
X;
X                movc3   buffer_len, buffer, (r7)
X                movl    r3, r7                  ; Store ending address
X                addl2   buffer_len, r6
X                rsb                             ; Leave...
X;
Xmove_some:      addl2   r0, r6                  ; We have filled the buffer
X                movc3   r0, buffer, (r7)
X                movl    r3, r7                  ; Store ending address
X;
Xend_storedata:  rsb                             ; End of storedata
X;
X;
X;
X;***************************************************************************
V****
X;* Sum_stats *
X;*      This subroutine is intended to add the current statistic to the tota
Vl. *
X;***************************************************************************
V****
X;
Xsum_stats:      addw2   TOTAL_INT(r8), stat_tot_int     ; Sum up the total i
Vnteractive jobs
X                addw2   TOTAL_BAT(r8), stat_tot_bat     ; Sum up the total b
Vatch jobs
X                addw2   TOTAL_NET(r8), stat_tot_net     ; Sum up the total n
Vetwork jobs
X                addw2   TOTAL_PRC(r8), stat_tot_prc     ; Sum up the total p
Vrocessess
X                rsb                                     ; End of sum_stats
X;
X;
X;
X;***************************************************************************
V****
X;* Quick *
X;*      This routine sorts the data pointers using the quick sort. *
X;***************************************************************************
V****
X;
X                .entry  quick, `094m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11>
X;
X                movl    4(ap), r10              ; Left pointer
X                movl    8(ap), r11              ; Right pointer
X;
X                cmpl    r10, r11
X                blss    split_half
X                ret
X;
Xsplit_half:     pushl   r11
X                pushl   r10
X                calls   #3, split               ; Split array in half
X                movl    r0, r9
X;
X                subl3   #1, r9, -(sp)
X                pushl   r10                     ; Sort the first half
X                calls   #2, quick
X;
X                pushl   r11
X                addl3   #1, r9, -(sp)           ; Sort the second half
X                calls   #2, quick
X;
X                ret                             ; We have finished
X;
X;
X;
X;***************************************************************************
V****
X;* Split *
X;*      This routine split the array in half, such that everything to the le
Vft *
X;* of the split point is less then everything to the right of the split poin
Vt. *
X;*
X;* Register Use:        R11 - Original Right index
X;*                      R10 - Original Left index
X;*                      R9 - Address of pointers to strings
X;*                      R8 - Pivot pointer to string
X;*                      R7 - New left index
X;*
X;***************************************************************************
V****
X;
X                .entry  split, `094m<r2,r3,r4,r5,r6,r7,r8,r8,r10,r11>
X;
X                movl    4(ap), r10              ; Left index
X                movl    8(ap), r11              ; Right index
X;
X                moval   data_ptr, r9            ; Where data pointers are
X                movl    (r9)`091r10`093, r8           ; Save pivot point
X;
X                addl3   #1, r10, r7             ; Leftindex is r10 + 1
X                                                ; Rightindex is just r11
X;
Xwhile_left:     cmpl    r7, r11                 ; End if left > right
X                bgtr    final_swap
X;
X                movl    r7, r6                  ; Index to be compared
X                jsb     cmpr                    ; Cmpr index and pivot strin
Vgs
X                bleq    while_right             ; Go and check the right
X                incl    r7                      ; Else increment to next ele
Vment
X                brb     while_left              ; Do it again sam...
X;
Xwhile_right:    cmpl    r7, r11                 ; End if left > right
X                bgtr    final_swap
X;
X                movl    r11, r6                 ; Index to compare
X                jsb     cmpr                    ; Cmpr pivot and index strin
Vgs
X                bgeq    do_swap                 ; Swap the left and right in
Vdexs
X                decl    r11                     ; Move to next string
X                brb     while_left              ; Do it again sam...
X;
Xdo_swap:        movl    (r9)`091r7`093, r0
X                movl    (r9)`091r11`093, (r9)`091r7`093     ; Swap left and
V right indexs
X                movl    r0, (r9)`091r11`093
X                incl    r7                      ; Move to next left index
X                decl    r11                     ; Move to next right index
X                brw     while_left              ; Go back and do it again sa
Vm...
X;
Xfinal_swap:     movl    (r9)`091r10`093, r0
X                movl    (r9)`091r11`093, (r9)`091r10`093    ; Swap left and
V right index ptr
X                movl    r0, (r9)`091r11`093
X;
X                movl    r11, r0                 ; Return split point
X                ret                             ; End of split
X;
X;
X;
X;***************************************************************************
V****
X;* Cmpr *
X;*      This subroutine does the comparison of the current indexes and the *
X;* pivot point. *
X;***************************************************************************
V****
X;
Xcmpr:           movzwl  user_offset, r0
X                addl3   r0, r8, r2
X                addl3   r0, (r9)`091r6`093, r3
X                cmpc3   #8, (r2), (r3)
X                beql    test_node
X                rsb
X;
Xtest_node:      movzwl  node_offset, r0
X                addl3   r0, r8, r2
X                addl3   r0, (r9)`091r6`093, r3
X                cmpc3   #6, (r2), (r3)
X                rsb                             ; End of compare
X;
X;
X                .end
$ CALL UNPACK DAE_FUNC.MAR;1 1946697584
$ create/nolog 'f'
X;***************************************************************************
V****
X;* Getncb *
X;*      This macro function takes a string, which is in the mailbox message
V *
X;* format, and extracts the network connect block from it. *
X;* *
X;* Format: getncb(&mbxmesg, &ncb_desc, &ncb); *
X;***************************************************************************
V****
X;
X                .title  GETNCB
X;
X                .psect  getncbcode, con, exe, lcl, shr, nowrt, pic, rel
X;
X                .entry  getncb, `094m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11>
X;
X                addl3   4(ap), #4, r8           ; Save pointer to mbx messag
Ve
X;
X                movzbl  (r8)+, r2               ; Get the dev count
X                addl2   r2, r8                  ; Skip over the string
X                movzbl  (r8)+, @8(ap)           ; Get the byte count of the
V str
X;
X                movc3   @8(ap), (r8), @12(ap)   ; Save the string in the NCB
X;
X                ret                             ; End of Getncb
X;
X                .end
$ CALL UNPACK GETNCB.MAR;1 543955525
$ create/nolog 'f'
X`009 EVAX=1
X`009 VMS_V15=1
X`009.TITLE`009LAVDRIVER`009VAX/VMS Load Average Pseudo Device
X`009.IDENT`009/Version 4.04/
X`009.SBTTL`009DOCUMENTATION
X;---------------S-R-I-International-Artificial-Intelligence-Center----------
V-
X;
X;
X; PROPRIETARY STATUS:
X;
X;`009Copyright (C) 1992, TGV, Inc.
X;
X;`009Redistribution and use in source and binary forms are
X;`009permitted provided that the above copyright notice and
X;`009this paragraph are duplicated in all such forms, and provided
X;`009that the driver is not distributed as part of or by any entity
X;`009that distributes software which implements the TCP/IP protocols
X;`009for VMS except as expressly provided for by a written license
X;`009with TGV.
X;
X;`009THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY
X;`009EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
X;`009LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
X;`009AND FITNESS FOR A PARTICULAR PURPOSE.
X;
X; MODULE NAME:
X;
X;`009LAVDRIVER
X;
X; PURPOSE:
X;
X;`009This is a pseudo device which supplies load average information to
X;`009programs wishing to display some indication of system load.
X;
X; KEYWORDS:
X;
X;`009Drivers
X;
X; USAGE:
X;
X;`009Standard system QIO calls.
X;
X;`009For VAX:
X;
X;`009The driver is installed via sysgen.  The following is the correct
X;`009`009sysgen command sequence.
X;
X;`009`009SYSGEN>  LOAD LAVDRIVER
X;`009`009SYSGEN>  CONNECT LAV0 /NOADA/DRIVER=LAVDRIVER
X;
X;`009`009Note: LAVDRIVER.EXE should reside in `091SYS$LDR`093
X;
X;`009For Alpha:
X;
X;`009The driver is installed via SYSMAN.  The following is the correct
X;`009`009sysman command sequence.
X;
X;`009`009SYSMAN> IO LOAD LAVDRIVER
X;`009`009SYSMAN> IO CONNECT LAV0 /NOADAPTER/DRIVER=LAVDRIVER
X;
X;`009`009Note: LAVDRIVER.EXE should reside in `091SYS$LDR`093
X;
X;
X; SPECIAL REQUIREMENTS:
X;
X;`009none
X;
X; LANGUAGE:
X;
X;`009VAX-11 MACRO
X;
X; PARAMETERS:
X;
X;`009none
X;
X; SPECIAL TECHNIQUES:
X;
X;`009none
X;
X; AUTHOR:
X;
X;`009David Kashtan
X;
X; DATE CREATED:
X;
X;`009Wed Jul 21 11:25:19 1982
X;
X; MAINTAINED BY:
X;
X;`009David Kashtan
X;
X; UPDATES:
X;
X;`009Modified for VMS V5 SMP  Thu Oct 8 1987       Kenneth Adelman / LBL
X;
X;`009Fixed priority calculation Fri Oct 4 1991     Kenneth Adelman / TGV
X;
X;`009Added DPT$M_SNAPSHOT`009   Thu Feb 6 1992     Kenneth Adelman / TGV
X;
X;`009Changed to use fixed-point arithmetic in
X;`009preparation for Alpha/VMS port
X;`009`009`009`009   Wed Aug 19 1992    Kenneth Adelman / TGV
X;
X;`009Port to Alpha/VMS`009   Thu 27-Aug-1992    Gerard K. Newman / TGV
X;
X;---------------S-R-I-International-Artificial-Intelligence-Center----------
V-
X
X`009.SBTTL`009DEFINITIONS
X
X.If`009DF,EVAX
X`009.LIBRARY`009/ALPHA$LIBRARY:LIB.MLB/
X`009.LINK`009`009/SYS$SYSTEM:SYS/
X.Iff
X`009.LIBRARY`009/SYS$LIBRARY:LIB.MLB/
X.Endc
X;+ ---
X;
X; DEFINE CONTROL BLOCK OFFSETS & OTHER SYSTEM STUFF BY CALLING 'DEF' MACROS
X;
X;- ---
X.IF`009NDF,VMS_V4
X`009$CPUDEF`009`009`009;DEFINE PER-CPU STRUCTURE
X.ENDC
X`009$CRBDEF`009`009`009;DEFINE CHANNEL REQUEST BLOCK
X`009$DCDEF`009`009`009;DEFINE DEVICE TYPES
X`009$DDBDEF`009`009`009;DEFINE DEVICE DATA BLOCK
X`009$DEVDEF`009`009`009;DEFINE DEVICE CONSTANTS
X`009$DPTDEF`009`009`009;DEFINE DRIVER PROLOGUE TABLE
X`009.IIF`009NDF,DPT$M_SNAPSHOT,`009DPT$M_SNAPSHOT`009=`0092048`009;Pre VMS V
V5.2
X`009$DYNDEF`009`009`009;DEFINE DYNAMIC STRUCTURE CODES
X`009$FKBDEF`009`009`009;DEFINE FORK BLOCK CODES
X`009$IODEF`009`009`009;DEFINE I/O FUNCTION CODES
X.IF`009DF,VMS_V4
X`009$IPLDEF`009`009`009;DEFINE INTERRUPT PRIORITY LEVELS
X.ENDC
X`009$IRPDEF`009`009`009;DEFINE I/O REQUEST PACKET
X.IF`009NDF,VMS_V4
X`009$ORBDEF`009`009`009;DEFINE OBJECT RIGHTS BLOCK
X.ENDC
X`009$PCBDEF`009`009`009;DEFINE PROCESS CONTROL BLOCK
X`009$PHDDEF`009`009`009;DEFINE PROCESS HEADER
X`009$PRVDEF`009`009`009;DEFINE VMS PRIVS
X`009$TQEDEF`009`009`009;DEFINE TIMER QUEUE ENTRY
X`009$UCBDEF`009`009`009;DEFINE UNIT CONTROL BLOCK
X`009$VECDEF`009`009`009;DEFINE VECTOR OFFSETS
X;
X
X`009.SBTTL`009DRIVER PROLOGUE TABLE
X
X.If`009DF,EVAX
X
X`009DRIVER_DATA`009`009`009`009;To the driver data psect
X
X.Endc
X;+ ---
X;
X; DRIVER CHARACTERISTICS
X;
X;- ---
X.IF`009DF,VMS_V4
X`009DPTAB`009       -
X`009`009`009END=LAV_END,`009       -;END OF DRIVER (SIZE)
X`009`009`009ADAPTER=NULL,`009       -;No adapter
X`009`009`009UCBSIZE=UCB$C_Length,  -;UNIT CONTROL BLOCK LENGTH
X`009`009`009MAXUNITS=1,`009       -;ONLY ONE LAV0 DEVICE
X`009`009`009UNLOAD=LAV_UNLOAD,     -;UNLOAD ROUTINE
X`009`009`009NAME=LAVDRIVER`009`009;DRIVER NAME
X.ENDC
X.IF`009DF,VMS_V5
X`009DPTAB`009       -
X`009`009`009END=LAV_END,`009       -;END OF DRIVER (SIZE)
X`009`009`009ADAPTER=NULL,`009       -;No adapter
X`009`009`009UCBSIZE=UCB$C_Length,  -;UNIT CONTROL BLOCK LENGTH
X`009`009`009MAXUNITS=1,`009       -;ONLY ONE LAV0 DEVICE
X`009`009`009UNLOAD=LAV_UNLOAD,     -;UNLOAD ROUTINE
X`009`009`009NAME=LAVDRIVER,        -;DRIVER NAME
X`009`009`009FLAGS=DPT$M_SNAPSHOT,  -;SNAPSHOT SYSTEM OK
X`009`009`009SMP=YES`009`009`009;Works under SMP
X.ENDC
X.IF`009DF,VMS_V6
X`009DPTAB`009       -
X`009`009`009END=LAV_END,`009       -;END OF DRIVER (SIZE)
X`009`009`009ADAPTER=NULL,`009       -;No adapter
X`009`009`009UCBSIZE=UCB$C_Length,  -;UNIT CONTROL BLOCK LENGTH
X`009`009`009MAXUNITS=1,`009       -;ONLY ONE LAV0 DEVICE
X`009`009`009UNLOAD=LAV_UNLOAD,     -;UNLOAD ROUTINE
X`009`009`009NAME=LAVDRIVER,        -;DRIVER NAME
X`009`009`009FLAGS=<DPT$M_SNAPSHOT!DPT$M_XPAMOD>,  -;SNAPSHOT SYSTEM OK
X`009`009`009SMP=YES`009`009`009;Works under SMP
X.ENDC
X.IF`009DF,EVAX
X`009DPTAB`009       -
X`009`009`009END=LAV_END,`009       -;END OF DRIVER (SIZE)
X`009`009`009ADAPTER=NULL,`009       -;No adapter
+-+-+-+-+-+-+-+-  END  OF PART 3 +-+-+-+-+-+-+-+-

