|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * The contents of this file constitute Original Code as defined in and ! 7: * are subject to the Apple Public Source License Version 1.1 (the ! 8: * "License"). You may not use this file except in compliance with the ! 9: * License. Please obtain a copy of the License at ! 10: * http://www.apple.com/publicsource and read it before using this file. ! 11: * ! 12: * This Original Code and all software distributed under the License are ! 13: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 14: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 15: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 16: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 17: * License for the specific language governing rights and limitations ! 18: * under the License. ! 19: * ! 20: * @APPLE_LICENSE_HEADER_END@ ! 21: */ ! 22: /* ! 23: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 24: * ! 25: * DRI: Josh de Cesare ! 26: * ! 27: */ ! 28: ! 29: #ifndef _IOKIT_APPLEVIA_H ! 30: #define _IOKIT_APPLEVIA_H ! 31: ! 32: #include <IOKit/IOInterrupts.h> ! 33: #include <IOKit/IOInterruptController.h> ! 34: ! 35: #define kInterruptControllerName "VIAInterruptController" ! 36: ! 37: #define kVIADeviceTypeCuda (0) ! 38: #define kVIADeviceTypePMU (1) ! 39: ! 40: #define kNumVectors (7) ! 41: ! 42: #define kAuxControlOffset (0x01600) ! 43: #define kT1CounterLowOffset (0x00800) ! 44: #define kT1CounterHightOffset (0x00A00) ! 45: #define kT1LatchLowOffset (0x00C00) ! 46: #define kT1LatchHighOffset (0x00E00) ! 47: ! 48: #define kIEOffset (0x01C00) ! 49: #define kIFOffset (0x01A00) ! 50: #define kPCOffset (0x01800) ! 51: ! 52: class AppleVIADevice; ! 53: class AppleVIAInterruptController; ! 54: ! 55: class AppleVIA : public IOService ! 56: { ! 57: OSDeclareDefaultStructors(AppleVIA); ! 58: ! 59: private: ! 60: IOLogicalAddress viaBaseAddress; ! 61: int viaDeviceType; ! 62: AppleVIADevice *viaDevice; ! 63: AppleVIAInterruptController *interruptController; ! 64: ! 65: public: ! 66: virtual bool start(IOService *provider); ! 67: virtual AppleVIADevice *createNub(void); ! 68: }; ! 69: ! 70: class AppleVIADevice : public IOService ! 71: { ! 72: OSDeclareDefaultStructors(AppleVIADevice); ! 73: public: ! 74: }; ! 75: ! 76: ! 77: class AppleVIAInterruptController : public IOInterruptController ! 78: { ! 79: OSDeclareDefaultStructors(AppleVIAInterruptController); ! 80: ! 81: private: ! 82: IOService *parentNub; ! 83: unsigned char pendingEvents; ! 84: volatile unsigned char *IEReg; ! 85: volatile unsigned char *IFReg; ! 86: volatile unsigned char *PCReg; ! 87: ! 88: public: ! 89: virtual IOReturn initInterruptController(IOService *provider, IOLogicalAddress interruptControllerBase); ! 90: ! 91: virtual IOInterruptAction getInterruptHandlerAddress(void); ! 92: virtual IOReturn handleInterrupt(void *refCon, ! 93: IOService *nub, int source); ! 94: ! 95: virtual void disableVectorHard(long vectorNumber, IOInterruptVector *vector); ! 96: virtual void enableVector(long vectorNumber, IOInterruptVector *vector); ! 97: virtual void causeVector(long vectorNumber, IOInterruptVector *vector); ! 98: }; ! 99: ! 100: ! 101: #endif /* ! _IOKIT_APPLEVIA_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.