Leaked source code of windows server 2003
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.

188 lines
3.8 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. UNREFERENCED_PARAMETER( RequestIrql );
  61. BlPrint( TEXT("\n*** Assertion in KiCheckForSoftwareInterrupt\n") );
  62. }
  63. VOID
  64. KeFlushIoBuffers (
  65. IN PMDL Mdl,
  66. IN BOOLEAN ReadOperation,
  67. IN BOOLEAN DmaOperation
  68. )
  69. /*++
  70. Routine Description:
  71. This function is similar to the kernel routine with the same name. It is
  72. very simplified relative to the kernel routine as during the boot process
  73. the environment is much more restrictive. Specifically, we boot
  74. as a uniprocessor and we always do DMA. Thus, we can simplify this
  75. code considerably.
  76. In the kernel, KeFlushIoBuffer() is used to flush the I-cache for the
  77. PIO cases. Architecturally, it is required to perform a flush cache,
  78. sync.i, and srlz.i to invalidate the I-cache. This sequence should
  79. supports both UP and MP cases (though booting is a UP case only)
  80. Arugements:
  81. Mdl - Supplies a pointer to a memory descriptor list that describes the
  82. I/O buffer location. [unused]
  83. ReadOperation - Supplies a boolean value that determines whether the I/O
  84. operation is a read into memory. [unused]
  85. DmaOperation - Supplies a boolean value that deternines whether the I/O
  86. operation is a DMA operation.
  87. Return Value:
  88. None.
  89. --*/
  90. {
  91. UNREFERENCED_PARAMETER( Mdl );
  92. UNREFERENCED_PARAMETER( ReadOperation );
  93. //
  94. // If we are doing something besides a DMA operation, we
  95. // have a problem. This routine is not designed to handle anything
  96. // except DMA
  97. //
  98. if (!DmaOperation) {
  99. RtlAssert("!DmaOperation", __FILE__, __LINE__,
  100. "Boot version of KeFlushIOBuffers can only handle DMA operations");
  101. // Never returns
  102. }
  103. __mf();
  104. }
  105. NTHALAPI
  106. VOID
  107. KeFlushWriteBuffer(
  108. VOID
  109. )
  110. /*++
  111. Routine Description:
  112. This function is similar to the kernel routine with the same name. It is
  113. very simplified relative to the kernel routine as during the boot process
  114. the environment is much more restrictive. Specifically, we boot
  115. as a uniprocessor.
  116. This routine is responsible for flushing all write buffers
  117. and/or other data storing or reordering
  118. hardware on the current processor. This ensures that all previous
  119. writes will occur before any new reads or writes are completed.
  120. NOTE: In the simulation environment, there is no write buffer and
  121. nothing needs to be done.
  122. Arguments:
  123. None
  124. Return Value:
  125. None.
  126. --*/
  127. {
  128. //
  129. // NOTE: The real hardware may need more than this
  130. //
  131. __mf();
  132. }