Annotation of kernel/driverkit/KernDevice.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: 
        !            25: /*
        !            26:  * Copyright (c) 1993, 1994 NeXT Computer, Inc.
        !            27:  *
        !            28:  * Exported interface for Kernel Device Object.
        !            29:  *
        !            30:  * HISTORY
        !            31:  *
        !            32:  * 1 Jul 1994 ? at NeXT
        !            33:  *     Modifications for shared interrupts.
        !            34:  * 27 Feb 1994 ? at NeXT
        !            35:  *     Major rewrite.
        !            36:  * 3 Oct 1993 ? at NeXT
        !            37:  *     Created.
        !            38:  */
        !            39: 
        !            40: #ifdef DRIVER_PRIVATE
        !            41: 
        !            42: #import <mach/mach_types.h>
        !            43: 
        !            44: #import <objc/Object.h>
        !            45: 
        !            46: /*
        !            47:  * This object supports the
        !            48:  * delivery of hardware device
        !            49:  * interrupts via an IPC message
        !            50:  * sent to a port.
        !            51:  */
        !            52: 
        !            53: @interface KernDevice : Object
        !            54: {
        !            55: @private
        !            56:     void       *_interruptPort;
        !            57:     id         _interrupts;
        !            58:     id         _deviceDescription;
        !            59: }
        !            60: 
        !            61: - initWithDeviceDescription: deviceDescription;
        !            62: 
        !            63: - deviceDescription;
        !            64: 
        !            65: - attachInterruptPort: (port_t)interruptPort;
        !            66: - detachInterruptPort;
        !            67: - interrupt: (int)index;
        !            68: - interrupts;
        !            69: 
        !            70: @end
        !            71: 
        !            72: @interface KernDeviceInterrupt : Object
        !            73: {
        !            74: @private
        !            75:     id                 _busInterrupt;
        !            76:     id                 _lock;
        !            77:     void               *_handler;
        !            78:     void               *_handlerArgument;
        !            79:     void               *_ipcMessage;
        !            80:     BOOL               _isSuspended;
        !            81: }
        !            82: 
        !            83: - initWithInterruptPort: (void *)port;
        !            84: 
        !            85: - attachToBusInterrupt: busInterrupt
        !            86:            withArgument: (void *)argument;
        !            87: - attachToBusInterrupt: busInterrupt
        !            88:        withSpecialHandler: (void *)handler
        !            89:                argument: (void *)argument
        !            90:                atLevel: (int)level;
        !            91: - detach;
        !            92: 
        !            93: - suspend;
        !            94: - resume;
        !            95: 
        !            96: @end
        !            97: 
        !            98: /*
        !            99:  * This primative is used
        !           100:  * to deliver an interrupt
        !           101:  * message to an IPC port
        !           102:  * from an interrupt handler.
        !           103:  * This routine is public API.
        !           104:  */
        !           105: 
        !           106: void
        !           107: IOSendInterrupt(
        !           108:        void                    *interrupt,
        !           109:        void                    *state,
        !           110:        unsigned int            msgId
        !           111: );
        !           112: 
        !           113: /*
        !           114:  * These primatives provide the
        !           115:  * ability to manipulate a device
        !           116:  * interrupt from an interrupt
        !           117:  * handler.  These only work
        !           118:  * correctly from inside a bone-
        !           119:  * fide interrupt handler.
        !           120:  */
        !           121: 
        !           122: void
        !           123: IOEnableInterrupt(
        !           124:        void                    *interrupt
        !           125: );
        !           126: 
        !           127: void
        !           128: IODisableInterrupt(
        !           129:        void                    *interrupt
        !           130: );
        !           131: 
        !           132: /*
        !           133:  * One of these primatives should
        !           134:  * be invoked to indicate the
        !           135:  * assertion of a hardware bus
        !           136:  * interrupt for an attached device
        !           137:  * interrupt.
        !           138:  */
        !           139: #if sparc
        !           140: int
        !           141: #else
        !           142: void
        !           143: #endif
        !           144: KernDeviceInterruptDispatch(
        !           145:        KernDeviceInterrupt     *interrupt,
        !           146:        void                    *state
        !           147: );
        !           148: 
        !           149: void
        !           150: KernDeviceInterruptDispatchShared(
        !           151:        KernDeviceInterrupt     *interrupt,
        !           152:        void                    *state
        !           153: );
        !           154: 
        !           155: #endif

unix.superglobalmegacorp.com

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