PageRenderTime 56ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title>MacRISC2CPU.h</title>
  6. <style type="text/css">
  7. .enscript-comment { font-style: italic; color: rgb(178,34,34); }
  8. .enscript-function-name { font-weight: bold; color: rgb(0,0,255); }
  9. .enscript-variable-name { font-weight: bold; color: rgb(184,134,11); }
  10. .enscript-keyword { font-weight: bold; color: rgb(160,32,240); }
  11. .enscript-reference { font-weight: bold; color: rgb(95,158,160); }
  12. .enscript-string { font-weight: bold; color: rgb(188,143,143); }
  13. .enscript-builtin { font-weight: bold; color: rgb(218,112,214); }
  14. .enscript-type { font-weight: bold; color: rgb(34,139,34); }
  15. .enscript-highlight { text-decoration: underline; color: 0; }
  16. </style>
  17. </head>
  18. <body id="top">
  19. <h1 style="margin:8px;" id="f1">MacRISC2CPU.h&nbsp;&nbsp;&nbsp;<span style="font-weight: normal; font-size: 0.5em;">[<a href="?txt">plain text</a>]</span></h1>
  20. <hr/>
  21. <div></div>
  22. <pre>
  23. <span class="enscript-comment">/*
  24. * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
  25. *
  26. * @APPLE_LICENSE_HEADER_START@
  27. *
  28. * The contents of this file constitute Original Code as defined in and
  29. * are subject to the Apple Public Source License Version 1.1 (the
  30. * &quot;License&quot;). You may not use this file except in compliance with the
  31. * License. Please obtain a copy of the License at
  32. * <a href="http://www.apple.com/publicsource">http://www.apple.com/publicsource</a> and read it before using this file.
  33. *
  34. * This Original Code and all software distributed under the License are
  35. * distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  36. * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  37. * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  38. * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
  39. * License for the specific language governing rights and limitations
  40. * under the License.
  41. *
  42. * @APPLE_LICENSE_HEADER_END@
  43. */</span>
  44. <span class="enscript-comment">/*
  45. * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved.
  46. *
  47. * DRI: Dave Radcliffe
  48. *
  49. */</span>
  50. #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">_IOKIT_MACRISC2CPU_H</span>
  51. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">_IOKIT_MACRISC2CPU_H</span>
  52. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/IOCPU.h&gt;</span>
  53. #<span class="enscript-reference">include</span> <span class="enscript-string">&quot;MacRISC2.h&quot;</span>
  54. #<span class="enscript-reference">include</span> <span class="enscript-string">&quot;IOPlatformMonitor.h&quot;</span>
  55. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">enableUserClientInterface</span> 0
  56. #<span class="enscript-reference">if</span> <span class="enscript-variable-name">enableUserClientInterface</span>
  57. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/IOService.h&gt;</span>
  58. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/IOPlatformExpert.h&gt;</span>
  59. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/IOTimerEventSource.h&gt;</span>
  60. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/IOInterruptEventSource.h&gt;</span>
  61. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/platform/AppleMacIODevice.h&gt;</span>
  62. #<span class="enscript-reference">include</span> <span class="enscript-string">&lt;IOKit/pwr_mgt/RootDomain.h&gt;</span>
  63. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kNormal</span> 0
  64. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kNoVoltage</span> 1
  65. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kDelayAACKOnly</span> 2
  66. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kToggleDelayAACK</span> 4
  67. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kDFSLow</span> 1
  68. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kDFSHigh</span> 0
  69. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kGPULow</span> 1
  70. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kGPUHigh</span> 0
  71. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kSteppedLow</span> 1
  72. #<span class="enscript-reference">define</span> <span class="enscript-variable-name">kSteppedHigh</span> 0
  73. #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">sub_iokit_graphics</span>
  74. # <span class="enscript-reference">define</span> <span class="enscript-variable-name">sub_iokit_graphics</span> err_sub(5)
  75. #<span class="enscript-reference">endif</span>
  76. #<span class="enscript-reference">ifndef</span> <span class="enscript-variable-name">kIOFBLowPowerAggressiveness</span>
  77. # <span class="enscript-reference">define</span> <span class="enscript-variable-name">kIOFBLowPowerAggressiveness</span> iokit_family_err(sub_iokit_graphics,1)
  78. #<span class="enscript-reference">endif</span>
  79. #<span class="enscript-reference">endif</span>
  80. class MacRISC2PE;
  81. class MacRISC2CPUInterruptController;
  82. <span class="enscript-type">enum</span> {
  83. kMaxPCIBridges = 32
  84. };
  85. class MacRISC2CPU : public IOCPU
  86. {
  87. OSDeclareDefaultStructors(MacRISC2CPU);
  88. <span class="enscript-reference">private</span>:
  89. bool bootCPU;
  90. bool flushOnLock;
  91. bool haveSleptMPIC;
  92. UInt32 l2crValue;
  93. MacRISC2PE *macRISC2PE;
  94. IOService *uniN;
  95. IOPlatformMonitor *ioPMon;
  96. OSDictionary *ioPMonDict;
  97. UInt32 numCPUs;
  98. bool rememberNap;
  99. IOService *mpic;
  100. IOService *keyLargo;
  101. IOService *pmu;
  102. UInt32 soft_reset_offset;
  103. UInt32 timebase_enable_offset;
  104. IOPMrootDomain *pmRootDomain;
  105. bool doSleep;
  106. bool processorSpeedChange;
  107. bool ignoreSpeedChange;
  108. UInt32 currentProcessorSpeed;
  109. bool needVSetting;
  110. bool needAACKDelay;
  111. UInt32 topLevelPCIBridgeCount;
  112. IOPCIBridge *topLevelPCIBridges[kMaxPCIBridges];
  113. 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);
  114. <span class="enscript-comment">// callPlatformFunction symbols
  115. </span> <span class="enscript-type">const</span> OSSymbol *mpic_dispatchIPI;
  116. <span class="enscript-type">const</span> OSSymbol *mpic_getProvider;
  117. <span class="enscript-type">const</span> OSSymbol *mpic_getIPIVector;
  118. <span class="enscript-type">const</span> OSSymbol *mpic_setCurrentTaskPriority;
  119. <span class="enscript-type">const</span> OSSymbol *mpic_setUpForSleep;
  120. <span class="enscript-type">const</span> OSSymbol *keyLargo_restoreRegisterState;
  121. <span class="enscript-type">const</span> OSSymbol *keyLargo_syncTimeBase;
  122. <span class="enscript-type">const</span> OSSymbol *keyLargo_saveRegisterState;
  123. <span class="enscript-type">const</span> OSSymbol *keyLargo_turnOffIO;
  124. <span class="enscript-type">const</span> OSSymbol *keyLargo_writeRegUInt8;
  125. <span class="enscript-type">const</span> OSSymbol *keyLargo_getHostKeyLargo;
  126. <span class="enscript-type">const</span> OSSymbol *keyLargo_setPowerSupply;
  127. <span class="enscript-type">const</span> OSSymbol *uniN_setPowerState;
  128. <span class="enscript-type">const</span> OSSymbol *uniN_setAACKDelay;
  129. #<span class="enscript-reference">if</span> <span class="enscript-variable-name">enableUserClientInterface</span>
  130. IOWorkLoop *fWorkLoop;
  131. IOTimerEventSource *fDFSContTimer;
  132. IOTimerEventSource *fGPUContTimer;
  133. IOTimerEventSource *fVStepContTimer;
  134. bool DFS_Status;
  135. bool GPU_Status;
  136. bool vStepped;
  137. UInt32 DFSTime;
  138. UInt32 GPUTime;
  139. UInt32 vStepTime;
  140. UInt32 DFScontMode;
  141. virtual bool initTimers(<span class="enscript-type">void</span>);
  142. virtual <span class="enscript-type">void</span> DFSContTimerEventOccurred(IOTimerEventSource *sender);
  143. virtual <span class="enscript-type">void</span> GPUContTimerEventOccurred(IOTimerEventSource *sender);
  144. virtual <span class="enscript-type">void</span> vStepContTimerEventOccurred(IOTimerEventSource *sender);
  145. #<span class="enscript-reference">endif</span>
  146. <span class="enscript-reference">public</span>:
  147. virtual <span class="enscript-type">const</span> OSSymbol *getCPUName(<span class="enscript-type">void</span>);
  148. virtual bool start(IOService *provider);
  149. virtual IOReturn powerStateWillChangeTo (IOPMPowerFlags, <span class="enscript-type">unsigned</span> <span class="enscript-type">long</span>, IOService*);
  150. 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);
  151. virtual <span class="enscript-type">void</span> performPMUSpeedChange (UInt32 newLevel);
  152. virtual <span class="enscript-type">void</span> initCPU(bool boot);
  153. virtual <span class="enscript-type">void</span> quiesceCPU(<span class="enscript-type">void</span>);
  154. virtual kern_return_t startCPU(vm_offset_t start_paddr, vm_offset_t arg_paddr);
  155. virtual <span class="enscript-type">void</span> haltCPU(<span class="enscript-type">void</span>);
  156. virtual <span class="enscript-type">void</span> signalCPU(IOCPU *target);
  157. virtual <span class="enscript-type">void</span> enableCPUTimeBase(bool enable);
  158. #<span class="enscript-reference">if</span> <span class="enscript-variable-name">enableUserClientInterface</span>
  159. virtual IOReturn DFS(UInt32 newLevel, UInt32 mode);
  160. virtual IOReturn DFSCont(UInt32 delayTime, UInt32 mode);
  161. virtual IOReturn DFSStopCont(<span class="enscript-type">void</span>);
  162. virtual IOReturn SetGPUPower(UInt32 GPUPowerLevel);
  163. virtual IOReturn GPUCont(UInt32 delayTime);
  164. virtual IOReturn GPUStopCont(<span class="enscript-type">void</span>);
  165. virtual IOReturn vStep(UInt32 newLevel);
  166. virtual IOReturn vStepCont(UInt32 delayTime);
  167. virtual IOReturn vStepStopCont(<span class="enscript-type">void</span>);
  168. <span class="enscript-type">static</span> <span class="enscript-type">void</span> DFSTimerEventHandler(OSObject *self, IOTimerEventSource *sender);
  169. <span class="enscript-type">static</span> <span class="enscript-type">void</span> GPUTimerEventHandler(OSObject *self, IOTimerEventSource *sender);
  170. <span class="enscript-type">static</span> <span class="enscript-type">void</span> vStepTimerEventHandler(OSObject *self, IOTimerEventSource *sender);
  171. #<span class="enscript-reference">endif</span>
  172. };
  173. #<span class="enscript-reference">endif</span> <span class="enscript-comment">/* ! _IOKIT_MACRISC2CPU_H */</span>
  174. </pre>
  175. <hr />
  176. </body></html>