Annotation of driverkit/Examples/KStub/IOStubPrivate.h, revision 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: /*     IOStubPrivate.h         1.0     02/07/91        (c) 1992 NeXT   
        !            25:  *
        !            26:  * IOStubPrivate.h - Private data structures for IOStub device.
        !            27:  *
        !            28:  * HISTORY
        !            29:  * 19-Oct-92   Doug Mitchell at NeXT
        !            30:  *      Created.
        !            31:  */
        !            32: 
        !            33: #import "IOStub.h"
        !            34: #import <driverkit/deviceCommon.h>
        !            35: #import <objc/objc.h>
        !            36: #import <kernserv/queue.h>
        !            37: #import <mach/mach_types.h>
        !            38: #import <driverkit/DeviceUxpr.h>
        !            39: 
        !            40: /*
        !            41:  * Operations performed by IOStub's I/O thread.
        !            42:  */
        !            43: enum stub_cmd {STUB_READ, STUB_WRITE, STUB_ABORT };
        !            44: 
        !            45: /*
        !            46:  * Representation of one I/O. This is generated by the device's exported
        !            47:  * methods and enqueued on IOQueue to be serviced by the I/O thread.
        !            48:  */
        !            49: typedef struct _IOBuf {
        !            50: 
        !            51:        enum stub_cmd   cmd;            /* op to perform */
        !            52:        u_int           offset;         /* block # */
        !            53:        u_int           bytesReq;       /* bytes to move */
        !            54:        void            *buf;           /* where to r/w */
        !            55:        u_int           bytesXfr;       /* bytes actually moved (RETURNED) */
        !            56:        IOReturn        status;         /* result (RETURNED) */
        !            57:        void            *pending;       /* if non-NULL, async request; this is
        !            58:                                         * used to ioComplete: the operation.
        !            59:                                         * For kernel version, this is actually
        !            60:                                         * a struct buf */
        !            61:        id              waitLock;       /* NXConditionLock. Sync I/O waits 
        !            62:                                         *    on this. */
        !            63:        vm_task_t       client;         /* address space of *buf */
        !            64: 
        !            65:        /*
        !            66:         * Fields written by device-specific dispatch code.
        !            67:         */
        !            68:        id              device;         /* instance which owns this I/O */
        !            69:        int             dirRead;        /* Written by command-specific code.
        !            70:                                         * Specifies direction of data 
        !            71:                                         * transfer. A hack which should go 
        !            72:                                         * away with RO support. */
        !            73:        /*
        !            74:         * Queueing fields.
        !            75:         */
        !            76:        queue_chain_t   ioChain;        /* for linking on IOQueue.queue */
        !            77:        
        !            78: } IOBuf;
        !            79: 
        !            80: /*
        !            81:  * Values for IOQueue.queueLock condition variable.
        !            82:  */
        !            83: #define NO_WORK_AVAILABLE      0
        !            84: #define WORK_AVAILABLE         1
        !            85: 
        !            86: /*
        !            87:  * bitmasks for xprMask.
        !            88:  */
        !            89: #define XPR_STUB       0x80000000
        !            90: 
        !            91: #define xpr_stub(x, a, b, c, d, e)                                     \
        !            92:        uxpr(XPR_IODEVICE_INDEX, XPR_STUB, x, a, b, c, d, e)

unix.superglobalmegacorp.com

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