Annotation of coherent/d/286_KERNEL/USRSRC/ldrv/dmalock.c, revision 1.1.1.1

1.1       root        1: /* $Header: /usr/src/sys/ldrv/RCS/dmalock.c,v 1.1 89/06/30 16:29:52 src Exp $
                      2:  *
                      3:  *     The  information  contained herein  is a trade secret  of INETCO
                      4:  *     Systems, Ltd, and is  confidential information.   It is provided
                      5:  *     under a license agreement,  and may be copied or disclosed  only
                      6:  *     under  the  terms  of  that  agreement.    Any  reproduction  or
                      7:  *     disclosure  of  this   material   without  the  express  written
                      8:  *     authorization of INETCO Systems, Ltd. or persuant to the license
                      9:  *     agreement is unlawful.
                     10:  *
                     11:  *     Copyright (c) 1989
                     12:  *     An unpublished work by INETCO Systems, Ltd.
                     13:  *     All rights reserved.
                     14:  *
                     15:  * $Description: $
                     16:  *     Routines to lock/unlock the DMA controller chip from a loadable driver.
                     17:  *
                     18:  * $Author: src $
                     19:  *
                     20:  * $Creation: June 29, 1989 $
                     21:  *
                     22:  * $Log:       /usr/src/sys/ldrv/RCS/dmalock.c,v $
                     23:  * Revision 1.1        89/06/30  16:29:52      src
                     24:  * Initial revision
                     25:  * 
                     26:  */
                     27: 
                     28: #include <sys/coherent.h>
                     29: 
                     30: typedef void (* vfp_t)();              /* Void function pointer type.       */
                     31: 
                     32: /*
                     33:  * External functions.
                     34:  */
                     35: extern void Kdmalock();
                     36: extern void Kdmaunlock();
                     37: extern void Kldtimcall();
                     38: extern saddr_t getcs();
                     39: 
                     40: /*
                     41:  * int
                     42:  * dmalock( tp, fun, arg )
                     43:  * TIM * tp;
                     44:  * vfp_t fun;
                     45:  * int  arg;
                     46:  *
                     47:  *     Inputs: tp  = Deferred function structure pointer.
                     48:  *             fun = Function to call if request is deferred.
                     49:  *             arg = Argument to pass to function.
                     50:  *
                     51:  *     Action: Calls kernel dmalock() routine.
                     52:  *
                     53:  *     Return: 0 = Lock granted or -1 = Lock deferred.
                     54:  *
                     55:  *     Notes:  DMA controller locking was introduced to cure a bug on the
                     56:  *             NCR DMA controller, where overlapped DMA caused problems.
                     57:  *             No action is taken if DMA locking is disabled.
                     58:  */
                     59: 
                     60: int
                     61: dmalock( tp, fun, arg )
                     62: register TIM  * tp;
                     63: vfp_t          fun;
                     64: int            arg;
                     65: {
                     66:        /*
                     67:         * Define loadable driver interface.
                     68:         * Kldtimcall will be invoked when a deferred function is executed.
                     69:         * It will in turn invoke FP_SEL(tp->t_ldrv):4 (the calling drivers
                     70:         * function call entry point), passing FP_OFF(tp->t_ldrv) (the function
                     71:         * to call) in AX.
                     72:         */
                     73:        FP_SEL(tp->t_ldrv) = getcs();
                     74:        FP_OFF(tp->t_ldrv) = fun;
                     75:        return( kcall( Kdmalock, tp, Kldtimcall, arg ) );
                     76: }
                     77: 
                     78: /*
                     79:  * void
                     80:  * dmaunlock( tp )
                     81:  * TIM * tp;
                     82:  *
                     83:  *     Inputs: tp = Deferred function structure pointer.
                     84:  *
                     85:  *     Action: Calls the kernel dmaunlock().
                     86:  */
                     87: 
                     88: void
                     89: dmaunlock( tp )
                     90: register TIM * tp;
                     91: {
                     92:        kcall( Kdmaunlock, tp );
                     93: }
                     94: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.