|
|
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_APPLEMPIC_H
30: #define _IOKIT_APPLEMPIC_H
31:
32: #include <IOKit/IOInterrupts.h>
33: #include <IOKit/IOInterruptController.h>
34:
35: // Offsets and strides to MPIC registers.
36:
37: #define kFeatureOffset (0x01000)
38: #define kGlobal0Offset (0x01020)
39: #define kVendorIDOffset (0x01080)
40: #define kProcInitOffset (0x01090)
41: #define kIPInVecPriOffset (0x010A0)
42: #define kIPInVecPriStride (0x00010)
43: #define kSpurVectOffset (0x010E0)
44: #define kTmrFreqOffset (0x010F0)
45: #define kTnCurrCntOffset (0x01100)
46: #define kTnBaseCntOffset (0x01110)
47: #define kTnVecPriOffset (0x01120)
48: #define kTnDestOffset (0x01130)
49: #define kTnStride (0x00040)
50: #define kIntnVecPriOffset (0x10000)
51: #define kIntnDestOffset (0x10010)
52: #define kIntnStride (0x00020)
53: #define kPnIPImDispOffset (0x20040)
54: #define kPnIPImDispStride (0x00010)
55: #define kPnCurrTskPriOffset (0x20080)
56: #define kPnIntAckOffset (0x200A0)
57: #define kPnEOIOffset (0x200B0)
58: #define kPnStride (0x01000)
59:
60: // Feature Reporting Register
61: #define kFRRVersionMask (0x000000FF)
62: #define kFRRVersionShift (0)
63: #define kFRRNumCPUMask (0x00001F00)
64: #define kFRRNumCPUShift (8)
65: #define kFRRNumIRQsMask (0x07FF0000)
66: #define kFRRNumIRQsShift (16)
67:
68: // Global Configuration Register 0
69: #define kGCR0Reset (0x80000000)
70: #define kGCR0Cascade (0x20000000)
71:
72: // Vendor ID Register
73: #define kVIDRVendorIDMask (0x000000FF)
74: #define kVIDRVendorIDShift (0)
75: #define kVIDRDeviceIDMask (0x0000FF00)
76: #define kVIDRDeviceIDShift (8)
77:
78: // Spurious Vector
79: #define kSpuriousVectorNumber (0xFF)
80:
81: // Interrupt Source n Vector/Priority Registers
82: #define kIntnVPRMask (0x80000000)
83: #define kIntnVPRActive (0x40000000)
84: #define kIntnVPRSense (0x00400000)
85: #define kIntnVPRPriorityMask (0x000F0000)
86: #define kIntnVPRPriorityShift (16)
87: #define kIntnVPRVectorMask (0x000000FF)
88: #define kIntnVPRVectorShift (0)
89:
90: class AppleMPICInterruptController : public IOInterruptController
91: {
92: OSDeclareDefaultStructors(AppleMPICInterruptController);
93:
94: private:
95: IOLogicalAddress mpicBaseAddress;
96: IOMemoryMap *mpicMemoryMap;
97: int numCPUs;
98: int numVectors;
99: OSSymbol *interruptControllerName;
100: IOService *parentNub;
101: long *senses;
102:
103: public:
104: virtual bool start(IOService *provider);
105:
106: virtual IOReturn getInterruptType(IOService *nub, int source,
107: int *interruptType);
108:
109: virtual IOInterruptAction getInterruptHandlerAddress(void);
110: virtual IOReturn handleInterrupt(void *refCon,
111: IOService *nub, int source);
112:
113: virtual bool vectorCanBeShared(long vectorNumber, IOInterruptVector *vector);
114: virtual void initVector(long vectorNumber, IOInterruptVector *vector);
115: virtual void disableVectorHard(long vectorNumber, IOInterruptVector *vector);
116: virtual void enableVector(long vectorNumber, IOInterruptVector *vector);
117:
118: virtual OSData *getIPIVector(long physCPU);
119: virtual void dispatchIPI(long source, long targetMask);
120: };
121:
122:
123: #endif /* ! _IOKIT_APPLEMPIC_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.