1
0

archdbg.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. archdbg.c
  5. Abstract:
  6. This module implements architecture-specific debug device support for the
  7. hardware library.
  8. Author:
  9. Evan Green 8-Apr-2014
  10. Environment:
  11. Kernel
  12. --*/
  13. //
  14. // ------------------------------------------------------------------- Includes
  15. //
  16. #include <minoca/kernel/kernel.h>
  17. #include "../hlp.h"
  18. //
  19. // ---------------------------------------------------------------- Definitions
  20. //
  21. //
  22. // ------------------------------------------------------ Data Type Definitions
  23. //
  24. //
  25. // ----------------------------------------------- Internal Function Prototypes
  26. //
  27. //
  28. // Builtin hardware module function prototypes.
  29. //
  30. VOID
  31. HlpPl11SerialModuleEntry (
  32. VOID
  33. );
  34. VOID
  35. HlpOmapSerialModuleEntry (
  36. VOID
  37. );
  38. VOID
  39. HlpNs16550SerialModuleEntry (
  40. VOID
  41. );
  42. //
  43. // -------------------------------------------------------------------- Globals
  44. //
  45. //
  46. // Built-in hardware modules.
  47. //
  48. PHARDWARE_MODULE_ENTRY HlBuiltinDebugDevices[] = {
  49. HlpPl11SerialModuleEntry,
  50. HlpOmapSerialModuleEntry,
  51. HlpNs16550SerialModuleEntry,
  52. };
  53. //
  54. // ------------------------------------------------------------------ Functions
  55. //
  56. KSTATUS
  57. HlpArchInitializeDebugDevices (
  58. VOID
  59. )
  60. /*++
  61. Routine Description:
  62. This routine performs architecture-specific initialization for the serial
  63. subsystem.
  64. Arguments:
  65. None.
  66. Return Value:
  67. Status code.
  68. --*/
  69. {
  70. ULONG ModuleCount;
  71. PHARDWARE_MODULE_ENTRY ModuleEntry;
  72. ULONG ModuleIndex;
  73. //
  74. // Loop through and initialize every built in hardware module.
  75. //
  76. ModuleCount = sizeof(HlBuiltinDebugDevices) /
  77. sizeof(HlBuiltinDebugDevices[0]);
  78. for (ModuleIndex = 0; ModuleIndex < ModuleCount; ModuleIndex += 1) {
  79. ModuleEntry = HlBuiltinDebugDevices[ModuleIndex];
  80. ModuleEntry();
  81. }
  82. return STATUS_SUCCESS;
  83. }
  84. //
  85. // --------------------------------------------------------- Internal Functions
  86. //