Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

276 lines
4.5 KiB

  1. //
  2. // No Check-in Source Code.
  3. //
  4. // Do not make this code available to non-Microsoft personnel
  5. // without Intel's express permission
  6. //
  7. /**
  8. *** Copyright (C) 1996-97 Intel Corporation. All rights reserved.
  9. ***
  10. *** The information and source code contained herein is the exclusive
  11. *** property of Intel Corporation and may not be disclosed, examined
  12. *** or reproduced in whole or in part without explicit written authorization
  13. *** from the company.
  14. **/
  15. /*++
  16. Copyright (c) 1995 Intel Corporation
  17. Module Name:
  18. simfw.c
  19. Abstract:
  20. This module implements the routines that transfer control
  21. from the kernel to the TAL and SAL code.
  22. Author:
  23. 14-Apr-1995
  24. Environment:
  25. Kernel mode
  26. Revision History:
  27. --*/
  28. #include "halp.h"
  29. #include "arc.h"
  30. #include "arccodes.h"
  31. VOID
  32. HalReturnToFirmware(
  33. IN FIRMWARE_ENTRY Routine
  34. )
  35. /*++
  36. Routine Description:
  37. Returns control to the firmware routine specified. Since the simulation
  38. does not provide TAL and SAL support, it just stops the system.
  39. System reboot can be done here.
  40. Arguments:
  41. Routine - Supplies a value indicating which firmware routine to invoke.
  42. Return Value:
  43. Does not return.
  44. --*/
  45. {
  46. switch (Routine) {
  47. case HalHaltRoutine:
  48. case HalPowerDownRoutine:
  49. case HalRestartRoutine:
  50. case HalRebootRoutine:
  51. SscExit(0);
  52. break;
  53. default:
  54. DbgPrint("HalReturnToFirmware called\n");
  55. DbgBreakPoint();
  56. break;
  57. }
  58. }
  59. ARC_STATUS
  60. HalGetEnvironmentVariable (
  61. IN PCHAR Variable,
  62. IN USHORT Length,
  63. OUT PCHAR Buffer
  64. )
  65. /*++
  66. Routine Description:
  67. This function locates an environment variable and returns its value.
  68. The only environment variable this implementation supports is
  69. "LastKnownGood". The returned value is always "FALSE".
  70. Arguments:
  71. Variable - Supplies a pointer to a zero terminated environment variable
  72. name.
  73. Length - Supplies the length of the value buffer in bytes.
  74. Buffer - Supplies a pointer to a buffer that receives the variable value.
  75. Return Value:
  76. ESUCCESS is returned if the enviroment variable is located. Otherwise,
  77. ENOENT is returned.
  78. --*/
  79. {
  80. if (_stricmp(Variable, "LastKnownGood") != 0) {
  81. return ENOENT;
  82. }
  83. strncpy(Buffer, "FALSE", Length);
  84. return ESUCCESS;
  85. }
  86. ARC_STATUS
  87. HalSetEnvironmentVariable (
  88. IN PCHAR Variable,
  89. IN PCHAR Value
  90. )
  91. /*++
  92. Routine Description:
  93. This function creates an environment variable with the specified value.
  94. The only environment variable this implementation supports is
  95. "LastKnownGood".
  96. Arguments:
  97. Variable - Supplies a pointer to an environment variable name.
  98. Value - Supplies a pointer to the environment variable value.
  99. Return Value:
  100. ESUCCESS is returned if the environment variable is created. Otherwise,
  101. ENOMEM is returned.
  102. --*/
  103. {
  104. if (_stricmp(Variable, "LastKnownGood") != 0) {
  105. return ENOMEM;
  106. }
  107. if (_stricmp(Value, "TRUE") == 0) {
  108. return(ENOMEM);
  109. } else if (_stricmp(Value, "FALSE") == 0) {
  110. return ESUCCESS;
  111. } else {
  112. return(ENOMEM);
  113. }
  114. }
  115. VOID
  116. HalSweepIcache (
  117. )
  118. /*++
  119. Routine Description:
  120. This function sweeps the entire I cache on the processor which it runs.
  121. Arguments:
  122. None.
  123. Return Value:
  124. None.
  125. --*/
  126. {
  127. return;
  128. }
  129. VOID
  130. HalSweepDcache (
  131. )
  132. /*++
  133. Routine Description:
  134. This function sweeps the entire D cache on ths processor which it runs.
  135. Arguments:
  136. None.
  137. Return Value:
  138. None.
  139. --*/
  140. {
  141. return;
  142. }
  143. VOID
  144. HalSweepIcacheRange (
  145. IN PVOID BaseAddress,
  146. IN ULONG Length
  147. )
  148. /*++
  149. Routine Description:
  150. This function sweeps the range of address in the I cache throughout the system.
  151. Arguments:
  152. BaseAddress - Supplies the starting virtual address of a range of
  153. virtual addresses that are to be flushed from the data cache.
  154. Length - Supplies the length of the range of virtual addresses
  155. that are to be flushed from the data cache.
  156. Return Value:
  157. None.
  158. --*/
  159. {
  160. return;
  161. }
  162. VOID
  163. HalSweepDcacheRange (
  164. IN PVOID BaseAddress,
  165. IN ULONG Length
  166. )
  167. /*++
  168. Routine Description:
  169. This function sweeps the range of address in the I cache throughout the system.
  170. Arguments:
  171. BaseAddress - Supplies the starting virtual address of a range of
  172. virtual addresses that are to be flushed from the data cache.
  173. Length - Supplies the length of the range of virtual addresses
  174. that are to be flushed from the data cache.
  175. Return Value:
  176. None.
  177. --*/
  178. {
  179. return;
  180. }