util.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. util.h
  5. Abstract:
  6. This header contains common utility definitions for the TI first stage
  7. loaders.
  8. Author:
  9. Evan Green 19-Dec-2014
  10. --*/
  11. //
  12. // ------------------------------------------------------------------- Includes
  13. //
  14. //
  15. // ---------------------------------------------------------------- Definitions
  16. //
  17. //
  18. // ------------------------------------------------------ Data Type Definitions
  19. //
  20. //
  21. // -------------------------------------------------------------------- Globals
  22. //
  23. //
  24. // -------------------------------------------------------- Function Prototypes
  25. //
  26. VOID
  27. EfipInitializeCrc32 (
  28. VOID *TableBuffer
  29. );
  30. /*++
  31. Routine Description:
  32. This routine initializes support for the early CRC32 support.
  33. Arguments:
  34. TableBuffer - Supplies a pointer to a region of memory that will be used to
  35. store the CRC32 table.
  36. Return Value:
  37. None.
  38. --*/
  39. UINT32
  40. EfipInitCalculateCrc32 (
  41. VOID *Buffer,
  42. UINTN DataSize
  43. );
  44. /*++
  45. Routine Description:
  46. This routine computes the CRC of the given buffer.
  47. Arguments:
  48. Buffer - Supplies a pointer to the buffer to CRC.
  49. DataSize - Supplies the number of bytes to CRC.
  50. Return Value:
  51. Returns the CRC of the buffer.
  52. --*/
  53. VOID
  54. EfipInitZeroMemory (
  55. VOID *Buffer,
  56. UINTN Size
  57. );
  58. /*++
  59. Routine Description:
  60. This routine zeroes memory.
  61. Arguments:
  62. Buffer - Supplies a pointer to the buffer to zero.
  63. Size - Supplies the number of bytes to zero.
  64. Return Value:
  65. None.
  66. --*/
  67. VOID
  68. EfipSerialPrintBuffer32 (
  69. CHAR8 *Title,
  70. VOID *Buffer,
  71. UINT32 Size
  72. );
  73. /*++
  74. Routine Description:
  75. This routine prints a buffer of 32-bit hex integers.
  76. Arguments:
  77. Title - Supplies an optional pointer to a string to title the buffer.
  78. Buffer - Supplies the buffer to print.
  79. Size - Supplies the size of the buffer. This is assumed to be divisible by
  80. 4.
  81. Return Value:
  82. None.
  83. --*/
  84. VOID
  85. EfipSerialPrintString (
  86. CHAR8 *String
  87. );
  88. /*++
  89. Routine Description:
  90. This routine prints a string to the serial console.
  91. Arguments:
  92. String - Supplies a pointer to the string to send.
  93. Return Value:
  94. None.
  95. --*/
  96. VOID
  97. EfipSerialPrintHexInteger (
  98. UINT32 Value
  99. );
  100. /*++
  101. Routine Description:
  102. This routine prints a hex integer to the console.
  103. Arguments:
  104. Value - Supplies the value to print.
  105. Return Value:
  106. None.
  107. --*/
  108. VOID
  109. EfipSerialPutCharacter (
  110. CHAR8 Character
  111. );
  112. /*++
  113. Routine Description:
  114. This routine prints a character to the serial console.
  115. Arguments:
  116. Character - Supplies the character to send.
  117. Return Value:
  118. None.
  119. --*/