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.

184 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. stubs.c
  5. Abstract:
  6. This module implements stub routines for the boot code.
  7. Author:
  8. David N. Cutler (davec) 7-Nov-1990
  9. Environment:
  10. Kernel mode only.
  11. Revision History:
  12. --*/
  13. #include "bootia64.h"
  14. #include "stdio.h"
  15. #include "stdarg.h"
  16. VOID
  17. KeBugCheck (
  18. IN ULONG BugCheckCode
  19. )
  20. /*++
  21. Routine Description:
  22. This function crashes the system in a controlled manner.
  23. Arguments:
  24. BugCheckCode - Supplies the reason for the bug check.
  25. Return Value:
  26. None.
  27. --*/
  28. {
  29. //
  30. // Print out the bug check code and break.
  31. //
  32. BlPrint(TEXT("\n*** BugCheck (%lx) ***\n\n"), BugCheckCode);
  33. while(TRUE) {
  34. };
  35. }
  36. VOID
  37. RtlAssert(
  38. IN PVOID FailedAssertion,
  39. IN PVOID FileName,
  40. IN ULONG LineNumber,
  41. IN PCHAR Message OPTIONAL
  42. )
  43. {
  44. BlPrint( TEXT("\n*** Assertion failed %S in %S line %d\n"),
  45. FailedAssertion,
  46. FileName,
  47. LineNumber );
  48. if (Message) {
  49. //bugbug UNICODE
  50. //BlPrint(Message);
  51. }
  52. while (TRUE) {
  53. }
  54. }
  55. VOID
  56. KiCheckForSoftwareInterrupt (
  57. KIRQL RequestIrql
  58. )
  59. {
  60. BlPrint( TEXT("\n*** Assertion in KiCheckForSoftwareInterrupt\n") );
  61. }
  62. VOID
  63. KeFlushIoBuffers (
  64. IN PMDL Mdl,
  65. IN BOOLEAN ReadOperation,
  66. IN BOOLEAN DmaOperation
  67. )
  68. /*++
  69. Routine Description:
  70. This function is similar to the kernel routine with the same name. It is
  71. very simplified relative to the kernel routine as during the boot process
  72. the environment is much more restrictive. Specifically, we boot
  73. as a uniprocessor and we always do DMA. Thus, we can simplify this
  74. code considerably.
  75. In the kernel, KeFlushIoBuffer() is used to flush the I-cache for the
  76. PIO cases. Architecturally, it is required to perform a flush cache,
  77. sync.i, and srlz.i to invalidate the I-cache. This sequence should
  78. supports both UP and MP cases (though booting is a UP case only)
  79. Arugements:
  80. Mdl - Supplies a pointer to a memory descriptor list that describes the
  81. I/O buffer location. [unused]
  82. ReadOperation - Supplies a boolean value that determines whether the I/O
  83. operation is a read into memory. [unused]
  84. DmaOperation - Supplies a boolean value that deternines whether the I/O
  85. operation is a DMA operation.
  86. Return Value:
  87. None.
  88. --*/
  89. {
  90. //
  91. // If we are doing something besides a DMA operation, we
  92. // have a problem. This routine is not designed to handle anything
  93. // except DMA
  94. //
  95. if (!DmaOperation) {
  96. RtlAssert("!DmaOperation", __FILE__, __LINE__,
  97. "Boot version of KeFlushIOBuffers can only handle DMA operations");
  98. // Never returns
  99. }
  100. __mf();
  101. }
  102. NTHALAPI
  103. VOID
  104. KeFlushWriteBuffer(
  105. VOID
  106. )
  107. /*++
  108. Routine Description:
  109. This function is similar to the kernel routine with the same name. It is
  110. very simplified relative to the kernel routine as during the boot process
  111. the environment is much more restrictive. Specifically, we boot
  112. as a uniprocessor.
  113. This routine is responsible for flushing all write buffers
  114. and/or other data storing or reordering
  115. hardware on the current processor. This ensures that all previous
  116. writes will occur before any new reads or writes are completed.
  117. NOTE: In the simulation environment, there is no write buffer and
  118. nothing needs to be done.
  119. Arguments:
  120. None
  121. Return Value:
  122. None.
  123. --*/
  124. {
  125. //
  126. // NOTE: The real hardware may need more than this
  127. //
  128. __mf();
  129. }