/opensource.apple.com/source/AppleMacRISC2PE/AppleMacRISC2PE-161.2.2/MacRISC2CPU.h
C Header | 197 lines | 153 code | 21 blank | 23 comment | 0 complexity | d210a6c295da43018c684ecdf67786f8 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0, BSD-3-Clause, GPL-3.0, MPL-2.0, LGPL-2.0, LGPL-2.1, CC-BY-SA-3.0, IPL-1.0, ISC, AGPL-1.0, AGPL-3.0, JSON, Apache-2.0, 0BSD
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>MacRISC2CPU.h</title>
- <style type="text/css">
- .enscript-comment { font-style: italic; color: rgb(178,34,34); }
- .enscript-function-name { font-weight: bold; color: rgb(0,0,255); }
- .enscript-variable-name { font-weight: bold; color: rgb(184,134,11); }
- .enscript-keyword { font-weight: bold; color: rgb(160,32,240); }
- .enscript-reference { font-weight: bold; color: rgb(95,158,160); }
- .enscript-string { font-weight: bold; color: rgb(188,143,143); }
- .enscript-builtin { font-weight: bold; color: rgb(218,112,214); }
- .enscript-type { font-weight: bold; color: rgb(34,139,34); }
- .enscript-highlight { text-decoration: underline; color: 0; }
- </style>
- </head>
- <body id="top">
- <h1 style="margin:8px;" id="f1">MacRISC2CPU.h <span style="font-weight: normal; font-size: 0.5em;">[<a href="?txt">plain text</a>]</span></h1>
- <hr/>
- <div></div>
- <pre>
- <span class="enscript-comment">/*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * <a href="http://www.apple.com/publicsource">http://www.apple.com/publicsource</a> and read it before using this file.
- *
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */</span>
- <span class="enscript-comment">/*
- * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved.
- *
- * DRI: Dave Radcliffe
- *
- */</span>
- #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">_IOKIT_MACRISC2CPU_H</span>
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">_IOKIT_MACRISC2CPU_H</span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/IOCPU.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string">"MacRISC2.h"</span>
- #<span class="enscript-reference">include</span> <span class="enscript-string">"IOPlatformMonitor.h"</span>
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">enableUserClientInterface</span> 0
- #<span class="enscript-reference">if</span> <span class="enscript-variable-name">enableUserClientInterface</span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/IOService.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/IOPlatformExpert.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/IOTimerEventSource.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/IOInterruptEventSource.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/platform/AppleMacIODevice.h></span>
- #<span class="enscript-reference">include</span> <span class="enscript-string"><IOKit/pwr_mgt/RootDomain.h></span>
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kNormal</span> 0
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kNoVoltage</span> 1
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kDelayAACKOnly</span> 2
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kToggleDelayAACK</span> 4
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kDFSLow</span> 1
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kDFSHigh</span> 0
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kGPULow</span> 1
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kGPUHigh</span> 0
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kSteppedLow</span> 1
- #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kSteppedHigh</span> 0
- #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">sub_iokit_graphics</span>
- # <span class="enscript-reference">define</span> <span class="enscript-variable-name">sub_iokit_graphics</span> err_sub(5)
- #<span class="enscript-reference">endif</span>
- #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">kIOFBLowPowerAggressiveness</span>
- # <span class="enscript-reference">define</span> <span class="enscript-variable-name">kIOFBLowPowerAggressiveness</span> iokit_family_err(sub_iokit_graphics,1)
- #<span class="enscript-reference">endif</span>
- #<span class="enscript-reference">endif</span>
- class MacRISC2PE;
- class MacRISC2CPUInterruptController;
- <span class="enscript-type">enum</span> {
- kMaxPCIBridges = 32
- };
- class MacRISC2CPU : public IOCPU
- {
- OSDeclareDefaultStructors(MacRISC2CPU);
-
- <span class="enscript-reference">private</span>:
- bool bootCPU;
- bool flushOnLock;
- bool haveSleptMPIC;
- UInt32 l2crValue;
- MacRISC2PE *macRISC2PE;
- IOService *uniN;
- IOPlatformMonitor *ioPMon;
- OSDictionary *ioPMonDict;
- UInt32 numCPUs;
- bool rememberNap;
- IOService *mpic;
- IOService *keyLargo;
- IOService *pmu;
- UInt32 soft_reset_offset;
- UInt32 timebase_enable_offset;
- IOPMrootDomain *pmRootDomain;
- bool doSleep;
- bool processorSpeedChange;
- bool ignoreSpeedChange;
- UInt32 currentProcessorSpeed;
- bool needVSetting;
- bool needAACKDelay;
- UInt32 topLevelPCIBridgeCount;
- IOPCIBridge *topLevelPCIBridges[kMaxPCIBridges];
-
- virtual <span class="enscript-type">void</span> ipiHandler(<span class="enscript-type">void</span> *refCon, <span class="enscript-type">void</span> *nub, <span class="enscript-type">int</span> source);
- <span class="enscript-comment">// callPlatformFunction symbols
- </span> <span class="enscript-type">const</span> OSSymbol *mpic_dispatchIPI;
- <span class="enscript-type">const</span> OSSymbol *mpic_getProvider;
- <span class="enscript-type">const</span> OSSymbol *mpic_getIPIVector;
- <span class="enscript-type">const</span> OSSymbol *mpic_setCurrentTaskPriority;
- <span class="enscript-type">const</span> OSSymbol *mpic_setUpForSleep;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_restoreRegisterState;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_syncTimeBase;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_saveRegisterState;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_turnOffIO;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_writeRegUInt8;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_getHostKeyLargo;
- <span class="enscript-type">const</span> OSSymbol *keyLargo_setPowerSupply;
- <span class="enscript-type">const</span> OSSymbol *uniN_setPowerState;
- <span class="enscript-type">const</span> OSSymbol *uniN_setAACKDelay;
- #<span class="enscript-reference">if</span> <span class="enscript-variable-name">enableUserClientInterface</span>
- IOWorkLoop *fWorkLoop;
- IOTimerEventSource *fDFSContTimer;
- IOTimerEventSource *fGPUContTimer;
- IOTimerEventSource *fVStepContTimer;
- bool DFS_Status;
- bool GPU_Status;
- bool vStepped;
- UInt32 DFSTime;
- UInt32 GPUTime;
- UInt32 vStepTime;
- UInt32 DFScontMode;
- virtual bool initTimers(<span class="enscript-type">void</span>);
- virtual <span class="enscript-type">void</span> DFSContTimerEventOccurred(IOTimerEventSource *sender);
- virtual <span class="enscript-type">void</span> GPUContTimerEventOccurred(IOTimerEventSource *sender);
- virtual <span class="enscript-type">void</span> vStepContTimerEventOccurred(IOTimerEventSource *sender);
- #<span class="enscript-reference">endif</span>
- <span class="enscript-reference">public</span>:
- virtual <span class="enscript-type">const</span> OSSymbol *getCPUName(<span class="enscript-type">void</span>);
-
- virtual bool start(IOService *provider);
- virtual IOReturn powerStateWillChangeTo (IOPMPowerFlags, <span class="enscript-type">unsigned</span> <span class="enscript-type">long</span>, IOService*);
- virtual IOReturn setAggressiveness(<span class="enscript-type">unsigned</span> <span class="enscript-type">long</span> selector, <span class="enscript-type">unsigned</span> <span class="enscript-type">long</span> newLevel);
- virtual <span class="enscript-type">void</span> performPMUSpeedChange (UInt32 newLevel);
- virtual <span class="enscript-type">void</span> initCPU(bool boot);
- virtual <span class="enscript-type">void</span> quiesceCPU(<span class="enscript-type">void</span>);
- virtual kern_return_t startCPU(vm_offset_t start_paddr, vm_offset_t arg_paddr);
- virtual <span class="enscript-type">void</span> haltCPU(<span class="enscript-type">void</span>);
- virtual <span class="enscript-type">void</span> signalCPU(IOCPU *target);
- virtual <span class="enscript-type">void</span> enableCPUTimeBase(bool enable);
- #<span class="enscript-reference">if</span> <span class="enscript-variable-name">enableUserClientInterface</span>
- virtual IOReturn DFS(UInt32 newLevel, UInt32 mode);
- virtual IOReturn DFSCont(UInt32 delayTime, UInt32 mode);
- virtual IOReturn DFSStopCont(<span class="enscript-type">void</span>);
- virtual IOReturn SetGPUPower(UInt32 GPUPowerLevel);
- virtual IOReturn GPUCont(UInt32 delayTime);
- virtual IOReturn GPUStopCont(<span class="enscript-type">void</span>);
- virtual IOReturn vStep(UInt32 newLevel);
- virtual IOReturn vStepCont(UInt32 delayTime);
- virtual IOReturn vStepStopCont(<span class="enscript-type">void</span>);
- <span class="enscript-type">static</span> <span class="enscript-type">void</span> DFSTimerEventHandler(OSObject *self, IOTimerEventSource *sender);
- <span class="enscript-type">static</span> <span class="enscript-type">void</span> GPUTimerEventHandler(OSObject *self, IOTimerEventSource *sender);
- <span class="enscript-type">static</span> <span class="enscript-type">void</span> vStepTimerEventHandler(OSObject *self, IOTimerEventSource *sender);
- #<span class="enscript-reference">endif</span>
- };
- #<span class="enscript-reference">endif</span> <span class="enscript-comment">/* ! _IOKIT_MACRISC2CPU_H */</span>
- </pre>
- <hr />
- </body></html>