Google
 

Trailing-Edge - PDP-10 Archives - bb-kl11k-bm_tops20_v7_0_tsu02_2_of_2 - t20src/mxfork.r36
There are 7 other files named mxfork.r36 in the archive. Click here to see a list.
!	COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1989.
!	ALL RIGHTS RESERVED.
!
!	THIS SOFTWARE IS FURNISHED UNDER A  LICENSE AND MAY BE USED AND  COPIED
!	ONLY IN  ACCORDANCE  WITH  THE  TERMS OF  SUCH  LICENSE  AND  WITH  THE
!	INCLUSION OF THE ABOVE  COPYRIGHT NOTICE.  THIS  SOFTWARE OR ANY  OTHER
!	COPIES THEREOF MAY NOT BE PROVIDED  OR OTHERWISE MADE AVAILABLE TO  ANY
!	OTHER PERSON.  NO  TITLE TO  AND OWNERSHIP  OF THE  SOFTWARE IS  HEREBY
!	TRANSFERRED.
!
!	THE INFORMATION IN THIS  SOFTWARE IS SUBJECT  TO CHANGE WITHOUT  NOTICE
!	AND SHOULD  NOT  BE CONSTRUED  AS  A COMMITMENT  BY  DIGITAL  EQUIPMENT
!	CORPORATION.
!
!	DIGITAL ASSUMES NO  RESPONSIBILITY FOR  THE USE OR  RELIABILITY OF  ITS
!	SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
!
! Global Routine Mappings
!
!
MACRO
    MX$FORK_INITIALIZE = FRKINI %,
    MX$FORK_CREATE = FRKCRE %,
    MX$FORK_KILL = FRKKIL %,
    MX$FORK_RUN = FRKRUN %,
    MX$FORK_INTERRUPT = FRKINT %;
!
! Fork Info Block
!
$FIELD
    fork_info_block_fields =
        SET
        fork_next =       [$ADDRESS],       !Next FIB in fork_list
        fork_task =       [$ADDRESS],       !Task block which owns this FIB
        fork_channel =    [$SHORT_INTEGER], !Interrupt channel number
        fork_event =      [$ADDRESS],       !Event block address
        fork_start =      [$ADDRESS],       !Start Address
        fork_handle =     [$ADDRESS],       !Fork Handle
        fork_page =       [$ADDRESS]        !Page address
        TES;

LITERAL
    fork_info_block_size = $FIELD_SET_SIZE;

MACRO
    fork_info_block =
	BLOCK [fork_info_block_size] FIELD (fork_info_block_fields) %;

MACRO
    mx$get_fib =
        BEGIN
        LOCAL
            ttsk: REF task_block,
            tfib: REF fork_info_block;

        tfib = nmu$memory_get(fork_info_block_size);
        tfib[fork_task] = ttsk = current_task;
        ttsk[tb_fork] = .tfib
        END %;

!
!Define the fork data page
!
$FIELD
    fork_data =
        SET
        sf_status =       [$INTEGER],       !Word 0
          sf_run =        [0,35,1,0],       !  Bit 0     
          sf_err =        [0,34,1,0],       !  Bit 1
          sf_dne =        [0,33,1,0],       !  Bit 2
          sf_dbg =        [0,32,1,0],       !  Bit 3
          sf_rea =        [0,0,18,0],       !Right half
        sf_function =     [$INTEGER],       !Word 1
        sf_argument_2 =   [$INTEGER],       !Word 2
        sf_argument_3 =   [$INTEGER],       !Word 3
        sf_argument_4 =   [$INTEGER]        !Word 4
        TES;

LITERAL
    fork_data_size = 512;

MACRO
    fork_data_page = BLOCK[fork_data_size] FIELD (fork_data) %;

MACRO
    mx$get_fork_data_page (fib) =
        BEGIN
        BIND
            fb = (fib): fork_info_block;

        fb[fork_page] = nmu$page_get();
        mx$init_fork_data_page(.fb[fork_page],.fb[fork_channel])
        END %;

MACRO
    mx$init_fork_data_page(pag,ichn) =
        BEGIN
        BIND
            pn = (pag),
            dp = pn * 512: fork_data_page;
            
        dp[sf_status] = 0;

    %IF %VARIANT EQL 1
    %THEN
        dp[sf_dbg] = 1;
    %FI

        dp[sf_function] = sd$ini;
        dp[sf_argument_2] = ichn;
        dp[sf_argument_3] = pn;
        dp
        END %;
!
! Add the SUBDCN function codes
!
LITERAL
    sd$ini = 0,
    sd$opn = 1,
    sd$rd  = 2,
    sd$wrm = 3,
    sd$wrs = 4;