Annotation of kernel/bsd/dev/ppc/drvApple96_SCSI/Apple96CurioDBDMA.m, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /**
                     26:  * Copyright (c) 1994-1996 NeXT Software, Inc.  All rights reserved. 
                     27:  * Copyright 1997 Apple Computer Inc. All Rights Reserved.
                     28:  * @author     Martin Minow    mailto:[email protected]
                     29:  * @revision   1997.02.13      Initial conversion from AMDPCSCSIDriver sources.
                     30:  *
                     31:  * Set tabs every 4 characters.
                     32:  *
                     33:  * Apple96PCIDBDMA.h - Minimal DBDMA Handler for the Apple 96 PCI driver. This is
                     34:  * a temporary file until "real" DBDMA support appears.
                     35:  *
                     36:  * Edit History
                     37:  * 1997.02.13  MM  Initial conversion from AMDPCSCSIDriver sources. 
                     38:  * 1997.07.18  MM  Added USE_CURIO_METHODS and wrote macros for the
                     39:  *         one-liner methods.
                     40:  */
                     41: #import "Apple96SCSI.h"
                     42: #import <driverkit/generalFuncs.h>
                     43: #import <driverkit/kernelDriver.h>
                     44: #import "Apple96CurioDBDMA.h"
                     45: #import <mach/mach_interface.h>
                     46: 
                     47: /**
                     48:  * These methods implement a minimal DBDMA support library for Curio.
                     49:  */
                     50: @implementation Apple96_SCSI(Curio_DBDMA)
                     51: 
                     52: /**
                     53:  * Quit: stop the DBDMA controller and free all memory.
                     54:  * Never done as a macro.
                     55:  */
                     56: - (void) dbdmaTerminate
                     57: {
                     58:                if (gDBDMALogicalAddress != NULL) {
                     59:            DBDMAreset();
                     60:                }
                     61:                if (gChannelCommandArea != NULL) {
                     62:                        IOFree(gChannelCommandArea, gChannelCommandAreaSize);
                     63:                        gChannelCommandArea = NULL;
                     64:        }   
                     65: }
                     66: 
                     67: #if USE_CURIO_METHODS
                     68: 
                     69: /**
                     70:  * Stop the DBDMA controller
                     71:  */
                     72: - (void) dbdmaReset
                     73: {
                     74:        __DBDMAreset();
                     75: }
                     76: 
                     77: /**
                     78:  * Start a DMA operation.
                     79:  */
                     80: - (void) dbdmaStartTransfer
                     81: {
                     82:        __DBDMAstartTransfer(); 
                     83: }
                     84: 
                     85: /**
                     86:  * Stop a DMA operation.
                     87:  */
                     88: - (void) dbdmaStopTransfer
                     89: {
                     90:        __DBDMAstopTransfer();
                     91: }
                     92: 
                     93: /**
                     94:  * Spin-wait until the DBDMA channel is inactive. This should be
                     95:  * timed to prevent deadlock.
                     96:  */
                     97: - (void) dbdmaSpinUntilIdle
                     98: {
                     99:        ENTRY("dbd dbdmaSpinUntilIdle");
                    100:        __DBDMAspinUntilIdle();
                    101:        EXIT();
                    102: }
                    103: #endif /* USE_CURIO_METHODS */
                    104: 
                    105: @end   /* Apple96_SCSI(Curio_DBDMA) */

unix.superglobalmegacorp.com

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