Annotation of driverkit/libDriver/ppc/IONDRVInterface.h, 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:  * Copyright (c) 1997 Apple Computer, Inc.
                     26:  *
                     27:  *
                     28:  * HISTORY
                     29:  *
                     30:  * Simon Douglas  22 Oct 97
                     31:  * - first checked in.
                     32:  */
                     33: 
                     34: 
                     35: #ifndef __NDRVINTERFACE__
                     36: #define __NDRVINTERFACE__
                     37: 
                     38: #import <driverkit/ppc/IOMacOSTypes.h>
                     39: 
                     40: #pragma options align=mac68k
                     41: 
                     42: 
                     43: typedef void * RegEntryID[4];
                     44: 
                     45: struct DriverInitInfo {
                     46:     UInt16                          refNum;
                     47:     RegEntryID                      deviceEntry;
                     48: };
                     49: 
                     50: #define MAKE_REG_ENTRY(regEntryID,obj)                                 \
                     51:        ((void **)regEntryID)[ 0 ] = (void *) obj;              \
                     52:        ((void **)regEntryID)[ 1 ] = (void *) ~(UInt32)obj;     \
                     53:        ((void **)regEntryID)[ 2 ] = (void *) 0x53696d65;       \
                     54:        ((void **)regEntryID)[ 3 ] = (void *) 0x52756c7a;
                     55: 
                     56: #define REG_ENTRY_TO_ID(regEntryID,obj)                        \
                     57:        if( (UInt32)((obj = ((id *)regEntryID)[ 0 ]))           \
                     58:         != ~((UInt32 *)regEntryID)[ 1 ] )                      \
                     59:            return( -2538);
                     60: 
                     61: struct CntrlParam {
                     62:     void *                          qLink;
                     63:     short                           qType;
                     64:     short                           ioTrap;
                     65:     void *                          ioCmdAddr;
                     66:     void *                          ioCompletion;
                     67:     short                           ioResult;
                     68:     char *                          ioNamePtr;
                     69:     short                           ioVRefNum;
                     70:     short                           ioCRefNum;
                     71:     short                           csCode;
                     72:     void *                          csParams;
                     73:     short                           csParam[9];
                     74: };
                     75: typedef struct CntrlParam CntrlParam, *CntrlParamPtr;
                     76: 
                     77: #pragma options align=reset
                     78: 
                     79: enum {
                     80:     kOpenCommand                = 0,
                     81:     kCloseCommand               = 1,
                     82:     kReadCommand                = 2,
                     83:     kWriteCommand               = 3,
                     84:     kControlCommand             = 4,
                     85:     kStatusCommand              = 5,
                     86:     kKillIOCommand              = 6,
                     87:     kInitializeCommand          = 7,                            /* init driver and device*/
                     88:     kFinalizeCommand            = 8,                            /* shutdown driver and device*/
                     89:     kReplaceCommand             = 9,                            /* replace an old driver*/
                     90:     kSupersededCommand          = 10                            /* prepare to be replaced by a new driver*/
                     91: };
                     92: enum {
                     93:     kSynchronousIOCommandKind   = 0x00000001,
                     94:     kAsynchronousIOCommandKind  = 0x00000002,
                     95:     kImmediateIOCommandKind     = 0x00000004
                     96: };
                     97: 
                     98: typedef void * NDRVInstance;
                     99: 
                    100: OSStatus    NDRVLoad( LogicalAddress container, ByteCount containerSize, NDRVInstance * instance );
                    101: OSStatus    NDRVGetSymbol( NDRVInstance instance, const char * symbolName, LogicalAddress * address );
                    102: OSStatus    NDRVGetShimClass( id ioDevice, NDRVInstance instance, UInt32 serviceIndex, char * className );
                    103: OSStatus    NDRVUnload( NDRVInstance * instance );
                    104: OSStatus    NDRVTest( void * ioDevice, LogicalAddress entry );
                    105: OSStatus    NDRVDoDriverIO( LogicalAddress entry, UInt32 commandID, void * contents, UInt32 commandCode, UInt32 commandKind );
                    106: 
                    107: extern OSStatus CallTVectorWithStack( 
                    108:            void * p1, void * p2, void * p3, void * p4, void * p5, void * p6,
                    109:            LogicalAddress entry, LogicalAddress stack );
                    110: 
                    111: extern OSStatus    CallTVector( 
                    112:            void * p1, void * p2, void * p3, void * p4, void * p5, void * p6,
                    113:            LogicalAddress entry );
                    114: 
                    115: struct InterruptSetMember {
                    116:        id              setID;
                    117:        UInt32          member;
                    118: };
                    119: typedef struct InterruptSetMember InterruptSetMember;
                    120: 
                    121: typedef SInt32 (*InterruptHandler)( InterruptSetMember setMember, void *refCon, UInt32 theIntCount);
                    122: typedef void    (*InterruptEnabler)( InterruptSetMember setMember, void *refCon);
                    123: typedef Boolean (*InterruptDisabler)( InterruptSetMember setMember, void *refCon);
                    124: 
                    125: enum {
                    126:     kFirstMemberNumber = 1,
                    127:     kIsrIsComplete     = 0,
                    128:     kIsrIsNotComplete  = -1,
                    129:     kMemberNumberParent        = -2
                    130: };
                    131: 
                    132: #endif /* __NDRVINTERFACE__ */
                    133: 

unix.superglobalmegacorp.com

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